Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.qoder.com/llms.txt

Use this file to discover all available pages before exploring further.

GET /v1/sessions/{session_id}/events Retrieves the events in a session in chronological order (oldest first). Supports cursor-based pagination.

Path parameters

ParameterTypeDescription
session_idstringSession ID with the sess_ prefix

Headers

HeaderRequiredDescription
AuthorizationYesBearer $QODER_PAT

Query parameters

ParameterTypeRequiredDescription
limitintegerNoMaximum number of records to return. Default 20
after_idstringNoCursor pagination: return records after this event ID
before_idstringNoCursor pagination: return records before this event ID

Example request

curl -X GET "https://openapi.qoder.sh/api/v1/cloud/sessions/sess_019e392c0d1e74e095d21ea4c6b41def/events?limit=5" \
  -H "Authorization: Bearer $QODER_PAT"

Example response

HTTP 200 OK
{
  "data": [
    {
      "id": "evt_019e392c0d787cfaa21bda98e06cd913",
      "type": "user.message",
      "content": "Hello, this is a test message.",
      "session_id": "sess_019e392c0d1e74e095d21ea4c6b41def",
      "turn_id": "turn_019e392c0d787ceea6bb62943f9ac3ec",
      "schema_version": "1.0",
      "created_at": "2026-05-18T03:40:48.888851795Z",
      "processed_at": "2026-05-18T03:40:48.888851795Z"
    },
    {
      "id": "evt_771c1195bcbd4a07834d4ed4dd6450ca",
      "type": "session.status_rescheduled",
      "session_id": "sess_019e392c0d1e74e095d21ea4c6b41def",
      "turn_id": "turn_019e392c0d787ceea6bb62943f9ac3ec",
      "schema_version": "1.0",
      "created_at": "2026-05-18T03:40:50.321Z",
      "processed_at": "2026-05-18T03:40:50.321Z"
    }
  ],
  "first_id": "evt_019e392c0d787cfaa21bda98e06cd913",
  "last_id": "evt_771c1195bcbd4a07834d4ed4dd6450ca",
  "has_more": true
}

Event type reference

TypeDescriptionSpecific fields
user.messageUser messagecontent (string)
agent.messageAgent replycontent (ContentBlock[])
agent.thinkingAgent thinking
session.status_rescheduledSession scheduled for execution
session.status_idleSession returned to idleusage, status, stop_reason
session.errorExecution errorerror, details, retry_status
span.model_request_startModel request started
span.model_request_endModel request ended
terminatedExecution terminated

agent.message content format

{
  "content": [
    {
      "type": "text",
      "text": "The agent's reply text."
    }
  ]
}

session.status_idle extra fields

{
  "type": "session.status_idle",
  "status": "idle",
  "usage": {
    "input_tokens": 150,
    "output_tokens": 42,
    "cache_read_input_tokens": 0,
    "cache_creation_input_tokens": 0
  },
  "stop_reason": {
    "type": "end_turn"
  }
}

session.error format

{
  "type": "session.error",
  "error": {
    "message": "The operation was aborted due to timeout",
    "type": "unknown_error"
  },
  "details": {
    "message": "The operation was aborted due to timeout",
    "name": "TimeoutError"
  },
  "retry_status": {
    "type": "exhausted"
  }
}

Pagination fields

FieldTypeDescription
dataarrayList of event objects
first_idstringID of the first record on the current page
last_idstringID of the last record on the current page
has_morebooleanWhether more records are available

Errors

HTTPTypeTrigger
401authentication_errorPAT invalid or expired
404not_found_errorSession does not exist
See Errors for the full error envelope.