POST

Authorizations

x-api-key
string
header
required

Headers

bma-workspace-id
string

Project scope. Required when the API key can access more than one project. Also accepted as anthropic-workspace-id; headers sent together must agree, otherwise the request is a 400 workspace_id_conflict.

Idempotency-Key
string

Replays the first result of a create; the same key with another body is 400 idempotency_key_reused, one while the first still runs 409 idempotency_key_in_use.

Required string length: 1 - 255

Path Parameters

terminal_session_id
string
required

ID of the terminal session to connect to (tsn_ followed by 26 base32 characters). An ID of another workspace or organization, or one that is not a tsn_ ID, answers 404.

Body

application/json

Body of a terminal ticket. purpose is optional and must be connect.

purpose
enum<string>

What the ticket opens; connect when omitted, any other value is a 400.

Available options:
connect
ttl_seconds
integer

Checked to be 15 to 120 when sent, but a terminal ticket always lives 60 seconds.

Required range: 15 <= x <= 120

Response

The ticket; its ticket value is shown only here.

A transport-bound credential. BMA WebSocket tickets are single-use; LiveKit credentials support SDK reconnect with admission rechecked. purpose names what it opens (watch, connect; control is reserved).

ticket
string
required

Opaque credential, never logged. BMA-owned WebSocket tickets are single-use. LiveKit access tokens support SDK reconnect and refresh; each connection rechecks the current session, viewer and control lease.

ws_url
string
required

WebSocket URL without the ticket.

type
any
required

Always ticket.

purpose
enum<string>
required

What the credential opens; watch for desktop tickets, connect for terminal tickets. control is not issued.

Available options:
watch,
connect,
control
id
string

ID of this credential (tkt_ followed by 26 base32 characters).

expires_at
string<date-time>

When the credential stops admitting a new connection (RFC 3339, UTC).

subprotocol
string

WebSocket subprotocol to request at ws_url; bma.desktop.v1 for a desktop watch socket, bma.terminal.v1 for a terminal, livekit for a live-media join token.

permissions
string[]

What the credential allows; desktop.watch for desktop tickets, terminal.attach, terminal.input, terminal.resize and terminal.close for terminal tickets.

machine_id
string

The machine of the desktop session (mch_...); desktop tickets only.

desktop_session_id
string

The desktop session the credential is for (dsn_...); desktop tickets only.

viewer
string

Opaque viewer identifier owned by the tenant, distinct from the SFU participant identity.

Required string length: 1 - 128
Pattern: ^[A-Za-z0-9._:-]{1,128}$
transport
enum<string>

How a live-media session is watched; livekit for a media server join token, rfb for a watch socket ticket of a viewer. Absent on tickets of sessions with a desktop agent and on terminal tickets.

Available options:
livekit,
rfb
room
string

Media server room of the capture; livekit tickets only.

publisher_identity
string

Media server identity of the machine publishing the screen in room; livekit tickets only.

viewer_identity
string

The platform-derived SFU participant identity of this ticket, distinct from viewer.

input_identity
string

Response-only trusted RFB input identity derived by the platform from the admitted capture and viewer. It must match an RFB control grant's holder and cannot authenticate as an SFU participant.

control_available
boolean

Whether the screen-live machine supports a separately acquired input lease.