Skip to main content
GET /v1/sessions/{session_id}/threads Retrieves all threads in a session. If the session has not yet created any threads, the system automatically creates a coordinator main thread.

Headers

HeaderRequiredDescription
AuthorizationYesBearer <PAT>

Path Parameters

ParameterTypeRequiredDescription
session_idstringYesSession ID (sess_ prefix)

Query Parameters

ParameterTypeRequiredDescription
limitintegerNoMaximum number of records to return. Default 20
orderstringNoSort direction: asc (default) or desc
before_idstringNoCursor pagination: return records before this ID
after_idstringNoCursor pagination: return records after this ID
statuses[]stringNoFilter by thread status. Supports multiple values: idle, running, archived, terminated, blocked

Example Request

curl -X GET "https://api.qoder.com/api/v1/cloud/sessions/sess_019f00000000000000000000000000aa/threads" \
  -H "Authorization: Bearer $QODER_PAT"

Filtering by status

curl -X GET "https://api.qoder.com/api/v1/cloud/sessions/sess_019f00000000000000000000000000aa/threads?statuses[]=running&statuses[]=idle" \
  -H "Authorization: Bearer $QODER_PAT"

Example Response

HTTP 200 OK
{
  "data": [
    {
      "id": "sthr_019f00000000000000000000000001aa",
      "type": "session_thread",
      "session_id": "sess_019f00000000000000000000000000aa",
      "parent_thread_id": null,
      "agent": {
        "id": "agent_019f000000000000000000000000001a",
        "type": "agent",
        "name": "task-coordinator",
        "model": "ultimate",
        "version": 1
      },
      "agent_id": "agent_019f000000000000000000000000001a",
      "agent_version": 1,
      "name": "",
      "role": "coordinator",
      "status": "idle",
      "stop_reason": {"type": "end_turn"},
      "created_by_tool_use_id": null,
      "archived_at": null,
      "created_at": "2026-06-15T08:00:00.000Z",
      "updated_at": "2026-06-15T08:05:00.000Z"
    },
    {
      "id": "sthr_019f00000000000000000000000002bb",
      "type": "session_thread",
      "session_id": "sess_019f00000000000000000000000000aa",
      "parent_thread_id": "sthr_019f00000000000000000000000001aa",
      "agent": {
        "id": "agent_019f000000000000000000000000002b",
        "type": "agent",
        "name": "Research Agent",
        "model": "ultimate",
        "version": 2
      },
      "agent_id": "agent_019f000000000000000000000000002b",
      "agent_version": 2,
      "name": "Research Agent",
      "role": "child",
      "status": "running",
      "stop_reason": {},
      "created_by_tool_use_id": "toolu_bdrk_01T42NPLcKrBvLJfWgGt3QMt",
      "archived_at": null,
      "created_at": "2026-06-15T08:01:00.000Z",
      "updated_at": "2026-06-15T08:01:00.000Z"
    }
  ],
  "first_id": "sthr_019f00000000000000000000000001aa",
  "last_id": "sthr_019f00000000000000000000000002bb",
  "has_more": false
}

Response Fields

FieldTypeDescription
dataarray of Session ThreadList of thread objects
first_idstring | nullID of the first record on the current page
last_idstring | nullID 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 full error envelope reference.

Managed Agents

Learn the coordinator and child thread collaboration model.

Archive a thread

Terminate a specific child thread.

Session Thread object

Full field reference for the Session Thread object.