curl --silent --show-error --fail-with-body --request POST \
--url 'https://api.sandbox.stateset.app/api/v1/sandbox/{id}/execute' \
--header "Authorization: ApiKey $STATESET_SANDBOX_API_KEY" \
--header 'Content-Type: application/json' \
--data '{
"command": "string",
"working_dir": "string",
"env": {},
"stream": true,
"timeout": 1000,
"sandbox_epoch": 1
}'
{
"execution_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"exit_code": 1,
"stdout": "string",
"stderr": "string",
"output_truncated": true
}
Execute a command in a sandbox
Command result. With stream: true the response is a text/event-stream instead: SSE events with JSON payloads {type: 'stdout'|'stderr', data}, {type:…
POST
/
api
/
v1
/
sandbox
/
{id}
/
execute
curl --silent --show-error --fail-with-body --request POST \
--url 'https://api.sandbox.stateset.app/api/v1/sandbox/{id}/execute' \
--header "Authorization: ApiKey $STATESET_SANDBOX_API_KEY" \
--header 'Content-Type: application/json' \
--data '{
"command": "string",
"working_dir": "string",
"env": {},
"stream": true,
"timeout": 1000,
"sandbox_epoch": 1
}'
{
"execution_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"exit_code": 1,
"stdout": "string",
"stderr": "string",
"output_truncated": true
}
Confirm your deployment before running this request. This page describes an API contract;
a published reference does not establish hosted availability. Check the dated
host report and obtain your deployment URL and credentials.
Replace the example host if your provisioned service uses a different URL.
Path parameters
string (uuid)
required
Sandbox identifier
Request body
ExecuteCommandRequest
string | string[] | object
required
Minimum length:
1. Maximum length: 100000.string
Minimum length:
1. Maximum length: 4096.object
Additional keys map to values of type
string.boolean
integer
Minimum:
1000. Maximum: 600000.integer
Minimum:
0. Maximum: 9007199254740991.Response
object
string
required
Identifier for this execution record.
integer
required
string
required
string
required
boolean
Present (true) only when captured output was truncated.
Status codes
| Code | Meaning | |
|---|---|---|
200 | Command result. With stream: true the response is a text/event-stream instead: SSE events with JSON payloads `{type: ‘stdout' | 'stderr’, data}, {type: ‘truncated’, output_truncated, message}(output capped at 8MB),{type: ‘error’, error, code?}, {type: ‘exit’, code, output_truncated?}and{type: ‘done’}, each with an SSE idusable asLast-Event-IDto resume, plus: heartbeat` comments every 20s. |
202 | Execution queued because the org’s concurrent execute limit is reached and queue mode is enabled. Retry-After and X-Stateset-Queue-Position headers are set. | |
404 | Sandbox not found |
Using this contract
Read the source OpenAPI document for declared schemas and alternatives. This page also includes documented corrections from the spec overlays. Example IDs and values are illustrative; replace them with records from your workspace.curl --silent --show-error --fail-with-body --request POST \
--url 'https://api.sandbox.stateset.app/api/v1/sandbox/{id}/execute' \
--header "Authorization: ApiKey $STATESET_SANDBOX_API_KEY" \
--header 'Content-Type: application/json' \
--data '{
"command": "string",
"working_dir": "string",
"env": {},
"stream": true,
"timeout": 1000,
"sandbox_epoch": 1
}'
{
"execution_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"exit_code": 1,
"stdout": "string",
"stderr": "string",
"output_truncated": true
}
Last modified on September 21, 2026