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

> Extends the expiration time of a running sandbox

Extends the expiration time of a running sandbox

### Path parameters

<ParamField path="sandboxId" type="string (uuid)" required>
  Unique sandbox identifier
</ParamField>

### Request body

`ExtendSandboxRequest`

<ParamField body="additional_seconds" type="integer" required>
  Number of seconds to extend the sandbox lifetime
</ParamField>

### Response

`ExtendSandboxResponse`

<ResponseField name="sandbox_id" type="string (uuid)" />

<ResponseField name="status" type="SandboxStatusEnum" />

<ResponseField name="expires_at" type="string (date-time)">
  New expiration time after extension
</ResponseField>

<ResponseField name="max_expires_at" type="string (date-time)">
  Maximum allowed expiration time
</ResponseField>

<ResponseField name="max_lifetime_seconds" type="integer">
  Maximum lifetime in seconds for the sandbox
</ResponseField>

<ResponseField name="remaining_extend_seconds" type="integer">
  Seconds still available for future extensions
</ResponseField>

<ResponseField name="requested_additional_seconds" type="integer">
  The number of seconds that were requested
</ResponseField>

<ResponseField name="applied_additional_seconds" type="integer">
  The number of seconds actually applied (may be capped)
</ResponseField>

### Status codes

| Code  | Meaning                   |
| ----- | ------------------------- |
| `200` | Sandbox lifetime extended |
| `400` | —                         |
| `401` | —                         |
| `404` | —                         |

<RequestExample>
  ```bash cURL theme={null}
  curl --request POST \
    --url 'https://api.sandbox.stateset.app/api/v1/sandbox/{sandboxId}/extend' \
    --header 'Authorization: Bearer YOUR_API_KEY' \
    --header 'Content-Type: application/json' \
    --data '{
    "additional_seconds": 1
  }'
  ```
</RequestExample>

<ResponseExample>
  ```json 200 theme={null}
  {
    "sandbox_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
    "status": "creating",
    "expires_at": "2026-07-24T12:00:00Z",
    "max_expires_at": "2026-07-24T12:00:00Z",
    "max_lifetime_seconds": 1,
    "remaining_extend_seconds": 1,
    "requested_additional_seconds": 1,
    "applied_additional_seconds": 1
  }
  ```
</ResponseExample>
