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

# Extend sandbox expiration window

> Sandbox extended (clamped to createdAt + min(plan max runtime, 24h); durable: the plan durable cap)

> [!WARNING]
>
> **Confirm your deployment before running this request.** This page describes an API contract;
> a published reference does not establish hosted availability. Check the dated
> [host report](https://docs.stateset.com/api-reference/hosts.md) and obtain your deployment URL and credentials.
> Replace the example host if your provisioned service uses a different URL.

### Path parameters

**id** `string (uuid)` *required*

Sandbox identifier

### Request body

`ExtendSandboxRequest`

**additional\_seconds** `integer` *required*

Minimum: `60`. Maximum: `86400`.

### Response

`SandboxResponse`

**sandbox\_id** `string (uuid)` *required*

Unique sandbox identifier.

**org\_id** `string` *required*

Organization that owns this sandbox.

**session\_id** `string` *required*

Session identifier.

**status** `string` *required*

Current sandbox status. Allowed values: `'creating'`, `'running'`, `'pausing'`, `'paused'`, `'resuming'`, `'terminating'`, `'terminated'`, `'error'`.

**pod\_ip** `string`

Internal pod IP address.

**sandbox\_epoch** `integer` *required*

Sandbox recycle epoch counter. Minimum: `-9007199254740991`. Maximum: `9007199254740991`.

**allocated\_vcpu** `number`

Allocated vCPU cores.

**allocated\_memory\_gib** `number`

Allocated memory in GiB.

**created\_at** `string (date-time)` *required*

ISO 8601 creation timestamp.

**expires\_at** `string (date-time)` *required*

ISO 8601 expiration timestamp.

**max\_expires\_at** `string (date-time)` *required*

Maximum possible expiration.

**max\_lifetime\_seconds** `integer` *required*

Maximum sandbox lifetime in seconds. Minimum: `-9007199254740991`. Maximum: `9007199254740991`.

**remaining\_extend\_seconds** `integer` *required*

Seconds available for extension. Minimum: `-9007199254740991`. Maximum: `9007199254740991`.

**lifetime\_used\_seconds** `integer` *required*

Seconds of lifetime consumed. Minimum: `-9007199254740991`. Maximum: `9007199254740991`.

**lifetime\_used\_percent** `number` *required*

Percentage of lifetime consumed.

**resource\_class** `string` *required*

Resource class: dedicated (guaranteed) or shared (burstable, preemptible Spot capacity). Allowed values: `'shared'`, `'dedicated'`.

**workspace** `object` *required*

Workspace storage backing.

**workspace**

**persistence** `string` *required*

Allowed values: `'ephemeral'`, `'persistent'`.

**pvc\_name** `string`

**size** `string`

**startup\_metrics** `object`

Startup timing breakdown.

**startup\_metrics**

**total\_ms** `number` *required*

Total startup time in milliseconds.

**pod\_creation\_ms** `number` *required*

Pod creation time.

**pod\_ready\_ms** `number` *required*

Time until pod ready.

**phases** `object[]` *required*

**phases**

**name** `string` *required*

**durationMs** `number` *required*

### Status codes

| Code | Meaning |
| - | - |
| `200` | Sandbox extended (clamped to createdAt + min(plan max runtime, 24h); durable: the plan durable cap) |
| `402` | PAYMENT\_REQUIRED: the org no longer passes the billing gate creates pass |
| `404` | Sandbox not found |
| `409` | SANDBOX\_INVALID\_STATE, details.reason max\_lifetime\_reached: already at its lifetime cap |

### Using this contract

Read the [source OpenAPI document](https://docs.stateset.com/spec/sandbox.json) for declared schemas and alternatives.
This page also includes documented corrections from the [spec overlays](https://github.com/stateset/docs/tree/main/spec/overlays).
Example IDs and values are illustrative; replace them with records from your workspace.

```bash cURL theme={null}
curl --silent --show-error --fail-with-body --request POST \
  --url 'https://api.sandbox.stateset.app/api/v1/sandbox/{id}/extend' \
  --header 'Authorization: ApiKey YOUR_API_KEY' \
  --header 'Content-Type: application/json' \
  --data '{
  "additional_seconds": 250
}'
```

```json 200 theme={null}
{
  "sandbox_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
  "org_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
  "session_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
  "status": "creating",
  "pod_ip": "string",
  "sandbox_epoch": 1,
  "allocated_vcpu": 1.5,
  "allocated_memory_gib": 1.5,
  "created_at": "2026-08-31T14:22:05Z",
  "expires_at": "2026-08-31T14:22:05Z",
  "max_expires_at": "2026-08-31T14:22:05Z",
  "max_lifetime_seconds": 250,
  "remaining_extend_seconds": 250,
  "lifetime_used_seconds": 250,
  "lifetime_used_percent": 7.5,
  "resource_class": "shared",
  "workspace": {
    "persistence": "ephemeral",
    "pvc_name": "string",
    "size": "string"
  },
  "startup_metrics": {
    "total_ms": 250,
    "pod_creation_ms": 250,
    "pod_ready_ms": 250,
    "phases": [
      {
        "name": "Two-Person Tent",
        "durationMs": 7.5
      }
    ]
  }
}
```


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