Delete a sandbox
Ends the VM, removes its local files and destroys its data keys.
DELETE/v1/sandboxes/{sandbox_id}
Ends the VM, removes its local files and destroys its data keys. Never answers conflict; a repeat on a deleted sandbox is a no-op.
A key with the sandboxes:write scope.
Request
curl -X DELETE "https://api.pod.mapier.ai/v1/sandboxes/sbx_3ahrz6dmv29gqy5ckt18fpx4b" \
-H "Authorization: Bearer $POD_API_KEY"Parameters
| Name | In | Type | Required | What it is |
|---|---|---|---|---|
sandbox_id | path | string | Yes | |
Pod-End-User | header | string | No | Narrows a project key to one of its end users: the call sees only that end user's sandboxes and usage, any other answering not_found, and a create is labelled with it. An end user of another project, or one that is not there, is not_found; a suspended one refuses creates and wakes (account_restricted). |
Idempotency-Key | header | string | No | Makes a repeat of this call safe for 24 hours. |
wait | query | boolean | No | Wait for the result instead of answering 202 with an operation. |
wait_timeout_s | query | integer | No | How long wait=true waits before answering 202 after all. |
Answer
200. With wait=true, the sandbox, deleted.
202. The work started; follow the operation.
{
"id": "sbx_3ahrz6dmv29gqy5ckt18fpx4b",
"project": "prj_3ahrz6dmv29gqy5ckt18fp",
"state": "running",
"tier": null,
"operation": null,
"reason": null,
"restarted": false,
"system": "linux",
"size": "small",
"class": "shared",
"disk": "persistent",
"template": null,
"parent": null,
"created_at": "2026-11-23T12:00:00.000Z",
"state_at": "2026-11-23T12:00:00.000Z",
"time_limit_at": null,
"idle_s": 900,
"flags": {
"no_save": false,
"billing_mark": null
},
"labels": {
"app": "quickstart"
},
"queue_position": null,
"end_user": null,
"group": null
}| Field | Type | Always | What it is |
|---|---|---|---|
id | string | Yes | |
project | string | Yes | |
state | "creating" | "running" | "stopping" | "sleeping" | "waking" | "stopped" | "deleting" | "deleted" | "error" | Yes | running means restored and reset: a sandbox made or woken from a copy (a template, a snapshot or a fork) shows running only once Pod's agent inside it has reset the copy (random numbers, clock and identity), so nothing that runs in it shares them with another copy. Secrets and the machine profile load after the reset. |
tier | "memory" | "disk" | "none" | null | Yes | Set only while sleeping. |
operation | "snapshotting" | "forking" | "moving" | null | Yes | |
reason | "create_failed" | "boot_failed" | "server_lost" | "resize_failed" | "vm_crashed" | "time_limit" | "no_capacity" | "idle" | "stopped" | null | Yes | |
restarted | boolean | Yes | True when the last wake booted, so programs started again. |
system | "linux" | Yes | |
size | "small" | "medium" | "large" | "xlarge" | "ci-2" | "ci-4" | "ci-8" | "ci-16" | Yes | |
class | "shared" | "ci" | "nested" | Yes | |
disk | "persistent" | "throwaway" | Yes | throwaway keeps writes on the server and never sends them to object storage; the sandbox cannot sleep to disk on another server and is lost with its server. The key that created it may still snapshot it, with its memory, and restore the snapshot at the same size; with no_save, every other key is refused. |
template | string | null | Yes | |
parent | string | null | Yes | The sandbox this one was forked from. |
created_at | string | Yes | RFC 3339 in UTC with milliseconds, for example 2026-11-23T17:04:05.123Z. |
state_at | string | Yes | RFC 3339 in UTC with milliseconds, for example 2026-11-23T17:04:05.123Z. |
time_limit_at | string | null | Yes | |
idle_s | integer | null | Yes | Seconds with no activity before it sleeps; null when it never sleeps for want of activity. At least 60. |
flags | SandboxFlags | Yes | |
labels | Labels | Yes | Up to 32 labels. Keys are lowercase, 1 to 63 characters; values up to 256. |
queue_position | integer | null | Yes | While waking and waiting for room. At least 1. |
end_user | string | null | Yes | The end user the sandbox was made for, if any. |
group | string | null | Yes | The sandbox's group: its swarm, or its group of one, whose id is the sandbox's with grp_ for sbx_. Null only from a cell that predates groups. |
Errors
The refusals this call is known for: not_found, in_other_cell. Any call can also answer unauthorized, rate_limited, unavailable or internal; the error list says what each means and when to send the call again.
In the SDKs
| Client | Call |
|---|---|
| TypeScript | sandbox.delete() |
| Python | sandbox.delete() |
| mpod | mpod sandboxes delete <sandbox> |