X-Sandbox-Token header.
Why capability tokens exist
Every sandbox data plane endpoint requires a capability token rather than your API key for two reasons. First, your organisation API key is a long-lived secret that should never travel to a sandbox agent. Second, when you want to grant a browser or a third-party service access to exactly one port on one sandbox for a limited time, you mint an attenuated token scoped to that port — no broader access is possible, even if the token is intercepted.POST /v1/sandboxes//token
Mints a fresh capability token for the sandbox’s current epoch. The request body is optional — omit it to get a full-scope token with the installation’s default TTL.string
required
The 24-character sandbox NanoID.
integer
Requested token lifetime in seconds. Bounded by the installation’s maximum
configured TTL. Omit to use the installation default.
integer[]
Restrict the token to these specific ports. A token with a port restriction
is rejected by the gateway for any port not in the list. Omit this field for
a full-scope token that permits all ports your credential allows. You cannot
mint a token with broader scope than your own credential grants. Up to 16
entries, each between 1 and 65535.
201 Created
string
required
The capability token string. Pass this in the
X-Sandbox-Token header on
data plane requests. Never log it.string
required
ISO 8601 timestamp after which the token is rejected. Mint a new token before
this time if you need continued access.
integer
required
The sandbox epoch this token was minted against. If the sandbox is paused and
resumed before the token expires, the token is still invalidated because the
epoch advances on resume.
integer[]
The port scope, when you requested a restriction. Null means full scope.
400 malformed request · 401 unauthenticated · 404 sandbox not found · 409 lifecycle conflict (sandbox not in a state that allows token minting)
Token lifetime and invalidation
A capability token is valid until the earlier of two events:- The
expires_attimestamp passes. - The sandbox epoch advances — which happens on every resume after a pause.
SandboxWithToken response includes a fresh token for the new epoch. All tokens minted against the previous epoch fail closed immediately.
The FissionPlane TypeScript SDK manages token lifecycle automatically. It stores
the token returned from sandbox create and resume, re-mints automatically when
a token is about to expire, and replaces the token on the handle after resume.
You only need this endpoint if you are calling the data plane directly — for
example, from a browser application or a language without an official SDK.
Attenuated tokens for browser access
To give a browser or untrusted client access to a specific port on your sandbox, mint a token scoped to just that port with a short TTL:3000 on that sandbox and expires in one hour. Even if a user inspects it, they cannot elevate it to access other ports or other sandboxes.
Using a token on the data plane
Once you have minted a token, include it in theX-Sandbox-Token header on every data plane request: