> ## Documentation Index
> Fetch the complete documentation index at: https://docs.declaw.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# List Snapshots

> List all snapshots (periodic, pause, and manual) for a sandbox, newest first.

Returns every snapshot recorded for this sandbox — periodic, pause-induced, and
manual — ordered by `created_at` descending.

Ownership is enforced: the caller must be the owner of the sandbox for any
snapshot metadata to be returned.

## Path Parameters

<ParamField path="sandbox_id" type="string" required>
  The sandbox identifier. Format: `sbx-<8 chars>`.
</ParamField>

## Response

<ResponseField name="snapshots" type="Snapshot[]">
  Array of snapshot objects, newest first.
</ResponseField>

### `Snapshot` object

<ResponseField name="snapshot_id" type="string">
  Unique snapshot identifier.
</ResponseField>

<ResponseField name="sandbox_id" type="string">
  The sandbox this snapshot belongs to.
</ResponseField>

<ResponseField name="source" type="string">
  How this snapshot was created: `"periodic"`, `"pause"`, or `"manual"`.
</ResponseField>

<ResponseField name="mem_blob_key" type="string">
  Blob store key for the memory image.
</ResponseField>

<ResponseField name="vmstate_blob_key" type="string">
  Blob store key for the sandbox VM state.
</ResponseField>

<ResponseField name="mem_size_bytes" type="integer | null">
  Size of the memory image in bytes, when recorded.
</ResponseField>

<ResponseField name="created_at" type="string">
  UTC timestamp when the snapshot was created.
</ResponseField>

## Example

<CodeGroup>
  ```bash cURL theme={null}
  curl "https://api.declaw.ai/sandboxes/sbx-a1b2c3d4/snapshots" \
    -H "X-API-Key: YOUR_API_KEY"
  ```

  ```python Python theme={null}
  from declaw import Sandbox

  sbx = Sandbox.connect("sbx-a1b2c3d4", api_key="YOUR_API_KEY", domain="api.declaw.ai")
  for snap in sbx.list_snapshots():
      print(snap.snapshot_id, snap.source, snap.created_at)
  ```

  ```typescript TypeScript theme={null}
  import { Sandbox } from "@declaw/sdk";

  const sbx = await Sandbox.connect("sbx-a1b2c3d4", {
    apiKey: "YOUR_API_KEY",
    domain: "api.declaw.ai",
  });
  for (const snap of await sbx.listSnapshots()) {
    console.log(snap.snapshotId, snap.source, snap.createdAt);
  }
  ```
</CodeGroup>

```json Response theme={null}
{
  "snapshots": [
    {
      "snapshot_id": "snap-a1b2c3d4",
      "sandbox_id": "sbx-a1b2c3d4",
      "source": "manual",
      "mem_blob_key": "snapshots/.../mem",
      "vmstate_blob_key": "snapshots/.../state",
      "mem_size_bytes": 268435456,
      "created_at": "2026-04-14T10:30:00Z"
    }
  ]
}
```

## Error Responses

| Status | Cause                            |
| ------ | -------------------------------- |
| `401`  | Missing or invalid API key       |
| `404`  | Sandbox not found                |
| `500`  | Internal error listing snapshots |
