Run a command in a running sandbox
With Accept: application/x-ndjson the output is streamed as it is
produced, one ExecEvent JSON object per line, ending with an exit
(or error) event. Otherwise the call waits and returns an
ExecResult with the collected output (capped at 4 MiB per stream;
stream larger output).
/v1/sandboxes/{sandbox}/execAuthorizationBearer token · headerrequiredOrg-scoped API key, pols_....
sandboxstringrequiredSandbox ID (sbx_...) or name.
application/jsoncommandstring[]requiredProgram and arguments, none containing NUL. Use ["bash", "-lc", "..."] for a shell.
envobjectExtra environment variables for this command.
cwdstringWorking directory, an absolute path. Defaults to the user's home.
rootbooleanRun as root instead of the default sandbox user (user, uid 1000, passwordless sudo).
stdinstringData written to the command's standard input.
timeout_secondsintegerThe command ran (whatever its exit code).
exit_codeintegerrequiredstdoutstringrequiredstderrstringrequiredtruncatedbooleanOutput exceeded the cap and was cut.
Rate limited (rate_limited): too many requests or failed
authentications from this address, too many requests or
lifecycle calls for this org, or too many of its exec, file,
computer and CDP calls in progress at once. Retry after
Retry-After seconds.
errorobjectrequiredShow propertiesHide properties
codestringrequiredStable machine-readable code: bad_request (400),
unauthorized (401), forbidden (403), quota_exceeded
(403), not_found (404), conflict (409),
rate_limited (429, see Retry-After), internal (500),
runtime_error (502, the sandbox host failed),
unavailable (503, the feature is not configured on this
deployment), timeout (504, or 408 when a request body
stalls).
messagestringrequiredError.
errorobjectrequiredShow propertiesHide properties
codestringrequiredStable machine-readable code: bad_request (400),
unauthorized (401), forbidden (403), quota_exceeded
(403), not_found (404), conflict (409),
rate_limited (429, see Retry-After), internal (500),
runtime_error (502, the sandbox host failed),
unavailable (503, the feature is not configured on this
deployment), timeout (504, or 408 when a request body
stalls).
messagestringrequired