Skip to main content
POST
Create a Sailbox

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Headers

Idempotency-Key
string

Makes the request retry-safe. Sail remembers the answer it sent under a key, including a 400 or a 409, and replays it with Idempotent-Replayed: true for a retry that repeats the key, the method, the path, and the body. Bodies are compared byte for byte. Reusing a key for a different request returns 409, so send a corrected request under a new key. A key that is blank or only spaces is ignored, and the request runs without idempotency.

Any string of up to 255 bytes works, and characters outside ASCII count for more than one. A UUID is a good default. Keys are remembered for at least 24 hours and scoped to the API key that sent them.

A server error, or a failure to record the answer, can leave a key unsettled, and creating a Sailbox is where that matters. See Retrying safely.

Maximum string length: 255

Body

application/json
name
string
required

Human-readable name for the new Sailbox. Names are not unique, so keep hold of the returned sailbox_id. It is stored as you send it, surrounding spaces included, so trim it yourself if you compare names later. Control characters are not allowed.

Required string length: 1 - 128
Pattern: \S
app_id
string
required

Id of the app that will own the Sailbox. Use POST /apps/find to look one up by name.

Minimum string length: 1
Pattern: \S
image
object
required

Describes the environment the Sailbox boots into. A base image on its own is ready to boot. Adding build steps, environment variables, or a Python version describes an image that has to be built before a Sailbox can start from it, and building one takes an SDK or the CLI.

size
enum<string>
default:m

Machine size. s is 1 vCPU, m is 4 vCPUs, l is 8 vCPUs.

Available options:
s,
m,
l,
memory_limit_gib
integer

Memory limit in GiB. Allowed ranges are 2 to 64 for size s, 8 to 128 for m, and 16 to 256 for l. Omit it to take the default for the size: 16 for s, 32 for m, and 64 for l.

state_disk_limit_gib
integer

Disk limit in GiB. Allowed ranges are 8 to 128 for size s, 32 to 512 for m, and 64 to 1024 for l. Omit it to take the default for the size: 32 for s, 128 for m, and 256 for l.

ingress_ports
object[]

Ports to publish. You can also publish ports later without restarting.

volume_mounts
object[]

Volumes to mount into the Sailbox.

visibility
enum<string>
default:org

org lets anyone in your organization operate the Sailbox. private restricts that to the user whose key created it, so it needs a user-scoped key. An organization admin can still pause, resume, sleep, schedule a wake, upgrade, or terminate it by sending X-Sail-Owner-Override-Reason.

Available options:
org,
private,

Response

Check status: running means the Sailbox is ready, and failed means it did not start, with error_message saying why.

sailbox_id
string
required

Id of the new Sailbox.

status
string
required

Current state of the Sailbox. Values in use today are creating, running, paused, sleeping, terminating, terminated, failed, create_failed, interrupted_restorable, and interrupted_unsafe_to_retry. New values can appear over time, so treat this as an open set.

error_message
string

Why the Sailbox failed to start, when it did.