Skip to main content
Sessions

查询 Thread Events

查询 Forward Session 中某个 Thread 的事件历史。

请求头

Header是否必填说明
AuthorizationBearer <PAT>

路径参数

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

查询参数

参数类型是否必填默认值说明
limitinteger20分页大小,最大 100。
after_idstring-返回该 Event ID 之后的事件。
before_idstring-返回该 Event ID 之前的事件。
orderstringasc排序方向:ascdesc
typestring-按 Event 类型过滤,支持逗号分隔。
types[]string-数组形式的 Event 类型过滤。
include_tool_callsbooleantrue是否包含工具调用类事件。
include_thinkingbooleantrue是否包含思考过程事件。

示例请求

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

示例响应

HTTP 200 OK
{
  "data": [
    {
      "id": "evt_xxx",
      "type": "agent.message",
      "session_id": "sess_xxx",
      "session_thread_id": "sthr_child_xxx",
      "content": [
        {
          "type": "text",
          "text": "The child task is complete."
        }
      ],
      "processed_at": "2026-06-22T11:05:00Z"
    }
  ],
  "first_id": "evt_xxx",
  "last_id": "evt_xxx",
  "has_more": false
}

响应字段

字段

类型

说明

data

array

当前页的 Event 对象。

first_id

string|null

当前页第一条 Event ID。

last_id

string|null

当前页最后一条 Event ID。

has_more

boolean

是否还有更多记录。

Thread Event 字段

data[] 中的每一项都使用与 List Session Events 相同的过滤后 Forward Event 对象。Thread 相关事件在公开 payload 中包含 session_thread_id。完整的按 Event type 分发字段矩阵见 List Session Events。

错误

HTTPTypeCode触发条件
400invalid_request_errorinvalid_event_cursor游标不属于当前 Thread。
400invalid_request_errorinvalid_pagination分页参数不合法。
404not_found_errorsession_not_foundSession 不存在。
404not_found_errorthread_not_foundThread 不存在。
401authentication_errorauthentication_requiredPAT 无效或已过期。

备注

  • Thread Event 响应使用与 Session Event 相同的稳定 payload 白名单。
  • Session 级 Event Stream 包含所有 Thread 的事件;本接口仅返回指定 Thread 的事件。

相关

查询 Thread Events - Qoder CN