Get a sandbox
Returns a sandbox's state and details. A running sandbox is read from its host; a sandbox that has ended is read from its stored history. Ended ephemeral sandboxes and history older than 24 hours answer 404.
Required permission
Requires the sandboxes.read permission. See Permissions for the roles and API key permissions that include it.
Command line
The orl CLI wraps this endpoint:
Guided workflow: orl sandbox get
orl sandbox get <sandbox-id>apiKeyAuthorizationBearer <token>OpenRelay API key. Send it as Authorization: Bearer or_… (legacy vl_… keys still work).
sandboxId*stringThe sandbox
application/json- response
id*stringOpaque; do not parse it.
template*stringstate*stringpaused is a sandbox its owner paused, until it is resumed. Its timeout counts on.
"running""paused""exited"createdAt*stringdate-timeexpiresAt*stringdate-timeendedAt?stringdate-timeexitReason?stringWhy the sandbox ended. Absent while it runs.
"killed""timeout""guest_exit""host_drain""error""lost""host_lost"groupId?stringThe group it was created in, if any.
metadata?ephemeral?booleanTrue when this sandbox leaves no customer history after it ends.
result?curl -X GET 'https://api.openrelay.inc/v1/sandboxes/string'{ "id": "string", "template": "string", "state": "running", "createdAt": "2019-08-24T14:15:22Z", "expiresAt": "2019-08-24T14:15:22Z", "endedAt": "2019-08-24T14:15:22Z", "exitReason": "killed", "groupId": "string", "metadata": { "property1": "string", "property2": "string" }, "ephemeral": true, "result": { "execId": "string", "exitCode": 0, "stdout": "string", "stderr": "string", "truncated": true, "error": { "error": "string", "code": "string", "permission": "string", "deniedBy": "string", "policies": [ "string" ], "requestId": "string" } }}Create a sandbox POST
Starts a sandbox from a template, optionally running a first command. Collect the result as JSON or stream output as NDJSON. With run set, application/json waits for the command to exit and answers the sandbox with its result; application/x-ndjson streams one SandboxEvent per line, the first naming the sandbox. Send an Idempotency-Key on every create. A repeat with the same key and body answers the same sandbox with Idempotent-Replayed: true, and a repeat with X-Resume-From skips the output it already read. A refusal (429 or 503) keeps nothing, so the next attempt runs again.
Kill a sandbox DELETE
Answers once the VM is stopped; its memory is released and its usage settled after the answer. Killing a sandbox that has ended answers 410.