API Overview
Base URL, authentication, conventions, and error handling for the REST API.
The Daytona REST API drives everything the SDK and dashboard do: creating and managing sandboxes, building images, capturing snapshots, and attaching volumes, object stores, secrets, and registry credentials.
Base URL
All example requests in this reference use this base URL.
Authentication
There are two authentication planes:
| Plane | Header | Used for |
|---|---|---|
| Workload | Authorization: Bearer rlp_... | All sandbox, image, snapshot, volume, object-store, registry, secret, region, job, and usage routes |
| Management | Authorization: Bearer <OIDC JWT> | Management API routes (/me, /orgs, /projects, /api-keys, credits) |
Workload API keys are project-scoped tokens with the rlp_ prefix, minted from the dashboard or via POST /projects/:id/api-keys. Every workload resource is scoped to the key's project — an id belonging to another project returns 404, exactly like a nonexistent one. Management routes use your dashboard login token (an OIDC bearer JWT), not an rlp_ key. See Authentication.
Conventions
- JSON everywhere. Request and response bodies are JSON unless noted (logs return
text/plain; image context uploads aremultipart/form-data). Unknown request fields are ignored. - Async creates + polling.
POST /vms,POST /images, andPOST /vms/:id/snapshotsreturn immediately withstatus: "pending"and ajob_id. Poll the resource (orGET /jobs/:id) until it reaches a ready/terminal state. - Long-poll with
?wait=.GET /vms/:id?wait=running&timeout_ms=30000blocks until the sandbox reaches the target status (or a terminal state), up to 60 s.GET /snapshots/:id?wait=readyworks the same way. On timeout you get200with the current state — check thestatusfield. - Cursor pagination. List endpoints (
GET /vms,/images,/snapshots) acceptlimit(default 100, max 200) andcursor. Responses includenext_cursor— an opaque token to echo back for the next page;nullmeans the last page. - External sandbox ids. Sandbox ids in responses are region-tagged tokens (bare UUIDs are also accepted on input). Treat them as opaque strings.
Status codes & errors
Errors return a JSON body of the shape:
The overload response (429) carries extra fields and a Retry-After header:
| Code | Meaning |
|---|---|
200 | Success |
204 | Success, no body (secret / registry writes and deletes) |
400 | Validation error — malformed body, invalid name, unknown region, bad cursor, resource caps exceeded |
401 | Missing or invalid credentials |
402 | Insufficient credits — the owning organization is out of credits |
403 | Authenticated but not permitted (e.g. non-owner org action) |
404 | Not found — including ids that belong to another project |
409 | State conflict — wrong lifecycle state, duplicate name, resource in use, artifact still replicating |
429 | Overloaded — create queue at capacity; honor Retry-After and retry |
500 | Internal error |
502 | Upstream queue error |
503 | Queue temporarily degraded — retry the request |
Endpoint index
| Resource | Endpoints | Reference |
|---|---|---|
| Sandboxes | POST/GET /vms, GET/DELETE /vms/:id | Sandboxes |
| Lifecycle | POST /vms/:id/stop, /start, /pause, /resume, /fork | Sandbox Lifecycle |
| Snapshots | POST /vms/:id/snapshots, GET /snapshots, GET/DELETE /snapshots/:id | VM Snapshots |
| Logs & usage | GET /vms/:id/logs, /entrypoint-logs, /usage, /usage/history, GET /usage/report | Logs & Usage |
| Images | POST/GET /images, GET /jobs/:id | Images |
| Volumes | POST/GET /volumes, GET/DELETE /volumes/:id | Volumes |
| Object stores | POST/GET /object-stores, GET/DELETE /object-stores/:id, runtime mounts | Object Stores |
| Registries | GET/PUT /registries, GET/PUT/DELETE /registries/:host | Registries |
| Secrets | GET /secrets, GET/PUT/DELETE /secrets/:name | Secrets |
| Regions | GET /regions | Regions |
| Management | /me, /orgs, /projects, /api-keys, credits | Management API |
Note: SDK users targeting the Daytona-compatible facade should see the compatibility guide instead.