Skip to main content
Destroying a sandbox kills the underlying Firecracker VM, waits for the process to exit, and removes all on-disk state including the reflinked rootfs. Call this when you are done with a sandbox to free resources. If you use the Python or TypeScript SDK, the sandbox is destroyed automatically when you exit a context manager or call close().

Request

DELETE /v1/sandboxes/:id
id
string
required
The sandbox id to destroy.

Response

Returns 204 No Content on success. There is no response body. Destroying an id that has already been destroyed is a no-op and returns 204 (or 200 depending on transport).

Examples

curl -X DELETE https://api.podflare.dev/v1/sandboxes/$SID \
  -H "Authorization: Bearer $PODFLARE_API_KEY"
Response
204 No Content

What happens during destroy

  1. The sandbox’s Firecracker process receives SIGKILL.
  2. The host waits for the process to exit (~1 ms).
  3. The per-VM working directory is deleted recursively, including the reflinked rootfs copy.
  4. The sandbox id is removed from the in-memory registry.

Timing

Destroy completes in approximately 30–50 ms end-to-end.

Error responses

StatusBodyCause
401{"error": "invalid api key"}Missing or invalid bearer token
404{"error": "sandbox not found"}Sandbox id was never created or already destroyed
500{"error": "..."}Process cleanup failed