> ## 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.

# Pause Sandbox

> Freeze a running sandbox, preserving its in-memory state.

Transitions the sandbox to the `paused` state. The underlying sandbox VM is
frozen and memory is preserved. Paused sandboxes do not consume CPU resources.

Returns an empty `{}` body on success.

<Note>
  Resume the sandbox with [`POST /sandboxes/{sandbox_id}/resume`](/api-reference/sandbox/resume).
  If `auto_resume` was set to `true` in the sandbox's `lifecycle` config, it
  also resumes automatically when accessed.
</Note>

## Path Parameters

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

## Response

Returns an empty JSON object `{}` on success.

## Example

<CodeGroup>
  ```bash cURL theme={null}
  curl -X POST https://api.declaw.ai/sandboxes/sbx-a1b2c3d4/pause \
    -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")
  sbx.pause()
  # sbx.state is now "paused"
  ```

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

  const sbx = await Sandbox.connect("sbx-a1b2c3d4", {
    apiKey: "YOUR_API_KEY",
    domain: "api.declaw.ai",
  });
  await sbx.pause();
  ```
</CodeGroup>

```json Response theme={null}
{}
```

## Error Responses

| Status | Cause                                                            |
| ------ | ---------------------------------------------------------------- |
| `401`  | Missing or invalid API key                                       |
| `404`  | Sandbox not found                                                |
| `409`  | Sandbox is not in a state that can be paused                     |
| `500`  | Pause succeeded on orchestrator but Postgres state update failed |
| `502`  | Orchestrator unreachable or returned non-200                     |
| `503`  | No orchestrator available for the sandbox                        |
