Skip to main content
POST
Create sandbox

Authorizations

Authorization
string
header
required

Boat bearer token in the form boat_.... Service API keys authenticate sandbox operations.

Headers

Idempotency-Key
string

Optional exactly-once key for creating a sandbox. Send your own opaque, account-unique value (a UUID) to make POST /sandboxes safe to retry when the response is lost (network timeout, 5xx): the first request creates the sandbox and binds it to the key; every later request with the same account, key, and request body returns that same sandbox instead of creating a second, billable one. Behavior: keys are retained for 24 hours; a concurrent or early retry while the first sandbox is still being minted returns 409 idempotency_in_progress (retry shortly, same key); reusing a key with a different body returns 409 idempotency_key_reused; timeouts and 5xx are safe to retry with the same key; a create that fails before the sandbox exists releases the key within ~2 minutes so a retry can create the sandbox. Omit the header to keep the default (non-idempotent) behavior.

Maximum string length: 255
X-Boat-Org
string

Same as the org query parameter. Query wins when both are set.

Query Parameters

org
string

Billing wallet for this request. A team id you belong to reads that team's limits / bills a create to that team. Your own account id is personal. Sandboxes, snapshots, and environments stay creator-private.

Body

application/json

Options for provisioning a new cloud computer.

type
enum<string>
default:default

Machine size. small consumes machine time at half rate and large at twice the default rate (see the Billing guide). xlarge costs $0.20 per running hour, requires the effective $100 plan or higher, and requires an explicit bare-metal operator allocation. A fork inherits the source sandbox's type unless the fork request passes its own, and resume and fork can move a sandbox between sizes.

Available options:
small,
default,
large,
xlarge
ttlSeconds
integer | null
default:3600

Number of seconds before automatic archival. null disables auto-stop. The backend also accepts the string infinite for legacy compatibility; new clients should send null.

Required range: 1 <= x <= 2592000
env
object

Per-sandbox environment variables injected into the sandbox's tool environment, on top of the account environment's variables (per-sandbox values win on conflicts). Keys must match [A-Za-z_][A-Za-z0-9_]{0,127}; at most 100 variables and 64KB total. Reserved names (ASCII_TOKEN, ASCII_API_URL, AGENT_ID, PRODUCT_MODE, ENVIRONMENT_ID, BOAT_ID, SERVICE_PREVIEW_TOKEN, BOAT_CLI_TOKEN) are rejected with invalid_env. Forked sandboxes inherit the source sandbox's env unless the fork request supplies its own env.

environment
string
default:base

Name of the sandbox environment to attach to this sandbox. Environments are managed in the Boat dashboard and bundle the repositories, secrets, and credential toggles a sandbox gets. Omit to use your default environment (base unless you changed it). Unknown names are rejected with unknown_environment. An environment marked "safe for third parties" passes nothing to the sandbox, exactly like noEnv.

Examples:

"base"

"customer-demos"

noEnv
boolean
default:false

Create a sandbox with none of the secrets attached to your account (no environment variables, secret files, or credentials), confined to itself so it cannot act on your account or other sandboxes. For sandboxes you give to your own users. SSH, SCP, desktop, snapshots, and public URLs still work; pass env to give the sandbox a secret of its own. A fork of a no-env sandbox is always no-env. Equivalent to attaching an environment marked "safe for third parties".

setupScript
string

Shell script that runs on the sandbox after it is ready. Ready means "ready to accept the user", not "setup done": the script starts in the background once provisioning completes and never blocks the sandbox becoming usable. It runs as the sandbox user via bash, with the sandbox's environment applied, and its output goes to a log file on the sandbox. Observe the outcome as setupStatus (pending/running/done/failed) and setupError on the sandbox. Rejected with a 400 invalid_setup_script error when it is not a string or exceeds 64KB.

Maximum string length: 65536
org
string

Bill this sandbox to a team you belong to (the team's shared wallet). Your own account id means personal billing. Listing, snapshots, and environments stay yours: the org is a wallet, not a shared workspace. Takes precedence over teamId and over the X-Boat-Org / ?org= request scope.

teamId
string

Legacy alias for org. Ignored when org is also set.

from
string

Create the sandbox from a named snapshot (saved with POST /named-snapshots, or boat snapshot <id> <name> in the CLI). The sandbox starts from that exact frozen state. Omitting type inherits the type the snapshot was saved from; env and no-env inherit from the snapshot's source sandbox unless the request passes its own, with the same rules as forking.

Response

Boat accepted for provisioning.

ok
boolean
required
Example:

true

type
string
required

Stable success envelope discriminator added by v1.

Allowed value: "sandbox.created"
status
enum<string>
required
Available options:
provisioning
ttlSeconds
integer | null
required
sandbox
object
required