POST /v3/sandboxes/{name}/fork
Forks a named sandbox, creating a new named sandbox from the source's configuration. Resources, timeout, ports, tags, network policy, mounts, Connect network, image, persistence, snapshot settings and — unlike the SDK-side fork — environment variables are copied from the source automatically (interactive is not). When the source has a snapshot the fork starts from it; otherwise it starts from the source's runtime/image. Any field provided in the request body overrides the value copied from the source. Unlike v2, when neither the body nor the source provides a value, snapshots expire after 7 days by default and persistent sandboxes keep only their most recent snapshot (keepLastSnapshots: null disables the limit).
Servers
- https://api.vercel.com
Path parameters
| Name | Type | Required | Description |
|---|---|---|---|
name |
String | Yes |
Name of the source sandbox to fork. |
Request headers
| Name | Type | Required | Description |
|---|---|---|---|
Content-Type |
String | Yes |
The media type of the request body.
Default value: "application/json" |
Query parameters
| Name | Type | Required | Description |
|---|---|---|---|
projectId |
String | No |
The ID of the project the source sandbox belongs to. Required unless authenticating with an OIDC token. |
teamId |
String | No |
The Team identifier to perform the request on behalf of. |
slug |
String | No |
The Team slug to perform the request on behalf of. |
Request body fields
| Name | Type | Required | Description |
|---|---|---|---|
region |
String | No |
The Vercel region in which to create the sandbox. Valid values:
|
failoverRegions[] |
Array | No |
The regions the sandbox falls back to when it cannot be created in |
env |
Object | No |
Default environment variables for the sandbox. These are inherited by all commands unless overridden. |
persistent |
Boolean | No |
Whether the sandbox persists its state across restarts via automatic snapshots. Defaults to the source sandbox setting. |
image |
String | No |
Image to use for the sandbox. |
networkPolicy |
No | ||
name |
String | No |
Name for the forked sandbox. Must be unique per project and URL-safe (alphanumeric, hyphens, underscores). A random name is generated when omitted. |
resources |
Object | No |
Resources to define the VM |
resources.memory |
Integer | No |
The amount of memory in megabytes to allocate to the sandbox. Must equal vcpus * 2048. |
resources.vcpus |
Integer | No |
The number of virtual CPUs to allocate to the sandbox. Must be 1, or an even number. Default value: 2 |
tags |
Object | No |
Key-value tags to associate with the sandbox. Maximum 5 tags. |
ports[] |
Array | No |
List of ports to expose from the sandbox. Each port will be accessible via a unique URL. Maximum of 15 ports can be exposed. |
timeout |
Integer | No |
Maximum duration in milliseconds that the sandbox can run before being automatically stopped. |
keepLastSnapshots |
No |
Protect the N most recent snapshots with different expiration/deletion behavior. Persistent sandboxes default to keeping only the last snapshot (evicted snapshots are deleted). Set to null to disable the limit. |
|
mounts |
Object | No |
List of drives to mount to the sandbox at the provided path. |
mounts.name |
Object | No | |
mounts.name.drive |
String | Yes |
Name of the drive to mount. The drive must already exist. |
mounts.name.mode |
String | No |
Mount the drive read-only or read-write. Valid values:
Default value: "read-write" |
snapshotExpiration |
No |
Default snapshot expiration time in milliseconds. Defaults to 7 days. Set to 0 to disable expiration. When set, this value is used as the default expiration for all snapshots created for this sandbox. |
How to start integrating
- Add HTTP Task to your workflow definition.
- Search for the API you want to integrate with and click on the name.
- This loads the API reference documentation and prepares the Http request settings.
- Click Test request to test run your request to the API and see the API's response.