Skip to main content
POST
Update Session
Every request requires ?beta=true.

Authorizations

X-Api-Key
string
header
default:sk-ant-local-default
required

OMA workspace API key.

Headers

anthropic-version
string
anthropic-beta
string

Path Parameters

session_id
string
required

Path parameter session_id

Query Parameters

beta
enum<boolean>
required

Selects the beta API contract for this endpoint. Must be true.

Available options:
true

Body

application/json

Request parameters for updating a session. Omit a field to preserve its current value.

title
string | null

Human-readable session title.

Required string length: 1 - 500
Example:

"Order #1234 inquiry"

metadata
object | null

Metadata patch. Set a key to a string to upsert it, or to null to delete it. Omit the field to preserve.

vault_ids
string[]

Vault IDs (vlt_*) to attach to the session. Not yet supported; requests setting this field are rejected. Reserved for future use.

agent
object

Agent configuration update. Only tools and mcp_servers are updatable mid-session. Only valid for sessions created from an agent or deployment reference. The session must not be running.

budget
object | null

Enforced spend ceiling for the session. Set an object to replace the budget of a session that was created with one, or null to remove it; omit to preserve. A budget cannot be added to a session created without one (rejected with reason budget_create_only), and a removed budget cannot be re-added. Allowed in any non-terminated status. Lowering max_list_cost to at or below the session's consumed list cost is rejected with reason budget_not_raised, and every model the session can run must have a public list price or the request is rejected with reason model_not_budgetable.

Response

Successful response (OK)

A Managed Agents session.

type
enum<string>
required
Available options:
session
Example:

"session"

id
string
required
Example:

"sesn_011CZkZAtmR3yMPDzynEDxu7"

status
enum<string>
required

SessionStatus enum

Available options:
rescheduling,
running,
idle,
terminated
Example:

"idle"

created_at
string<date-time>
required

A timestamp in RFC 3339 format

Example:

"2026-03-15T10:00:00Z"

updated_at
string<date-time>
required

A timestamp in RFC 3339 format

Example:

"2026-03-15T10:00:00Z"

environment_id
string
required
Example:

"env_011CZkZ9X2dpNyB7HsEFoRfW"

title
string | null
required
Example:

"Order #1234 inquiry"

metadata
object
required
Example:
agent
object
required

Resolved agent definition for a session. Snapshot of the agent at session creation time.

Example:
resources
object[]
required
Example:
Example:
vault_ids
string[]
required

Vault IDs attached to the session at creation. Empty when no vaults were supplied.

Example:
outcome_evaluations
object[]
required

Per-outcome evaluation state. One entry per define_outcome event sent to the session.

Example:
usage
object
required

Cumulative token usage for the session.

Example:
stats
object
required

Timing statistics for the session.

Example:
archived_at
string<date-time> | null
required

When the session was archived. Null if not archived.

Example:

null

budget
object | null
required

The session's enforced spend ceiling, or null when no budget is set.

Example:

null

deployment_id
string | null

Deployment ID when the session was created from a deployment reference. Null otherwise.