Skip to main content
PATCH
Update a session

Authorizations

Authorization
string
header
required

A gbr_pat_ access token. Scopes are recorded on the token when it is minted.

Headers

Idempotency-Key
string

Retrying with the same key replays the first answer instead of acting again.

Maximum string length: 255

Body

application/json

Only the fields present are changed.

title
string | null

null clears it.

metadata
object | null

null clears every label.

agent
object

Change what runs, mid-session. The workspace and the transcript are kept either way.

Response

Change a session: title, metadata, instructions, or its safety settings.

object
string
required

Always session. Names the shape, so a value can be identified without knowing which call returned it.

Allowed value: "session"
id
string
required

Ours, not yours. Use metadata to carry your own identifier.

status
enum<string>
required

idle accepts input. working is running a turn. requires_action is waiting on you — see required_actions. failed is the last turn's outcome, not a dead session.

Available options:
idle,
working,
requires_action,
failed
created_at
integer
required

Unix milliseconds.

updated_at
integer
required

Unix milliseconds. Moves on any change, including the workspace waking.

agent
object
required

What is running, and how freely.

environment
object
required

The workspace: its state, where the agent works, and the repository bound to it.

preview
object
required

Addresses for whatever the agent is serving. See preview.md.

title
string | null

A label for people. Set it yourself; nothing derives one.

source
enum<string> | null

Which door created this session. Null on sessions predating the field.

Available options:
api,
console,
cli,
null
created_by_token
string | null

The id of the access token that created it — never its secret.

required_actions
object[]

Everything the session is waiting on you for. Authoritative — not a replay of events, so a caller that restarted gets the same complete answer.