Execute a command
Execute a command and return process information.
Streaming: with Accept: application/x-ndjson (or Accept: text/event-stream, kept for compatibility) the response is NDJSON (Content-Type: application/x-ndjson), not SSE: one JSON object per line, {"type": "...", "data": "..."}.
type is stdout or stderr (data is a raw output chunk, sent as soon as the process writes it, newlines included; if the process finished before any chunk was streamed, its output is sent instead as one event per line, without the newline), keepalive (every 5 seconds, no data), error (data is the message, ends the stream) or result (last event, data is the ProcessResponse as a JSON string).
Authorizations
Sandbox access token created through POST /v1/token.
Body
Process execution request
"ls -la"
Disable scale-to-zero while process runs. Default timeout is 600s (10 minutes). Set timeout to 0 for infinite.
false
Maximum number of restarts on failure. Set to a negative value (e.g. -1) for unlimited restarts.
3
"my-process"
true
Open a writable stdin pipe, fed via POST /process/{identifier}/stdin and closed via DELETE. The pipe does not survive a sandbox-api restart: the process then sees EOF.
false
Timeout in seconds. When keepAlive is true, defaults to 600s (10 minutes). Set to 0 for infinite (no auto-kill).
30
false
"/home/user"
Response
Process information
"ls -la"
Completion time, same format as startedAt. Empty string while the process runs
"Wed, 01 Jan 2023 12:01:00 GMT"
0
"logs output"
"my-process"
"1234"
Start time as an HTTP date (RFC 1123, e.g. Wed, 01 Jan 2023 12:00:00 GMT)
"Wed, 01 Jan 2023 12:00:00 GMT"
failed, killed, stopped, running, completed "running"
"stderr output"
"stdout output"
"/home/user"
Whether scale-to-zero is disabled for this process
false
3
2
true
Whether the process was started with a writable stdin pipe
false