GET /v1/sessions/{session_id}/events
Retrieves the events in a session in chronological order (oldest first). Supports cursor-based pagination.
Path parameters
| Parameter | Type | Description |
|---|---|---|
session_id | string | Session ID with the sess_ prefix |
Headers
| Header | Required | Description |
|---|---|---|
Authorization | Yes | Bearer $QODER_PAT |
Query parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
limit | integer | No | Maximum number of records to return. Default 20 |
after_id | string | No | Cursor pagination: return records after this event ID |
before_id | string | No | Cursor pagination: return records before this event ID |
order | string | No | Sort direction: asc (default, chronological) or desc (reverse chronological) |
type | string | No | Filter by event type. Values match the type field on returned events (e.g. user.message, agent.message, agent.artifact_delivered). Supports comma-separated values for multi-type filtering (e.g. type=user.message,agent.message). Repeating the key also works (e.g. type=a&type=b). Omit to return all event types |
types[] | string | No | Array-style alternative to type. Pass multiple types[]=… parameters to filter by several event types (e.g. types[]=user.message&types[]=agent.message) |
created_at[gte] | string | No | Return events created at or after this time (inclusive). RFC 3339 format |
created_at[lte] | string | No | Return events created at or before this time (inclusive). RFC 3339 format |
Example request
Filtering by event type
Example response
HTTP 200 OKEvent type reference
| Type | Description | Specific fields |
|---|---|---|
user.message | User message | content (string) |
agent.tool_use | Agent tool invocation | tool_name, name, tool_input, tool_use_id, requires_confirmation |
agent.tool_result | Tool execution result | tool_use_id, content (ContentBlock[]), is_error |
agent.message | Agent reply | content (ContentBlock[]) |
agent.thinking | Agent thinking | – |
session.status_running | Session started running | – |
session.status_idle | Session returned to idle | usage, status, stop_reason |
session.error | Execution error | error, details, retry_status |
span.model_request_start | Model request started | – |
span.model_request_end | Model request ended | – |
agent.artifact_delivered | Agent delivered a file via the DeliverArtifacts tool | file_id, original_filename, size, content_type |
terminated | Execution terminated | – |
agent.message content format
session.status_idle extra fields
session.error format
Pagination fields
| Field | Type | Description |
|---|---|---|
data | array | List of event objects |
first_id | string | ID of the first record on the current page |
last_id | string | ID of the last record on the current page |
has_more | boolean | Whether more records are available |
Errors
| HTTP | Type | Trigger |
|---|---|---|
| 401 | authentication_error | PAT invalid or expired |
| 404 | not_found_error | Session does not exist |
Retrieving agent output files
When an Agent calls theDeliverArtifacts tool, the platform uploads each delivered file to durable storage and emits an agent.artifact_delivered event. Use the type filter to retrieve only these events, then download each file via the Files API.