Skip to main content
GET
Get session changes
Returns a stream of changes (events, status transitions, agent actions) that have occurred since your last request. Uses long polling: the server holds the connection open until new changes are available or the timeout expires. Returns 200 with the response below, or 204 No Content if no new events arrive within the wait period.

Polling rules

changes is a delta: each call returns only what is new since from_index.
  • The answer rides the page that delivers the final events. status can already read completed while those events sit unread on a later page, so keep advancing from_index until the session is terminal and a poll returns no further events.
  • 204 No Content means no new events yet, not no answer.
  • status never carries the answer.
To skip the loop and read a finished run’s result, use latest_answer: it needs no cursor and never goes stale. The SDK helper drains the loop for you.

Path parameters

string
required
The session ID.

Query parameters

integer
default:"0"
Event index to start from. Use this to resume from where you left off.
integer
Maximum number of events to return.
boolean
default:"true"
Whether to include event details in the response.
integer
default:"0"
How long the server should hold the connection waiting for changes, up to 25 seconds. The default 0 returns immediately. Set 20 to 25 for efficient long polling.

Response

Response

Examples


Long-polling pattern

Long polling is more efficient than repeated status checks because the server only responds when something actually changes. The SDK ships a helper that runs the loop for you: it drives termination off status (authoritative) while streaming events from changes, resuming from_index and handling the 204 no-change responses automatically.
Long-poll changes to follow a run: it returns new events and the final answer with near-instant latency and far fewer calls than fixed-interval polling. Reach for status only when you want a cheap, one-off liveness check.