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

# snapshot

> Create and delete snapshots of a sandbox's state

## `bonya snapshot`

> [!NOTE]
>
> Alias: `snap`

Snapshots capture a running sandbox's state. Creating one requires the source sandbox to be **running** — suspended, failed, and deleted sandboxes are all rejected.

> [!NOTE]
>
> There is no `snapshot list` command. `bonya snapshot` only supports `create` and `delete`.

## `create`

Creates a snapshot from a running sandbox.

```shell theme={null}
bonya snapshot create [sandbox]
```

| Flag | Default | Description |
| - | - | - |
| `--idempotency-key` | — | Idempotency key for the snapshot create request. |
| `--by-name` | `false` | Treat the sandbox argument as a name even if it looks like an id. |

```shell theme={null}
bonya snapshot create web
```

## `delete`

Deletes a snapshot.

```shell theme={null}
bonya snapshot delete [sandbox] <snapshot-id>
```

```shell theme={null}
bonya snapshot delete web snp-a1b2c3d4e5f6
```

| Flag | Default | Description |
| - | - | - |
| `--by-name` | `false` | Treat the sandbox argument as a name even if it looks like an id. |


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.