---
title: "Fork sandbox"
method: POST
path: "/sandboxes/{sandboxName}/fork"
tags: ["compute"]
---

# Fork sandbox

`POST /sandboxes/{sandboxName}/fork`

Forks a sandbox into a new sandbox or application. When forking to a sandbox, the target must not already exist (409 if it does). When forking to an application, a new revision is added if the app already exists, or a new application is created. This is a WIP endpoint — the full implementation depends on the execution plane.

## Path parameters

- `sandboxName` string, required

## Request body

- SandboxForkRequest — Request body for forking a sandbox into an application. Creates a new application or adds a canary revision to an existing one.
  - `customDomain` string — Custom domain for the application
  - `port` integer — Port to expose from the sandbox
  - `prefix` string — URL prefix for the application
  - `snapshotId` string — Snapshot ID to fork from. When set, the application revision references this snapshot.
  - `targetName` string, required — Name of the target application to create or update
  - `targetType` string, required — Target resource type to fork into
  - `traffic` integer — Traffic percentage for canary deployment (0-100). When set on an existing target, creates a new revision with this traffic percentage.

## Response `200`

Fork created successfully

- SandboxForkResponse — Response returned after forking a sandbox. Contains either the new sandbox or application depending on the fork type.
  - `name` string — Name of the created or updated resource
  - `snapshotId` string — The snapshot ID the fork was created from
  - `type` 'sandbox' | 'application' — Type of resource that was created (sandbox or application)

## Other responses

- `400` — Bad request - Invalid fork parameters
- `404` — Not found - Source sandbox does not exist
- `409` — Conflict - Target sandbox already exists (only for type sandbox)
- `500` — Internal server error

---

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