POST

인증

x-api-key
string
header
필수

헤더

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

본문

application/json

The native create body plus the machine the session runs on.

machine_id
string
필수
agent_id
string

The id /v1/agents uses.

read_only
boolean
기본값:false
lease_seconds
integer<int32>
필수 범위: 1 <= x <= 900
keepalive_seconds
integer<int32>
기본값:300

Screen capture keepalive duration, applied from the open on (also while the capture is starting).

필수 범위: 60 <= x <= 3600
capabilities
object
ticket
object

Also mint the session's first ticket (as POST /v1/desktop_sessions/{desktop_session_id}/tickets with this body) and return it in the response's ticket, saving the viewer a second round trip. A retry with the same Idempotency-Key answers the same session with a newly minted ticket.

응답

Success.

type
string
필수

Always desktop_session.

Allowed value: "desktop_session"
id
string
필수

Desktop session ID (dsn_...).

Pattern: ^dsn_[a-z2-7]{26}$
org_id
string
필수
Pattern: ^org_[a-z2-7]{26}$
project_id
string
필수

Project ID (proj_...).

Pattern: ^proj_[a-z2-7]{26}$
machine_id
string
필수

Machine ID (mch_...).

Pattern: ^mch_[a-z2-7]{26}$
owner_id
string
필수

Opaque authenticated principal that created the session, such as a user UUID or organization API key ID.

read_only
boolean
필수
closed
boolean
필수
state
enum<string>
필수

A screen capture answers starting until the machine confirms it publishes (then live); tickets are issued and viewers connect meanwhile and receive the track once published. A start the machine does not confirm closes the session.

사용 가능한 옵션:
open,
starting,
live,
closing,
closed
created_at
string<date-time>
필수
capabilities
object
필수
control
object
필수
agent_id
string

The id /v1/agents uses (never the native agt_ id).

expires_at
string<date-time>

Screen capture keepalive deadline; ticket issuance does not extend it.

ticket
object

The first ticket, only in the answer of a create request that asked for one (ticket).

close_reason
enum<string>

Why the session ended, present once it is closed. capture_refused - the machine refused to publish its screen (opening again gets the same answer until something changes on the machine); capture_unconfirmed - the machine did not confirm the start in time; capture_lost - the machine stopped renewing a running capture; expired - the keepalive passed; closed_by_user - closed through POST /v1/desktop_sessions/{desktop_session_id}/close.

사용 가능한 옵션:
closed_by_user,
expired,
capture_refused,
capture_unconfirmed,
capture_lost