Skip to main content
POST
Execute a command in a sandbox

Authorizations

Authorization
string
header
required

Boat bearer token in the form boat_.... Service API keys authenticate sandbox operations.

Path Parameters

sandboxId
string
required

Public Sandbox id returned by create/list/get sandbox calls.

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

Body

application/json
command
string
required
cwd
string

Relative working directory inside the sandbox work directory.

env
object

Variables for this command only. Not saved in the command history. Maximum 32 KB and 1,000 variables.

stdin
string

Text that the command reads on its standard input. Not saved in the command history. Maximum 5 MB.

user
string

Linux user that runs the command, for example root. Default: the sandbox user.

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 sandbox; poll the status endpoint for it.

stream
boolean
default:false

Stream the output as the command writes it: the response is newline-delimited JSON (application/x-ndjson), one CommandStreamFrame per line. Ignored with detached.

Response

Command result (synchronous), process start confirmation (detached), or the output stream (stream: true).

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
commandId
string

The command's record in the command history.

signal
string | null
oomKilled
boolean

True when the memory ceiling killed the command or one of its processes and the command failed.

stdoutTruncated
boolean
stderrTruncated
boolean
cwd
string
startedAt
string<date-time>
finishedAt
string<date-time>