Claude Platform Docs

Events

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
Send Events
$client->beta->sessions->events->send(string sessionID, list<ManagedAgentsEventParams> events, ?list<AnthropicBeta> betas, ?string workspaceID): ManagedAgentsSendSessionEvents
POST/v1/sessions/{session_id}/events
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
Models
One of the following:
class ManagedAgentsAgentAutoEvaluatedPermissionAllow { $type = 'allow'; }
"allow" type
class ManagedAgentsAgentAutoEvaluatedPermissionAsk { $type = 'ask'; $reasonCode; }
"ask" type
string reasonCode

The judgement's grounds in registry-bound terms, for client branching and audit rather than end-user display. Open registry; currently "indeterminate" (no judgement was reached). Clients must tolerate values outside this set.

class ManagedAgentsAgentAutoEvaluatedPermissionDeny { $type = 'deny'; $reasonCode; }
"deny" type
string reasonCode

The judgement's grounds in registry-bound terms. Open registry; currently "high_risk" (judged high-risk; the call does not run). Clients must tolerate values outside this set.

class ManagedAgentsAgentAutoEvaluatedPermissionAllow { $type = 'allow'; }
"allow" type
class ManagedAgentsAgentAutoEvaluatedPermissionAsk { $type = 'ask'; $reasonCode; }
"ask" type
string reasonCode

The judgement's grounds in registry-bound terms, for client branching and audit rather than end-user display. Open registry; currently "indeterminate" (no judgement was reached). Clients must tolerate values outside this set.

class ManagedAgentsAgentAutoEvaluatedPermissionDeny { $type = 'deny'; $reasonCode; }
"deny" type
string reasonCode

The judgement's grounds in registry-bound terms. Open registry; currently "high_risk" (judged high-risk; the call does not run). Clients must tolerate values outside this set.

class ManagedAgentsAgentCustomToolUseEvent { $type; $id; $input; /* 3 more */ }
Type type
string id

Unique identifier for this event.

array<string,mixed> input

Input parameters for the tool call.

string name

Name of the custom tool being called.

\Datetime processedAt

Timestamp when this tool use was processed.

?string sessionThreadID

When set, this event was cross-posted from a subagent's thread to surface its custom tool use on the primary thread's stream. Empty on the thread's own events. Informational only: the server routes the matching user.custom_tool_result by custom_tool_use_id, so clients do not send it back.

One of the following:
"allow"
"ask"
"deny"
class ManagedAgentsAgentMCPToolResultEvent { $type; $id; $mcpToolUseID; /* 3 more */ }
Type type
string id

Unique identifier for this event.

string mcpToolUseID

The id of the agent.mcp_tool_use event this result corresponds to.

\Datetime processedAt

Timestamp when this event was processed.

?list<Content> content

The result content returned by the tool.

?bool isError

Whether the tool execution resulted in an error.

class ManagedAgentsAgentMCPToolUseEvent { $type; $id; $input; /* 6 more */ }
Type type
string id

Unique identifier for this event.

array<string,mixed> input

Input parameters for the tool call.

string mcpServerName

Name of the MCP server providing the tool.

string name

Name of the MCP tool being used.

\Datetime processedAt

Timestamp when this event was processed.

The evaluated permission policy for this tool invocation.

Which resolved permission_policy produced evaluated_permission: always_allow, always_ask, or auto (with the server's per-invocation judgement). Absent only when the server refused the call before any policy applied (for example, the named tool is not enabled in the session); such a refusal has evaluated_permission deny. An event recorded before this field existed reads as the arm its evaluated_permission implies (always_allow for allow, always_ask for ask).

?string sessionThreadID

When set, this event was cross-posted from a subagent's thread to surface its permission request on the primary thread's stream. Empty on the thread's own events. Informational only: the server routes the matching user.tool_confirmation by tool_use_id, so clients do not send it back.

class ManagedAgentsAgentMessageEvent { $type; $id; $content; $processedAt; }
Type type
string id

Unique identifier for this event.

list<Content> content

Array of text blocks comprising the agent response.

\Datetime processedAt

Timestamp when this response was generated.

class ManagedAgentsAgentThinkingEvent { $type; $id; $processedAt; }
Type type
string id

Unique identifier for this event.

\Datetime processedAt

Timestamp when this thinking was produced.

class ManagedAgentsAgentThreadContextCompactedEvent { $type; $id; $processedAt; }
Type type
string id

Unique identifier for this event.

\Datetime processedAt

Timestamp when compaction was processed.

class ManagedAgentsAgentThreadMessageReceivedEvent { $type; $id; $content; /* 3 more */ }
Type type
string id

Unique identifier for this event.

list<Content> content

Message content blocks.

string fromSessionThreadID

Public sthr_ ID of the thread that sent the message.

\Datetime processedAt

Timestamp when the message was received.

?string fromAgentName

Name of the callable agent this message came from. Absent when received from the primary agent.

class ManagedAgentsAgentThreadMessageSentEvent { $type; $id; $content; /* 3 more */ }
Type type
string id

Unique identifier for this event.

list<Content> content

Message content blocks.

\Datetime processedAt

Timestamp when the message was sent.

string toSessionThreadID

Public sthr_ ID of the thread the message was sent to.

?string toAgentName

Name of the callable agent this message was sent to. Absent when sent to the primary agent.

One of the following:
class ManagedAgentsAgentToolEvaluationAlwaysAllow { $type = 'always_allow'; }
"always_allow" type
class ManagedAgentsAgentToolEvaluationAlwaysAsk { $type = 'always_ask'; }
"always_ask" type
class ManagedAgentsAgentToolEvaluationAuto { $type = 'auto'; $evaluatedPermission; }
"auto" type

The server's judgement for this invocation.

class ManagedAgentsAgentToolEvaluationAlwaysAllow { $type = 'always_allow'; }
"always_allow" type
class ManagedAgentsAgentToolEvaluationAlwaysAsk { $type = 'always_ask'; }
"always_ask" type
class ManagedAgentsAgentToolEvaluationAuto { $type = 'auto'; $evaluatedPermission; }
"auto" type

The server's judgement for this invocation.

class ManagedAgentsAgentToolResultEvent { $type; $id; $processedAt; /* 3 more */ }
Type type
string id

Unique identifier for this event.

\Datetime processedAt

Timestamp when this event was processed.

string toolUseID

The id of the agent.tool_use event this result corresponds to.

?list<Content> content

The result content returned by the tool.

?bool isError

Whether the tool execution resulted in an error.

class ManagedAgentsAgentToolUseEvent { $type; $id; $input; /* 5 more */ }
Type type
string id

Unique identifier for this event.

array<string,mixed> input

Input parameters for the tool call.

string name

Name of the agent tool being used.

\Datetime processedAt

Timestamp when this event was processed.

The evaluated permission policy for this tool invocation.

Which resolved permission_policy produced evaluated_permission: always_allow, always_ask, or auto (with the server's per-invocation judgement). Absent only when the server refused the call before any policy applied (for example, the named tool is not enabled in the session); such a refusal has evaluated_permission deny. An event recorded before this field existed reads as the arm its evaluated_permission implies (always_allow for allow, always_ask for ask).

?string sessionThreadID

When set, this event was cross-posted from a subagent's thread to surface its permission request on the primary thread's stream. Empty on the thread's own events. Informational only: the server routes the matching user.tool_confirmation or user.tool_result by tool_use_id, so clients do not send it back.

class ManagedAgentsBase64DocumentSource { $type; $data; $mediaType; }
Type type
string data

Base64-encoded document data.

string mediaType

MIME type of the document (e.g., "application/pdf").

class ManagedAgentsBase64ImageSource { $type; $data; $mediaType; }
Type type
string data

Base64-encoded image data.

string mediaType

MIME type of the image (e.g., "image/png", "image/jpeg", "image/gif", "image/webp").

class ManagedAgentsBillingError { $type; $message; $retryStatus; }
Type type
string message

Human-readable error description.

RetryStatus retryStatus

What the client should do next.

class ManagedAgentsCredentialHostUnreachableError { $type; $credentialID; $message; /* 2 more */ }
Type type
string credentialID

ID of the affected credential.

string message

Human-readable error description.

RetryStatus retryStatus

What the client should do next.

string vaultID

ID of the vault containing the affected credential.

class ManagedAgentsDocumentBlock { $type; $source; $context; $title; }
Type type
Source source

The source of the document data.

?string context

Additional context about the document for the model.

?string title

The title of the document.

One of the following:
class ManagedAgentsFileDocumentSource { $type; $fileID; }
Type type
string fileID

ID of a previously uploaded file.

class ManagedAgentsFileImageSource { $type; $fileID; }
Type type
string fileID

ID of a previously uploaded file.

class ManagedAgentsFileRubric { $type; $fileID; }
Type type
string fileID

ID of the rubric file.

class ManagedAgentsFileRubricParams { $type; $fileID; }
Type type
string fileID

ID of the rubric file.

class ManagedAgentsImageBlock { $type; $source; }
Type type
Source source

The source of the image data.

class ManagedAgentsMaxWorkflowRunsWorkflowRunError { $type = 'max_workflow_runs_error'; $message; }
"max_workflow_runs_error" type
string message

Short explanation written by the server. It never contains content from the run or its agents.

class ManagedAgentsMCPAuthenticationFailedError { $type; $mcpServerName; $message; $retryStatus; }
Type type
string mcpServerName

Name of the MCP server that failed authentication.

string message

Human-readable error description.

RetryStatus retryStatus

What the client should do next.

class ManagedAgentsMCPConnectionFailedError { $type; $mcpServerName; $message; $retryStatus; }
Type type
string mcpServerName

Name of the MCP server that failed to connect.

string message

Human-readable error description.

RetryStatus retryStatus

What the client should do next.

class ManagedAgentsModelOverloadedError { $type; $message; $retryStatus; }
Type type
string message

Human-readable error description.

RetryStatus retryStatus

What the client should do next.

class ManagedAgentsModelRateLimitedError { $type; $message; $retryStatus; }
Type type
string message

Human-readable error description.

RetryStatus retryStatus

What the client should do next.

class ManagedAgentsModelRequestFailedError { $type; $message; $retryStatus; }
Type type
string message

Human-readable error description.

RetryStatus retryStatus

What the client should do next.

class ManagedAgentsPlainTextDocumentSource { $type; $data; $mediaType; }
Type type
string data

The plain text content.

MediaType mediaType

MIME type of the text content. Must be "text/plain".

class ManagedAgentsProgramWorkflowRunError { $type = 'program_error'; $message; }
"program_error" type
string message

Short explanation written by the server. It never contains content from the run or its agents.

class ManagedAgentsRedactedBlock { $type; }
Type type
class ManagedAgentsRepositoryAuthenticationError { $type = 'repository_authentication_error'; $message; $repositoryURL; $retryStatus; }
"repository_authentication_error" type
string message

Human-readable error description.

?string repositoryURL

URL of the repository that could not be cloned. Null when it could not be identified.

RetryStatus retryStatus

What the client should do next. Always retrying: the session keeps running without the repository.

class ManagedAgentsRepositoryCheckoutError { $type = 'repository_checkout_error'; $message; $repositoryURL; $retryStatus; }
"repository_checkout_error" type
string message

Human-readable error description.

?string repositoryURL

URL of the repository that could not be cloned. Null when it could not be identified.

RetryStatus retryStatus

What the client should do next. Always retrying: the session keeps running without the repository.

class ManagedAgentsRepositoryCloneError { $type = 'repository_clone_error'; $message; $repositoryURL; $retryStatus; }
"repository_clone_error" type
string message

Human-readable error description.

?string repositoryURL

URL of the repository that could not be cloned. Null when it could not be identified.

RetryStatus retryStatus

What the client should do next. Always retrying: the session keeps running without the repository.

class ManagedAgentsRepositoryForbiddenError { $type = 'repository_forbidden_error'; $message; $repositoryURL; $retryStatus; }
"repository_forbidden_error" type
string message

Human-readable error description.

?string repositoryURL

URL of the repository that could not be cloned. Null when it could not be identified.

RetryStatus retryStatus

What the client should do next. Always retrying: the session keeps running without the repository.

class ManagedAgentsRepositoryNotFoundError { $type = 'repository_not_found_error'; $message; $repositoryURL; $retryStatus; }
"repository_not_found_error" type
string message

Human-readable error description.

?string repositoryURL

URL of the repository that could not be cloned. Null when it could not be identified.

RetryStatus retryStatus

What the client should do next. Always retrying: the session keeps running without the repository.

Type type
Type type
Type type
class ManagedAgentsSearchResultBlock { $type; $citations; $content; /* 2 more */ }
Type type

Citation settings for this search result.

Array of text content blocks from the search result.

string source

The URL source of the search result.

string title

The title of the search result.

class ManagedAgentsSearchResultCitations { $enabled; }
bool enabled

Whether citations are enabled for this search result.

class ManagedAgentsSearchResultContent { $type; $text; }
Type type
string text

The text content.

class ManagedAgentsSendSessionEvents { $data; }
?list<Data> data

Sent events

Type type
class ManagedAgentsSessionDeletedEvent { $type; $id; $processedAt; }
Type type
string id

Unique identifier for this event.

\Datetime processedAt

Timestamp when the session was deleted.

class ManagedAgentsSessionEndTurn { $type; }
Type type
class ManagedAgentsSessionErrorEvent { $type; $id; $error; $processedAt; }
Type type
string id

Unique identifier for this event.

Error error
\Datetime processedAt

Timestamp when the error occurred.

One of the following:
One of the following:
class ManagedAgentsSessionRefusal { $type = 'refusal'; }
"refusal" type
class ManagedAgentsSessionRefusalStopDetails { $type = 'refusal'; $category; $explanation; }
"refusal" type
?Category category

The policy category that triggered the refusal, or null when there is no named category. New values can be added over time.

?string explanation

Human-readable explanation of the refusal, or null when none is available. The wording can change, so do not parse it.

class ManagedAgentsSessionRequiresAction { $type; $eventIDs; }
Type type
list<string> eventIDs

The ids of events the agent is blocked on. Resolving fewer than all re-emits session.status_idle with the remainder.

Type type
class ManagedAgentsSessionStatusIdleEvent { $type; $id; $processedAt; /* 2 more */ }
Type type
string id

Unique identifier for this event.

\Datetime processedAt

Timestamp of status change.

Structured information about why the session stopped. null when there is nothing more to report.

StopReason stopReason
class ManagedAgentsSessionStatusRescheduledEvent { $type; $id; $processedAt; }
Type type
string id

Unique identifier for this event.

\Datetime processedAt

Timestamp of status change.

class ManagedAgentsSessionStatusRunningEvent { $type; $id; $processedAt; }
Type type
string id

Unique identifier for this event.

\Datetime processedAt

Timestamp of status change.

class ManagedAgentsSessionStatusTerminatedEvent { $type; $id; $processedAt; }
Type type
string id

Unique identifier for this event.

\Datetime processedAt

Timestamp of status change.

class ManagedAgentsSessionThreadCreatedEvent { $type; $id; $agentName; /* 3 more */ }
Type type
string id

Unique identifier for this event.

string agentName

Name of the callable agent the thread runs.

\Datetime processedAt

Timestamp when the thread was created.

string sessionThreadID

Public sthr_ ID of the newly created thread.

?string workflowRunID

Identifier of the workflow run that created the thread, or null for any other thread.

class ManagedAgentsSessionThreadStatusIdleEvent { $type; $id; $agentName; /* 4 more */ }
Type type
string id

Unique identifier for this event.

string agentName

Name of the agent the thread runs.

\Datetime processedAt

Timestamp of the status transition.

string sessionThreadID

Public sthr_ ID of the thread that went idle.

Structured information about why the thread stopped. null when there is nothing more to report.

StopReason stopReason
class ManagedAgentsSessionThreadStatusRescheduledEvent { $type; $id; $agentName; /* 2 more */ }
Type type
string id

Unique identifier for this event.

string agentName

Name of the agent the thread runs.

\Datetime processedAt

Timestamp of the status transition.

string sessionThreadID

Public sthr_ ID of the thread that is retrying.

class ManagedAgentsSessionThreadStatusRunningEvent { $type; $id; $agentName; /* 2 more */ }
Type type
string id

Unique identifier for this event.

string agentName

Name of the agent the thread runs.

\Datetime processedAt

Timestamp of the status transition.

string sessionThreadID

Public sthr_ ID of the thread that started running.

class ManagedAgentsSessionThreadStatusTerminatedEvent { $type; $id; $agentName; /* 2 more */ }
Type type
string id

Unique identifier for this event.

string agentName

Name of the agent the thread runs.

\Datetime processedAt

Timestamp of the status transition.

string sessionThreadID

Public sthr_ ID of the thread that terminated.

class ManagedAgentsSessionUsageSnapshot { $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. 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.

?int outputTokens

Total output tokens generated across all turns.

Cumulative server-executed tool usage across all turns.

class ManagedAgentsSpanModelRequestEndEvent { $type; $id; $isError; /* 3 more */ }
Type type
string id

Unique identifier for this event.

?bool isError

Whether the model request resulted in an error.

string modelRequestStartID

The id of the corresponding span.model_request_start event.

Token usage for this model request.

\Datetime processedAt

Timestamp when the model request completed.

class ManagedAgentsSpanModelRequestStartEvent { $type; $id; $processedAt; }
Type type
string id

Unique identifier for this event.

\Datetime processedAt

Timestamp when the model request started.

class ManagedAgentsSpanModelUsage { $cacheCreationInputTokens; $cacheReadInputTokens; $inputTokens; /* 2 more */ }
int cacheCreationInputTokens

Tokens used to create prompt cache in this request.

int cacheReadInputTokens

Tokens read from prompt cache in this request.

int inputTokens

Input tokens consumed by this request.

int outputTokens

Output tokens generated by this request.

?Speed speed

Inference speed tier this request actually ran at. Mirrors usage.speed on /v1/messages. Only present when the fast-mode beta is active.

class ManagedAgentsSpanOutcomeEvaluationEndEvent { $type; $id; $explanation; /* 6 more */ }
Type type
string id

Unique identifier for this event.

string explanation

Human-readable explanation of the verdict. For needs_revision, describes which criteria failed and why.

int iteration

0-indexed revision cycle, matching the corresponding span.outcome_evaluation_start.

string outcomeEvaluationStartID

The id of the corresponding span.outcome_evaluation_start event.

string outcomeID

The outc_ ID of the outcome being evaluated.

\Datetime processedAt

Timestamp when outcome evaluation ended.

string result

Evaluation verdict. 'satisfied': criteria met, session goes idle. 'needs_revision': criteria not met, another revision cycle follows. 'max_iterations_reached': evaluation budget exhausted with criteria still unmet — one final acknowledgment turn follows before the session goes idle, but no further evaluation runs. 'failed': grader determined the rubric does not apply to the deliverables. 'interrupted': user sent an interrupt while evaluation was in progress.

Aggregate token usage for this evaluation cycle. Sums across all grader model requests within the cycle.

class ManagedAgentsSpanOutcomeEvaluationOngoingEvent { $type; $id; $iteration; /* 2 more */ }
Type type
string id

Unique identifier for this event.

int iteration

0-indexed revision cycle, matching the corresponding span.outcome_evaluation_start.

string outcomeID

The outc_ ID of the outcome being evaluated.

\Datetime processedAt

Timestamp when this heartbeat was emitted.

class ManagedAgentsSpanOutcomeEvaluationStartEvent { $type; $id; $iteration; /* 2 more */ }
Type type
string id

Unique identifier for this event.

int iteration

0-indexed revision cycle. 0 is the first evaluation; 1 is the re-evaluation after the first revision; etc.

string outcomeID

The outc_ ID of the outcome being evaluated.

\Datetime processedAt

Timestamp when outcome evaluation started.

One of the following:
class ManagedAgentsSystemMessageEventParams { $type; $content; }
Type type

System content blocks to append. Text-only.

class ManagedAgentsTextBlock { $type; $text; }
Type type
string text

The text content.

class ManagedAgentsTextRubric { $type; $content; }
Type type
string content

Rubric content. Plain text or markdown — the grader treats it as freeform text.

class ManagedAgentsTextRubricParams { $type; $content; }
Type type
string content

Rubric content. Plain text or markdown — the grader treats it as freeform text. Maximum 262144 characters.

class ManagedAgentsThreadLimitWorkflowRunError { $type = 'thread_limit_error'; $message; }
"thread_limit_error" type
string message

Short explanation written by the server. It never contains content from the run or its agents.

class ManagedAgentsTimeoutWorkflowRunError { $type = 'timeout_error'; $message; }
"timeout_error" type
string message

Short explanation written by the server. It never contains content from the run or its agents.

class ManagedAgentsUnknownError { $type; $message; $retryStatus; }
Type type
string message

Human-readable error description.

RetryStatus retryStatus

What the client should do next.

class ManagedAgentsUnknownWorkflowRunError { $type = 'unknown_error'; $message; }
"unknown_error" type
string message

Short explanation written by the server. It never contains content from the run or its agents.

class ManagedAgentsURLDocumentSource { $type; $url; }
Type type
string url

URL of the document to fetch.

class ManagedAgentsURLImageSource { $type; $url; }
Type type
string url

URL of the image to fetch.

class ManagedAgentsUserCustomToolResultEvent { $type; $id; $customToolUseID; /* 4 more */ }
Type type
string id

Unique identifier for this event.

string customToolUseID

The id of the agent.custom_tool_use event this result corresponds to. It is also listed 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.

class ManagedAgentsUserCustomToolResultEventParams { $type; $customToolUseID; $content; $isError; }
Type type
string customToolUseID

The id of the agent.custom_tool_use event this result corresponds to. It is also listed 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.

class ManagedAgentsUserDefineOutcomeEvent { $type; $id; $description; /* 4 more */ }
Type type
string id

Unique identifier for this event.

string description

What the agent should produce. Copied from the input event.

?int maxIterations

Evaluate-then-revise cycles before giving up. Default 3, max 20.

string outcomeID

Server-generated outc_ ID for this outcome. Referenced by span.outcome_evaluation_* events and the session's outcome_evaluations list.

\Datetime processedAt

Timestamp when the outcome was accepted.

Rubric rubric

How to grade the outcome. File rubrics are currently resolved to their text content; clients should handle both variants.

class ManagedAgentsUserDefineOutcomeEventParams { $type; $description; $rubric; $maxIterations; }
Type type
string description

What the agent should produce. This is the task specification.

Rubric rubric

How to grade the outcome. Text or file reference.

?int maxIterations

Eval→revision cycles before giving up. Default 3, max 20.

class ManagedAgentsUserInterruptEvent { $type; $id; $processedAt; $sessionThreadID; }
Type type
string id

Unique identifier for this event.

?\Datetime processedAt

Timestamp when the interrupt was processed.

?string sessionThreadID

If absent, interrupts every non-archived thread in a multiagent session (or the primary alone in a single-agent session). If present, interrupts only the named thread.

class ManagedAgentsUserInterruptEventParams { $type; $sessionThreadID; }
Type type
?string sessionThreadID

If absent, interrupts every non-archived thread in a multiagent session (or the primary alone in a single-agent session). If present, interrupts only the named thread.

class ManagedAgentsUserMessageEvent { $type; $id; $content; $processedAt; }
Type type
string id

Unique identifier for this event.

list<Content> content

Array of content blocks comprising the user message.

?\Datetime processedAt

Timestamp when the agent finished processing this message.

class ManagedAgentsUserMessageEventParams { $type; $content; }
Type type
list<Content> content

Array of content blocks for the user message.

class ManagedAgentsUserToolConfirmationEvent { $type; $id; $result; /* 4 more */ }
Type type
string id

Unique identifier for this event.

Result result

The confirmation result: 'allow' or 'deny'.

string toolUseID

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

?string denyMessage

Optional message providing context for a 'deny' decision. Only allowed when result is 'deny'.

?\Datetime processedAt

Timestamp when the confirmation was processed.

?string sessionThreadID

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

class ManagedAgentsUserToolConfirmationEventParams { $type; $result; $toolUseID; $denyMessage; }
Type type
Result result

The confirmation result: 'allow' or 'deny'.

string toolUseID

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

?string denyMessage

Optional message providing context for a 'deny' decision. Only allowed when result is 'deny'.

class ManagedAgentsUserToolResultEventParams { $type; $toolUseID; $content; $isError; }
Type type
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.

class ManagedAgentsWorkflowRunCreatedEvent { $type = 'workflow_run.created'; $id; $description; /* 4 more */ }
"workflow_run.created" type
string id

Unique identifier for this event.

?string description

Description that the agent gave the run, passed on as written, or null if it gave none.

string name

Name that the agent gave the run, passed on as written, or a name that the server assigned.

The phases that the run's plan declares, in the plan's order. Can be empty.

\Datetime processedAt

Timestamp when this event was processed.

string workflowRunID

Identifier of the run. The same value is on all of the run's workflow_run.* events.

One of the following:
class ManagedAgentsWorkflowRunErrorEvent { $type = 'workflow_run.error'; $id; $error; /* 2 more */ }
"workflow_run.error" type
string id

Unique identifier for this event.

Why the run did not finish, or was not created.

\Datetime processedAt

Timestamp when this event was processed.

?string workflowRunID

Identifier of the run that met the error, or null when the error kept a run from being created.

class ManagedAgentsWorkflowRunPhase { $id; $description; $name; }
string id

Unique identifier for the phase.

?string description

Description that the agent gave the phase, passed on as written, or null if it gave none.

string name

Name that the agent gave the phase, passed on as written.

class ManagedAgentsWorkflowRunPhaseEndedEvent { $type = 'workflow_run.phase_ended'; $id; $phaseStartedID; /* 3 more */ }
"workflow_run.phase_ended" type
string id

Unique identifier for this event.

string phaseStartedID

Identifier of the workflow_run.phase_started event that opened the phase.

\Datetime processedAt

Timestamp when this event was processed.

string workflowRunID

Identifier of the run. The same value is on all of the run's workflow_run.* events.

string workflowRunPhaseID

Identifier of the phase, as in phases on the run's workflow_run.created event.

class ManagedAgentsWorkflowRunPhaseStartedEvent { $type = 'workflow_run.phase_started'; $id; $processedAt; /* 2 more */ }
"workflow_run.phase_started" type
string id

Unique identifier for this event.

\Datetime processedAt

Timestamp when this event was processed.

string workflowRunID

Identifier of the run. The same value is on all of the run's workflow_run.* events.

string workflowRunPhaseID

Identifier of the phase, as in phases on the run's workflow_run.created event.

One of the following:
class ManagedAgentsWorkflowRunResultCompleted { $type = 'completed'; }
"completed" type
class ManagedAgentsWorkflowRunResultError { $type = 'error'; $error; }
"error" type

Why the run did not finish.

class ManagedAgentsWorkflowRunResultStopped { $type = 'stopped'; }
"stopped" type
class ManagedAgentsWorkflowRunResultCompleted { $type = 'completed'; }
"completed" type
class ManagedAgentsWorkflowRunResultError { $type = 'error'; $error; }
"error" type

Why the run did not finish.

class ManagedAgentsWorkflowRunResultStopped { $type = 'stopped'; }
"stopped" type
class ManagedAgentsWorkflowRunStatusEndedEvent { $type = 'workflow_run.status_ended'; $id; $processedAt; /* 2 more */ }
"workflow_run.status_ended" type
string id

Unique identifier for this event.

\Datetime processedAt

Timestamp when this event was processed.

How the run ended.

string workflowRunID

Identifier of the run. The same value is on all of the run's workflow_run.* events.

class ManagedAgentsWorkflowRunStatusIdleEvent { $type = 'workflow_run.status_idle'; $id; $processedAt; $workflowRunID; }
"workflow_run.status_idle" type
string id

Unique identifier for this event.

\Datetime processedAt

Timestamp when this event was processed.

string workflowRunID

Identifier of the run. The same value is on all of the run's workflow_run.* events.

class ManagedAgentsWorkflowRunStatusRunningEvent { $type = 'workflow_run.status_running'; $id; $processedAt; $workflowRunID; }
"workflow_run.status_running" type
string id

Unique identifier for this event.

\Datetime processedAt

Timestamp when this event was processed.

string workflowRunID

Identifier of the run. The same value is on all of the run's workflow_run.* events.