> ## Documentation Index
> Fetch the complete documentation index at: https://docs.boat.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Get a command from the history

> Get one command's record: its text, mode, status, exit code and output size.



## OpenAPI

````yaml openapi/boat-v1.yaml GET /sandboxes/{sandboxId}/command-history/{commandId}
openapi: 3.1.0
info:
  title: Boat Public API v1
  version: 1.0.0
  description: >
    Public JSON API for creating, operating, prompting, observing, and exposing
    sandboxes from backend services, CI jobs, hosted workers, and Boat
    automation products.


    The v1 reference intentionally documents the developer integration surface
    only. Dashboard billing actions are not part of v1.
servers:
  - url: https://boat.dev/api/v1
security:
  - BoatBearerAuth: []
tags:
  - name: Boat
    description: >-
      Unified Boat account, setup, lifecycle, prompting, event history, desktop
      access, and SSH operations.
paths:
  /sandboxes/{sandboxId}/command-history/{commandId}:
    get:
      tags:
        - Boat
      summary: Get one command from the history
      operationId: getCommand
      parameters:
        - $ref: '#/components/parameters/SandboxId'
        - name: commandId
          in: path
          required: true
          schema:
            type: string
      responses:
        '200':
          description: The command.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CommandInfoResponse'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
components:
  parameters:
    SandboxId:
      name: sandboxId
      in: path
      required: true
      schema:
        type: string
        pattern: ^bx_[23456789abcdefghjkmnpqrstuvwxyz]{8}$
      description: Public Sandbox id returned by create/list/get sandbox calls.
  schemas:
    CommandInfoResponse:
      allOf:
        - $ref: '#/components/schemas/SuccessBase'
        - type: object
          required:
            - command
          properties:
            type:
              type: string
              const: command.info
            command:
              $ref: '#/components/schemas/CommandRecord'
    SuccessBase:
      type: object
      required:
        - ok
        - type
      properties:
        ok:
          type: boolean
          examples:
            - true
        type:
          type: string
          description: Stable success envelope discriminator added by v1.
    CommandRecord:
      type: object
      description: >-
        One command run through the commands endpoint (kept 90 days), or one
        process of the sandbox with mode `process` (kept 72 hours). Readable
        while the sandbox is stopped.
      required:
        - commandId
        - sandboxId
        - command
        - mode
        - status
        - stdoutBytes
        - stderrBytes
        - outputTruncated
        - startedAt
      properties:
        commandId:
          type: string
          examples:
            - cmd_k3v9x2mq7tbw
          description: Id of the record in the command history.
        sandboxId:
          type: string
        command:
          type: string
          description: The command text as sent (first 64 KiB).
        cwd:
          type:
            - string
            - 'null'
        mode:
          type: string
          enum:
            - sync
            - stream
            - detached
            - process
          description: >-
            sync: the request waited for the result. stream: the output was
            streamed. detached: started in the background. process: any other
            process of the sandbox, recorded from what it wrote to its
            stdout/stderr.
        processId:
          type:
            - integer
            - 'null'
          description: 'detached: the process id on the sandbox.'
        status:
          type: string
          enum:
            - running
            - exited
            - timed_out
            - failed
            - killed
            - lost
          description: >-
            failed: the command could not start or its result never arrived.
            killed: ended by a signal or by DELETE /commands/{processId}. lost:
            the sandbox stopped or its agent restarted while the command ran.
        exitCode:
          type:
            - integer
            - 'null'
        signal:
          type:
            - string
            - 'null'
        stdoutBytes:
          type: integer
          description: Bytes of stdout written so far.
        stderrBytes:
          type: integer
          description: Bytes of stderr written so far.
        outputTruncated:
          type: boolean
          description: >-
            True when part of the output is not kept: the sandbox cut the output
            of a waiting command at 8 MiB, or the account wrote more than 10 MiB
            (compressed) of command output, or of process output, in one hour.
        startedAt:
          type: string
          format: date-time
        finishedAt:
          type:
            - string
            - 'null'
          format: date-time
    ErrorEnvelope:
      type: object
      required:
        - ok
        - type
        - status
        - code
        - message
        - error
        - requestId
      properties:
        ok:
          type: boolean
          examples:
            - false
        type:
          type: string
          examples:
            - sandbox.error
        status:
          type: integer
          examples:
            - 409
        code:
          type: string
          examples:
            - provider_not_configured
        message:
          type: string
          examples:
            - Prompting is locked until Codex is configured on the Agents page.
        requestId:
          type: string
          examples:
            - req_01HX...
        error:
          type: object
          required:
            - code
            - message
            - status
          properties:
            code:
              type: string
            message:
              type: string
            status:
              type: integer
            details:
              type: object
              additionalProperties: true
  responses:
    Unauthorized:
      description: Missing or invalid bearer token.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorEnvelope'
          examples:
            unauthorized:
              value:
                ok: false
                type: sandbox.error
                status: 401
                code: unauthorized
                message: Unauthorized
                error:
                  code: unauthorized
                  message: Unauthorized
                  status: 401
                requestId: req_01HX...
    NotFound:
      description: Resource not found.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorEnvelope'
  securitySchemes:
    BoatBearerAuth:
      type: http
      scheme: bearer
      bearerFormat: sandbox_api_key
      description: >-
        Boat bearer token in the form `boat_...`. Service API keys authenticate
        sandbox operations.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.