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

# Execute Box command



## OpenAPI

````yaml openapi/box-v1.yaml POST /boxes/{boxId}/commands
openapi: 3.1.0
info:
  title: Box Public API v1
  version: 1.0.0
  description: >
    Public JSON API for creating, operating, prompting, observing, and exposing
    Box sandboxes from backend services, CI jobs, hosted workers, and Box
    automation products.


    The v1 reference intentionally documents the developer integration surface
    only. Dashboard billing actions are not part of v1.
servers:
  - url: https://ascii.dev/api/box/v1
security:
  - BoxBearerAuth: []
tags:
  - name: Box
    description: >-
      Unified Box account, setup, lifecycle, prompting, event history, desktop
      access, and SSH operations.
paths:
  /boxes/{boxId}/commands:
    post:
      tags:
        - Box
      summary: Execute a command in a Box
      operationId: command
      parameters:
        - $ref: '#/components/parameters/BoxId'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CommandRequest'
      responses:
        '200':
          description: Command result.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CommandResponse'
components:
  parameters:
    BoxId:
      name: boxId
      in: path
      required: true
      schema:
        type: string
        pattern: ^bx_[23456789abcdefghjkmnpqrstuvwxyz]{8}$
      description: Public Box id returned by create/list/get box calls.
  schemas:
    CommandRequest:
      type: object
      required:
        - command
      properties:
        command:
          type: string
        cwd:
          type: string
          description: Relative working directory inside the Box work directory.
        timeoutSeconds:
          type: integer
          minimum: 1
          maximum: 60
          default: 30
    CommandResponse:
      allOf:
        - $ref: '#/components/schemas/SuccessBase'
        - type: object
          required:
            - success
            - exitCode
            - stdout
            - stderr
            - timedOut
          properties:
            type:
              type: string
              const: command.finished
            success:
              type: boolean
            exitCode:
              type:
                - integer
                - 'null'
            signal:
              type:
                - string
                - 'null'
            stdout:
              type: string
            stderr:
              type: string
            stdoutTruncated:
              type: boolean
            stderrTruncated:
              type: boolean
            timedOut:
              type: boolean
            cwd:
              type: string
            startedAt:
              type: string
              format: date-time
            finishedAt:
              type: string
              format: date-time
    SuccessBase:
      type: object
      required:
        - ok
        - type
      properties:
        ok:
          type: boolean
          examples:
            - true
        type:
          type: string
          description: Stable success envelope discriminator added by v1.
  securitySchemes:
    BoxBearerAuth:
      type: http
      scheme: bearer
      bearerFormat: box_api_key
      description: >-
        Box bearer token in the form `box_...`. Service API keys authenticate
        Box operations.

````