Claude Platform Docs

Sessions

Create Session
$client->beta->sessions->create(Agent agent, string environmentID, ?BetaManagedAgentsBudgetLimit budget, ?list<InitialEvent> initialEvents, ?array<string,string> metadata, ?list<Resource> resources, ?string title, ?list<string> vaultIDs, ?list<AnthropicBeta> betas, ?string workspaceID): BetaManagedAgentsSession
POST/v1/sessions
Requires anthropic-beta: managed-agents-2026-04-01. How to send beta headers
List Sessions
$client->beta->sessions->list(?string agentID, ?int agentVersion, ?\Datetime createdAtGt, ?\Datetime createdAtGte, ?\Datetime createdAtLt, ?\Datetime createdAtLte, ?string deploymentID, ?bool includeArchived, ?int limit, ?string memoryStoreID, ?Order order, ?string page, ?list<Status> statuses, ?list<AnthropicBeta> betas, ?string workspaceID): BidirectionalPageCursor<BetaManagedAgentsSession>
GET/v1/sessions
Requires anthropic-beta: managed-agents-2026-04-01. How to send beta headers
Get Session
$client->beta->sessions->retrieve(string sessionID, ?list<AnthropicBeta> betas, ?string workspaceID): BetaManagedAgentsSession
GET/v1/sessions/{session_id}
Requires anthropic-beta: managed-agents-2026-04-01. How to send beta headers
Update Session
$client->beta->sessions->update(string sessionID, ?BetaManagedAgentsSessionAgentUpdate agent, ?BetaManagedAgentsBudgetLimit budget, ?array<string,string> metadata, ?string title, ?list<string> vaultIDs, ?list<AnthropicBeta> betas, ?string workspaceID): BetaManagedAgentsSession
POST/v1/sessions/{session_id}
Requires anthropic-beta: managed-agents-2026-04-01. How to send beta headers
Delete Session
$client->beta->sessions->delete(string sessionID, ?list<AnthropicBeta> betas, ?string workspaceID): BetaManagedAgentsDeletedSession
DELETE/v1/sessions/{session_id}
Requires anthropic-beta: managed-agents-2026-04-01. How to send beta headers
Archive Session
$client->beta->sessions->archive(string sessionID, ?list<AnthropicBeta> betas, ?string workspaceID): BetaManagedAgentsSession
POST/v1/sessions/{session_id}/archive
Requires anthropic-beta: managed-agents-2026-04-01. How to send beta headers
Models
class BetaManagedAgentsAdvisorParams { $type = 'advisor'; $model; }
"advisor" type
string model

A Claude model id. The model must be permitted as an advisor for this agent's model.

class BetaManagedAgentsAgentMessagePreview { $type = 'agent.message'; $id; }
"agent.message" type
string id

The id the buffered agent.message will carry if it is emitted. Matches the event_id on this preview's event_delta events.

class BetaManagedAgentsAgentParams { $type = 'agent'; $id; $version; }
"agent" type
string id

The agent ID.

?int version

The specific agent version to use. Omit to use the latest version. Must be at least 1 if specified.

class BetaManagedAgentsAgentThinkingPreview { $type = 'agent.thinking'; $id; }
"agent.thinking" type
string id

The id the buffered agent.thinking will carry if it is emitted. Start-only — no event_delta events follow.

class BetaManagedAgentsAgentWithOverridesParams { $type = 'agent_with_overrides'; $id; $mcpServers; /* 5 more */ }
"agent_with_overrides" type
string id

The agent ID.

Replacement MCP server list. Full replacement: the provided array becomes the MCP servers. Send an empty array to clear; omit to preserve the agent's servers.

?Model model

Replacement model. Accepts the model string, e.g. claude-opus-5-5, or a model_config object. Omit to use the agent's model.

Replacement skill list. Full replacement: the provided array becomes the skills. Send an empty array to clear; omit to preserve the agent's skills.

?string system

Replacement system prompt. Up to 100,000 characters. Set to null to clear the agent's system prompt; omit to preserve it.

?list<Tool> tools

Replacement tool list. Full replacement: the provided array becomes the tool configuration. Send an empty array to clear; omit to preserve the agent's tools.

?int version

The specific agent version to use. Omit to use the latest version.

class BetaManagedAgentsBranchCheckout { $type = 'branch'; $name; }
"branch" type
string name

Branch name to check out.

class BetaManagedAgentsBudgetLimit { $type = 'limit'; $maxListCost; }
"limit" type
BetaMonetaryAmount maxListCost

Maximum list cost the session may accrue. List price is used regardless of any negotiated discount, so the cap fires at or before the actual charge.

class BetaManagedAgentsCacheCreationUsage { $ephemeral1hInputTokens; $ephemeral5mInputTokens; }
?int ephemeral1hInputTokens

Tokens used to create 1-hour ephemeral cache entries.

?int ephemeral5mInputTokens

Tokens used to create 5-minute ephemeral cache entries.

class BetaManagedAgentsCommitCheckout { $type = 'commit'; $sha; }
"commit" type
string sha

Full commit SHA to check out.

class BetaManagedAgentsDeletedSession { $type = 'session_deleted'; $id; }
"session_deleted" type
string id
class BetaManagedAgentsDeltaContent { $type = 'content_delta'; $content; $index; }
"content_delta" type

A partial element of the content array at index, typed like the element itself — the same shape the buffered agent.message carries in content.

?int index

Which entry in the previewed event's content array this fragment lands in. Insert content as that entry when the index is new; append to the existing entry otherwise.

class BetaManagedAgentsDeltaEvent { $type = 'event_delta'; $delta; $eventID; }
"event_delta" type

One fragment of the previewed event. The delta type is named for the previewed event's field it streams into: agent.message events stream content_delta fragments, each a partial element of the content array.

string eventID

The id of the event being previewed. Matches event.id on the corresponding event_start and the buffered event that reconciles the preview.

One of the following:
"agent.message"
"agent.thinking"
class BetaManagedAgentsFileResourceParams { $type = 'file'; $fileID; $mountPath; }
"file" type
string fileID

ID of a previously uploaded file.

?string mountPath

Mount path in the container. Defaults to /mnt/session/uploads/<file_id>.

class BetaManagedAgentsGitHubRepositoryResourceParams { $type = 'github_repository'; $url; $authorizationToken; /* 2 more */ }
"github_repository" type
string url

Github URL of the repository

?string authorizationToken

GitHub authorization token used to clone the repository. Required for private repositories; optional for public ones.

?Checkout checkout

Branch or commit to check out. Defaults to the repository's default branch.

?string mountPath

Mount path in the container. Defaults to /workspace/<repo-name>.

class BetaManagedAgentsMemoryStoreResourceParam { $type = 'memory_store'; $memoryStoreID; $access; $instructions; }
"memory_store" type
string memoryStoreID

The memory store ID (memstore_...). Must belong to the caller's organization and workspace.

?Access access

Access mode for the mounted store. Defaults to read_write. read_only mounts the store as a read-only filesystem.

?string instructions

Per-attachment guidance for the agent on how to use this store. Rendered into the memory section of the system prompt. Max 4096 chars.

One of the following:
class BetaManagedAgentsMultiagentCoordinator { $type = 'coordinator'; $agents; }
"coordinator" type
list<Agent> agents

Agents the coordinator may spawn as session threads, each resolved to a specific version.

class BetaManagedAgentsMultiagent20261001 { $type = 'multiagent_20261001'; $advisor; $subagents; $workflows; }
"multiagent_20261001" type

Whether the session's primary thread can consult an advisor model.

Whether the agent can spawn session threads.

Whether the agent can start workflow runs.

One of the following:
One of the following:
string
class BetaManagedAgentsAgentParams { $type = 'agent'; $id; $version; }
"agent" type
string id

The agent ID.

?int version

The specific agent version to use. Omit to use the latest version. Must be at least 1 if specified.

class BetaManagedAgentsMultiagentSelfParams { $type = 'self'; }
"self" type
class BetaManagedAgentsAdvisorParams { $type = 'advisor'; $model; }
"advisor" type
string model

A Claude model id. The model must be permitted as an advisor for this agent's model.

class BetaManagedAgentsOutcomeEvaluationResource { $type = 'outcome_evaluation'; $completedAt; $description; /* 4 more */ }
"outcome_evaluation" type
?\Datetime completedAt

When the outcome reached a terminal result. Null while pending/running/evaluating.

string description

What the agent should produce.

?string explanation

Grader's verdict text from the most recent evaluation. For satisfied, explains why criteria are met; for needs_revision (intermediate), what's missing; for failed, why unrecoverable.

int iteration

0-indexed revision cycle the outcome is currently on.

string outcomeID

Server-generated outc_ ID for this outcome.

string result

Current evaluation state. pending before the agent begins work; running while producing or revising; evaluating while the grader scores; satisfied/max_iterations_reached/failed/interrupted are terminal.

class BetaManagedAgentsServerToolUsage { $webFetchRequests; $webSearchRequests; }
?int webFetchRequests

Number of server-executed web fetch requests.

?int webSearchRequests

Number of server-executed web search requests.

class BetaManagedAgentsSession { $type = 'session'; $id; $agent; /* 14 more */ }
class BetaManagedAgentsSessionAgent { $type = 'agent'; $id; $description; /* 9 more */ }
"agent" type
string id
?string description

Execution principal snapshotted from the agent at session creation. Always present; {"type": "service_account"} when runs carry no customer-named principal.

Model identifier and configuration.

Resolved multiagent orchestration configuration. Null when the agent is single-threaded.

string name
list<Skill> skills
?string system
list<Tool> tools
int version
class BetaManagedAgentsSessionAgentUpdate { $mcpServers; $tools; }

Replacement MCP server list. Full replacement: the provided array becomes the new value. Send an empty array to clear; omit to preserve.

?list<Tool> tools

Replacement tool list. Full replacement: the provided array becomes the new value. Send an empty array to clear; omit to preserve.

One of the following:
class BetaManagedAgentsSessionMultiagentCoordinator { $type = 'coordinator'; $agents; }
"coordinator" type
list<Agent> agents

Full agent definitions the coordinator may spawn as session threads.

class BetaManagedAgentsSessionMultiagent20261001 { $type = 'multiagent_20261001'; $advisor; $subagents; $workflows; }
"multiagent_20261001" type

Whether the session's primary thread can consult an advisor model.

Whether the agent can spawn session threads.

Whether the agent can start workflow runs.

class BetaManagedAgentsSessionMultiagentCoordinator { $type = 'coordinator'; $agents; }
"coordinator" type
list<Agent> agents

Full agent definitions the coordinator may spawn as session threads.

One of the following:
class BetaManagedAgentsSessionMultiagentSubagentsEnabled { $type = 'enabled'; $inlineAgents; $predefinedAgents; }
"enabled" type

Whether the agent can define inline agents, which are not saved, when it spawns session threads.

list<BetaManagedAgentsSessionThreadAgent> predefinedAgents

Full agent definitions of the predefined agents, which are saved agents that this agent can spawn as session threads.

class BetaManagedAgentsMultiagentSubagentsDisabled { $type = 'disabled'; }
"disabled" type
class BetaManagedAgentsSessionMultiagentSubagentsEnabled { $type = 'enabled'; $inlineAgents; $predefinedAgents; }
"enabled" type

Whether the agent can define inline agents, which are not saved, when it spawns session threads.

list<BetaManagedAgentsSessionThreadAgent> predefinedAgents

Full agent definitions of the predefined agents, which are saved agents that this agent can spawn as session threads.

One of the following:
class BetaManagedAgentsSessionMultiagentWorkflowsEnabled { $type = 'enabled'; $inlineAgents; $predefinedAgents; }
"enabled" type

Whether a run's plan can define inline agents, which are not saved.

list<BetaManagedAgentsSessionThreadAgent> predefinedAgents

Full agent definitions of the predefined agents, which are saved agents that a run's plan can use.

class BetaManagedAgentsMultiagentWorkflowsDisabled { $type = 'disabled'; }
"disabled" type
class BetaManagedAgentsSessionMultiagentWorkflowsEnabled { $type = 'enabled'; $inlineAgents; $predefinedAgents; }
"enabled" type

Whether a run's plan can define inline agents, which are not saved.

list<BetaManagedAgentsSessionThreadAgent> predefinedAgents

Full agent definitions of the predefined agents, which are saved agents that a run's plan can use.

class BetaManagedAgentsSessionMultiagent20261001 { $type = 'multiagent_20261001'; $advisor; $subagents; $workflows; }
"multiagent_20261001" type

Whether the session's primary thread can consult an advisor model.

Whether the agent can spawn session threads.

Whether the agent can start workflow runs.

class BetaManagedAgentsSessionStats { $activeSeconds; $durationSeconds; }
?float activeSeconds

Cumulative time in seconds the session spent in running status. Excludes idle time.

?float durationSeconds

Elapsed time since session creation in seconds. For terminated sessions, frozen at the final update.

class BetaManagedAgentsSessionUpdatedEvent { $type = 'session.updated'; $id; $processedAt; /* 4 more */ }
"session.updated" type
string id

Unique identifier for this event.

\Datetime processedAt

Timestamp when the update was applied.

The session's effective agent configuration after the update. Present only when the update changed agent (tools or mcp_servers); when present it is the full materialised snapshot, not a diff.

The session's budget after the update: the new budget when set or replaced, or null when the update removed it. Present only when the update changed the budget.

?array<string,string> metadata

The session's full metadata bag after the update. Present when the update set non-empty metadata; absent when metadata was unchanged or cleared to empty.

?string title

The session's new title. Present only when the update changed it.

class BetaManagedAgentsSessionUsage { $activeSeconds; $cacheCreation; $cacheReadInputTokens; /* 4 more */ }
?float activeSeconds

Cumulative time in seconds during which the session had at least one thread in running status. Overlapping activity from concurrent threads is counted once, unlike stats.active_seconds, which sums each thread's own active time. This is the duration the session's runtime cost is priced on.

Tokens used to create prompt cache entries, broken down by cache TTL.

?int cacheReadInputTokens

Total tokens read from prompt cache.

?int inputTokens

Total input tokens consumed across all turns.

?BetaMonetaryAmount listCost

Cumulative list cost of the session across all turns, priced at public list rates. Absent until cost tracking is available for the session.

?int outputTokens

Total output tokens generated across all turns.

Cumulative server-executed tool usage across all turns. Absent until server-tool tracking is available for the session.

class BetaManagedAgentsSessionUsageEvent { $type = 'session.usage'; $id; $processedAt; /* 2 more */ }
"session.usage" type
string id

Unique identifier for this event.

\Datetime processedAt

Timestamp when the snapshot was taken.

The session's cumulative usage at the snapshot time.

The session's configured budget at the snapshot time, or null when the session has no budget.

class BetaManagedAgentsStartEvent { $type = 'event_start'; $event; }
"event_start" type

The previewed event's type and id. The event type determines which delta types the preview's event_delta events carry: agent.message events stream content_delta fragments; agent.thinking previews are start-only — no deltas follow, and the buffered agent.thinking with the same id concludes them.

One of the following:
class BetaManagedAgentsAgentMessagePreview { $type = 'agent.message'; $id; }
"agent.message" type
string id

The id the buffered agent.message will carry if it is emitted. Matches the event_id on this preview's event_delta events.

class BetaManagedAgentsAgentThinkingPreview { $type = 'agent.thinking'; $id; }
"agent.thinking" type
string id

The id the buffered agent.thinking will carry if it is emitted. Start-only — no event_delta events follow.

class BetaManagedAgentsSystemContentBlock { $type = 'text'; $text; }
"text" type
string text

The text content.

class BetaManagedAgentsSystemMessageEvent { $type = 'system.message'; $id; $content; $processedAt; }
"system.message" type
string id

Unique identifier for this event.

System content blocks. Text-only.

?\Datetime processedAt

Timestamp when this system message was processed.

class BetaManagedAgentsUserToolResultEvent { $type = 'user.tool_result'; $id; $toolUseID; /* 4 more */ }
"user.tool_result" type
string id

Unique identifier for this event.

string toolUseID

The id of the agent.tool_use event this result corresponds to, which can be found in the last session.status_idle event's stop_reason.event_ids field.

?list<Content> content

The result content returned by the tool.

?bool isError

Whether the tool execution resulted in an error.

?\Datetime processedAt

Timestamp when this result was processed.

?string sessionThreadID

Set by the server to the subagent thread this result was routed to. Omitted when it was routed to the primary thread.

SessionsEvents

List Events
$client->beta->sessions->events->list(string sessionID, ?\Datetime createdAtGt, ?\Datetime createdAtGte, ?\Datetime createdAtLt, ?\Datetime createdAtLte, ?int limit, ?Order order, ?string page, ?list<ManagedAgentsSessionEventType> types, ?list<AnthropicBeta> betas, ?string workspaceID): PageCursor<ManagedAgentsSessionEvent>
GET/v1/sessions/{session_id}/events
Requires anthropic-beta: managed-agents-2026-04-01. How to send beta headers
Send Events
$client->beta->sessions->events->send(string sessionID, list<ManagedAgentsEventParams> events, ?list<AnthropicBeta> betas, ?string workspaceID): ManagedAgentsSendSessionEvents
POST/v1/sessions/{session_id}/events
Requires anthropic-beta: managed-agents-2026-04-01. How to send beta headers
Stream Events
$client->beta->sessions->events->streamStream(string sessionID, ?list<BetaManagedAgentsDeltaType> eventDeltas, ?list<AnthropicBeta> betas, ?string workspaceID): BaseStream<ManagedAgentsStreamSessionEvents>
GET/v1/sessions/{session_id}/events/stream
Requires anthropic-beta: managed-agents-2026-04-01. How to send beta headers

SessionsResources

Add Session Resource
$client->beta->sessions->resources->add(string sessionID, string fileID, "file" type, ?string mountPath, ?list<AnthropicBeta> betas, ?string workspaceID): ManagedAgentsFileResource
POST/v1/sessions/{session_id}/resources
Requires anthropic-beta: managed-agents-2026-04-01. How to send beta headers
List Session Resources
$client->beta->sessions->resources->list(string sessionID, ?int limit, ?string page, ?list<AnthropicBeta> betas, ?string workspaceID): PageCursor<ManagedAgentsSessionResource>
GET/v1/sessions/{session_id}/resources
Requires anthropic-beta: managed-agents-2026-04-01. How to send beta headers
Get Session Resource
$client->beta->sessions->resources->retrieve(string resourceID, string sessionID, ?list<AnthropicBeta> betas, ?string workspaceID): ResourceGetResponse
GET/v1/sessions/{session_id}/resources/{resource_id}
Requires anthropic-beta: managed-agents-2026-04-01. How to send beta headers
Update Session Resource
$client->beta->sessions->resources->update(string resourceID, string sessionID, string authorizationToken, ?list<AnthropicBeta> betas, ?string workspaceID): ResourceUpdateResponse
POST/v1/sessions/{session_id}/resources/{resource_id}
Requires anthropic-beta: managed-agents-2026-04-01. How to send beta headers
Delete Session Resource
$client->beta->sessions->resources->delete(string resourceID, string sessionID, ?list<AnthropicBeta> betas, ?string workspaceID): ManagedAgentsDeleteSessionResource
DELETE/v1/sessions/{session_id}/resources/{resource_id}
Requires anthropic-beta: managed-agents-2026-04-01. How to send beta headers

SessionsThreads

List Session Threads
$client->beta->sessions->threads->list(string sessionID, ?int limit, ?string page, ?list<ManagedAgentsSessionThreadStatus> statuses, ?list<AnthropicBeta> betas, ?string workspaceID): PageCursor<ManagedAgentsSessionThread>
GET/v1/sessions/{session_id}/threads
Requires anthropic-beta: managed-agents-2026-04-01. How to send beta headers
Get Session Thread
$client->beta->sessions->threads->retrieve(string threadID, string sessionID, ?list<AnthropicBeta> betas, ?string workspaceID): ManagedAgentsSessionThread
GET/v1/sessions/{session_id}/threads/{thread_id}
Requires anthropic-beta: managed-agents-2026-04-01. How to send beta headers
Archive Session Thread
$client->beta->sessions->threads->archive(string threadID, string sessionID, ?list<AnthropicBeta> betas, ?string workspaceID): ManagedAgentsSessionThread
POST/v1/sessions/{session_id}/threads/{thread_id}/archive
Requires anthropic-beta: managed-agents-2026-04-01. How to send beta headers

SessionsThreadsEvents

List Session Thread Events
$client->beta->sessions->threads->events->list(string threadID, string sessionID, ?int limit, ?string page, ?list<AnthropicBeta> betas, ?string workspaceID): PageCursor<ManagedAgentsSessionEvent>
GET/v1/sessions/{session_id}/threads/{thread_id}/events
Requires anthropic-beta: managed-agents-2026-04-01. How to send beta headers
Stream Session Thread Events
$client->beta->sessions->threads->events->streamStream(string threadID, string sessionID, ?list<BetaManagedAgentsDeltaType> eventDeltas, ?list<AnthropicBeta> betas, ?string workspaceID): BaseStream<ManagedAgentsStreamSessionThreadEvents>
GET/v1/sessions/{session_id}/threads/{thread_id}/stream
Requires anthropic-beta: managed-agents-2026-04-01. How to send beta headers