跳转到主要内容
GET /api/v1/cloud/sessions/{session_id}/threads 列出 Session 中的线程。协调器主线程排在子线程之前。

路径参数

参数类型说明
session_idstringsess_ 为前缀的 Session ID

请求头

头部必选说明
AuthorizationBearer $QODER_PAT

查询参数

参数类型必填说明
limitinteger最大返回线程数。默认 20,范围 1-100。超过 100 返回 400 invalid_request_error
pagestring上一次响应 next_page 返回的不透明游标

示例请求

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

示例响应

HTTP 200 OK
{
  "data": [
    {
      "id": "sthr_019f00000000000000000000000001aa",
      "type": "session_thread",
      "session_id": "sess_019f00000000000000000000000000aa",
      "parent_thread_id": null,
      "agent": {"id": "agent_019f000000000000000000000000001a", "type": "agent", "version": 1},
      "status": "idle",
      "stats": null,
      "archived_at": null,
      "created_at": "2026-06-15T08:00:00.000Z",
      "updated_at": "2026-06-15T08:05:00.000Z"
    }
  ],
  "first_id": "sthr_019f00000000000000000000000001aa",
  "has_more": false,
  "last_id": "sthr_019f00000000000000000000000001aa",
  "next_page": null
}
响应项结构见 Session Thread 对象

响应字段

字段类型说明
dataarray of Session ThreadThread 对象
has_moreboolean当前结果集之后还有更多页时为 true
first_idstring | null当前页第一个 thread 的 ID
last_idstring | null当前页最后一个 thread 的 ID
next_pagestring | null下一页的不透明游标

错误码

HTTP类型触发条件
400invalid_request_error分页参数无效
401authentication_errorPAT 无效或过期
404not_found_errorSession 不存在
HTTP 404 Not Found
{
  "type": "error",
  "request_id": "cb80235f-76a2-4ff3-9e28-5aa2da12dc14",
  "error": {
    "type": "not_found_error",
    "message": "Session 'sess_doesnotexist_xxxxxxxxxxxxxxxxxxxxxxxx' was not found."
  }
}
完整错误信封格式见 错误参考

相关

Managed Agents

了解 coordinator 与 child 线程的协作模型。

归档 Thread

终止指定的子线程。

Session Thread 对象

Session Thread 对象的完整字段参考。