Skip to main content
Sessions

List Session Threads

List execution Threads in a Forward Session with cursor pagination.

GET /api/v1/forward/sessions/{session_id}/threads A Thread is an execution branch in the Session runtime. The coordinator Thread and its child Threads use the same data structure.

Request headers

HeaderRequiredDescription
AuthorizationYesBearer <PAT or SAT>

Path parameters

ParameterTypeRequiredDescription
session_idstringYesSession ID with the sess_ prefix.

Query parameters

ParameterTypeRequiredDefaultDescription
limitintegerNo20Page size from 1 to 100.
after_idstringNo-Return records after this Thread ID.
before_idstringNo-Return records before this Thread ID.
You cannot pass after_id and before_id together. Results are always sorted in ascending order. This endpoint does not support order, statuses, statuses[], or include_archived. Passing any of these parameters, even with an empty value, returns 400 invalid_request.

Example request

curl -s -X GET 'https://api.qoder.com/api/v1/forward/sessions/sess_xxx/threads?limit=20' \
  -H "Authorization: Bearer $QODER_ACCESS_TOKEN"

Example response

HTTP 200 OK
{
  "data": [{
    "id": "sthr_xxx",
    "type": "session_thread",
    "session_id": "sess_xxx",
    "template_id": "tmpl_support",
    "role": "coordinator",
    "status": "idle",
    "stop_reason": { "type": "end_turn" },
    "created_at": "2026-06-22T10:00:00Z",
    "updated_at": "2026-06-22T10:05:00Z"
  }],
  "first_id": "sthr_xxx",
  "last_id": "sthr_xxx",
  "has_more": false
}
FieldTypeDescription
dataarrayThread objects on this page.
first_idstring | nullFirst Thread ID on this page, or null when empty.
last_idstring | nullLast Thread ID on this page, or null when empty.
has_morebooleanWhether more records are available.

Errors

HTTPTypeCodeCondition
400invalid_requestinvalid_limitlimit is not an integer from 1 to 100.
400invalid_requestinvalid_paginationBoth after_id and before_id were provided.
400invalid_requestinvalid_requestAn unsupported selector was provided.
401authentication_errorauthentication_requiredThe PAT or SAT is invalid or expired.
404not_foundsession_not_foundThe Session does not exist or is not visible to the caller.
502api_errorruntime_unavailableThe Thread runtime service is unavailable.

Notes

  • While the parent Session is active, the list excludes archived Threads. After the parent Session is archived, the list may include archived Threads.
  • If you know a Thread ID, use the get Thread endpoint to retrieve its final state.