Skip to main content
Sessions

归档 Session Thread

归档 Forward Session 中的 child thread。

请求头

Header是否必填说明
AuthorizationBearer <PAT>
Idempotency-Key有副作用请求可选的幂等键。

路径参数

参数类型是否必填说明
session_idstringSession ID。
thread_idstringThread ID。

示例请求

curl -s -X POST 'https://api.qoder.com.cn/api/v1/forward/sessions/sess_xxx/threads/sthr_child_xxx/archive' \
  -H "Authorization: Bearer $QODER_PAT"

示例响应

HTTP 200 OK
{
  "id": "sthr_child_xxx",
  "type": "session_thread",
  "session_id": "sess_xxx",
  "parent_thread_id": "sthr_xxx",
  "template_id": "tmpl_worker",
  "name": "research",
  "role": "child",
  "status": "archived",
  "stop_reason": {
    "type": "archive"
  },
  "created_by_tool_use_id": "toolu_xxx",
  "archived_at": "2026-06-22T12:00:00Z",
  "created_at": "2026-06-22T11:00:00Z",
  "updated_at": "2026-06-22T12:00:00Z"
}

响应字段

字段类型说明
返回值object归档后的 Thread 对象。

错误

HTTPTypeCode触发条件
404not_found_errorsession_not_foundSession 不存在。
404not_found_errorthread_not_foundThread 不存在或不属于该 Session。
409conflict_errorcoordinator_thread_not_archivable尝试归档 coordinator thread。
409conflict_errorthread_not_idleThread 当前不是 idle,不能归档。
401authentication_errorauthentication_requiredPAT 无效或已过期。

备注

  • 只允许归档 role=childstatus=idle 的 Thread。
  • 响应为收敛后的 Forward Thread 对象。

相关