POST
Open a terminal session (body machine_id)

Authorizations

x-api-key
string
header
required

Headers

x-bma-project-id
string

Project scope. Required when the API key can access more than one project (alias: anthropic-workspace-id).

Idempotency-Key
string

Replays the first result of a create; the same key with another body is 409.

Required string length: 1 - 255

Body

application/json

The create body plus the machine the session runs on.

machine_id
string
required

Machine ID (mch_...).

Pattern: ^mch_[a-z2-7]{26}$
shell
string
cwd
string
cols
integer<int32>
Required range: 1 <= x <= 4096
rows
integer<int32>
Required range: 1 <= x <= 512

Response

Success.

type
string
required
Allowed value: "terminal_session"
id
string
required

Terminal session ID (tsn_...).

Pattern: ^tsn_[a-z2-7]{26}$
org_id
string
required
Pattern: ^org_[a-z2-7]{26}$
project_id
string
required

Project ID (proj_...).

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

Machine ID (mch_...).

Pattern: ^mch_[a-z2-7]{26}$
state
enum<string>
required
Available options:
starting,
running,
closing,
closed,
failed
created_at
string<date-time>
required
shell
string
cwd
string
cols
integer<int32>
rows
integer<int32>
closed_at
string<date-time>
exit_code
integer<int32>
close_reason
string