Sandboxes

Execute a command

Queues one process inside the sandbox. The sandbox can execute multiple commands over its lifetime.

post/v1/sandboxes/{id}/exec

Request

  • Base URL
    / (relative, and the document was published on a file host, not at the API’s origin)
  • Auth
    HTTP bearer

Path parameters

idstring required

Headers

Idempotency-Keystring required

Stable key for this logical operation. Reuse the same key and body after an uncertain response.

Request body

commandstring[] required

Process argument vector. No shell parsing is performed.

cwdstring

Optional canonical absolute POSIX working directory.

envobject

Nonsecret environment values. Values equal to any retained tenant secret are rejected. Use sandbox secrets for confidential values.

timeout_sinteger

Process timeout no greater than the sandbox maximum lifetime.

stdinboolean

Enable framed stdin writes for this process.

ttyboolean

Allocate a controlling terminal with merged stdout and stderr. Requires stdin and explicit rows and cols.

rowsinteger
colsinteger

Response

Accepted

idstring required
sandbox_idstring required
state'queued' | 'dispatching' | 'running' | 'completed' | 'failed' | 'cancelled' | 'lost' required
created_atstring date-time required
updated_atstring date-time required
dispatched_atstring date-time nullable
deadline_atstring date-time nullable
started_atstring date-time nullable
completed_atstring date-time nullable
exit_codeinteger nullable

Process exit code when known. A completed process can have a nonzero exit code.

failure_codestring

Failure to start or maintain execution, separate from a process exit code.

output_sequenceinteger required
stdout_bytesinteger required
stderr_bytesinteger required
final_output_sequenceinteger nullable
cancel_requested_atstring date-time nullable
cancel_reasonstring

Changes

No recorded changes to this operation across all 70 revisions of this API.