Skip to main content
POST
Execute a command in a Box

Authorizations

Authorization
string
header
required

Box bearer token in the form box_.... Service API keys authenticate Box operations.

Path Parameters

boxId
string
required

Public Box id returned by create/list/get box calls.

Pattern: ^bx_[23456789abcdefghjkmnpqrstuvwxyz]{8}$

Body

application/json
command
string
required
cwd
string

Relative working directory inside the Box work directory.

timeoutSeconds
integer
default:30

Command timeout in seconds. Values outside 1-600 are rejected with a 400 invalid_timeout error.

Required range: 1 <= x <= 600
detached
boolean
default:false

Start the command in the background and return a process id immediately instead of waiting for it to finish. Output goes to a log file on the Box; poll the status endpoint for it.

Response

Command result (synchronous) or process start confirmation (detached).

ok
boolean
required
Example:

true

type
string
required

Stable success envelope discriminator added by v1.

Allowed value: "command.finished"
success
boolean
required
exitCode
integer | null
required
stdout
string
required
stderr
string
required
timedOut
boolean
required
signal
string | null
stdoutTruncated
boolean
stderrTruncated
boolean
cwd
string
startedAt
string<date-time>
finishedAt
string<date-time>