Get session changes
Track progress
Get session changes
Long-poll for real-time session updates.
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
Long-poll
200 with a SessionChanges object, or 204 No Content if no new events arrive within the wait period.
changes is a delta: each call returns only what’s new since from_index, and 204 when nothing new has arrived yet. Note that status can read completed while events (including the answer) are still unread on later pages, so keep advancing from_index until the session is terminal and a poll returns no further events. To skip the loop entirely and just read a finished run’s result, use latest_answer; the SDK helper drains for you.
Path parameters
The session ID.
Query parameters
Event index to start from. Use this to resume from where you left off.
Maximum number of events to return.
Whether to include event details in the response.
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 offstatus (authoritative) while streaming events from changes, resuming from_index and handling the 204 no-change responses automatically.
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.