Create sandbox

Create a sandbox. Returns the initial sandbox snapshot synchronously.

With snapshotId: 404 with code: snapshot_not_found if the snapshot does not
exist; 409 with code: snapshot_not_available if it is not available, or
code: snapshot_plan_mismatch if a runtime snapshot was requested with a
different plan.

With snapshotName: 400 with code: invalid_snapshot_name if the name is
malformed, 400 without a code if snapshotId is also set, and 404 with
code: snapshot_not_found if no available snapshot in the group has the
name. The 409 cases above apply to the resolved snapshot.

409 with code: sandbox_group_suspended if the sandbox group is suspended.

400 with code: sandbox_group_limit_reached if the owner has no default
sandbox group and is already at its sandbox group limit.

400 with code: invalid_sandbox_plan if plan is not one the API currently
accepts. The message lists the accepted plans.

400 with code: invalid_timeout_seconds if timeoutSeconds is below 0 or
above the plan's maximum: 2592000 (30 days), or 86400 (24 hours) on Hobby
workspaces.

Recent Requests
Log in to see full request history
TimeStatusUser Agent
Retrieving recent requests…
LoadingLoading…
Body Params
string
required

The ID of the workspace the sandbox belongs to.

string
^sbg-[0-9a-v]{20}$

Group to create the sandbox in; defaults to the workspace's default group.

networkPolicy
object

Set either type or its deprecated alias default. Sending both is
only accepted when they name the same policy.

enum

Compute plan. See sandboxPlan for known values.


The compute plan to use. starter, standard and pro are deprecated.

integer
Defaults to 86400

Maximum sandbox lifetime in seconds. Sandbox is terminated when reached. Use 0 for no timeout.

integer
0 to 86400
Defaults to 900

Seconds of inactivity before the sandbox is suspended. Use 0 to disable automatic idle suspension. Positive values must be at least 300.

env
object

Inline environment variables injected into the sandbox at creation.

string
^snp-[0-9a-v]{20}$

Start from this snapshot instead of the base image. Must be available
and in the same sandbox group. For a runtime snapshot, plan must
match the snapshot's plan.

string
length between 1 and 64

Start from the snapshot this name currently resolves to in the sandbox
group. Mutually exclusive with snapshotId. Same restore rules as
snapshotId.

Responses

Language
Credentials
Bearer
LoadingLoading…
Response
Click Try It! to start a request and see the response here! Or choose an example:
application/json