Skip to main content
GET
Attach to the sandbox shell (WebSocket)

Authorizations

X-Access-Token
string
header
required

Sandbox data-plane token — the sandbox_access_token returned by the create/connect endpoints. Used for /files, Sandbox-Exec, and other data-plane endpoints; the control plane (/api/v2) does not accept it, and conversely the control plane's Authorization: Bearer is invalid on the data plane.

The token is bound to its sandbox: using sandbox A's token against sandbox B's host fails. It stays valid until the sandbox's lifetime ends; there is no separate rotation endpoint (rotate_traffic_token rotates the port traffic token traffic_access_token and does not affect this one).

Response

Handshake succeeded. The connection is now a WebSocket carrying raw terminal bytes in BINARY frames; see the operation description for the framing protocol. If attaching to the shell fails after the upgrade, the server closes the WebSocket with close code 1011 and reason attach failed.