---
title: "Extend session timeout"
method: POST
path: "/v2/sandboxes/sessions/{sessionId}/extend-timeout"
tags: ["sandboxes"]
---

# Extend session timeout

`POST /v2/sandboxes/sessions/{sessionId}/extend-timeout`

Extends the maximum execution time of a running session. The session must be active and able to accept commands. The total timeout cannot exceed the maximum allowed limit for your account.

## Path parameters

- `sessionId` string, required — The unique identifier of the session to extend the timeout for.

## Query parameters

- `teamId` string
- `slug` string

## Request body

- object
  - `duration` number, required — The amount of time in milliseconds to add to the current timeout. Must be at least 1000ms (1 second).

## Response `200`

The session timeout was extended successfully.

- object
  - `session` Session, required — This object contains information related to a Vercel Sandbox Session. v2 endpoints return "session" instead of "sandbox" as the response wrapper key.
    - `sourceSandboxName` string, required — The name of the source sandbox.
    - `projectId` string, required — The unique identifier of the project associated with this session.
    - `id` string, required — The unique identifier of the sandbox.
    - `memory` number, required — Memory allocated to this sandbox in MB.
    - `vcpus` number, required — Number of vCPUs allocated to this sandbox.
    - `region` string, required — The region where the sandbox is hosted.
    - `runtime` string, required — The runtime of the sandbox.
    - `timeout` number, required — The maximum amount of time the sandbox will run for in milliseconds.
    - `status` 'aborted' | 'failed' | 'pending' | 'running' | 'snapshotting' | 'stopped' | 'stopping', required — The status of the sandbox.
    - `requestedAt` number, required — The time when the sandbox was requested, in milliseconds since the epoch.
    - `startedAt` number — The time when the sandbox was started, in milliseconds since the epoch.
    - `cwd` string, required — The working directory of the sandbox.
    - `requestedStopAt` number — The time when the sandbox was requested to stop, in milliseconds since the epoch.
    - `stoppedAt` number — The time when the sandbox was stopped, in milliseconds since the epoch.
    - `abortedAt` number — The time when the sandbox was aborted, in milliseconds since the epoch.
    - `duration` number — The duration of the sandbox in milliseconds.
    - `sourceSnapshotId` string — The unique identifier of the snapshot associated with this sandbox, if any.
    - `snapshottedAt` number — The time when a snapshot was requested, in milliseconds since the epoch.
    - `createdAt` number, required — The time when the sandbox was created, in milliseconds since the epoch.
    - `updatedAt` number, required — The last time the sandbox was updated, in milliseconds since the epoch.
    - `networkPolicy` SandboxNetworkPolicy — The network policy applied to this sandbox, if any.
      - `mode` 'allow-all' | 'custom' | 'deny-all', required — The network policy mode. - 'allow-all': All traffic is allowed. - 'deny-all': All traffic is blocked. - 'custom': Traffic is controlled by explicit allow/deny rules.
      - `allowedDomains` string[] — List of domain names the sandbox is allowed to connect to. Supports wildcard patterns (e.g., "*.vercel.com" matches all subdomains).
      - `allowedCIDRs` string[] — List of IP address ranges (in CIDR notation) the sandbox is allowed to connect to.
      - `deniedCIDRs` string[] — List of IP address ranges (in CIDR notation) the sandbox is blocked from connecting to. These rules take precedence over all allowed rules.
      - `injectionRules` SandboxInjectionRule[] — HTTP header injection rules for outgoing requests matching specific domains.
        - `domain` string, required — The domain (or pattern) that this injection rule applies to. Supports wildcards like *.vercel.com.
        - `headerNames` string[] — The names of HTTP headers that have value that will be injected for requests to this domain.
    - `activeCpuDurationMs` number — The amount of CPU time the sandbox consumed, if available, in milliseconds. This value is only available once the sandbox is stopped, and only if it stopped successfully.
    - `networkTransfer` object — The quantity of data transfered to and from the sandbox, in bytes. This value is only available once the sandbox is stopped, and only if it stopped successfully.
      - `ingress` number, required
      - `egress` number, required

## Other responses

- `400` — One of the provided values in the request body is invalid. One of the provided values in the request query is invalid.
- `401` — The request is not authorized.
- `403` — You do not have permission to access this resource.
- `404`
- `410`
- `422`
- `429`
- `500`

---

[API](https://skmtc.net/vercel/apis/api.md) · [All operations](https://skmtc.net/vercel/apis/api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/vercel/api/versions/b4d86a3e3479/schema)
