---
title: "Snapshot a running sandbox"
method: POST
path: "/sandboxes/{id}/snapshots"
tags: ["Snapshots"]
---

# Snapshot a running sandbox

`POST /sandboxes/{id}/snapshots`

## Request

- Base URL: `https://sandbox-as-a-service.com/v1`
- URL: `https://sandbox-as-a-service.com/v1/sandboxes/{id}/snapshots`
- Auth: HTTP bearer

Captures a full-VM image of a running sandbox. The sandbox keeps running throughout: the capture is crash-consistent for the filesystem and does not reboot or otherwise disturb it.

The call returns `202` with the snapshot still `pending`; poll `GET /snapshots` until it is `available`. A snapshot can then be restored into a new sandbox with `POST /sandboxes` and `snapshot_id`, which restores the captured filesystem state. Processes are not resumed.

The source sandbox must stay alive until the snapshot is `available` — a capture outlasting the sandbox fails. Extend the sandbox (`POST /sandboxes/{id}/extend`) before snapshotting it for a long-running capture. Capture requires a positive balance. At most 3 snapshots are kept per account and only one capture may be in flight; snapshots are deleted automatically after 7 days of retention. This operation is REST-only.

## Request body

- object
  - `name` string: Optional label for your own reference.

## Response `202`

Capture accepted and in progress. Poll GET /snapshots until the status is `available`.

- Snapshot
  - `object` 'snapshot'
  - `id` string
  - `sandbox_id` string
  - `name` string, nullable
  - `status` 'pending' | 'available' | 'failed' | 'deleted': Capture lifecycle: `pending` while the image is being created, `available` once it is restorable, `failed` if the capture could not finish, `deleted` once it is gone.
  - `size` 'small' | 'medium' | 'large'
  - `created_at` string, date-time
  - `available_at` string, date-time, nullable
  - `expires_at` string, date-time, nullable: When the snapshot is deleted automatically (retention).
  - `deleted_at` string, date-time, nullable

## Other responses

- `400`: Invalid request parameters.
- `401`: Missing or invalid API key.
- `402`: Credit balance exhausted.
- `404`: No sandbox with that id for this account.
- `409`: Sandbox is not running.
- `429`: Rate limit or concurrent sandbox limit reached.
- `502`: Snapshot capture could not be started.

---

[API](https://skmtc.dev/sandbox-as-a-service/apis/sandbox-as-a-service-api.md) · [All operations](https://skmtc.dev/sandbox-as-a-service/apis/sandbox-as-a-service-api/llms.txt) · [OpenAPI document](https://skmtc.dev/sandbox-as-a-service/apis/sandbox-as-a-service-api/revisions/4f1ea2cf8333?raw)
