---
title: "Take an explicit snapshot of the run's sandbox"
description: Takes an explicit snapshot of the live sandbox and returns its identity.
api_method: POST
api_path: "/v1/agent-runs/{runId}/sandbox/snapshot"
canonical_url: https://wiblo.app/docs/developers/api/agent-runs/snapshot-agent-sandbox
last_updated: 2026-07-28T17:31:44+02:00
md_url: https://wiblo.app/docs/developers/api/agent-runs/snapshot-agent-sandbox.md
---

# Take an explicit snapshot of the run's sandbox

`POST /v1/agent-runs/{runId}/sandbox/snapshot`

Takes an explicit snapshot of the live sandbox and returns its identity. On the cloud host a snapshot stops the box (sandbox-lab F-012), so this behaves as a park whose snapshot was taken deliberately: the snapshot is mirrored onto the lease as the freshest resume source, the stop receipt is harvested, and the lease settles `stopped`. 409 `AGENT_SANDBOX_UNAVAILABLE` when no live sandbox exists; 502 `UPSTREAM_UNAVAILABLE` when the host cannot snapshot. Per-user rate-limited at 10/60s.

## Path parameters

| Parameter | Type | Required | Description |
| --- | --- | --- | --- |
| `runId` | `string` | Yes |  |

## Request

**curl**

```bash
curl https://api.wiblo.app/v1/agent-runs/{runId}/sandbox/snapshot \
  -X POST \
  -H "Authorization: Bearer $WIBLO_TOKEN"
```

**TypeScript**

```ts
import { createSdk, snapshotAgentSandbox } from "@workspace/sdk"

const sdk = createSdk({ baseUrl: "https://api.wiblo.app" })

const { data, error } = await snapshotAgentSandbox({
  client: sdk,
  path: { runId: "..." },
})
```

## Responses

**`200`** — The snapshot was taken and the sandbox parked. Returns `SnapshotAgentSandboxResponse`.

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `runId` | `string` | Yes |  |
| `status` | `"provisioning" \| "active" \| "disconnected" \| "hibernating" \| "hibernated" \| "failed" \| ...` | Yes |  |
| `needsReprovision` | `boolean` | Yes |  |
| `snapshot` | `object` | Yes |  |
| `snapshot.id` | `string` | Yes |  |
| `snapshot.sizeBytes` | `integer \| null` | No | Defaults to `null`. |
| `snapshot.expiresAt` | `string \| null` | No | Defaults to `null`. |

**`401`** — No valid session cookie or `wbl_*` bearer was present. Returns `ApiErrorEnvelope`.

**`404`** — No run visible to the caller with this id (`AGENT_RUN_NOT_FOUND`). Returns `ApiErrorEnvelope`.

**`409`** — No live sandbox to snapshot (`AGENT_SANDBOX_UNAVAILABLE`). Returns `ApiErrorEnvelope`.

**`422`** — Path param failed UUID validation (`INVALID_PARAMS`). Returns `ApiErrorEnvelope`.

**`429`** — Rate limit exceeded. The body's `error.code` is `RATE_LIMITED` and `error.details.retry_after` is the same number of seconds as the `Retry-After` header. Returns `ApiErrorEnvelope`.

**`502`** — The sandbox host could not take a snapshot (`UPSTREAM_UNAVAILABLE`). Returns `ApiErrorEnvelope`.
