Skip to main content
GET /api/v1/cloud/sessions/{session_id}/events Retrieves public Session events with cursor pagination. If the Accept header requests text/event-stream, this route switches to SSE streaming; use Accept: application/json or omit the SSE media type for the paginated JSON response. If the Session was created with incremental_streaming_enabled: true, the response may include persisted incremental agent events. If the flag is false or omitted, incremental events are hidden and only full public events are returned.

Path parameters

ParameterTypeDescription
session_idstringSession ID with the sess_ prefix

Headers

HeaderRequiredDescription
AuthorizationYesBearer $QODER_PAT

Query parameters

ParameterTypeRequiredDescription
limitintegerNoMaximum number of events to return. Default 20, range 1-100. Values above 100 return 400 invalid_request_error.
pagestringNoOpaque cursor from a previous response’s next_page. Mutually exclusive with before_id and after_id
before_idstringNoReturn events ordered before this event ID. Mutually exclusive with page and after_id
after_idstringNoReturn events ordered after this event ID. Mutually exclusive with page and before_id
orderstringNoSort direction: asc (default) or desc
typesstring or arrayNoFilter by event type. Unrecognized event types are silently ignored — the response simply contains no matching events
created_at[gt]stringNoReturn events created after this RFC 3339 timestamp
created_at[gte]stringNoReturn events created at or after this RFC 3339 timestamp
created_at[lt]stringNoReturn events created before this RFC 3339 timestamp
created_at[lte]stringNoReturn events created at or before this RFC 3339 timestamp

Example request

curl -X GET "https://api.qoder.com/api/v1/cloud/sessions/sess_019e392c0d1e74e095d21ea4c6b41def/events?limit=5&types=user.message,agent.message" \
  -H "Authorization: Bearer $QODER_PAT"

Example response

HTTP 200 OK
{
  "data": [
    {
      "id": "evt_019e392c0d787cfaa21bda98e06cd913",
      "type": "user.message",
      "content": [
        {"type": "text", "text": "Hello, this is a test message."}
      ],
      "processed_at": "2026-05-18T03:40:48.888851795Z"
    },
    {
      "id": "evt_771c1195bcbd4a07834d4ed4dd6450ca",
      "type": "agent.message",
      "content": [
        {"type": "text", "text": "Hello! How can I help you today?"}
      ],
      "processed_at": "2026-05-18T03:40:55.123Z"
    }
  ],
  "first_id": "evt_019e392c0d787cfaa21bda98e06cd913",
  "has_more": false,
  "last_id": "evt_771c1195bcbd4a07834d4ed4dd6450ca",
  "next_page": null
}

Event types

See Public event types for the full set of event types exposed by list and stream endpoints. For incremental streaming Sessions, use the top-level event types agent.message_start, agent.content_block_start, agent.content_block_delta, agent.content_block_stop, agent.message_delta, and agent.message_stop when filtering types. Do not filter by text_delta or input_json_delta; those are nested delta.type values inside agent.content_block_delta.

Response fields

FieldTypeDescription
dataarrayList of public Event objects
has_morebooleanWhether more results are available beyond this page
first_idstring | nullID of the first event in the current page
last_idstring | nullID of the last event in the current page
next_pagestring | nullOpaque cursor for the next page, or null when there are no more results

Errors

HTTPTypeTrigger
400invalid_request_errorInvalid limit (non-integer or non-positive), invalid order, invalid timestamp filter, or simultaneously providing page with before_id/after_id
401authentication_errorPAT invalid or expired
Note: This endpoint returns HTTP 200 with an empty data array for non-existent Session IDs, enabling clients to poll safely. Use GET /api/v1/cloud/sessions/{id} to verify Session existence.

Example: 400 invalid order

{
  "error": {
    "message": "Field 'order' must be one of: asc, desc.",
    "type": "invalid_request_error"
  },
  "request_id": "74c9b7ee-f2f4-450a-9283-933fd3315cf8",
  "type": "error"
}

Example: 400 invalid limit

{
  "error": {
    "message": "Field 'limit' must be a positive integer.",
    "type": "invalid_request_error"
  },
  "request_id": "d582074b-11ec-45cb-9c94-929278a19261",
  "type": "error"
}
See Errors for the full error envelope.

Session event stream

Stream agent thinking, messages, tool calls, and status over SSE.