---
title: Events
url: https://platform.claude.com/docs/en/api/php/beta/sessions/events
---

# 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`

List Events

### Parameters

- `sessionID: string` (path parameter)

- `createdAtGt?: optional \Datetime` (query parameter)

  Return events created after this time (exclusive). Compared against the event's `processed_at` value.

- `createdAtGte?: optional \Datetime` (query parameter)

  Return events created at or after this time (inclusive). Compared against the event's `processed_at` value.

- `createdAtLt?: optional \Datetime` (query parameter)

  Return events created before this time (exclusive). Compared against the event's `processed_at` value.

- `createdAtLte?: optional \Datetime` (query parameter)

  Return events created at or before this time (inclusive). Compared against the event's `processed_at` value.

- `limit?: optional int` (query parameter)

- `order?: optional Order` (query parameter)

  Sort direction for results, ordered by the event's `processed_at`. Defaults to `asc` (chronological).

- `page?: optional string` (query parameter)

  Opaque pagination cursor from a previous response's `next_page`.

- `types?: optional list<ManagedAgentsSessionEventType>` (query parameter)

  Filter by event type. Values match the `type` field on returned events (for example, `user.message` or `agent.tool_use`). Omit to return all event types.

- `betas?: optional list<AnthropicBeta>` (header parameter)

  This endpoint is in beta: requests must send `managed-agents-2026-04-01` in this header.

- `workspaceID?: optional string` (header parameter)

  Optional header to select the Workspace for this request. The value is a Workspace ID (for example, `wrkspc_011CZkZaBF1tNoB5wlCeusgy`).

  Only needed for credentials that can act on more than one Workspace. A credential that belongs to a specific Workspace may omit it; if sent, it must match that Workspace.

### Returns

- `class ManagedAgentsSessionEvent`

  - `class ManagedAgentsUserMessageEvent`

    - `"user.message" 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 ManagedAgentsUserInterruptEvent`

    - `"user.interrupt" 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 ManagedAgentsUserToolConfirmationEvent`

    - `"user.tool_confirmation" 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](https://platform.claude.com/docs/en/api/beta/sessions/events/list?sdk_languages=php#beta_managed_agents_session_requires_action.event_ids) `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 ManagedAgentsUserCustomToolResultEvent`

    - `"user.custom_tool_result" 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](https://platform.claude.com/docs/en/api/beta/sessions/events/list?sdk_languages=php#beta_managed_agents_session_requires_action.event_ids) `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 ManagedAgentsAgentCustomToolUseEvent`

    - `"agent.custom_tool_use" 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.

  - `class ManagedAgentsAgentMessageEvent`

    - `"agent.message" 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`

    - `"agent.thinking" type`

    - `string id`

      Unique identifier for this event.

    - `\Datetime processedAt`

      Timestamp when this thinking was produced.

  - `class ManagedAgentsAgentMCPToolUseEvent`

    - `"agent.mcp_tool_use" 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.

    - `?ManagedAgentsAgentEvaluatedPermission evaluatedPermission`

      The evaluated permission policy for this tool invocation.

    - `?ManagedAgentsAgentToolEvaluation evaluation`

      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 ManagedAgentsAgentMCPToolResultEvent`

    - `"agent.mcp_tool_result" 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 ManagedAgentsAgentToolUseEvent`

    - `"agent.tool_use" 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.

    - `?ManagedAgentsAgentEvaluatedPermission evaluatedPermission`

      The evaluated permission policy for this tool invocation.

    - `?ManagedAgentsAgentToolEvaluation evaluation`

      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 ManagedAgentsAgentToolResultEvent`

    - `"agent.tool_result" 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 ManagedAgentsAgentThreadMessageReceivedEvent`

    - `"agent.thread_message_received" 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`

    - `"agent.thread_message_sent" 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.

  - `class ManagedAgentsAgentThreadContextCompactedEvent`

    - `"agent.thread_context_compacted" type`

    - `string id`

      Unique identifier for this event.

    - `\Datetime processedAt`

      Timestamp when compaction was processed.

  - `class ManagedAgentsSessionErrorEvent`

    - `"session.error" type`

    - `string id`

      Unique identifier for this event.

    - `Error error`

    - `\Datetime processedAt`

      Timestamp when the error occurred.

  - `class ManagedAgentsSessionStatusRescheduledEvent`

    - `"session.status_rescheduled" type`

    - `string id`

      Unique identifier for this event.

    - `\Datetime processedAt`

      Timestamp of status change.

  - `class ManagedAgentsSessionStatusRunningEvent`

    - `"session.status_running" type`

    - `string id`

      Unique identifier for this event.

    - `\Datetime processedAt`

      Timestamp of status change.

  - `class ManagedAgentsSessionStatusIdleEvent`

    - `"session.status_idle" type`

    - `string id`

      Unique identifier for this event.

    - `\Datetime processedAt`

      Timestamp of status change.

    - `?ManagedAgentsSessionRefusalStopDetails stopDetails`

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

    - `StopReason stopReason`

  - `class ManagedAgentsSessionStatusTerminatedEvent`

    - `"session.status_terminated" type`

    - `string id`

      Unique identifier for this event.

    - `\Datetime processedAt`

      Timestamp of status change.

  - `class ManagedAgentsSessionThreadCreatedEvent`

    - `"session.thread_created" 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 ManagedAgentsSpanOutcomeEvaluationStartEvent`

    - `"span.outcome_evaluation_start" 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.

  - `class ManagedAgentsSpanOutcomeEvaluationEndEvent`

    - `"span.outcome_evaluation_end" 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.

    - `ManagedAgentsSpanModelUsage usage`

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

  - `class ManagedAgentsSpanModelRequestStartEvent`

    - `"span.model_request_start" type`

    - `string id`

      Unique identifier for this event.

    - `\Datetime processedAt`

      Timestamp when the model request started.

  - `class ManagedAgentsSpanModelRequestEndEvent`

    - `"span.model_request_end" 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.

    - `ManagedAgentsSpanModelUsage modelUsage`

      Token usage for this model request.

    - `\Datetime processedAt`

      Timestamp when the model request completed.

  - `class ManagedAgentsSpanOutcomeEvaluationOngoingEvent`

    - `"span.outcome_evaluation_ongoing" 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 ManagedAgentsUserDefineOutcomeEvent`

    - `"user.define_outcome" 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 ManagedAgentsSessionDeletedEvent`

    - `"session.deleted" type`

    - `string id`

      Unique identifier for this event.

    - `\Datetime processedAt`

      Timestamp when the session was deleted.

  - `class ManagedAgentsSessionThreadStatusRunningEvent`

    - `"session.thread_status_running" 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 ManagedAgentsSessionThreadStatusIdleEvent`

    - `"session.thread_status_idle" 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.

    - `?ManagedAgentsSessionRefusalStopDetails stopDetails`

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

    - `StopReason stopReason`

  - `class ManagedAgentsSessionThreadStatusTerminatedEvent`

    - `"session.thread_status_terminated" 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 BetaManagedAgentsUserToolResultEvent`

    - `"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](https://platform.claude.com/docs/en/api/beta/sessions/events/list?sdk_languages=php#beta_managed_agents_session_requires_action.event_ids) `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 ManagedAgentsSessionThreadStatusRescheduledEvent`

    - `"session.thread_status_rescheduled" 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 BetaManagedAgentsSessionUpdatedEvent`

    - `"session.updated" type`

    - `string id`

      Unique identifier for this event.

    - `\Datetime processedAt`

      Timestamp when the update was applied.

    - `?BetaManagedAgentsSessionAgent agent`

      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.

    - `?BetaManagedAgentsBudgetLimit budget`

      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 BetaManagedAgentsSystemMessageEvent`

    - `"system.message" type`

    - `string id`

      Unique identifier for this event.

    - `list<BetaManagedAgentsSystemContentBlock> content`

      System content blocks. Text-only.

    - `?\Datetime processedAt`

      Timestamp when this system message was processed.

  - `class BetaManagedAgentsSessionUsageEvent`

    - `"session.usage" type`

    - `string id`

      Unique identifier for this event.

    - `\Datetime processedAt`

      Timestamp when the snapshot was taken.

    - `ManagedAgentsSessionUsageSnapshot usage`

      The session's cumulative usage at the snapshot time.

    - `?BetaManagedAgentsBudgetLimit budget`

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

  - `class ManagedAgentsWorkflowRunCreatedEvent`

    - `"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.

    - `list<ManagedAgentsWorkflowRunPhase> phases`

      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.

  - `class ManagedAgentsWorkflowRunStatusEndedEvent`

    - `"workflow_run.status_ended" type`

    - `string id`

      Unique identifier for this event.

    - `\Datetime processedAt`

      Timestamp when this event was processed.

    - `ManagedAgentsWorkflowRunResult result`

      How the run ended.

    - `string workflowRunID`

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

  - `class ManagedAgentsWorkflowRunPhaseStartedEvent`

    - `"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.

  - `class ManagedAgentsWorkflowRunPhaseEndedEvent`

    - `"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 ManagedAgentsWorkflowRunStatusRunningEvent`

    - `"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.

  - `class ManagedAgentsWorkflowRunStatusIdleEvent`

    - `"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 ManagedAgentsWorkflowRunErrorEvent`

    - `"workflow_run.error" type`

    - `string id`

      Unique identifier for this event.

    - `ManagedAgentsWorkflowRunError error`

      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.

### Example

```php
<?php

require_once dirname(__DIR__) . '/vendor/autoload.php';

use Anthropic\Client;
use Anthropic\Beta\AnthropicBeta;
use Anthropic\Beta\Sessions\Events\ManagedAgentsSessionEventType;

$client = new Client(apiKey: 'my-anthropic-api-key');

$page = $client->beta->sessions->events->list(
  'sesn_011CZkZAtmR3yMPDzynEDxu7',
  createdAtGt: new \DateTimeImmutable('2019-12-27T18:11:19.117Z'),
  createdAtGte: new \DateTimeImmutable('2019-12-27T18:11:19.117Z'),
  createdAtLt: new \DateTimeImmutable('2019-12-27T18:11:19.117Z'),
  createdAtLte: new \DateTimeImmutable('2019-12-27T18:11:19.117Z'),
  limit: 0,
  order: 'asc',
  page: 'page',
  types: [ManagedAgentsSessionEventType::USER_MESSAGE],
  betas: [AnthropicBeta::MESSAGE_BATCHES_2024_09_24],
  workspaceID: 'wrkspc_011CZkZaBF1tNoB5wlCeusgy',
);

var_dump($page);
```

#### Response (200)

```json
{
  "data": [
    {
      "id": "sevt_011CZkZGPp1iBcp4kaQSihUm",
      "content": [
        {
          "text": "Where is my order #1234?",
          "type": "text"
        }
      ],
      "type": "user.message",
      "processed_at": "2026-03-15T10:00:00Z"
    },
    {
      "id": "sevt_011CZkZHPq1jCdq5mbRTjiVn",
      "content": [
        {
          "text": "Let me look up order #1234 for you.",
          "type": "text"
        }
      ],
      "processed_at": "2026-03-15T10:00:00Z",
      "type": "agent.message"
    }
  ],
  "next_page": "page_MjAyNS0wNS0xNFQwMDowMDowMFo="
}
```

## Send Events

`$client->beta->sessions->events->send(string sessionID, list<ManagedAgentsEventParams> events, ?list<AnthropicBeta> betas, ?string workspaceID): ManagedAgentsSendSessionEvents`

**POST** `/v1/sessions/{session_id}/events`

Send Events

### Parameters

- `sessionID: string` (path parameter)

- `events: list<ManagedAgentsEventParams>`

  Events to send to the `session`.

- `betas?: optional list<AnthropicBeta>` (header parameter)

  This endpoint is in beta: requests must send `managed-agents-2026-04-01` in this header.

- `workspaceID?: optional string` (header parameter)

  Optional header to select the Workspace for this request. The value is a Workspace ID (for example, `wrkspc_011CZkZaBF1tNoB5wlCeusgy`).

  Only needed for credentials that can act on more than one Workspace. A credential that belongs to a specific Workspace may omit it; if sent, it must match that Workspace.

### Returns

- `class ManagedAgentsSendSessionEvents`

  - `?list<Data> data`

    Sent events

### Example

```php
<?php

require_once dirname(__DIR__) . '/vendor/autoload.php';

use Anthropic\Client;
use Anthropic\Beta\AnthropicBeta;

$client = new Client(apiKey: 'my-anthropic-api-key');

$betaManagedAgentsSendSessionEvents = $client->beta->sessions->events->send(
  'sesn_011CZkZAtmR3yMPDzynEDxu7',
  events: [
    [
      'content' => [['text' => 'Where is my order #1234?', 'type' => 'text']],
      'type' => 'user.message',
    ],
  ],
  betas: [AnthropicBeta::MESSAGE_BATCHES_2024_09_24],
  workspaceID: 'wrkspc_011CZkZaBF1tNoB5wlCeusgy',
);

var_dump($betaManagedAgentsSendSessionEvents);
```

#### Response (200)

```json
{
  "data": [
    {
      "id": "sevt_011CZkZGPp1iBcp4kaQSihUm",
      "content": [
        {
          "text": "Where is my order #1234?",
          "type": "text"
        }
      ],
      "type": "user.message",
      "processed_at": "2026-03-15T10:00:00Z"
    }
  ]
}
```

## 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`

Stream Events

### Parameters

- `sessionID: string` (path parameter)

- `eventDeltas?: optional list<BetaManagedAgentsDeltaType>` (query parameter)

  When set, this connection also receives streaming deltas (`event_start`, `event_delta`) while an event is being produced, before the event itself arrives. Deltas are best-effort; when the final event is produced it carries the complete content. A model request that ends early (an error or interrupt) produces no final event — its terminal `span.model_request_end` closes the preview. Accepts one or more event types to preview and may be repeated: `agent.message` streams `content_delta` fragments; `agent.thinking` is start-only — a signal that the agent has begun extended thinking, concluded by the `agent.thinking` event itself. Only previews of the requested event types are sent.

- `betas?: optional list<AnthropicBeta>` (header parameter)

  This endpoint is in beta: requests must send `managed-agents-2026-04-01` in this header.

- `workspaceID?: optional string` (header parameter)

  Optional header to select the Workspace for this request. The value is a Workspace ID (for example, `wrkspc_011CZkZaBF1tNoB5wlCeusgy`).

  Only needed for credentials that can act on more than one Workspace. A credential that belongs to a specific Workspace may omit it; if sent, it must match that Workspace.

### Returns

- `class ManagedAgentsStreamSessionEvents`

  - `class ManagedAgentsUserMessageEvent`

    - `"user.message" 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 ManagedAgentsUserInterruptEvent`

    - `"user.interrupt" 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 ManagedAgentsUserToolConfirmationEvent`

    - `"user.tool_confirmation" 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](https://platform.claude.com/docs/en/api/beta/sessions/events/list?sdk_languages=php#beta_managed_agents_session_requires_action.event_ids) `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 ManagedAgentsUserCustomToolResultEvent`

    - `"user.custom_tool_result" 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](https://platform.claude.com/docs/en/api/beta/sessions/events/list?sdk_languages=php#beta_managed_agents_session_requires_action.event_ids) `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 ManagedAgentsAgentCustomToolUseEvent`

    - `"agent.custom_tool_use" 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.

  - `class ManagedAgentsAgentMessageEvent`

    - `"agent.message" 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`

    - `"agent.thinking" type`

    - `string id`

      Unique identifier for this event.

    - `\Datetime processedAt`

      Timestamp when this thinking was produced.

  - `class ManagedAgentsAgentMCPToolUseEvent`

    - `"agent.mcp_tool_use" 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.

    - `?ManagedAgentsAgentEvaluatedPermission evaluatedPermission`

      The evaluated permission policy for this tool invocation.

    - `?ManagedAgentsAgentToolEvaluation evaluation`

      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 ManagedAgentsAgentMCPToolResultEvent`

    - `"agent.mcp_tool_result" 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 ManagedAgentsAgentToolUseEvent`

    - `"agent.tool_use" 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.

    - `?ManagedAgentsAgentEvaluatedPermission evaluatedPermission`

      The evaluated permission policy for this tool invocation.

    - `?ManagedAgentsAgentToolEvaluation evaluation`

      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 ManagedAgentsAgentToolResultEvent`

    - `"agent.tool_result" 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 ManagedAgentsAgentThreadMessageReceivedEvent`

    - `"agent.thread_message_received" 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`

    - `"agent.thread_message_sent" 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.

  - `class ManagedAgentsAgentThreadContextCompactedEvent`

    - `"agent.thread_context_compacted" type`

    - `string id`

      Unique identifier for this event.

    - `\Datetime processedAt`

      Timestamp when compaction was processed.

  - `class ManagedAgentsSessionErrorEvent`

    - `"session.error" type`

    - `string id`

      Unique identifier for this event.

    - `Error error`

    - `\Datetime processedAt`

      Timestamp when the error occurred.

  - `class ManagedAgentsSessionStatusRescheduledEvent`

    - `"session.status_rescheduled" type`

    - `string id`

      Unique identifier for this event.

    - `\Datetime processedAt`

      Timestamp of status change.

  - `class ManagedAgentsSessionStatusRunningEvent`

    - `"session.status_running" type`

    - `string id`

      Unique identifier for this event.

    - `\Datetime processedAt`

      Timestamp of status change.

  - `class ManagedAgentsSessionStatusIdleEvent`

    - `"session.status_idle" type`

    - `string id`

      Unique identifier for this event.

    - `\Datetime processedAt`

      Timestamp of status change.

    - `?ManagedAgentsSessionRefusalStopDetails stopDetails`

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

    - `StopReason stopReason`

  - `class ManagedAgentsSessionStatusTerminatedEvent`

    - `"session.status_terminated" type`

    - `string id`

      Unique identifier for this event.

    - `\Datetime processedAt`

      Timestamp of status change.

  - `class ManagedAgentsSessionThreadCreatedEvent`

    - `"session.thread_created" 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 ManagedAgentsSpanOutcomeEvaluationStartEvent`

    - `"span.outcome_evaluation_start" 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.

  - `class ManagedAgentsSpanOutcomeEvaluationEndEvent`

    - `"span.outcome_evaluation_end" 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.

    - `ManagedAgentsSpanModelUsage usage`

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

  - `class ManagedAgentsSpanModelRequestStartEvent`

    - `"span.model_request_start" type`

    - `string id`

      Unique identifier for this event.

    - `\Datetime processedAt`

      Timestamp when the model request started.

  - `class ManagedAgentsSpanModelRequestEndEvent`

    - `"span.model_request_end" 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.

    - `ManagedAgentsSpanModelUsage modelUsage`

      Token usage for this model request.

    - `\Datetime processedAt`

      Timestamp when the model request completed.

  - `class ManagedAgentsSpanOutcomeEvaluationOngoingEvent`

    - `"span.outcome_evaluation_ongoing" 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 ManagedAgentsUserDefineOutcomeEvent`

    - `"user.define_outcome" 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 ManagedAgentsSessionDeletedEvent`

    - `"session.deleted" type`

    - `string id`

      Unique identifier for this event.

    - `\Datetime processedAt`

      Timestamp when the session was deleted.

  - `class ManagedAgentsSessionThreadStatusRunningEvent`

    - `"session.thread_status_running" 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 ManagedAgentsSessionThreadStatusIdleEvent`

    - `"session.thread_status_idle" 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.

    - `?ManagedAgentsSessionRefusalStopDetails stopDetails`

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

    - `StopReason stopReason`

  - `class ManagedAgentsSessionThreadStatusTerminatedEvent`

    - `"session.thread_status_terminated" 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 BetaManagedAgentsUserToolResultEvent`

    - `"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](https://platform.claude.com/docs/en/api/beta/sessions/events/list?sdk_languages=php#beta_managed_agents_session_requires_action.event_ids) `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 ManagedAgentsSessionThreadStatusRescheduledEvent`

    - `"session.thread_status_rescheduled" 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 BetaManagedAgentsSessionUpdatedEvent`

    - `"session.updated" type`

    - `string id`

      Unique identifier for this event.

    - `\Datetime processedAt`

      Timestamp when the update was applied.

    - `?BetaManagedAgentsSessionAgent agent`

      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.

    - `?BetaManagedAgentsBudgetLimit budget`

      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 BetaManagedAgentsStartEvent`

    - `"event_start" type`

    - `BetaManagedAgentsStartEventPreview event`

      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.

  - `class BetaManagedAgentsDeltaEvent`

    - `"event_delta" type`

    - `BetaManagedAgentsDeltaContent delta`

      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.

  - `class BetaManagedAgentsSystemMessageEvent`

    - `"system.message" type`

    - `string id`

      Unique identifier for this event.

    - `list<BetaManagedAgentsSystemContentBlock> content`

      System content blocks. Text-only.

    - `?\Datetime processedAt`

      Timestamp when this system message was processed.

  - `class BetaManagedAgentsSessionUsageEvent`

    - `"session.usage" type`

    - `string id`

      Unique identifier for this event.

    - `\Datetime processedAt`

      Timestamp when the snapshot was taken.

    - `ManagedAgentsSessionUsageSnapshot usage`

      The session's cumulative usage at the snapshot time.

    - `?BetaManagedAgentsBudgetLimit budget`

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

  - `class ManagedAgentsWorkflowRunCreatedEvent`

    - `"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.

    - `list<ManagedAgentsWorkflowRunPhase> phases`

      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.

  - `class ManagedAgentsWorkflowRunStatusEndedEvent`

    - `"workflow_run.status_ended" type`

    - `string id`

      Unique identifier for this event.

    - `\Datetime processedAt`

      Timestamp when this event was processed.

    - `ManagedAgentsWorkflowRunResult result`

      How the run ended.

    - `string workflowRunID`

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

  - `class ManagedAgentsWorkflowRunPhaseStartedEvent`

    - `"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.

  - `class ManagedAgentsWorkflowRunPhaseEndedEvent`

    - `"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 ManagedAgentsWorkflowRunStatusRunningEvent`

    - `"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.

  - `class ManagedAgentsWorkflowRunStatusIdleEvent`

    - `"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 ManagedAgentsWorkflowRunErrorEvent`

    - `"workflow_run.error" type`

    - `string id`

      Unique identifier for this event.

    - `ManagedAgentsWorkflowRunError error`

      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.

### Example

```php
<?php

require_once dirname(__DIR__) . '/vendor/autoload.php';

use Anthropic\Client;
use Anthropic\Beta\AnthropicBeta;
use Anthropic\Beta\Sessions\BetaManagedAgentsDeltaType;

$client = new Client(apiKey: 'my-anthropic-api-key');

$betaManagedAgentsStreamSessionEvents = $client
  ->beta
  ->sessions
  ->events
  ->streamStream(
  'sesn_011CZkZAtmR3yMPDzynEDxu7',
  eventDeltas: [BetaManagedAgentsDeltaType::AGENT_MESSAGE],
  betas: [AnthropicBeta::MESSAGE_BATCHES_2024_09_24],
  workspaceID: 'wrkspc_011CZkZaBF1tNoB5wlCeusgy',
);

var_dump($betaManagedAgentsStreamSessionEvents);
```

#### Response (200)

```json
{
  "id": "sevt_011CZkZGPp1iBcp4kaQSihUm",
  "content": [
    {
      "text": "Where is my order #1234?",
      "type": "text"
    }
  ],
  "type": "user.message",
  "processed_at": "2026-03-15T10:00:00Z"
}
```

## Domain types

### Beta Managed Agents Agent Auto Evaluated Permission

- `class ManagedAgentsAgentAutoEvaluatedPermission`

  - `class ManagedAgentsAgentAutoEvaluatedPermissionAllow`

    - `"allow" type`

  - `class ManagedAgentsAgentAutoEvaluatedPermissionAsk`

    - `"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`

    - `"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.

### Beta Managed Agents Agent Auto Evaluated Permission Allow

- `class ManagedAgentsAgentAutoEvaluatedPermissionAllow`

  - `"allow" type`

### Beta Managed Agents Agent Auto Evaluated Permission Ask

- `class ManagedAgentsAgentAutoEvaluatedPermissionAsk`

  - `"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.

### Beta Managed Agents Agent Auto Evaluated Permission Deny

- `class ManagedAgentsAgentAutoEvaluatedPermissionDeny`

  - `"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.

### Beta Managed Agents Agent Custom Tool Use Event

- `class ManagedAgentsAgentCustomToolUseEvent`

  - `"agent.custom_tool_use" 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.

### Beta Managed Agents Agent Evaluated Permission

- `enum ManagedAgentsAgentEvaluatedPermission`

  - `"allow"`

  - `"ask"`

  - `"deny"`

### Beta Managed Agents Agent MCP Tool Result Event

- `class ManagedAgentsAgentMCPToolResultEvent`

  - `"agent.mcp_tool_result" 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.

### Beta Managed Agents Agent MCP Tool Use Event

- `class ManagedAgentsAgentMCPToolUseEvent`

  - `"agent.mcp_tool_use" 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.

  - `?ManagedAgentsAgentEvaluatedPermission evaluatedPermission`

    The evaluated permission policy for this tool invocation.

  - `?ManagedAgentsAgentToolEvaluation evaluation`

    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.

### Beta Managed Agents Agent Message Event

- `class ManagedAgentsAgentMessageEvent`

  - `"agent.message" 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.

### Beta Managed Agents Agent Thinking Event

- `class ManagedAgentsAgentThinkingEvent`

  - `"agent.thinking" type`

  - `string id`

    Unique identifier for this event.

  - `\Datetime processedAt`

    Timestamp when this thinking was produced.

### Beta Managed Agents Agent Thread Context Compacted Event

- `class ManagedAgentsAgentThreadContextCompactedEvent`

  - `"agent.thread_context_compacted" type`

  - `string id`

    Unique identifier for this event.

  - `\Datetime processedAt`

    Timestamp when compaction was processed.

### Beta Managed Agents Agent Thread Message Received Event

- `class ManagedAgentsAgentThreadMessageReceivedEvent`

  - `"agent.thread_message_received" 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.

### Beta Managed Agents Agent Thread Message Sent Event

- `class ManagedAgentsAgentThreadMessageSentEvent`

  - `"agent.thread_message_sent" 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.

### Beta Managed Agents Agent Tool Evaluation

- `class ManagedAgentsAgentToolEvaluation`

  - `class ManagedAgentsAgentToolEvaluationAlwaysAllow`

    - `"always_allow" type`

  - `class ManagedAgentsAgentToolEvaluationAlwaysAsk`

    - `"always_ask" type`

  - `class ManagedAgentsAgentToolEvaluationAuto`

    - `"auto" type`

    - `ManagedAgentsAgentAutoEvaluatedPermission evaluatedPermission`

      The server's judgement for this invocation.

### Beta Managed Agents Agent Tool Evaluation Always Allow

- `class ManagedAgentsAgentToolEvaluationAlwaysAllow`

  - `"always_allow" type`

### Beta Managed Agents Agent Tool Evaluation Always Ask

- `class ManagedAgentsAgentToolEvaluationAlwaysAsk`

  - `"always_ask" type`

### Beta Managed Agents Agent Tool Evaluation Auto

- `class ManagedAgentsAgentToolEvaluationAuto`

  - `"auto" type`

  - `ManagedAgentsAgentAutoEvaluatedPermission evaluatedPermission`

    The server's judgement for this invocation.

### Beta Managed Agents Agent Tool Result Event

- `class ManagedAgentsAgentToolResultEvent`

  - `"agent.tool_result" 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.

### Beta Managed Agents Agent Tool Use Event

- `class ManagedAgentsAgentToolUseEvent`

  - `"agent.tool_use" 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.

  - `?ManagedAgentsAgentEvaluatedPermission evaluatedPermission`

    The evaluated permission policy for this tool invocation.

  - `?ManagedAgentsAgentToolEvaluation evaluation`

    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.

### Beta Managed Agents Base64 Document Source

- `class ManagedAgentsBase64DocumentSource`

  - `"base64" type`

  - `string data`

    Base64-encoded document data.

  - `string mediaType`

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

### Beta Managed Agents Base64 Image Source

- `class ManagedAgentsBase64ImageSource`

  - `"base64" type`

  - `string data`

    Base64-encoded image data.

  - `string mediaType`

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

### Beta Managed Agents Billing Error

- `class ManagedAgentsBillingError`

  - `"billing_error" type`

  - `string message`

    Human-readable error description.

  - `RetryStatus retryStatus`

    What the client should do next.

### Beta Managed Agents Compaction Limit Reached Error

- `class ManagedAgentsCompactionLimitReachedError`

  - `"compaction_limit_reached_error" type`

  - `string message`

    Human-readable error description.

  - `RetryStatus retryStatus`

    What the client should do next.

### Beta Managed Agents Credential Host Unreachable Error

- `class ManagedAgentsCredentialHostUnreachableError`

  - `"credential_host_unreachable_error" 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.

### Beta Managed Agents Document Block

- `class ManagedAgentsDocumentBlock`

  - `"document" 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.

### Beta Managed Agents Event Params

- `class ManagedAgentsEventParams`

  - `class ManagedAgentsUserMessageEventParams`

    - `"user.message" type`

    - `list<Content> content`

      Array of content blocks for the user message.

  - `class ManagedAgentsUserInterruptEventParams`

    - `"user.interrupt" 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 ManagedAgentsUserToolConfirmationEventParams`

    - `"user.tool_confirmation" 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](https://platform.claude.com/docs/en/api/beta/sessions/events/list?sdk_languages=php#beta_managed_agents_session_requires_action.event_ids) `stop_reason.event_ids` field.

    - `?string denyMessage`

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

  - `class ManagedAgentsUserCustomToolResultEventParams`

    - `"user.custom_tool_result" 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](https://platform.claude.com/docs/en/api/beta/sessions/events/list?sdk_languages=php#beta_managed_agents_session_requires_action.event_ids) `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 ManagedAgentsUserDefineOutcomeEventParams`

    - `"user.define_outcome" 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 ManagedAgentsUserToolResultEventParams`

    - `"user.tool_result" 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](https://platform.claude.com/docs/en/api/beta/sessions/events/list?sdk_languages=php#beta_managed_agents_session_requires_action.event_ids) `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 ManagedAgentsSystemMessageEventParams`

    - `"system.message" type`

    - `list<BetaManagedAgentsSystemContentBlock> content`

      System content blocks to append. Text-only.

### Beta Managed Agents File Document Source

- `class ManagedAgentsFileDocumentSource`

  - `"file" type`

  - `string fileID`

    ID of a previously uploaded file.

### Beta Managed Agents File Image Source

- `class ManagedAgentsFileImageSource`

  - `"file" type`

  - `string fileID`

    ID of a previously uploaded file.

### Beta Managed Agents File Rubric

- `class ManagedAgentsFileRubric`

  - `"file" type`

  - `string fileID`

    ID of the rubric file.

### Beta Managed Agents File Rubric Params

- `class ManagedAgentsFileRubricParams`

  - `"file" type`

  - `string fileID`

    ID of the rubric file.

### Beta Managed Agents Image Block

- `class ManagedAgentsImageBlock`

  - `"image" type`

  - `Source source`

    The source of the image data.

### Beta Managed Agents Max Workflow Runs Workflow Run Error

- `class ManagedAgentsMaxWorkflowRunsWorkflowRunError`

  - `"max_workflow_runs_error" type`

  - `string message`

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

### Beta Managed Agents MCP Authentication Failed Error

- `class ManagedAgentsMCPAuthenticationFailedError`

  - `"mcp_authentication_failed_error" 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.

### Beta Managed Agents MCP Connection Failed Error

- `class ManagedAgentsMCPConnectionFailedError`

  - `"mcp_connection_failed_error" 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.

### Beta Managed Agents Model Overloaded Error

- `class ManagedAgentsModelOverloadedError`

  - `"model_overloaded_error" type`

  - `string message`

    Human-readable error description.

  - `RetryStatus retryStatus`

    What the client should do next.

### Beta Managed Agents Model Rate Limited Error

- `class ManagedAgentsModelRateLimitedError`

  - `"model_rate_limited_error" type`

  - `string message`

    Human-readable error description.

  - `RetryStatus retryStatus`

    What the client should do next.

### Beta Managed Agents Model Request Failed Error

- `class ManagedAgentsModelRequestFailedError`

  - `"model_request_failed_error" type`

  - `string message`

    Human-readable error description.

  - `RetryStatus retryStatus`

    What the client should do next.

### Beta Managed Agents Plain Text Document Source

- `class ManagedAgentsPlainTextDocumentSource`

  - `"text" type`

  - `string data`

    The plain text content.

  - `"text/plain" mediaType`

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

### Beta Managed Agents Program Workflow Run Error

- `class ManagedAgentsProgramWorkflowRunError`

  - `"program_error" type`

  - `string message`

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

### Beta Managed Agents Redacted Block

- `class ManagedAgentsRedactedBlock`

  - `"redacted" type`

### Beta Managed Agents Repository Authentication Error

- `class ManagedAgentsRepositoryAuthenticationError`

  - `"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.

### Beta Managed Agents Repository Checkout Error

- `class ManagedAgentsRepositoryCheckoutError`

  - `"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.

### Beta Managed Agents Repository Clone Error

- `class ManagedAgentsRepositoryCloneError`

  - `"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.

### Beta Managed Agents Repository Forbidden Error

- `class ManagedAgentsRepositoryForbiddenError`

  - `"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.

### Beta Managed Agents Repository Not Found Error

- `class ManagedAgentsRepositoryNotFoundError`

  - `"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.

### Beta Managed Agents Retry Status Exhausted

- `class ManagedAgentsRetryStatusExhausted`

  - `"exhausted" type`

### Beta Managed Agents Retry Status Retrying

- `class ManagedAgentsRetryStatusRetrying`

  - `"retrying" type`

### Beta Managed Agents Retry Status Terminal

- `class ManagedAgentsRetryStatusTerminal`

  - `"terminal" type`

### Beta Managed Agents Search Result Block

- `class ManagedAgentsSearchResultBlock`

  - `"search_result" type`

  - `ManagedAgentsSearchResultCitations citations`

    Citation settings for this search result.

  - `list<ManagedAgentsSearchResultContent> content`

    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.

### Beta Managed Agents Search Result Citations

- `class ManagedAgentsSearchResultCitations`

  - `bool enabled`

    Whether citations are enabled for this search result.

### Beta Managed Agents Search Result Content

- `class ManagedAgentsSearchResultContent`

  - `"text" type`

  - `string text`

    The text content.

### Beta Managed Agents Send Session Events

- `class ManagedAgentsSendSessionEvents`

  - `?list<Data> data`

    Sent events

### Beta Managed Agents Session Budget Reached

- `class ManagedAgentsSessionBudgetReached`

  - `"budget_reached" type`

### Beta Managed Agents Session Deleted Event

- `class ManagedAgentsSessionDeletedEvent`

  - `"session.deleted" type`

  - `string id`

    Unique identifier for this event.

  - `\Datetime processedAt`

    Timestamp when the session was deleted.

### Beta Managed Agents Session End Turn

- `class ManagedAgentsSessionEndTurn`

  - `"end_turn" type`

### Beta Managed Agents Session Error Event

- `class ManagedAgentsSessionErrorEvent`

  - `"session.error" type`

  - `string id`

    Unique identifier for this event.

  - `Error error`

  - `\Datetime processedAt`

    Timestamp when the error occurred.

### Beta Managed Agents Session Event

- `class ManagedAgentsSessionEvent`

  - `class ManagedAgentsUserMessageEvent`

    - `"user.message" 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 ManagedAgentsUserInterruptEvent`

    - `"user.interrupt" 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 ManagedAgentsUserToolConfirmationEvent`

    - `"user.tool_confirmation" 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](https://platform.claude.com/docs/en/api/beta/sessions/events/list?sdk_languages=php#beta_managed_agents_session_requires_action.event_ids) `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 ManagedAgentsUserCustomToolResultEvent`

    - `"user.custom_tool_result" 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](https://platform.claude.com/docs/en/api/beta/sessions/events/list?sdk_languages=php#beta_managed_agents_session_requires_action.event_ids) `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 ManagedAgentsAgentCustomToolUseEvent`

    - `"agent.custom_tool_use" 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.

  - `class ManagedAgentsAgentMessageEvent`

    - `"agent.message" 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`

    - `"agent.thinking" type`

    - `string id`

      Unique identifier for this event.

    - `\Datetime processedAt`

      Timestamp when this thinking was produced.

  - `class ManagedAgentsAgentMCPToolUseEvent`

    - `"agent.mcp_tool_use" 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.

    - `?ManagedAgentsAgentEvaluatedPermission evaluatedPermission`

      The evaluated permission policy for this tool invocation.

    - `?ManagedAgentsAgentToolEvaluation evaluation`

      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 ManagedAgentsAgentMCPToolResultEvent`

    - `"agent.mcp_tool_result" 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 ManagedAgentsAgentToolUseEvent`

    - `"agent.tool_use" 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.

    - `?ManagedAgentsAgentEvaluatedPermission evaluatedPermission`

      The evaluated permission policy for this tool invocation.

    - `?ManagedAgentsAgentToolEvaluation evaluation`

      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 ManagedAgentsAgentToolResultEvent`

    - `"agent.tool_result" 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 ManagedAgentsAgentThreadMessageReceivedEvent`

    - `"agent.thread_message_received" 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`

    - `"agent.thread_message_sent" 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.

  - `class ManagedAgentsAgentThreadContextCompactedEvent`

    - `"agent.thread_context_compacted" type`

    - `string id`

      Unique identifier for this event.

    - `\Datetime processedAt`

      Timestamp when compaction was processed.

  - `class ManagedAgentsSessionErrorEvent`

    - `"session.error" type`

    - `string id`

      Unique identifier for this event.

    - `Error error`

    - `\Datetime processedAt`

      Timestamp when the error occurred.

  - `class ManagedAgentsSessionStatusRescheduledEvent`

    - `"session.status_rescheduled" type`

    - `string id`

      Unique identifier for this event.

    - `\Datetime processedAt`

      Timestamp of status change.

  - `class ManagedAgentsSessionStatusRunningEvent`

    - `"session.status_running" type`

    - `string id`

      Unique identifier for this event.

    - `\Datetime processedAt`

      Timestamp of status change.

  - `class ManagedAgentsSessionStatusIdleEvent`

    - `"session.status_idle" type`

    - `string id`

      Unique identifier for this event.

    - `\Datetime processedAt`

      Timestamp of status change.

    - `?ManagedAgentsSessionRefusalStopDetails stopDetails`

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

    - `StopReason stopReason`

  - `class ManagedAgentsSessionStatusTerminatedEvent`

    - `"session.status_terminated" type`

    - `string id`

      Unique identifier for this event.

    - `\Datetime processedAt`

      Timestamp of status change.

  - `class ManagedAgentsSessionThreadCreatedEvent`

    - `"session.thread_created" 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 ManagedAgentsSpanOutcomeEvaluationStartEvent`

    - `"span.outcome_evaluation_start" 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.

  - `class ManagedAgentsSpanOutcomeEvaluationEndEvent`

    - `"span.outcome_evaluation_end" 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.

    - `ManagedAgentsSpanModelUsage usage`

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

  - `class ManagedAgentsSpanModelRequestStartEvent`

    - `"span.model_request_start" type`

    - `string id`

      Unique identifier for this event.

    - `\Datetime processedAt`

      Timestamp when the model request started.

  - `class ManagedAgentsSpanModelRequestEndEvent`

    - `"span.model_request_end" 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.

    - `ManagedAgentsSpanModelUsage modelUsage`

      Token usage for this model request.

    - `\Datetime processedAt`

      Timestamp when the model request completed.

  - `class ManagedAgentsSpanOutcomeEvaluationOngoingEvent`

    - `"span.outcome_evaluation_ongoing" 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 ManagedAgentsUserDefineOutcomeEvent`

    - `"user.define_outcome" 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 ManagedAgentsSessionDeletedEvent`

    - `"session.deleted" type`

    - `string id`

      Unique identifier for this event.

    - `\Datetime processedAt`

      Timestamp when the session was deleted.

  - `class ManagedAgentsSessionThreadStatusRunningEvent`

    - `"session.thread_status_running" 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 ManagedAgentsSessionThreadStatusIdleEvent`

    - `"session.thread_status_idle" 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.

    - `?ManagedAgentsSessionRefusalStopDetails stopDetails`

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

    - `StopReason stopReason`

  - `class ManagedAgentsSessionThreadStatusTerminatedEvent`

    - `"session.thread_status_terminated" 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 BetaManagedAgentsUserToolResultEvent`

    - `"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](https://platform.claude.com/docs/en/api/beta/sessions/events/list?sdk_languages=php#beta_managed_agents_session_requires_action.event_ids) `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 ManagedAgentsSessionThreadStatusRescheduledEvent`

    - `"session.thread_status_rescheduled" 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 BetaManagedAgentsSessionUpdatedEvent`

    - `"session.updated" type`

    - `string id`

      Unique identifier for this event.

    - `\Datetime processedAt`

      Timestamp when the update was applied.

    - `?BetaManagedAgentsSessionAgent agent`

      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.

    - `?BetaManagedAgentsBudgetLimit budget`

      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 BetaManagedAgentsSystemMessageEvent`

    - `"system.message" type`

    - `string id`

      Unique identifier for this event.

    - `list<BetaManagedAgentsSystemContentBlock> content`

      System content blocks. Text-only.

    - `?\Datetime processedAt`

      Timestamp when this system message was processed.

  - `class BetaManagedAgentsSessionUsageEvent`

    - `"session.usage" type`

    - `string id`

      Unique identifier for this event.

    - `\Datetime processedAt`

      Timestamp when the snapshot was taken.

    - `ManagedAgentsSessionUsageSnapshot usage`

      The session's cumulative usage at the snapshot time.

    - `?BetaManagedAgentsBudgetLimit budget`

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

  - `class ManagedAgentsWorkflowRunCreatedEvent`

    - `"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.

    - `list<ManagedAgentsWorkflowRunPhase> phases`

      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.

  - `class ManagedAgentsWorkflowRunStatusEndedEvent`

    - `"workflow_run.status_ended" type`

    - `string id`

      Unique identifier for this event.

    - `\Datetime processedAt`

      Timestamp when this event was processed.

    - `ManagedAgentsWorkflowRunResult result`

      How the run ended.

    - `string workflowRunID`

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

  - `class ManagedAgentsWorkflowRunPhaseStartedEvent`

    - `"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.

  - `class ManagedAgentsWorkflowRunPhaseEndedEvent`

    - `"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 ManagedAgentsWorkflowRunStatusRunningEvent`

    - `"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.

  - `class ManagedAgentsWorkflowRunStatusIdleEvent`

    - `"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 ManagedAgentsWorkflowRunErrorEvent`

    - `"workflow_run.error" type`

    - `string id`

      Unique identifier for this event.

    - `ManagedAgentsWorkflowRunError error`

      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.

### Beta Managed Agents Session Event Type

- `enum ManagedAgentsSessionEventType`

  - `"user.message"`

  - `"user.interrupt"`

  - `"user.tool_confirmation"`

  - `"user.custom_tool_result"`

  - `"agent.custom_tool_use"`

  - `"agent.message"`

  - `"agent.thinking"`

  - `"agent.mcp_tool_use"`

  - `"agent.mcp_tool_result"`

  - `"agent.tool_use"`

  - `"agent.tool_result"`

  - `"agent.thread_message_received"`

  - `"agent.thread_message_sent"`

  - `"agent.thread_context_compacted"`

  - `"session.error"`

  - `"session.status_rescheduled"`

  - `"session.status_running"`

  - `"session.status_idle"`

  - `"session.status_terminated"`

  - `"session.thread_created"`

  - `"span.outcome_evaluation_start"`

  - `"span.outcome_evaluation_end"`

  - `"span.model_request_start"`

  - `"span.model_request_end"`

  - `"span.outcome_evaluation_ongoing"`

  - `"user.define_outcome"`

  - `"session.thread_status_running"`

  - `"session.thread_status_idle"`

  - `"session.thread_status_terminated"`

  - `"user.tool_result"`

  - `"session.thread_status_rescheduled"`

  - `"session.updated"`

  - `"system.message"`

  - `"session.usage"`

  - `"workflow_run.created"`

  - `"workflow_run.status_running"`

  - `"workflow_run.status_idle"`

  - `"workflow_run.status_ended"`

  - `"workflow_run.error"`

  - `"workflow_run.phase_started"`

  - `"workflow_run.phase_ended"`

### Beta Managed Agents Session Refusal

- `class ManagedAgentsSessionRefusal`

  - `"refusal" type`

### Beta Managed Agents Session Refusal Stop Details

- `class ManagedAgentsSessionRefusalStopDetails`

  - `"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.

### Beta Managed Agents Session Requires Action

- `class ManagedAgentsSessionRequiresAction`

  - `"requires_action" 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.

### Beta Managed Agents Session Retries Exhausted

- `class ManagedAgentsSessionRetriesExhausted`

  - `"retries_exhausted" type`

### Beta Managed Agents Session Status Idle Event

- `class ManagedAgentsSessionStatusIdleEvent`

  - `"session.status_idle" type`

  - `string id`

    Unique identifier for this event.

  - `\Datetime processedAt`

    Timestamp of status change.

  - `?ManagedAgentsSessionRefusalStopDetails stopDetails`

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

  - `StopReason stopReason`

### Beta Managed Agents Session Status Rescheduled Event

- `class ManagedAgentsSessionStatusRescheduledEvent`

  - `"session.status_rescheduled" type`

  - `string id`

    Unique identifier for this event.

  - `\Datetime processedAt`

    Timestamp of status change.

### Beta Managed Agents Session Status Running Event

- `class ManagedAgentsSessionStatusRunningEvent`

  - `"session.status_running" type`

  - `string id`

    Unique identifier for this event.

  - `\Datetime processedAt`

    Timestamp of status change.

### Beta Managed Agents Session Status Terminated Event

- `class ManagedAgentsSessionStatusTerminatedEvent`

  - `"session.status_terminated" type`

  - `string id`

    Unique identifier for this event.

  - `\Datetime processedAt`

    Timestamp of status change.

### Beta Managed Agents Session Thread Created Event

- `class ManagedAgentsSessionThreadCreatedEvent`

  - `"session.thread_created" 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.

### Beta Managed Agents Session Thread Status Idle Event

- `class ManagedAgentsSessionThreadStatusIdleEvent`

  - `"session.thread_status_idle" 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.

  - `?ManagedAgentsSessionRefusalStopDetails stopDetails`

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

  - `StopReason stopReason`

### Beta Managed Agents Session Thread Status Rescheduled Event

- `class ManagedAgentsSessionThreadStatusRescheduledEvent`

  - `"session.thread_status_rescheduled" 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.

### Beta Managed Agents Session Thread Status Running Event

- `class ManagedAgentsSessionThreadStatusRunningEvent`

  - `"session.thread_status_running" 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.

### Beta Managed Agents Session Thread Status Terminated Event

- `class ManagedAgentsSessionThreadStatusTerminatedEvent`

  - `"session.thread_status_terminated" 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.

### Beta Managed Agents Session Usage Snapshot

- `class ManagedAgentsSessionUsageSnapshot`

  - `?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.

  - `?BetaManagedAgentsCacheCreationUsage cacheCreation`

    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.

  - `?BetaManagedAgentsServerToolUsage serverToolUse`

    Cumulative server-executed tool usage across all turns.

### Beta Managed Agents Span Model Request End Event

- `class ManagedAgentsSpanModelRequestEndEvent`

  - `"span.model_request_end" 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.

  - `ManagedAgentsSpanModelUsage modelUsage`

    Token usage for this model request.

  - `\Datetime processedAt`

    Timestamp when the model request completed.

### Beta Managed Agents Span Model Request Start Event

- `class ManagedAgentsSpanModelRequestStartEvent`

  - `"span.model_request_start" type`

  - `string id`

    Unique identifier for this event.

  - `\Datetime processedAt`

    Timestamp when the model request started.

### Beta Managed Agents Span Model Usage

- `class ManagedAgentsSpanModelUsage`

  - `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.

### Beta Managed Agents Span Outcome Evaluation End Event

- `class ManagedAgentsSpanOutcomeEvaluationEndEvent`

  - `"span.outcome_evaluation_end" 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.

  - `ManagedAgentsSpanModelUsage usage`

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

### Beta Managed Agents Span Outcome Evaluation Ongoing Event

- `class ManagedAgentsSpanOutcomeEvaluationOngoingEvent`

  - `"span.outcome_evaluation_ongoing" 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.

### Beta Managed Agents Span Outcome Evaluation Start Event

- `class ManagedAgentsSpanOutcomeEvaluationStartEvent`

  - `"span.outcome_evaluation_start" 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.

### Beta Managed Agents Stream Session Events

- `class ManagedAgentsStreamSessionEvents`

  - `class ManagedAgentsUserMessageEvent`

    - `"user.message" 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 ManagedAgentsUserInterruptEvent`

    - `"user.interrupt" 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 ManagedAgentsUserToolConfirmationEvent`

    - `"user.tool_confirmation" 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](https://platform.claude.com/docs/en/api/beta/sessions/events/list?sdk_languages=php#beta_managed_agents_session_requires_action.event_ids) `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 ManagedAgentsUserCustomToolResultEvent`

    - `"user.custom_tool_result" 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](https://platform.claude.com/docs/en/api/beta/sessions/events/list?sdk_languages=php#beta_managed_agents_session_requires_action.event_ids) `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 ManagedAgentsAgentCustomToolUseEvent`

    - `"agent.custom_tool_use" 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.

  - `class ManagedAgentsAgentMessageEvent`

    - `"agent.message" 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`

    - `"agent.thinking" type`

    - `string id`

      Unique identifier for this event.

    - `\Datetime processedAt`

      Timestamp when this thinking was produced.

  - `class ManagedAgentsAgentMCPToolUseEvent`

    - `"agent.mcp_tool_use" 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.

    - `?ManagedAgentsAgentEvaluatedPermission evaluatedPermission`

      The evaluated permission policy for this tool invocation.

    - `?ManagedAgentsAgentToolEvaluation evaluation`

      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 ManagedAgentsAgentMCPToolResultEvent`

    - `"agent.mcp_tool_result" 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 ManagedAgentsAgentToolUseEvent`

    - `"agent.tool_use" 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.

    - `?ManagedAgentsAgentEvaluatedPermission evaluatedPermission`

      The evaluated permission policy for this tool invocation.

    - `?ManagedAgentsAgentToolEvaluation evaluation`

      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 ManagedAgentsAgentToolResultEvent`

    - `"agent.tool_result" 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 ManagedAgentsAgentThreadMessageReceivedEvent`

    - `"agent.thread_message_received" 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`

    - `"agent.thread_message_sent" 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.

  - `class ManagedAgentsAgentThreadContextCompactedEvent`

    - `"agent.thread_context_compacted" type`

    - `string id`

      Unique identifier for this event.

    - `\Datetime processedAt`

      Timestamp when compaction was processed.

  - `class ManagedAgentsSessionErrorEvent`

    - `"session.error" type`

    - `string id`

      Unique identifier for this event.

    - `Error error`

    - `\Datetime processedAt`

      Timestamp when the error occurred.

  - `class ManagedAgentsSessionStatusRescheduledEvent`

    - `"session.status_rescheduled" type`

    - `string id`

      Unique identifier for this event.

    - `\Datetime processedAt`

      Timestamp of status change.

  - `class ManagedAgentsSessionStatusRunningEvent`

    - `"session.status_running" type`

    - `string id`

      Unique identifier for this event.

    - `\Datetime processedAt`

      Timestamp of status change.

  - `class ManagedAgentsSessionStatusIdleEvent`

    - `"session.status_idle" type`

    - `string id`

      Unique identifier for this event.

    - `\Datetime processedAt`

      Timestamp of status change.

    - `?ManagedAgentsSessionRefusalStopDetails stopDetails`

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

    - `StopReason stopReason`

  - `class ManagedAgentsSessionStatusTerminatedEvent`

    - `"session.status_terminated" type`

    - `string id`

      Unique identifier for this event.

    - `\Datetime processedAt`

      Timestamp of status change.

  - `class ManagedAgentsSessionThreadCreatedEvent`

    - `"session.thread_created" 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 ManagedAgentsSpanOutcomeEvaluationStartEvent`

    - `"span.outcome_evaluation_start" 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.

  - `class ManagedAgentsSpanOutcomeEvaluationEndEvent`

    - `"span.outcome_evaluation_end" 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.

    - `ManagedAgentsSpanModelUsage usage`

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

  - `class ManagedAgentsSpanModelRequestStartEvent`

    - `"span.model_request_start" type`

    - `string id`

      Unique identifier for this event.

    - `\Datetime processedAt`

      Timestamp when the model request started.

  - `class ManagedAgentsSpanModelRequestEndEvent`

    - `"span.model_request_end" 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.

    - `ManagedAgentsSpanModelUsage modelUsage`

      Token usage for this model request.

    - `\Datetime processedAt`

      Timestamp when the model request completed.

  - `class ManagedAgentsSpanOutcomeEvaluationOngoingEvent`

    - `"span.outcome_evaluation_ongoing" 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 ManagedAgentsUserDefineOutcomeEvent`

    - `"user.define_outcome" 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 ManagedAgentsSessionDeletedEvent`

    - `"session.deleted" type`

    - `string id`

      Unique identifier for this event.

    - `\Datetime processedAt`

      Timestamp when the session was deleted.

  - `class ManagedAgentsSessionThreadStatusRunningEvent`

    - `"session.thread_status_running" 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 ManagedAgentsSessionThreadStatusIdleEvent`

    - `"session.thread_status_idle" 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.

    - `?ManagedAgentsSessionRefusalStopDetails stopDetails`

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

    - `StopReason stopReason`

  - `class ManagedAgentsSessionThreadStatusTerminatedEvent`

    - `"session.thread_status_terminated" 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 BetaManagedAgentsUserToolResultEvent`

    - `"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](https://platform.claude.com/docs/en/api/beta/sessions/events/list?sdk_languages=php#beta_managed_agents_session_requires_action.event_ids) `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 ManagedAgentsSessionThreadStatusRescheduledEvent`

    - `"session.thread_status_rescheduled" 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 BetaManagedAgentsSessionUpdatedEvent`

    - `"session.updated" type`

    - `string id`

      Unique identifier for this event.

    - `\Datetime processedAt`

      Timestamp when the update was applied.

    - `?BetaManagedAgentsSessionAgent agent`

      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.

    - `?BetaManagedAgentsBudgetLimit budget`

      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 BetaManagedAgentsStartEvent`

    - `"event_start" type`

    - `BetaManagedAgentsStartEventPreview event`

      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.

  - `class BetaManagedAgentsDeltaEvent`

    - `"event_delta" type`

    - `BetaManagedAgentsDeltaContent delta`

      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.

  - `class BetaManagedAgentsSystemMessageEvent`

    - `"system.message" type`

    - `string id`

      Unique identifier for this event.

    - `list<BetaManagedAgentsSystemContentBlock> content`

      System content blocks. Text-only.

    - `?\Datetime processedAt`

      Timestamp when this system message was processed.

  - `class BetaManagedAgentsSessionUsageEvent`

    - `"session.usage" type`

    - `string id`

      Unique identifier for this event.

    - `\Datetime processedAt`

      Timestamp when the snapshot was taken.

    - `ManagedAgentsSessionUsageSnapshot usage`

      The session's cumulative usage at the snapshot time.

    - `?BetaManagedAgentsBudgetLimit budget`

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

  - `class ManagedAgentsWorkflowRunCreatedEvent`

    - `"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.

    - `list<ManagedAgentsWorkflowRunPhase> phases`

      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.

  - `class ManagedAgentsWorkflowRunStatusEndedEvent`

    - `"workflow_run.status_ended" type`

    - `string id`

      Unique identifier for this event.

    - `\Datetime processedAt`

      Timestamp when this event was processed.

    - `ManagedAgentsWorkflowRunResult result`

      How the run ended.

    - `string workflowRunID`

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

  - `class ManagedAgentsWorkflowRunPhaseStartedEvent`

    - `"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.

  - `class ManagedAgentsWorkflowRunPhaseEndedEvent`

    - `"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 ManagedAgentsWorkflowRunStatusRunningEvent`

    - `"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.

  - `class ManagedAgentsWorkflowRunStatusIdleEvent`

    - `"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 ManagedAgentsWorkflowRunErrorEvent`

    - `"workflow_run.error" type`

    - `string id`

      Unique identifier for this event.

    - `ManagedAgentsWorkflowRunError error`

      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.

### Beta Managed Agents System Message Event Params

- `class ManagedAgentsSystemMessageEventParams`

  - `"system.message" type`

  - `list<BetaManagedAgentsSystemContentBlock> content`

    System content blocks to append. Text-only.

### Beta Managed Agents Text Block

- `class ManagedAgentsTextBlock`

  - `"text" type`

  - `string text`

    The text content.

### Beta Managed Agents Text Rubric

- `class ManagedAgentsTextRubric`

  - `"text" type`

  - `string content`

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

### Beta Managed Agents Text Rubric Params

- `class ManagedAgentsTextRubricParams`

  - `"text" type`

  - `string content`

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

### Beta Managed Agents Thread Limit Workflow Run Error

- `class ManagedAgentsThreadLimitWorkflowRunError`

  - `"thread_limit_error" type`

  - `string message`

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

### Beta Managed Agents Timeout Workflow Run Error

- `class ManagedAgentsTimeoutWorkflowRunError`

  - `"timeout_error" type`

  - `string message`

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

### Beta Managed Agents Tool Use Limit Reached Error

- `class ManagedAgentsToolUseLimitReachedError`

  - `"tool_use_limit_reached_error" type`

  - `string message`

    Human-readable error description.

  - `RetryStatus retryStatus`

    What the client should do next.

### Beta Managed Agents Unknown Error

- `class ManagedAgentsUnknownError`

  - `"unknown_error" type`

  - `string message`

    Human-readable error description.

  - `RetryStatus retryStatus`

    What the client should do next.

### Beta Managed Agents Unknown Workflow Run Error

- `class ManagedAgentsUnknownWorkflowRunError`

  - `"unknown_error" type`

  - `string message`

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

### Beta Managed Agents URL Document Source

- `class ManagedAgentsURLDocumentSource`

  - `"url" type`

  - `string url`

    URL of the document to fetch.

### Beta Managed Agents URL Image Source

- `class ManagedAgentsURLImageSource`

  - `"url" type`

  - `string url`

    URL of the image to fetch.

### Beta Managed Agents User Custom Tool Result Event

- `class ManagedAgentsUserCustomToolResultEvent`

  - `"user.custom_tool_result" 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](https://platform.claude.com/docs/en/api/beta/sessions/events/list?sdk_languages=php#beta_managed_agents_session_requires_action.event_ids) `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.

### Beta Managed Agents User Custom Tool Result Event Params

- `class ManagedAgentsUserCustomToolResultEventParams`

  - `"user.custom_tool_result" 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](https://platform.claude.com/docs/en/api/beta/sessions/events/list?sdk_languages=php#beta_managed_agents_session_requires_action.event_ids) `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.

### Beta Managed Agents User Define Outcome Event

- `class ManagedAgentsUserDefineOutcomeEvent`

  - `"user.define_outcome" 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.

### Beta Managed Agents User Define Outcome Event Params

- `class ManagedAgentsUserDefineOutcomeEventParams`

  - `"user.define_outcome" 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.

### Beta Managed Agents User Interrupt Event

- `class ManagedAgentsUserInterruptEvent`

  - `"user.interrupt" 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.

### Beta Managed Agents User Interrupt Event Params

- `class ManagedAgentsUserInterruptEventParams`

  - `"user.interrupt" 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.

### Beta Managed Agents User Message Event

- `class ManagedAgentsUserMessageEvent`

  - `"user.message" 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.

### Beta Managed Agents User Message Event Params

- `class ManagedAgentsUserMessageEventParams`

  - `"user.message" type`

  - `list<Content> content`

    Array of content blocks for the user message.

### Beta Managed Agents User Tool Confirmation Event

- `class ManagedAgentsUserToolConfirmationEvent`

  - `"user.tool_confirmation" 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](https://platform.claude.com/docs/en/api/beta/sessions/events/list?sdk_languages=php#beta_managed_agents_session_requires_action.event_ids) `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.

### Beta Managed Agents User Tool Confirmation Event Params

- `class ManagedAgentsUserToolConfirmationEventParams`

  - `"user.tool_confirmation" 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](https://platform.claude.com/docs/en/api/beta/sessions/events/list?sdk_languages=php#beta_managed_agents_session_requires_action.event_ids) `stop_reason.event_ids` field.

  - `?string denyMessage`

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

### Beta Managed Agents User Tool Result Event Params

- `class ManagedAgentsUserToolResultEventParams`

  - `"user.tool_result" 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](https://platform.claude.com/docs/en/api/beta/sessions/events/list?sdk_languages=php#beta_managed_agents_session_requires_action.event_ids) `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.

### Beta Managed Agents Workflow Run Created Event

- `class ManagedAgentsWorkflowRunCreatedEvent`

  - `"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.

  - `list<ManagedAgentsWorkflowRunPhase> phases`

    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.

### Beta Managed Agents Workflow Run Error

- `class ManagedAgentsWorkflowRunError`

  - `class ManagedAgentsTimeoutWorkflowRunError`

    - `"timeout_error" type`

    - `string message`

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

  - `class ManagedAgentsProgramWorkflowRunError`

    - `"program_error" type`

    - `string message`

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

  - `class ManagedAgentsUnknownWorkflowRunError`

    - `"unknown_error" type`

    - `string message`

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

  - `class ManagedAgentsThreadLimitWorkflowRunError`

    - `"thread_limit_error" type`

    - `string message`

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

  - `class ManagedAgentsMaxWorkflowRunsWorkflowRunError`

    - `"max_workflow_runs_error" type`

    - `string message`

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

### Beta Managed Agents Workflow Run Error Event

- `class ManagedAgentsWorkflowRunErrorEvent`

  - `"workflow_run.error" type`

  - `string id`

    Unique identifier for this event.

  - `ManagedAgentsWorkflowRunError error`

    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.

### Beta Managed Agents Workflow Run Phase

- `class ManagedAgentsWorkflowRunPhase`

  - `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.

### Beta Managed Agents Workflow Run Phase Ended Event

- `class ManagedAgentsWorkflowRunPhaseEndedEvent`

  - `"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.

### Beta Managed Agents Workflow Run Phase Started Event

- `class ManagedAgentsWorkflowRunPhaseStartedEvent`

  - `"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.

### Beta Managed Agents Workflow Run Result

- `class ManagedAgentsWorkflowRunResult`

  - `class ManagedAgentsWorkflowRunResultCompleted`

    - `"completed" type`

  - `class ManagedAgentsWorkflowRunResultError`

    - `"error" type`

    - `ManagedAgentsWorkflowRunError error`

      Why the run did not finish.

  - `class ManagedAgentsWorkflowRunResultStopped`

    - `"stopped" type`

### Beta Managed Agents Workflow Run Result Completed

- `class ManagedAgentsWorkflowRunResultCompleted`

  - `"completed" type`

### Beta Managed Agents Workflow Run Result Error

- `class ManagedAgentsWorkflowRunResultError`

  - `"error" type`

  - `ManagedAgentsWorkflowRunError error`

    Why the run did not finish.

### Beta Managed Agents Workflow Run Result Stopped

- `class ManagedAgentsWorkflowRunResultStopped`

  - `"stopped" type`

### Beta Managed Agents Workflow Run Status Ended Event

- `class ManagedAgentsWorkflowRunStatusEndedEvent`

  - `"workflow_run.status_ended" type`

  - `string id`

    Unique identifier for this event.

  - `\Datetime processedAt`

    Timestamp when this event was processed.

  - `ManagedAgentsWorkflowRunResult result`

    How the run ended.

  - `string workflowRunID`

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

### Beta Managed Agents Workflow Run Status Idle Event

- `class ManagedAgentsWorkflowRunStatusIdleEvent`

  - `"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.

### Beta Managed Agents Workflow Run Status Running Event

- `class ManagedAgentsWorkflowRunStatusRunningEvent`

  - `"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.
