List session events

GET/v1/sessions/{id}/events
Returns durable agent events in ascending id order. after and before form an exclusive range; order chooses traversal. Page forward with after = previous lastId, or backward with before = previous firstId, while hasMore is true.

Authorization

header

Authorization: Bearer <token>

An access token from Settings → Access tokens, with the scopes this call needs. Authentication

Path parameters

idstringrequired
TypeID with prefix "asess_".

Query parameters

typesstring
Comma-separated event payload types to include (e.g. message.created,session.status), at most 64.
toolsstring
Comma-separated tool names, at most 64. Includes their tool events in addition to events matching types. With only tools, includes only matching tool events. Tool events recorded before tool-name stamping always match; existing rows are not backfilled.
afterstring
Return items after this cursor (numeric id, exclusive)
beforestring
Return items before this cursor (numeric id, exclusive)
orderstring
Traversal direction (default asc)
Value in
"asc" | "desc"
limitstring
Max events to return (1-1000, default 100)
threadIdstring
Thread whose events to read. Omit for the full interleaved stream; unlike push, omission does not select the root thread.
includeHeadIdstring | null
Stamp headId on the response: the newest durable event id across the whole log at read time, unaffected by types/threadId filters. Costs one extra read per request; off by default.
Value in
"true" | "false"
viewstring | null
Select the conversation view of the durable event log. Omit for the full event view.

Responses

Successapplication/json

dataarray<SessionEvent>required
firstIdnumber | nullrequired
Numeric id of the first item in this page
lastIdnumber | nullrequired
Numeric id of the last item (use as after for the next page)
hasMorebooleanrequired
Whether more items exist after this page
settledThroughIdinteger
Only set for conversation reads. Greatest event id through which this thread’s history may be filtered at the read head. Zero means no history was filtered; omission means no boundary was supplied.
Range
0 to 9007199254740991
headIdnumber
Newest durable event id across the whole session log at read time, unaffected by the page filters (types, threadId). Lets a filtered read resume the event stream without a separate head probe. Optional: absent while the serving actor predates the field.