Skip to content

Run a command (streams frames)

POST/sandboxes/{id}/exec

Runs a command in the guest and streams the result as length-prefixed frames ([type:1][reserved:3][size:4 BE][payload]) where type is stdout, stderr, or exit; the exit payload is a JSON ExecResult. Set ?stdin=1 for a hijacked, full-duplex interactive exec.

path parameters
object
idstringrequired

Sandbox ID, e.g. sbx_ab12cd34.

query parameters
object
stdinstring

Set to "1" for an interactive, full-duplex exec (hijacked stream).

Request bodyapplication/json
ExecReq
cmdarray | null
items
string
cwdstring
envobject
additional properties
string
timeout_sinteger
Responses
200 OKOK
stringbase64
400 Bad requestBad Request
ErrorResponse
errorstring
404 Not foundNot Found
ErrorResponse
errorstring
Authentication
bearerAuthHTTP bearer. Daemon API key. Omit on a keyless loopback daemon.
Request
POST/sandboxes/{id}/exec
cURL
curl '/sandboxes/{id}/exec?stdin=' \
  -X POST \
  -H 'Content-Type: application/json' \
  -d '{}'
Response
200 OK
No response body.
Was this page helpful?