Skip to main content
POST
Run a command and wait for it to finish

Authorizations

X-Access-Token
string
header
required

Per-sandbox token returned by create, resume, and activate. Grants access to a single sandbox's files and commands. Distinct from the team X-API-Key.

Body

application/json
command
string
required

Command to execute. Wrapped in /bin/sh -c unless args is provided.

Minimum string length: 1
args
string[]

If provided, command is used as the binary and args as arguments (no shell wrapping).

env
object

Environment variables for the command.

working_dir
string

Working directory (default /home/user).

timeout_s
integer
default:30

Timeout in seconds.

Response

The command finished; full output and exit code.

Full output of a command run to completion via POST /exec.

stdout
string
required

Complete standard output.

stderr
string
required

Complete standard error.

exit_code
integer
required

Process exit code. A non-zero value is returned, not raised.