POST /v1/sandboxes/{sandbox_id}/ticket
Returns a single-use ticket, valid for 30 seconds, that opens one stream under this sandbox (the terminal WebSocket or the logs event stream) without a bearer header. Pass it as `?ticket=` or in `Sec-WebSocket-Protocol: b3os.v1, b3os.ticket.<ticket>`. The stream runs with this caller's scopes.

Authentication

Bearer Token (b3os_sk_ API key or b3os_pat_ token) API Key (cookie: __Host-b3os_session)

Path Parameters

sandbox_id string required path
The sandbox ID (`sbx_…`).
Example: "sbx_01m5t68q1b590rj801nbzsqzkk"

Responses

200 The ticket.
application/json
ticket string REQUIRED
The ticket. Treat it like a password until it is used.
object string REQUIRED
Enum: stream_ticket
resource string REQUIRED
Absolute API path the ticket opens streams under.
expires_in_s integer REQUIRED
Seconds until the ticket expires if unused.
400 The request failed validation (`invalid_request`, `invalid_url`).
401 Missing, malformed, expired or revoked credentials (`unauthorized`).
403 Authenticated but not allowed (`forbidden`, `egress_denied`).
404 No such sandbox in this project (`sandbox_not_found`).
429 A rate, concurrency or quota limit applies (`rate_limited`, `concurrency_limited`, `quota_exceeded`).
500 Something failed inside B3OS (`internal`). Retry with backoff.
503 The node or the product is not available right now (`node_unavailable`, `product_unavailable`, `capacity_unavailable`).
curl -X POST 'https://beta-api.b3os.org/v1/sandboxes/sbx_01m5t68q1b590rj801nbzsqzkk/ticket' \  -H 'Authorization: Bearer YOUR_API_TOKEN'
const response = await fetch('https://beta-api.b3os.org/v1/sandboxes/sbx_01m5t68q1b590rj801nbzsqzkk/ticket', {  method: 'POST',  headers: {      "Authorization": "Bearer YOUR_API_TOKEN"  }});const data = await response.json();console.log(data);
import requestsheaders = {    'Authorization': 'Bearer YOUR_API_TOKEN'}response = requests.post('https://beta-api.b3os.org/v1/sandboxes/sbx_01m5t68q1b590rj801nbzsqzkk/ticket', headers=headers)print(response.json())
200 Response
{  "ticket": "tkt_01m5t5pvw7ppqztakqdthdt3zc",  "object": "stream_ticket",  "resource": "/v1/sandboxes/sbx_01m5t68q1b590rj801nbzsqzkk",  "expires_in_s": 30}
Ask a question... ⌘I