Skip to main content
POST
Run a command

Authorizations

Authorization
string
header
required

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

Headers

Idempotency-Key
string

Exec id for retries and reconnects. It can contain only letters, digits, -, ., _, and ~; it cannot equal . or ..; and it must match idempotency_key when both are sent.

Minimum string length: 1
Pattern: ^[A-Za-z0-9._~-]+$
X-Sail-Owner-Override-Reason
string

Lets an organization admin operate a private Sailbox someone else created. Say why in plain text; the reason goes into your organization's audit log, and the operation is refused without it. Ignored on Sailboxes you could already operate.

Pause, resume, sleep, scheduled wake, upgrade, and terminate accept an override. Attaching or clearing an HTTP policy accepts one too. Running commands and moving files accept one through an SDK or the CLI. Publishing and unpublishing ports, adding and removing custom domains, checkpointing, and creating from a checkpoint stay with the creator.

Pattern: ^[ -~]*$

Path Parameters

sailbox_id
string
required

Id of the Sailbox, as returned by create. It is sb_ followed by a UUID.

Body

application/json
command
required

Shell command string or argument array. Shell features apply only to a string.

Minimum string length: 1
timeout
integer

Command timeout in seconds.

Required range: x >= 1
background
boolean
default:false

Detach a string command from standard input and output.

cwd
string

Working directory for a string command.

open_stdin
boolean
default:false

Keep standard input open for writes.

pty
boolean
default:false

Run the command in a pseudo-terminal. This implies open_stdin.

term
string

Initial TERM value. A PTY defaults to xterm-256color.

cols
integer

Initial PTY width. Zero uses the guest default.

Required range: x >= 0
rows
integer

Initial PTY height. Zero uses the guest default.

Required range: x >= 0
env
object

Environment values for the command. Names must match [A-Za-z_][A-Za-z0-9_]*. Names and values cannot contain a NUL character.

user
string

Guest user in the same form as the SDK user option.

idempotency_key
string

Stable exec id for a retry or stream reconnect. A supplied key can contain only letters, digits, -, ., _, and ~, and it cannot equal . or ...

Pattern: ^[A-Za-z0-9._~-]*$
stdout_resume_seq
integer<int64>

Highest stdout sequence already received.

Required range: x >= 0
stderr_resume_seq
integer<int64>

Highest stderr sequence already received.

Required range: x >= 0
forward_ports
boolean
default:false
forward_browser
boolean
default:false
forward_clipboard
boolean
default:false

Response

Exec event stream.

The response is of type string.