Reference / Agent Sandboxes
Create a sandbox
Create a sandbox and request its first start.
/v1/customer/tenants/{tenantId}/sandboxesBase URL: https://api.runzivo.dev
Authentication
Send Authorization: Bearer <token> with a customer access token or workspace API key.
API key permission: sandboxes:write. These are permissions, not legacy scopes. A key with the all:all scope also works, limited by its creator's current workspace permissions.
Parameters
| Field | Description |
|---|---|
tenantIdstring · pathRequired | Your workspace's tenant ID. Replace the placeholder with an ID your token can access. |
Request body
Send Content-Type: application/json.
| Field | Description |
|---|---|
namestringRequired | 1–80 characters after trimming. A live sandbox name must be unique in the workspace. |
sizestringRequired | 2vcpu-8gb, 4vcpu-16gb, 8vcpu-32gb or 16vcpu-64gb. Choose a size from the list response's sizes field. |
disk_gibintegerOptional | 5–64 GiB; default 20. |
client_operation_idstringOptional | 8–200 characters. Reusing this value returns the sandbox first created for it. |
Behavior and limits
- Send application/json. Request body limit: 4 KiB. Unknown JSON fields are rejected.
- A successful request returns 201 and a bare Sandbox object. Poll its status; a response is not proof that the VM is ready.
- Conflicts include sandbox_limit_reached, credit_exhausted, sandbox_name_taken, size_unavailable and workspace_blocked. The eight-hour lifetime runs from the first start, not from the browser or CLI opening.
Responses
| Status | Meaning |
|---|---|
| 201 Created | application/json |
| 400 Invalid request | Malformed JSON, unknown fields or invalid values. Terminal upgrades also reject malformed handshakes. |
| 401 Unauthorized | Missing or invalid bearer token. A ticketed terminal request can instead return ticket_invalid. |
| 403 Forbidden | The caller lacks workspace membership or permission, or the API key is not allowed. Codes include tenant_membership_required, permission_required and api_key_scope_required. |
| 409 Conflict | Creation was refused by the workspace limit, credit, name, size or workspace controls. Codes include sandbox_limit_reached, credit_exhausted, sandbox_name_taken, size_unavailable and workspace_blocked. |
| 500 Internal error | The server could not complete the request. |
| 503 Unavailable | Sandbox service is unavailable. Exec and terminal operations can also return sandbox_exec_unavailable. |
Examples use synthetic IDs, dates and values. Read the actual response and status in your workspace.
Sandbox response fields
Success returns a Sandbox object directly, with these fields.
| Field | Description |
|---|---|
idstringRequired | Sandbox ID: sbx_ followed by 24 lowercase hexadecimal characters. |
namestringRequired | Workspace sandbox name. |
sizestringRequired | The selected size identifier. |
disk_gibintegerRequired | Workspace disk size in GiB. |
statusstringRequired | pending, starting, running, stopping, stopped, deleting, deleted, expired or failed. |
errorobject | nullRequired | null, or {code, message} explaining a failed sandbox. |
created_atdate-timeRequired | When the sandbox was created. |
started_atdate-time | nullRequired | First start; null until it starts. |
expires_atdate-time | nullRequired | First start plus eight hours. Stopping does not pause the lifetime. |
remaining_secondsintegerRequired | Lifetime left; 28800 before first start, 0 once expired or deleted. |
runtime_secondsintegerRequired | Seconds the VM has been up; excludes stopped time. |
credits_usednumberRequired | Unit-minutes charged at the size's multiplier. |
Page tools
View as MarkdownAsk AI about this page
Open in ChatGPTOpen in ClaudeOpen in CursorClaude shows a caution banner on any prefilled prompt. That is expected: review the prompt, then send it.