Skip to main content
Sessions

列出 Session Thread Events

分页读取指定 Forward Session Thread 的公开 Event 历史。

GET /api/v1/forward/sessions/{session_id}/threads/{thread_id}/events

参数

位置参数类型是否必填默认值说明
HeaderAuthorizationstring-Bearer <PAT 或 SAT>
Pathsession_idstring-sess_ 前缀的 Session ID。
Paththread_idstring-sthr_ 前缀的 Thread ID。
Querylimitinteger20分页大小,范围为 1–100。
Queryafter_idstring-返回该 Event ID 之后的记录。
Querybefore_idstring-返回该 Event ID 之前的记录。
after_idbefore_id 不能同时传入。结果顺序固定为升序。 Thread Event 历史不支持 ordertypetypestypes[]include_tool_callsinclude_thinkingevent_deltas[]。即使这些参数的值为空,也会返回 400 invalid_request

示例请求

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

示例响应

{
  "data": [{
    "id": "evt_xxx",
    "type": "agent.message",
    "session_id": "sess_xxx",
    "content": [{ "type": "text", "text": "子任务执行完成。" }],
    "processed_at": "2026-06-22T11:05:00Z"
  }],
  "first_id": "evt_xxx",
  "last_id": "evt_xxx",
  "has_more": false
}
字段类型说明
dataarray当前页的 Event 对象
first_idstring | null当前页第一个 Event 的 ID;当前页为空时为 null
last_idstring | null当前页最后一个 Event 的 ID;当前页为空时为 null
has_moreboolean是否还有更多记录。

错误

HTTPTypeCode触发条件
400invalid_requestinvalid_limitlimit 不是 1–100 的整数。
400invalid_requestinvalid_pagination同时传入 after_idbefore_id
400invalid_requestinvalid_request传入该接口不支持的 selector。
401authentication_errorauthentication_requiredPAT 或 SAT 无效或已过期。
404not_foundsession_not_foundSession 不存在或当前调用方不可见。
404not_found_errorthread_not_foundThread 不存在或不属于该 Session。
502api_errorruntime_unavailableThread 运行服务暂时不可用。

备注

  • Thread Event 使用 Session Event 相同的公开字段投影;未知 Event 类型只返回最小 Event envelope。
  • Thread 归档后,其完整 message/tool 历史不再通过该接口提供。可从父 Session 的 Event history/stream 恢复 lifecycle Event,并通过获取 Thread 接口读取最终状态。