# Pause, resume and snapshot a sandbox

> Pause a Sandscale sandbox and resume it later, save its /workspace as a snapshot, and start new sandboxes from it.

Pause keeps a sandbox's memory and files for later. A snapshot saves its /workspace so you can start new sandboxes from it.

Pause and resume work on every plan. Snapshots come with Pro and up, within your organization’s snapshot policy (on or off, how many, how large and how long they are kept).

## Pause and resume

```ts
await sandscale.sandboxes.pause(box.id, { region: box.region });
await sandscale.sandboxes.resume(box.id, { region: box.region });
```

```python
sandscale.sandboxes.pause(box.id, region=box.region)
sandscale.sandboxes.resume(box.id, region=box.region)
```

```sh
curl -X POST "$API/instances/$ID/pause" -H "$AUTH"
curl -X POST "$API/instances/$ID/resume" -H "$AUTH"
```

## Save a snapshot

```ts
const snap = await sandscale.sandboxes.snapshot(box.id, { region: box.region, label: 'after-npm-ci' });
```

```python
snap = sandscale.sandboxes.snapshot(box.id, label="after-npm-ci", region=box.region)
```

```sh
curl -X POST "$API/instances/$ID/snapshot" -H "$AUTH"
```

A snapshot is an archive of the sandbox’s `/workspace`, checked end to end. Nothing mounted into the workspace is included, so runtime secrets are never in a snapshot. It belongs to your organization and keeps the sandbox’s project.

## Start from a snapshot

```ts
const next = await sandscale.sandboxes.create({ snapshotId: snap.id });
```

```python
nxt = sandscale.sandboxes.create(snapshot_id=snap.id)
```

```sh
curl -X POST "$API/instances" -H "$AUTH" -H "Content-Type: application/json" -d "{\"snapshot_id\": \"$SNAPSHOT_ID\"}"
```

The new sandbox starts with the snapshot’s files, in the snapshot’s project, with your own permissions. If the archive fails its check, the start fails rather than giving you a broken workspace.

## List and delete

`GET /api/v1/sandbox/snapshots` lists your organization’s snapshots, and `DELETE /api/v1/sandbox/snapshots/{snapshotId}` deletes one. Snapshots past the policy’s retention are deleted for you. See the [Sandboxes API](https://sandscale.dev/docs/reference/api/sandboxes).

---
Source: https://sandscale.dev/docs/guides/snapshots
