# updateSandboxLifetime

```graphql
mutation UpdateSandboxLifetime($sandboxId: ID!, $input: SandboxLifetimeInput!) {
  updateSandboxLifetime(sandboxId: $sandboxId, input: $input) {
    id
    accessScope
    workspaceStorage
    shortId
    endpoint
    status
    ttlMode
    ttlHours
    expiresAt
    runId
    stoppedAt
    createdAt
    projectId
    lastActivityAt
    variableSnapshot {
      sourceEnvironmentId
      variableCount
      copiedAt
    }
  }
}
```

Update sandbox lifetime. Requires project.sandboxes.manage.

## Arguments

| Name             | Type                  | Required | Description                                |
| ---------------- | --------------------- | -------- | ------------------------------------------ |
| `sandboxId`      | ID!                   | Yes      |                                            |
| `input`          | SandboxLifetimeInput! | Yes      |                                            |
| `input.ttlMode`  | SandboxLifetimeMode!  | Yes      | One of `default`, `duration`, `always_on`. |
| `input.ttlHours` | Int                   |          |                                            |

## Variables

```json
{
  "sandboxId": "string",
  "input": {
    "ttlMode": "default"
  }
}
```

## Responses

| Status | Description                                 |
| ------ | ------------------------------------------- |
| 200    | The Sandbox! in data.updateSandboxLifetime. |

## Call it

```bash
curl -X POST "https://api.veryfront.com/graphql" \
  -H "Authorization: Bearer $VERYFRONT_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "query": "mutation UpdateSandboxLifetime($sandboxId: ID!, $input: SandboxLifetimeInput!) {\n  updateSandboxLifetime(sandboxId: $sandboxId, input: $input) {\n    id\n    accessScope\n    workspaceStorage\n    shortId\n    endpoint\n    status\n    ttlMode\n    ttlHours\n    expiresAt\n    runId\n    stoppedAt\n    createdAt\n    projectId\n    lastActivityAt\n    variableSnapshot {\n      sourceEnvironmentId\n      variableCount\n      copiedAt\n    }\n  }\n}",
  "variables": {
    "sandboxId": "string",
    "input": {
      "ttlMode": "default"
    }
  }
}'
```

## Example response

```json
{
  "data": {
    "updateSandboxLifetime": {
      "id": "string",
      "accessScope": "project",
      "workspaceStorage": "ephemeral",
      "shortId": "string",
      "endpoint": "string",
      "status": "pending",
      "ttlMode": "default",
      "ttlHours": 0,
      "expiresAt": "2026-01-01T00:00:00Z",
      "runId": "string",
      "stoppedAt": "2026-01-01T00:00:00Z",
      "createdAt": "2026-01-01T00:00:00Z",
      "projectId": "string",
      "lastActivityAt": "2026-01-01T00:00:00Z",
      "variableSnapshot": {
        "sourceEnvironmentId": "string",
        "variableCount": 0,
        "copiedAt": "2026-01-01T00:00:00Z"
      }
    }
  }
}
```
