イベント
イベントの一覧
$client->beta->sessions->events->list(string sessionID, ?\Datetime createdAtGt, ?\Datetime createdAtGte, ?\Datetime createdAtLt, ?\Datetime createdAtLte, ?int limit, ?Order order, ?string page, ?list<string> types, ?list<AnthropicBeta> betas, ?string workspaceID): PageCursor<ManagedAgentsSessionEvent>イベントを送信
$client->beta->sessions->events->send(string sessionID, list<ManagedAgentsEventParams> events, ?list<AnthropicBeta> betas, ?string workspaceID): ManagedAgentsSendSessionEventsイベントをストリーミング
$client->beta->sessions->events->stream(string sessionID, ?list<BetaManagedAgentsDeltaType> eventDeltas, ?list<AnthropicBeta> betas, ?string workspaceID): ManagedAgentsStreamSessionEventsModels
class ManagedAgentsAgentAutoEvaluatedPermissionAllow { $type = 'allow'; }
class ManagedAgentsAgentAutoEvaluatedPermissionAsk { $type = 'ask'; $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; }
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'; }
class ManagedAgentsAgentAutoEvaluatedPermissionAsk { $type = 'ask'; $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; }
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 */ }
Unique identifier for this event.
Input parameters for the tool call.
Name of the custom tool being called.
A timestamp in RFC 3339 format
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.
class ManagedAgentsAgentMCPToolResultEvent { $type; $id; $mcpToolUseID; /* 3 more */ }
Unique identifier for this event.
The id of the agent.mcp_tool_use event this result corresponds to.
A timestamp in RFC 3339 format
The result content returned by the tool.
Whether the tool execution resulted in an error.
class ManagedAgentsAgentMCPToolUseEvent { $type; $id; $input; /* 6 more */ }
Unique identifier for this event.
Input parameters for the tool call.
Name of the MCP server providing the tool.
Name of the MCP tool being used.
A timestamp in RFC 3339 format
AgentEvaluatedPermission enum
Names the resolved permission_policy that produced evaluated_permission, and under auto carries the judgement. Open union: clients must tolerate unknown variants.
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; }
Unique identifier for this event.
Array of text blocks comprising the agent response.
A timestamp in RFC 3339 format
class ManagedAgentsAgentThinkingEvent { $type; $id; $processedAt; }
Unique identifier for this event.
A timestamp in RFC 3339 format
class ManagedAgentsAgentThreadContextCompactedEvent { $type; $id; $processedAt; }
Unique identifier for this event.
A timestamp in RFC 3339 format
class ManagedAgentsAgentThreadMessageReceivedEvent { $type; $id; $content; /* 3 more */ }
Unique identifier for this event.
Message content blocks.
Public sthr_ ID of the thread that sent the message.
A timestamp in RFC 3339 format
Name of the callable agent this message came from. Absent when received from the primary agent.
class ManagedAgentsAgentThreadMessageSentEvent { $type; $id; $content; /* 3 more */ }
Unique identifier for this event.
Message content blocks.
A timestamp in RFC 3339 format
Public sthr_ ID of the thread the message was sent to.
Name of the callable agent this message was sent to. Absent when sent to the primary agent.
class ManagedAgentsAgentToolEvaluationAlwaysAllow { $type = 'always_allow'; }
class ManagedAgentsAgentToolEvaluationAlwaysAsk { $type = 'always_ask'; }
class ManagedAgentsAgentToolEvaluationAuto { $type = 'auto'; $evaluatedPermission; }
The server's per-invocation judgement under the auto permission policy. Its type always equals the event's top-level evaluated_permission. Open union: clients must tolerate unknown variants.
class ManagedAgentsAgentToolEvaluationAlwaysAllow { $type = 'always_allow'; }
class ManagedAgentsAgentToolEvaluationAlwaysAsk { $type = 'always_ask'; }
class ManagedAgentsAgentToolEvaluationAuto { $type = 'auto'; $evaluatedPermission; }
The server's per-invocation judgement under the auto permission policy. Its type always equals the event's top-level evaluated_permission. Open union: clients must tolerate unknown variants.
class ManagedAgentsAgentToolResultEvent { $type; $id; $processedAt; /* 3 more */ }
Unique identifier for this event.
A timestamp in RFC 3339 format
The id of the agent.tool_use event this result corresponds to.
The result content returned by the tool.
Whether the tool execution resulted in an error.
class ManagedAgentsAgentToolUseEvent { $type; $id; $input; /* 5 more */ }
Unique identifier for this event.
Input parameters for the tool call.
Name of the agent tool being used.
A timestamp in RFC 3339 format
AgentEvaluatedPermission enum
Names the resolved permission_policy that produced evaluated_permission, and under auto carries the judgement. Open union: clients must tolerate unknown variants.
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; }
Base64-encoded document data.
MIME type of the document (e.g., "application/pdf").
class ManagedAgentsBase64ImageSource { $type; $data; $mediaType; }
Base64-encoded image data.
MIME type of the image (e.g., "image/png", "image/jpeg", "image/gif", "image/webp").
class ManagedAgentsBillingError { $type; $message; $retryStatus; }
Human-readable error description.
What the client should do next in response to this error.
class ManagedAgentsCredentialHostUnreachableError { $type; $credentialID; $message; /* 2 more */ }
ID of the affected credential.
Human-readable error description.
What the client should do next in response to this error.
ID of the vault containing the affected credential.
class ManagedAgentsDocumentBlock { $type; $source; $context; $title; }
Union type for document source variants.
Additional context about the document for the model.
The title of the document.
class ManagedAgentsEventParams
class ManagedAgentsFileDocumentSource { $type; $fileID; }
ID of a previously uploaded file.
class ManagedAgentsFileImageSource { $type; $fileID; }
ID of a previously uploaded file.
class ManagedAgentsFileRubric { $type; $fileID; }
ID of the rubric file.
class ManagedAgentsFileRubricParams { $type; $fileID; }
ID of the rubric file.
class ManagedAgentsImageBlock { $type; $source; }
Union type for image source variants.
class ManagedAgentsMCPAuthenticationFailedError { $type; $mcpServerName; $message; $retryStatus; }
Name of the MCP server that failed authentication.
Human-readable error description.
What the client should do next in response to this error.
class ManagedAgentsMCPConnectionFailedError { $type; $mcpServerName; $message; $retryStatus; }
Name of the MCP server that failed to connect.
Human-readable error description.
What the client should do next in response to this error.
class ManagedAgentsModelOverloadedError { $type; $message; $retryStatus; }
Human-readable error description.
What the client should do next in response to this error.
class ManagedAgentsModelRateLimitedError { $type; $message; $retryStatus; }
Human-readable error description.
What the client should do next in response to this error.
class ManagedAgentsModelRequestFailedError { $type; $message; $retryStatus; }
Human-readable error description.
What the client should do next in response to this error.
class ManagedAgentsPlainTextDocumentSource { $type; $data; $mediaType; }
The plain text content.
MIME type of the text content. Must be "text/plain".
class ManagedAgentsRedactedBlock { $type; }
class ManagedAgentsRetryStatusExhausted { $type; }
class ManagedAgentsRetryStatusRetrying { $type; }
class ManagedAgentsRetryStatusTerminal { $type; }
class ManagedAgentsSearchResultBlock { $type; $citations; $content; /* 2 more */ }
Citation settings for a search result.
Array of text content blocks from the search result.
The URL source of the search result.
The title of the search result.
class ManagedAgentsSearchResultCitations { $enabled; }
Whether citations are enabled for this search result.
class ManagedAgentsSearchResultContent { $type; $text; }
The text content.
class ManagedAgentsSendSessionEvents { $data; }
Sent events
class ManagedAgentsSessionBudgetReached { $type; }
class ManagedAgentsSessionDeletedEvent { $type; $id; $processedAt; }
Unique identifier for this event.
A timestamp in RFC 3339 format
class ManagedAgentsSessionEndTurn { $type; }
class ManagedAgentsSessionErrorEvent { $type; $id; $error; $processedAt; }
Unique identifier for this event.
A timestamp in RFC 3339 format
class ManagedAgentsSessionRequiresAction { $type; $eventIDs; }
The ids of events the agent is blocked on. Resolving fewer than all re-emits session.status_idle with the remainder.
class ManagedAgentsSessionRetriesExhausted { $type; }
class ManagedAgentsSessionStatusIdleEvent { $type; $id; $processedAt; $stopReason; }
Unique identifier for this event.
A timestamp in RFC 3339 format
class ManagedAgentsSessionStatusRescheduledEvent { $type; $id; $processedAt; }
Unique identifier for this event.
A timestamp in RFC 3339 format
class ManagedAgentsSessionStatusRunningEvent { $type; $id; $processedAt; }
Unique identifier for this event.
A timestamp in RFC 3339 format
class ManagedAgentsSessionStatusTerminatedEvent { $type; $id; $processedAt; }
Unique identifier for this event.
A timestamp in RFC 3339 format
class ManagedAgentsSessionThreadCreatedEvent { $type; $id; $agentName; /* 2 more */ }
Unique identifier for this event.
Name of the callable agent the thread runs.
A timestamp in RFC 3339 format
Public sthr_ ID of the newly created thread.
class ManagedAgentsSessionThreadStatusIdleEvent { $type; $id; $agentName; /* 3 more */ }
Unique identifier for this event.
Name of the agent the thread runs.
A timestamp in RFC 3339 format
Public sthr_ ID of the thread that went idle.
class ManagedAgentsSessionThreadStatusRescheduledEvent { $type; $id; $agentName; /* 2 more */ }
Unique identifier for this event.
Name of the agent the thread runs.
A timestamp in RFC 3339 format
Public sthr_ ID of the thread that is retrying.
class ManagedAgentsSessionThreadStatusRunningEvent { $type; $id; $agentName; /* 2 more */ }
Unique identifier for this event.
Name of the agent the thread runs.
A timestamp in RFC 3339 format
Public sthr_ ID of the thread that started running.
class ManagedAgentsSessionThreadStatusTerminatedEvent { $type; $id; $agentName; /* 2 more */ }
Unique identifier for this event.
Name of the agent the thread runs.
A timestamp in RFC 3339 format
Public sthr_ ID of the thread that terminated.
class ManagedAgentsSessionUsageSnapshot { $activeSeconds; $cacheCreation; $cacheReadInputTokens; /* 4 more */ }
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.
Prompt-cache creation token usage broken down by cache lifetime.
Total tokens read from prompt cache.
Total input tokens consumed across all turns.
A monetary amount in a specific currency.
Total output tokens generated across all turns.
Cumulative count of server-executed tool invocations, broken down by tool.
class ManagedAgentsSpanModelRequestEndEvent { $type; $id; $isError; /* 3 more */ }
Unique identifier for this event.
Whether the model request resulted in an error.
The id of the corresponding span.model_request_start event.
Token usage for a single model request.
A timestamp in RFC 3339 format
class ManagedAgentsSpanModelRequestStartEvent { $type; $id; $processedAt; }
Unique identifier for this event.
A timestamp in RFC 3339 format
class ManagedAgentsSpanModelUsage { $cacheCreationInputTokens; $cacheReadInputTokens; $inputTokens; /* 2 more */ }
Tokens used to create prompt cache in this request.
Tokens read from prompt cache in this request.
Input tokens consumed by this request.
Output tokens generated by this request.
Inference speed mode. fast provides significantly faster output token generation at premium pricing. Not all models support fast; invalid combinations are rejected at create time.
class ManagedAgentsSpanOutcomeEvaluationEndEvent { $type; $id; $explanation; /* 6 more */ }
Unique identifier for this event.
Human-readable explanation of the verdict. For needs_revision, describes which criteria failed and why.
0-indexed revision cycle, matching the corresponding span.outcome_evaluation_start.
The id of the corresponding span.outcome_evaluation_start event.
The outc_ ID of the outcome being evaluated.
A timestamp in RFC 3339 format
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.
Token usage for a single model request.
class ManagedAgentsSpanOutcomeEvaluationOngoingEvent { $type; $id; $iteration; /* 2 more */ }
Unique identifier for this event.
0-indexed revision cycle, matching the corresponding span.outcome_evaluation_start.
The outc_ ID of the outcome being evaluated.
A timestamp in RFC 3339 format
class ManagedAgentsSpanOutcomeEvaluationStartEvent { $type; $id; $iteration; /* 2 more */ }
Unique identifier for this event.
0-indexed revision cycle. 0 is the first evaluation; 1 is the re-evaluation after the first revision; etc.
The outc_ ID of the outcome being evaluated.
A timestamp in RFC 3339 format
class ManagedAgentsSystemMessageEventParams { $type; $content; }
System content blocks to append. Text-only.
class ManagedAgentsTextBlock { $type; $text; }
The text content.
class ManagedAgentsTextRubric { $type; $content; }
Rubric content. Plain text or markdown — the grader treats it as freeform text.
class ManagedAgentsTextRubricParams { $type; $content; }
Rubric content. Plain text or markdown — the grader treats it as freeform text. Maximum 262144 characters.
class ManagedAgentsUnknownError { $type; $message; $retryStatus; }
Human-readable error description.
What the client should do next in response to this error.
class ManagedAgentsURLDocumentSource { $type; $url; }
URL of the document to fetch.
class ManagedAgentsURLImageSource { $type; $url; }
URL of the image to fetch.
class ManagedAgentsUserCustomToolResultEvent { $type; $id; $customToolUseID; /* 4 more */ }
Unique identifier for this event.
The id of the agent.custom_tool_use event this result corresponds to, which can be found in the last session.status_idle event's stop_reason.event_ids field.
The result content returned by the tool.
Whether the tool execution resulted in an error.
A timestamp in RFC 3339 format
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; }
The id of the agent.custom_tool_use event this result corresponds to, which can be found in the last session.status_idle event's stop_reason.event_ids field.
The result content returned by the tool.
Whether the tool execution resulted in an error.
class ManagedAgentsUserDefineOutcomeEvent { $type; $id; $description; /* 4 more */ }
Unique identifier for this event.
What the agent should produce. Copied from the input event.
Evaluate-then-revise cycles before giving up. Default 3, max 20.
Server-generated outc_ ID for this outcome. Referenced by span.outcome_evaluation_* events and the session's outcome_evaluations list.
A timestamp in RFC 3339 format
Rubric for grading the quality of an outcome.
class ManagedAgentsUserDefineOutcomeEventParams { $type; $description; $rubric; $maxIterations; }
What the agent should produce. This is the task specification.
Rubric for grading the quality of an outcome.
Eval→revision cycles before giving up. Default 3, max 20.
class ManagedAgentsUserInterruptEvent { $type; $id; $processedAt; $sessionThreadID; }
Unique identifier for this event.
A timestamp in RFC 3339 format
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; }
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; }
Unique identifier for this event.
Array of content blocks comprising the user message.
A timestamp in RFC 3339 format
class ManagedAgentsUserMessageEventParams { $type; $content; }
Array of content blocks for the user message.
class ManagedAgentsUserToolConfirmationEvent { $type; $id; $result; /* 4 more */ }
Unique identifier for this event.
UserToolConfirmationResult enum
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.
Optional message providing context for a 'deny' decision. Only allowed when result is 'deny'.
A timestamp in RFC 3339 format
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; }
UserToolConfirmationResult enum
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.
Optional message providing context for a 'deny' decision. Only allowed when result is 'deny'.
class ManagedAgentsUserToolResultEventParams { $type; $toolUseID; $content; $isError; }
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.
The result content returned by the tool.
Whether the tool execution resulted in an error.