---
title: "Fork box"
method: POST
path: "/boxes/{boxId}/fork"
tags: ["Box"]
---

# Fork box

`POST /boxes/{boxId}/fork`

## Path parameters

- `boxId` string, required

## Request body

- object
  - `env` object — Replaces the env the fork would otherwise inherit from the source box. Same validation rules as `CreateBoxRequest.env`.
  - `noEnv` boolean — Make the fork no-env (see `CreateBoxRequest.noEnv`). A fork of a no-env box is always no-env regardless of this field.

## Response `202`

Fork started. The response `id` is the new forked box id.

- BoxActionResponse
  - `ok` boolean, required
  - `type` string, required — Stable success envelope discriminator added by v1.
  - `id` string, required
  - `status` string, required
  - `box` Box
    - `id` string, required
    - `name` string, required
    - `state` 'init' | 'provisioning' | 'provisioned' | 'cloning' | 'ready' | 'idle' | 'running' | 'archiving' | 'archived' | 'error', required
    - `url` string, uri, nullable — Machine URL when assigned.
    - `ip` string, nullable — Machine IPv4 address when assigned.
    - `createdAt` string, date-time, nullable
    - `updatedAt` string, date-time, nullable
    - `archiveAfter` string, date-time, nullable — Automatic archival time, or null when auto-stop is disabled.
    - `desktopAvailable` boolean, required
    - `desktopUrl` string, uri, nullable — Secret-bearing desktop stream URL when available. Redact from logs.
    - `snapshotAvailable` boolean, required
    - `snapshotCompletedAt` string, date-time, nullable — Timestamp of the most recent successfully completed snapshot, or null.
    - `subdomain` string, nullable — The box's stable three-word subdomain slug (e.g. "frazil-pneuma-rallye"), or null before one is assigned.
    - `lastSnapshotAttemptAt` string, date-time, nullable — Timestamp of the most recent snapshot attempt of any status (queued, in_progress, completed, failed, cancelled), or null. Use with snapshotCompletedAt to detect snapshots that keep failing.
    - `lastSnapshotStatus` 'queued' | 'in_progress' | 'completed' | 'failed' | 'cancelled' | 'null', nullable — Status of the most recent snapshot attempt, or null if none. A value other than completed while snapshotCompletedAt stays stale indicates failing snapshots.

## Other responses

- `401` — Missing or invalid bearer token.
- `402` — Account cannot currently create or operate Boxes. The error body may include a dashboard billing URL, but billing actions are not part of the v1 API.
- `404` — Resource not found.
- `409` — Request conflicts with current account or box state.

---

[API](https://skmtc.dev/ascii/apis/box-public-api-v1.md) · [All operations](https://skmtc.dev/ascii/apis/box-public-api-v1/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/ascii/box-public-api-v1/revisions/82d576f82046/schema)
