Sandboxes
API reference
Every endpoint of the Sandboxes REST API, its parameters and what it returns, made from the API's own OpenAPI description.
Note
This page is made from the OpenAPI description the API serves, so it lists exactly what the API takes. For how the pieces fit together, start with the REST API guide. You can load the same file into Postman, Insomnia or a client generator.
Base address: https://api.quietrobot.ai/api/v1. Every request carries Authorization: Bearer qr_live_.... Read-only keys can make GET requests only. Errors are JSON { "error": { "code", "message" } }; the codes are on Errors.
Endpoints
Sandboxes
GET /sandboxes: List sandboxesPOST /sandboxes: Create a sandboxGET /sandboxes/{id}: Get a sandboxDELETE /sandboxes/{id}: Destroy a sandboxPOST /sandboxes/{id}/pause: Pause a sandboxPOST /sandboxes/{id}/resume: Resume a paused or archived sandboxPOST /sandboxes/{id}/timeout: Set the deadline to now + timeoutSecPUT /sandboxes/{id}/egress: Change a sandbox's network rulesGET /sandboxes/{id}/egress/learn: What learn mode has seen, as allow rulesPOST /sandboxes/{id}/egress/learn: Start learn mode: record the hosts the sandbox reachesDELETE /sandboxes/{id}/egress/learn: Stop learn mode and put the old rules backPOST /sandboxes/{id}/egress/learn/apply: Stop learn mode and allow only these hostsPUT /sandboxes/{id}/spend-cap: Set the sandbox's spend capGET /sandboxes/{id}/report: What did the agent do: a report on one sandboxGET /sandboxes/{id}/image: The sandbox's image and exact package versionsGET /sandboxes/{id}/metrics: A sandbox's CPU, memory, disk, runtime, storage and egress
Commands
POST /sandboxes/{id}/exec: Run a commandPOST /sandboxes/{id}/terminal: Open an interactive terminalGET /sandboxes/{id}/executions: List a sandbox's commandsGET /executions/{id}: Get a commandGET /sandboxes/{id}/ports: List preview URLsPUT /sandboxes/{id}/ports: Set preview URLsGET /executions/{id}/output: Read a live command's outputPOST /executions/{id}/stdin: Send input to an interactive command or terminalPOST /executions/{id}/kill: Stop a live commandPOST /executions/{id}/resize: Resize a terminalPOST /executions/{id}/approve: Approve a held command (signed-in people only)POST /executions/{id}/deny: Deny a held command (signed-in people only)POST /executions/{id}/undo: Undo a command: put the files back as they were just before it ran
Files
GET /sandboxes/{id}/files: Read a filePUT /sandboxes/{id}/files: Write a fileDELETE /sandboxes/{id}/files: Delete a fileGET /sandboxes/{id}/files/list: List a folder
Snapshots
GET /sandboxes/{id}/snapshots: List a sandbox's snapshotsPOST /sandboxes/{id}/snapshots: Snapshot a sandbox's filesPOST /sandboxes/{id}/fork: Fork a sandboxPOST /sandboxes/{id}/rewind: Rewind a sandbox to a snapshotGET /snapshots: List snapshotsGET /snapshots/{id}: Get a snapshotDELETE /snapshots/{id}: Delete a snapshot
Templates
GET /templates: List your templatesPOST /templates: Make a template from a DockerfileGET /templates/{id}: Get a template by id or name, with recent buildsPATCH /templates/{id}: Change a template's description or warm poolDELETE /templates/{id}: Delete a templatePOST /templates/{id}/builds: Build a template againGET /template-builds/{id}: Get a build and its log
Volumes
POST /sandboxes/{id}/volumes/sync: Save a sandbox's volumes nowGET /volumes: List volumesPOST /volumes: Make an empty volumeGET /volumes/{id}: Get a volume by id or nameDELETE /volumes/{id}: Delete a volume and its files
Webhooks
GET /webhooks: List webhook endpointsPOST /webhooks: Add a webhook endpointGET /webhooks/{id}: Get a webhook endpointPATCH /webhooks/{id}: Change a webhook endpointDELETE /webhooks/{id}: Delete a webhook endpointPOST /webhooks/{id}/test: Send a signed ping nowPOST /webhooks/{id}/rotate-secret: Make a new signing secretGET /webhooks/{id}/deliveries: Recent deliveries to an endpointPOST /webhooks/{id}/deliveries/{deliveryId}/redeliver: Send a delivery again
Secrets
GET /secrets: List secretsPOST /secrets: Add or replace a secretDELETE /secrets/{name}: Delete a secretGET /outbound-check: Your outbound checkGET /identity/jwks.json: Public key for sandbox identity tokens
Organization
GET /sandboxes/{id}/audit: A sandbox's audit logGET /audit: The organization's audit logGET /usage: Usage this month, and the plan's limitsGET /reservations: List reserved machines
Sandboxes
List sandboxes
GET /api/v1/sandboxes| Parameter | In | Type | Notes |
|---|---|---|---|
status | query | "starting", "running", "pausing", "paused", "archived", "stopped", "error" |
Returns 200 with an object.
Create a sandbox
POST /api/v1/sandboxesBody (JSON):
| Field | Type | Notes |
|---|---|---|
name | string | |
template | string | base (default), minimal, or one of your own templates by name or id |
cpuClass | "standard", "performance" | Default "standard". |
cpus | 1, 2, 4, 8, 16 | |
memoryMb | integer | Multiple of 256 |
timeoutSec | integer | Session length; the plan sets the maximum |
region | string | Region code, e.g. us-virginia or eu-frankfurt |
reservationId | string | |
snapshotId | string | Start with this snapshot's files |
pool | boolean | false always boots a fresh microVM |
durable | boolean | Keep this sandbox's files (its home folder) through pauses, the time limit and a lost host. Every pause saves them to object storage first; the time limit pauses instead of deleting; after the plan's warm window the machine is deleted and the sandbox is archived until its next call, which restores the files onto a new microVM. Ends only when deleted. Stored files are billed per GB-month. |
ifExists | "error", "return" | Durable only: when a durable sandbox already has this name, error (409 name_taken) or return that sandbox Default "error". |
egress | Egress | |
env | object | |
metadata | object | |
secrets | string[] | Names of the organization's secrets this sandbox may use. Each arrives as an environment variable holding a stand-in, never the value. Send calls through $QR_GATEWAY_URL/ |
identity | object | Hosts (your own services) this sandbox may prove itself to. It gets QR_IDENTITY_TOKEN, a stand-in the gateway swaps for a five-minute EdDSA token; check it with /identity/jwks.json |
autoPauseSec | integer | Pause after this many seconds with no commands, file calls or gateway calls, unless programs inside are still working (using CPU or holding a connection open). Any call wakes it again |
run | ExecRequest | A first command to run as soon as the sandbox is up, in the same request. The result comes back as run. |
volumes | object[] | Folders kept between sandboxes. Each is put in place before the sandbox is returned, and saved when it pauses or stops, shortly before its deadline, and on POST /sandboxes/{id}/volumes/sync. One live sandbox holds a volume at a time (409 volume_in_use). |
spendCapUsd | number |
Returns 200 with Sandbox.
Returns 201 with CreatedSandbox: Created
Get a sandbox
GET /api/v1/sandboxes/{id}| Parameter | In | Type | Notes |
|---|---|---|---|
id (required) | path | string | Sandbox ID, or the name of a durable sandbox |
Returns 200 with Sandbox.
Destroy a sandbox
DELETE /api/v1/sandboxes/{id}| Parameter | In | Type | Notes |
|---|---|---|---|
id (required) | path | string | Sandbox ID, or the name of a durable sandbox |
Returns 200 with Sandbox.
Pause a sandbox
POST /api/v1/sandboxes/{id}/pauseFreezes memory, files and processes. Paused time doesn't count toward usage. A durable sandbox saves its files to object storage first. 409 paused_storage_full when the plan's paused storage is used up.
| Parameter | In | Type | Notes |
|---|---|---|---|
id (required) | path | string | Sandbox ID, or the name of a durable sandbox |
Returns 200 with Sandbox.
Resume a paused or archived sandbox
POST /api/v1/sandboxes/{id}/resumeAny command or file call also wakes it. An archived durable sandbox wakes cold: a new microVM with its files restored (resumedFrom cold, memoryKept false).
| Parameter | In | Type | Notes |
|---|---|---|---|
id (required) | path | string | Sandbox ID, or the name of a durable sandbox |
Returns 200 with Sandbox.
Set the deadline to now + timeoutSec
POST /api/v1/sandboxes/{id}/timeout| Parameter | In | Type | Notes |
|---|---|---|---|
id (required) | path | string | Sandbox ID, or the name of a durable sandbox |
Body (JSON):
| Field | Type | Notes |
|---|---|---|
timeoutSec (required) | integer |
Returns 200 with Sandbox.
Change a sandbox's network rules
PUT /api/v1/sandboxes/{id}/egressFields left out keep their value. Applies to new connections at once, and wakes a paused sandbox. 409 egress_too_wide when the rules need more than the sandbox's maxMode.
| Parameter | In | Type | Notes |
|---|---|---|---|
id (required) | path | string | Sandbox ID, or the name of a durable sandbox |
Body (JSON):
| Field | Type | Notes |
|---|---|---|
mode | "deny", "allowlist", "open" | deny: no outbound traffic. allowlist: only what allow lists. open: any public address. |
allow | string[] | Rules: a domain (pypi.org, .github.com), an IP address or a CIDR range (203.0.113.0/24, [2001:db8::/32]), with an optional port (db.example.com:5432, 203.0.113.0/24:8000-8100, example.com:). No port means 80 and 443. Private ranges can't be allowed. |
deny | string[] | Rules that are always blocked, in allowlist and open mode. Same format; no port means every port. Denied domains take no port. |
maxMode | "deny", "allowlist", "open" | The widest mode this sandbox can be switched to later. Set at create; defaults to what its rules need. An allow rule on a port other than 80 or 443 needs open. |
Returns 200 with Sandbox.
What learn mode has seen, as allow rules
GET /api/v1/sandboxes/{id}/egress/learn| Parameter | In | Type | Notes |
|---|---|---|---|
id (required) | path | string | Sandbox ID, or the name of a durable sandbox |
Returns 200 with an object.
Start learn mode: record the hosts the sandbox reaches
POST /api/v1/sandboxes/{id}/egress/learnWith open internet allowed by the plan and maxMode, the sandbox runs open while learning and every website it visits is recorded (ports 80 and 443). Otherwise its rules stay as they are and what it tries to reach, allowed or blocked, is recorded.
| Parameter | In | Type | Notes |
|---|---|---|---|
id (required) | path | string | Sandbox ID, or the name of a durable sandbox |
Returns 200 with Sandbox.
Stop learn mode and put the old rules back
DELETE /api/v1/sandboxes/{id}/egress/learn| Parameter | In | Type | Notes |
|---|---|---|---|
id (required) | path | string | Sandbox ID, or the name of a durable sandbox |
Returns 200 with Sandbox.
Stop learn mode and allow only these hosts
POST /api/v1/sandboxes/{id}/egress/learn/apply| Parameter | In | Type | Notes |
|---|---|---|---|
id (required) | path | string | Sandbox ID, or the name of a durable sandbox |
Body (JSON):
| Field | Type | Notes |
|---|---|---|
allow (required) | string[] |
Returns 200 with Sandbox.
Set the sandbox's spend cap
PUT /api/v1/sandboxes/{id}/spend-capcapUsd in dollars, or null for none. An API key may only lower the cap; raising or removing it needs a person in the dashboard. Raising it lets a sandbox the cap paused run again.
| Parameter | In | Type | Notes |
|---|---|---|---|
id (required) | path | string | Sandbox ID, or the name of a durable sandbox |
Body (JSON):
| Field | Type | Notes |
|---|---|---|
capUsd (required) | number |
Returns 200 with Sandbox.
What did the agent do: a report on one sandbox
GET /api/v1/sandboxes/{id}/reportA summary written from the audit log (no AI model), counts, every approval and who decided it, hosts reached and blocked, files, and the timeline. format=pdf returns a PDF file.
| Parameter | In | Type | Notes |
|---|---|---|---|
id (required) | path | string | Sandbox ID, or the name of a durable sandbox |
format | query | "json", "pdf" |
Returns 200 with an object.
The sandbox's image and exact package versions
GET /api/v1/sandboxes/{id}/image| Parameter | In | Type | Notes |
|---|---|---|---|
id (required) | path | string | Sandbox ID, or the name of a durable sandbox |
Returns 200 with an object.
A sandbox's CPU, memory, disk, runtime, storage and egress
GET /api/v1/sandboxes/{id}/metricsA running sandbox gets a fresh reading first (at most every 10 seconds). Recorded usage, not a bill.
| Parameter | In | Type | Notes |
|---|---|---|---|
id (required) | path | string | Sandbox ID, or the name of a durable sandbox |
hours | query | integer | How far back the readings go |
Returns 200 with Metrics.
Commands
Run a command
POST /api/v1/sandboxes/{id}/execReturns the finished execution (200). Returns 202 with status pending_approval if a policy rule holds it for a person, or with status running if it is still going after 90 seconds. Poll GET /executions/{id} until it finishes. With stream: true (or Accept: text/event-stream) the answer is server-sent events: start (the execution), stdout and stderr ({data, offset}), then done ({exitCode, timedOut}). With background: true it answers 202 at once; read its output with GET /executions/{id}/output.
| Parameter | In | Type | Notes |
|---|---|---|---|
id (required) | path | string | Sandbox ID, or the name of a durable sandbox |
Body (JSON):
| Field | Type | Notes |
|---|---|---|
cmd (required) | string | Shell command |
cwd | string | |
env | object | |
timeoutMs | integer | A plain run: 1 s to 5 min (default 60 s). Streamed: up to 1 hour. Background: no limit of its own unless set (up to 24 hours). |
stdin | string | Written to the command's stdin when it starts (at most 1 MB) |
stream | boolean | Answer with server-sent events as it runs (or send Accept: text/event-stream) |
background | boolean | Answer 202 at once and keep it running; read GET /executions/{id}/output |
interactive | boolean | Keep stdin open for POST /executions/{id}/stdin (needs stream or background). An API key's interactive command needs a person's approval when the organization has approval rules. |
Returns 200 with Execution.
Open an interactive terminal
POST /api/v1/sandboxes/{id}/terminalA shell on a pseudo-terminal. Read what it prints from GET /executions/{id}/output, send keys to POST /executions/{id}/stdin, resize with POST /executions/{id}/resize, close with POST /executions/{id}/kill. 201 when open; 202 pending_approval when an API key opens one in an organization with approval rules, since what is typed isn't checked command by command.
| Parameter | In | Type | Notes |
|---|---|---|---|
id (required) | path | string | Sandbox ID, or the name of a durable sandbox |
Body (JSON):
| Field | Type | Notes |
|---|---|---|
cols | integer | |
rows | integer | |
cmd | string | Defaults to a login shell |
cwd | string | |
env | object |
Returns 200 with Execution.
List a sandbox's commands
GET /api/v1/sandboxes/{id}/executions| Parameter | In | Type | Notes |
|---|---|---|---|
id (required) | path | string | Sandbox ID, or the name of a durable sandbox |
status | query | string |
Returns 200 with an object.
Get a command
GET /api/v1/executions/{id}| Parameter | In | Type | Notes |
|---|---|---|---|
id (required) | path | string | Execution ID |
Returns 200 with Execution.
List preview URLs
GET /api/v1/sandboxes/{id}/portsPorts reachable from a browser at https://
| Parameter | In | Type | Notes |
|---|---|---|---|
id (required) | path | string | Sandbox ID, or the name of a durable sandbox |
Returns 200 with an object.
Set preview URLs
PUT /api/v1/sandboxes/{id}/portsReplaces the list. Private by default. Data sent to visitors counts as the sandbox's outbound data.
| Parameter | In | Type | Notes |
|---|---|---|---|
id (required) | path | string | Sandbox ID, or the name of a durable sandbox |
Body (JSON):
| Field | Type | Notes |
|---|---|---|
ports (required) | object[] | |
rotate | boolean | New tokens for private ports: links shared before stop working |
Returns 200 with an object.
Read a live command's output
GET /api/v1/executions/{id}/outputOutput of a streamed, background or terminal command after byte offsets out and err. With Accept: text/event-stream (or ?stream=1): server-sent events until it ends (stdout, stderr, missed, done), or reconnect ({out, err}) after a long stream.
| Parameter | In | Type | Notes |
|---|---|---|---|
id (required) | path | string | Execution ID |
out | query | integer | |
err | query | integer | |
wait | query | integer | Wait up to this many ms (max 25000) for new output |
Returns 200 with OutputChunk.
Send input to an interactive command or terminal
POST /api/v1/executions/{id}/stdinJSON {data, close}, or a raw body of any other type with ?close=1. The first 64 KB sent is kept with the command for the audit trail.
| Parameter | In | Type | Notes |
|---|---|---|---|
id (required) | path | string | Execution ID |
Body (JSON):
| Field | Type | Notes |
|---|---|---|
data | string | |
close | boolean | End stdin (a terminal gets ^D) |
Returns 200 with an object.
Stop a live command
POST /api/v1/executions/{id}/kill| Parameter | In | Type | Notes |
|---|---|---|---|
id (required) | path | string | Execution ID |
Body (JSON):
| Field | Type | Notes |
|---|---|---|
signal | "TERM", "KILL", "INT", "HUP", "QUIT", "USR1", "USR2" |
Returns 200 with Execution.
Resize a terminal
POST /api/v1/executions/{id}/resize| Parameter | In | Type | Notes |
|---|---|---|---|
id (required) | path | string | Execution ID |
Body (JSON):
| Field | Type | Notes |
|---|---|---|
cols (required) | integer | |
rows (required) | integer |
Returns 200 with an object.
Approve a held command (signed-in people only)
POST /api/v1/executions/{id}/approve| Parameter | In | Type | Notes |
|---|---|---|---|
id (required) | path | string | Execution ID |
Body (JSON):
| Field | Type | Notes |
|---|---|---|
note | string |
Returns 200 with Execution.
Deny a held command (signed-in people only)
POST /api/v1/executions/{id}/deny| Parameter | In | Type | Notes |
|---|---|---|---|
id (required) | path | string | Execution ID |
Body (JSON):
| Field | Type | Notes |
|---|---|---|
note | string |
Returns 200 with Execution.
Undo a command: put the files back as they were just before it ran
POST /api/v1/executions/{id}/undo| Parameter | In | Type | Notes |
|---|---|---|---|
id (required) | path | string | Execution ID |
Returns 200 with an object.
Files
Read a file
GET /api/v1/sandboxes/{id}/files| Parameter | In | Type | Notes |
|---|---|---|---|
id (required) | path | string | Sandbox ID, or the name of a durable sandbox |
path (required) | query | string | Path inside the sandbox, relative to the work folder or absolute |
Returns 200 with string: File contents
Write a file
PUT /api/v1/sandboxes/{id}/files| Parameter | In | Type | Notes |
|---|---|---|---|
id (required) | path | string | Sandbox ID, or the name of a durable sandbox |
path (required) | query | string | Path inside the sandbox, relative to the work folder or absolute |
Body: application/octet-stream
Returns 200 with an object.
Delete a file
DELETE /api/v1/sandboxes/{id}/files| Parameter | In | Type | Notes |
|---|---|---|---|
id (required) | path | string | Sandbox ID, or the name of a durable sandbox |
path (required) | query | string | Path inside the sandbox, relative to the work folder or absolute |
Returns 200 with an object.
List a folder
GET /api/v1/sandboxes/{id}/files/list| Parameter | In | Type | Notes |
|---|---|---|---|
id (required) | path | string | Sandbox ID, or the name of a durable sandbox |
path | query | string | Path inside the sandbox, relative to the work folder or absolute |
Returns 200 with an object.
Snapshots
List a sandbox's snapshots
GET /api/v1/sandboxes/{id}/snapshots| Parameter | In | Type | Notes |
|---|---|---|---|
id (required) | path | string | Sandbox ID, or the name of a durable sandbox |
Returns 200 with an object.
Snapshot a sandbox's files
POST /api/v1/sandboxes/{id}/snapshots| Parameter | In | Type | Notes |
|---|---|---|---|
id (required) | path | string | Sandbox ID, or the name of a durable sandbox |
Body (JSON):
| Field | Type | Notes |
|---|---|---|
name | string |
Returns 200 with Snapshot.
Fork a sandbox
POST /api/v1/sandboxes/{id}/forkSnapshots the sandbox's files (or uses snapshotId) and starts up to 10 copies with the same settings, each with those files. Memory and running programs aren't copied, and neither is env: pass it again. Copies that fail are listed in errors.
| Parameter | In | Type | Notes |
|---|---|---|---|
id (required) | path | string | Sandbox ID, or the name of a durable sandbox |
Body (JSON):
| Field | Type | Notes |
|---|---|---|
count | integer | Default 1. |
snapshotId | string | Fork from this snapshot instead of taking a new one |
name | string | Copies are named |
env | object | |
timeoutSec | integer |
Returns 200 with an object.
Rewind a sandbox to a snapshot
POST /api/v1/sandboxes/{id}/rewindPuts the sandbox's files back as they were in the snapshot: files made since are deleted. Running programs keep running. With saveCurrent, the files as they are now are snapshotted first, so you can rewind back.
| Parameter | In | Type | Notes |
|---|---|---|---|
id (required) | path | string | Sandbox ID, or the name of a durable sandbox |
Body (JSON):
| Field | Type | Notes |
|---|---|---|
snapshotId (required) | string | |
saveCurrent | boolean | Default false. |
Returns 200 with an object.
List snapshots
GET /api/v1/snapshotsReturns 200 with an object.
Get a snapshot
GET /api/v1/snapshots/{id}| Parameter | In | Type | Notes |
|---|---|---|---|
id (required) | path | string | Snapshot ID |
Returns 200 with Snapshot.
Delete a snapshot
DELETE /api/v1/snapshots/{id}| Parameter | In | Type | Notes |
|---|---|---|---|
id (required) | path | string | Snapshot ID |
Returns 200 with Snapshot.
Templates
List your templates
GET /api/v1/templatesReturns 200 with an object.
Make a template from a Dockerfile
POST /api/v1/templatesBuilds your own sandbox image from a Dockerfile, in its own microVM. The last stage must start FROM quietrobot/base or quietrobot/minimal; other stages can use any public image. There is no build context: fetch files with RUN or ADD a URL, or COPY --from another stage. CMD, ENTRYPOINT, VOLUME and HEALTHCHECK aren't used. ENV values reach every command. Returns 202 at once; poll GET /templates/{id} until status is ready, then create sandboxes with template set to its name or id. Each plan limits templates, builds a day, build time and image size; build time is billed at Standard rates.
Body (JSON):
| Field | Type | Notes |
|---|---|---|
name (required) | string | 2 to 48 lowercase letters, digits or dashes |
dockerfile (required) | string | |
description | string | |
warmPool | object | Keep this many VMs ready for fast starts (paid plans) |
Returns 200 with an object: Accepted: the first build is queued
Get a template by id or name, with recent builds
GET /api/v1/templates/{id}| Parameter | In | Type | Notes |
|---|---|---|---|
id (required) | path | string | Template ID |
Returns 200 with an object.
Change a template's description or warm pool
PATCH /api/v1/templates/{id}| Parameter | In | Type | Notes |
|---|---|---|---|
id (required) | path | string | Template ID |
Body (JSON):
| Field | Type | Notes |
|---|---|---|
description | string | |
warmPool | object |
Returns 200 with Template.
Delete a template
DELETE /api/v1/templates/{id}Sandboxes already running from it keep running.
| Parameter | In | Type | Notes |
|---|---|---|---|
id (required) | path | string | Template ID |
Returns 200 with an object.
Build a template again
POST /api/v1/templates/{id}/buildsWith a new dockerfile, or with none to rebuild the last one on our latest base image. The template keeps serving its current image until the new build is ready.
| Parameter | In | Type | Notes |
|---|---|---|---|
id (required) | path | string | Template ID |
Body (JSON):
| Field | Type | Notes |
|---|---|---|
dockerfile | string |
Returns 200 with an object: Accepted
Get a build and its log
GET /api/v1/template-builds/{id}| Parameter | In | Type | Notes |
|---|---|---|---|
id (required) | path | string | Build ID |
Returns 200 with TemplateBuild.
Volumes
Save a sandbox's volumes now
POST /api/v1/sandboxes/{id}/volumes/sync| Parameter | In | Type | Notes |
|---|---|---|---|
id (required) | path | string | Sandbox ID, or the name of a durable sandbox |
Returns 200 with an object.
List volumes
GET /api/v1/volumesReturns 200 with an object.
Make an empty volume
POST /api/v1/volumesBody (JSON):
| Field | Type | Notes |
|---|---|---|
name (required) | string |
Returns 200 with Volume.
Get a volume by id or name
GET /api/v1/volumes/{id}| Parameter | In | Type | Notes |
|---|---|---|---|
id (required) | path | string | Volume ID |
Returns 200 with Volume.
Delete a volume and its files
DELETE /api/v1/volumes/{id}Refused (409 volume_in_use) while a live or paused sandbox holds it.
| Parameter | In | Type | Notes |
|---|---|---|---|
id (required) | path | string | Volume ID |
Returns 200 with Volume.
Webhooks
List webhook endpoints
GET /api/v1/webhooksReturns 200 with an object.
Add a webhook endpoint
POST /api/v1/webhooksEvents are POSTed as JSON {id, type, createdAt, data}, signed the Standard Webhooks way: webhook-id, webhook-timestamp and webhook-signature (v1,
Body (JSON):
| Field | Type | Notes |
|---|---|---|
url (required) | string | |
description | string | |
events | string[] |
Returns 200 with Webhook.
Get a webhook endpoint
GET /api/v1/webhooks/{id}| Parameter | In | Type | Notes |
|---|---|---|---|
id (required) | path | string | Webhook ID |
Returns 200 with Webhook.
Change a webhook endpoint
PATCH /api/v1/webhooks/{id}| Parameter | In | Type | Notes |
|---|---|---|---|
id (required) | path | string | Webhook ID |
Body (JSON):
| Field | Type | Notes |
|---|---|---|
url | string | |
description | string | |
events | string[] | |
enabled | boolean |
Returns 200 with Webhook.
Delete a webhook endpoint
DELETE /api/v1/webhooks/{id}| Parameter | In | Type | Notes |
|---|---|---|---|
id (required) | path | string | Webhook ID |
Returns 200 with Webhook.
Send a signed ping now
POST /api/v1/webhooks/{id}/test| Parameter | In | Type | Notes |
|---|---|---|---|
id (required) | path | string | Webhook ID |
Returns 200 with an object.
Make a new signing secret
POST /api/v1/webhooks/{id}/rotate-secretThe old secret stops working at once.
| Parameter | In | Type | Notes |
|---|---|---|---|
id (required) | path | string | Webhook ID |
Returns 200 with Webhook.
Recent deliveries to an endpoint
GET /api/v1/webhooks/{id}/deliveries| Parameter | In | Type | Notes |
|---|---|---|---|
id (required) | path | string | Webhook ID |
limit | query | integer |
Returns 200 with an object.
Send a delivery again
POST /api/v1/webhooks/{id}/deliveries/{deliveryId}/redeliver| Parameter | In | Type | Notes |
|---|---|---|---|
id (required) | path | string | Webhook ID |
deliveryId (required) | path | string |
Returns 200 with WebhookDelivery.
Secrets
List secrets
GET /api/v1/secretsReturns 200 with an object.
Add or replace a secret
POST /api/v1/secretsStores a key a sandbox can use without holding it. Replacing a value takes effect on the next call from running sandboxes.
Body (JSON):
| Field | Type | Notes |
|---|---|---|
name (required) | string | A-Z, 0-9 and , starting with a letter; not starting with QR |
value (required) | string | The key or token, up to 16 KB. Stored encrypted |
hosts (required) | string[] |
Returns 200 with Secret.
Returns 201 with Secret: Saved
Delete a secret
DELETE /api/v1/secrets/{name}Stand-ins for it stop working at once, in every sandbox.
| Parameter | In | Type | Notes |
|---|---|---|---|
name (required) | path | string |
Returns 200 with Secret.
Your outbound check
GET /api/v1/outbound-checkSet or remove it on the dashboard's Policy page (owners and admins).
Returns 200 with an object.
Public key for sandbox identity tokens
GET /api/v1/identity/jwks.jsonReturns 200 with an object.
Organization
A sandbox's audit log
GET /api/v1/sandboxes/{id}/audit| Parameter | In | Type | Notes |
|---|---|---|---|
id (required) | path | string | Sandbox ID, or the name of a durable sandbox |
Returns 200 with an object.
The organization's audit log
GET /api/v1/audit| Parameter | In | Type | Notes |
|---|---|---|---|
before | query | integer | Return events with seq below this |
limit | query | integer | |
action | query | string |
Returns 200 with an object.
Usage this month, and the plan's limits
GET /api/v1/usage| Parameter | In | Type | Notes |
|---|---|---|---|
days | query | integer | A rolling window instead of this month |
Returns 200 with Usage.
List reserved machines
GET /api/v1/reservationsReturns 200 with an object.
Objects
Error
| Field | Type | Notes |
|---|---|---|
error (required) | object |
Egress
| Field | Type | Notes |
|---|---|---|
mode | "deny", "allowlist", "open" | deny: no outbound traffic. allowlist: only what allow lists. open: any public address. |
allow | string[] | Rules: a domain (pypi.org, .github.com), an IP address or a CIDR range (203.0.113.0/24, [2001:db8::/32]), with an optional port (db.example.com:5432, 203.0.113.0/24:8000-8100, example.com:). No port means 80 and 443. Private ranges can't be allowed. |
deny | string[] | Rules that are always blocked, in allowlist and open mode. Same format; no port means every port. Denied domains take no port. |
maxMode | "deny", "allowlist", "open" | The widest mode this sandbox can be switched to later. Set at create; defaults to what its rules need. An allow rule on a port other than 80 or 443 needs open. |
Sandbox
| Field | Type | Notes |
|---|---|---|
id | string | |
name | string | |
status | "starting", "running", "pausing", "paused", "archived", "stopped", "error" | pausing: a durable sandbox saving its files. archived: a durable sandbox whose machine was deleted; its files are kept and any call wakes it. |
template | string | base, minimal, or the id of one of your own templates (tpl_...) |
region | string | |
cpuClass | "standard", "performance" | |
reservationId | string | |
pausedAt | string | |
fromSnapshotId | string | |
warmStart | boolean | Handed out from a pre-started microVM |
cpus | integer | |
memoryMb | integer | |
egress | Egress | |
secrets | string[] | Names of the secrets this sandbox may use through the gateway |
identity | object | |
autoPauseSec | integer | |
lastActiveAt | string | |
durable | boolean | |
storage | object | |
resumedFrom | "warm", "cold" | |
memoryKept | boolean | |
spend | object | Spend so far (running time at the size's price plus data sent out) and the sandbox's spend cap |
metadata | object | |
error | string | |
createdAt | string | |
startedAt | string | |
deadlineAt | string | |
endedAt | string |
Secret
A stored key or token. The value is write-only: it is never returned.
| Field | Type | Notes |
|---|---|---|
name | string | Environment variable name the stand-in arrives under, e.g. OPENAI_API_KEY |
hosts | string[] | The only hosts the value may be sent to; *.example.com allowed |
createdAt | string | |
updatedAt | string | |
lastUsedAt | string |
PutSecret
| Field | Type | Notes |
|---|---|---|
name (required) | string | A-Z, 0-9 and , starting with a letter; not starting with QR |
value (required) | string | The key or token, up to 16 KB. Stored encrypted |
hosts (required) | string[] |
CreateSandbox
| Field | Type | Notes |
|---|---|---|
name | string | |
template | string | base (default), minimal, or one of your own templates by name or id |
cpuClass | "standard", "performance" | Default "standard". |
cpus | 1, 2, 4, 8, 16 | |
memoryMb | integer | Multiple of 256 |
timeoutSec | integer | Session length; the plan sets the maximum |
region | string | Region code, e.g. us-virginia or eu-frankfurt |
reservationId | string | |
snapshotId | string | Start with this snapshot's files |
pool | boolean | false always boots a fresh microVM |
durable | boolean | Keep this sandbox's files (its home folder) through pauses, the time limit and a lost host. Every pause saves them to object storage first; the time limit pauses instead of deleting; after the plan's warm window the machine is deleted and the sandbox is archived until its next call, which restores the files onto a new microVM. Ends only when deleted. Stored files are billed per GB-month. |
ifExists | "error", "return" | Durable only: when a durable sandbox already has this name, error (409 name_taken) or return that sandbox Default "error". |
egress | Egress | |
env | object | |
metadata | object | |
secrets | string[] | Names of the organization's secrets this sandbox may use. Each arrives as an environment variable holding a stand-in, never the value. Send calls through $QR_GATEWAY_URL/ |
identity | object | Hosts (your own services) this sandbox may prove itself to. It gets QR_IDENTITY_TOKEN, a stand-in the gateway swaps for a five-minute EdDSA token; check it with /identity/jwks.json |
autoPauseSec | integer | Pause after this many seconds with no commands, file calls or gateway calls, unless programs inside are still working (using CPU or holding a connection open). Any call wakes it again |
run | ExecRequest | A first command to run as soon as the sandbox is up, in the same request. The result comes back as run. |
volumes | object[] | Folders kept between sandboxes. Each is put in place before the sandbox is returned, and saved when it pauses or stops, shortly before its deadline, and on POST /sandboxes/{id}/volumes/sync. One live sandbox holds a volume at a time (409 volume_in_use). |
spendCapUsd | number |
ExecRequest
| Field | Type | Notes |
|---|---|---|
cmd (required) | string | Shell command |
cwd | string | |
env | object | |
timeoutMs | integer | A plain run: 1 s to 5 min (default 60 s). Streamed: up to 1 hour. Background: no limit of its own unless set (up to 24 hours). |
stdin | string | Written to the command's stdin when it starts (at most 1 MB) |
stream | boolean | Answer with server-sent events as it runs (or send Accept: text/event-stream) |
background | boolean | Answer 202 at once and keep it running; read GET /executions/{id}/output |
interactive | boolean | Keep stdin open for POST /executions/{id}/stdin (needs stream or background). An API key's interactive command needs a person's approval when the organization has approval rules. |
ExposedPort
| Field | Type | Notes |
|---|---|---|
port | integer | |
access | "private", "public" | |
url | string | |
shareUrl | string | |
token | string |
OutputChunk
| Field | Type | Notes |
|---|---|---|
stdout | string | |
stderr | string | |
out | integer | stdout byte offset to ask from next |
err | integer | stderr byte offset to ask from next |
missed | integer | Bytes that fell out of the 2 MB buffer before they were read |
done | boolean | |
exitCode | integer | |
timedOut | boolean |
Execution
| Field | Type | Notes |
|---|---|---|
id | string | |
sandboxId | string | |
status | "pending_approval", "running", "completed", "denied", "failed" | |
cmd | string | |
cwd | string | |
envKeys | string[] | |
exitCode | integer | |
stdout | string | |
stderr | string | |
durationMs | integer | |
timedOut | boolean | |
mode | "run", "stream", "background", "terminal" | |
interactive | boolean | |
requestedBy | object | |
approval | object | |
checkpointSnapshotId | string | |
createdAt | string | |
finishedAt | string |
Template
| Field | Type | Notes |
|---|---|---|
id | string | |
name | string | |
description | string | |
status | "building", "ready", "failed" | ready once a build has finished; a template keeps its last good image while a rebuild runs |
base | "base", "minimal" | |
sizeBytes | integer | |
upToDate | boolean | |
warmPool | object | |
env | string[] | Names of the variables the Dockerfile set with ENV. Every command gets them. |
latestBuild | TemplateBuild | |
createdAt | string | |
updatedAt | string |
TemplateBuild
| Field | Type | Notes |
|---|---|---|
id | string | |
templateId | string | |
status | "queued", "building", "sealing", "ready", "failed", "cancelled" | |
base | string | |
error | string | |
sizeBytes | integer | |
log | string | The end of the build output (GET /template-builds/{id} only) |
createdAt | string | |
startedAt | string | |
endedAt | string |
Volume
| Field | Type | Notes |
|---|---|---|
id | string | |
name | string | |
sizeBytes | integer | Compressed size of the last save |
attachedTo | string | |
path | string | |
savedAt | string | |
createdAt | string |
VolumeSave
| Field | Type | Notes |
|---|---|---|
volumeId | string | |
name | string | |
ok | boolean | |
sizeBytes | integer | |
error | string |
Metrics
Readings of the whole microVM, about once a minute while it runs, kept 7 days. CPU is % of the sandbox's vCPUs.
| Field | Type | Notes |
|---|---|---|
sandboxId | string | |
status | string | |
cpus | integer | |
memoryMb | integer | |
sampledAt | string | |
runtime | object | |
cpu | object | |
memory | object | |
disk | object | |
storage | object | |
egress | object | |
samples | object[] |
Webhook
| Field | Type | Notes |
|---|---|---|
id | string | |
url | string | |
description | string | |
events | string[] | Event names or groups (sandbox., approval., ). Default: sandbox., approval.*, volume.save_failed |
enabled | boolean | |
failingSince | string | |
lastDeliveryAt | string | |
lastStatus | integer | |
createdAt | string | |
secret | string | Only when created or rotated: the signing secret (whsec_...). Shown once. |
WebhookDelivery
| Field | Type | Notes |
|---|---|---|
id | string | Also the webhook-id header |
event | string | |
status | "pending", "delivered", "failed" | |
attempts | integer | |
nextAttemptAt | string | |
lastStatus | integer | |
lastError | string | |
createdAt | string | |
deliveredAt | string | |
payload | object |
Snapshot
| Field | Type | Notes |
|---|---|---|
id | string | |
name | string | |
kind | "manual", "checkpoint" | |
status | "creating", "ready" | |
sizeBytes | integer | |
sourceSandboxId | string | |
createdAt | string |
AuditEvent
| Field | Type | Notes |
|---|---|---|
seq | integer | |
sandboxId | string | |
actorKind | string | |
actorLabel | string | |
action | string | |
detail | object | |
createdAt | string |
FileEntry
| Field | Type | Notes |
|---|---|---|
name | string | |
path | string | |
type | string | file or dir |
size | integer | |
modified | string |
Usage
Usage for the window. limits is set on plans with hard monthly limits (Free).
| Field | Type | Notes |
|---|---|---|
since | string | |
plan | object | |
limits | object | |
sandboxes | integer | |
executions | integer | |
cpuHours | number | |
gbHours | number | |
egressGb | number | |
pastCapStorageUsd | number | Files kept past the plan's paused-storage limit because a spend cap paused a sandbox. Charged on every plan, Free included. |
bySandbox | object[] | Each sandbox in the window, most expensive first (at most 100) |
storage | object | What's stored now. Recorded; not billed yet. |