Claude Platform Docs

Список событий

$client->beta->sessions->events->list(string sessionID, ?\Datetime createdAtGt, ?\Datetime createdAtGte, ?\Datetime createdAtLt, ?\Datetime createdAtLte, ?int limit, ?Order order, ?string page, ?list<string> types, ?list<AnthropicBeta> betas, ?string workspaceID): PageCursor<ManagedAgentsSessionEvent>
GET/v1/sessions/{session_id}/events

Список событий

Parameters
sessionID: string
createdAtGt?:optional \Datetime

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

createdAtGte?:optional \Datetime

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

createdAtLt?:optional \Datetime

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

createdAtLte?:optional \Datetime

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

limit?:optional int

Query parameter for limit

order?:optional Order

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

page?:optional string

Opaque pagination cursor from a previous response's next_page.

types?:optional list<string>

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>

Optional header to specify the beta version(s) you want to use.

workspaceID?:optional string
Returns
One of the following:
Список событий
<?php

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

$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: ['string'],
  betas: [AnthropicBeta::MESSAGE_BATCHES_2024_09_24],
  workspaceID: 'wrkspc_011CZkZaBF1tNoB5wlCeusgy',
);

var_dump($page);
Returns Examples
Response 200
{
  "data": [
    {
      "id": "sevt_011CZkZGOp0iBcp4kaQSihUmy",
      "content": [
        {
          "text": "Where is my order #1234?",
          "type": "text"
        }
      ],
      "type": "user.message",
      "processed_at": "2026-03-15T10:00:00Z"
    },
    {
      "id": "sevt_011CZkZHPq1jCdq5lbRTjiVnz",
      "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="
}