Makes an isolated machine from a sandbox template on one of the team's
sandbox servers (or the installation's), within the team's limits. It
runs until its lifetime ends or it's deleted. The answer has the
connection: the server's address and a token, valid an hour, for exec,
terminals, files and ports there. Ask for a new token with
createSandboxToken. teamId may be left out when the API key (or
you) can use only one team. server runs it on that server only.
A server that doesn't have Pyo's template base (or desktop) yet
makes it first: the first sandbox from it there takes a minute or so
longer, and later ones start at once.
API key access: sandboxes.
apiKeyAuthorizationBearer <pyo_…>An API key from the dashboard's API keys page: Authorization: Bearer pyo_…. Keys can expire, and an expired one gets a 401.
application/jsonWhat a client asks for. Everything but the team and template has a default.
teamId?|The team the sandbox belongs to. May be left out when the API key (or user) has exactly one team.
name?|A name to tell it apart, like "checkout tests": up to 63 letters, digits, spaces, dashes, underscores and dots. It needn't be unique and never addresses the sandbox: its id does. A short one like "quiet-river" when omitted.
template?|A sandbox template's name (or id): the team's own, else the installation's. "base" (Pyo's built-in Ubuntu 24.04 template) when omitted. "desktop" is Pyo's built-in desktop with a browser: CDP on port 9222 and the screen (voxl) on port 6080. A server that doesn't have Pyo's template yet makes it first, so the first sandbox from it there takes longer.
server?|The sandbox server to run it on, by id or name: the team's own or the installation's. Pyo picks one when omitted.
cpus?|1 when omitted (2 for "desktop").
int320 <= valuememoryMib?|512 when omitted (2048 for "desktop").
int320 <= valuediskMib?|The writable disk, sparse. 2048 when omitted.
int320 <= valuettl?|How long it lives, like "30m", "1h" or "7d", or seconds, up to 365 days and the team's longest lifetime. "none": it runs until it's deleted, when the team has no limit. 5 minutes when omitted.
pauseWhenIdleSecs?|Pause after this many seconds without use. Kept for now, acted on in a later release.
int640 <= valueenv?Environment variables. Pyo passes them on and keeps only the names.
network?|"internet" (the default) or "none".
isolation?|"auto" (the default: Firecracker where the server has KVM, gVisor elsewhere) or "vm" (Firecracker only).
labels?projectId?|A project of the team, as a label.
sandbox (as in listSandboxes) and connection: url, sandboxId, token and expiresAt.
application/jsoncurl -X POST 'https://your-pyo.example.com/api/v1/sandboxes' \
-H 'Content-Type: application/json' \
-d '{}'{}