分页读取指定 Forward Session Thread 的公开 Event 历史。
GET /api/v1/forward/sessions/{session_id}/threads/{thread_id}/events
参数
| 位置 | 参数 | 类型 | 是否必填 | 默认值 | 说明 |
|---|---|---|---|---|---|
| Header | Authorization | string | 是 | - | Bearer <PAT 或 SAT> |
| Path | session_id | string | 是 | - | sess_ 前缀的 Session ID。 |
| Path | thread_id | string | 是 | - | sthr_ 前缀的 Thread ID。 |
| Query | limit | integer | 否 | 20 | 分页大小,范围为 1–100。 |
| Query | after_id | string | 否 | - | 返回该 Event ID 之后的记录。 |
| Query | before_id | string | 否 | - | 返回该 Event ID 之前的记录。 |
after_id 和 before_id 不能同时传入。结果顺序固定为升序。
Thread Event 历史不支持 order、type、types、types[]、include_tool_calls、include_thinking 或 event_deltas[]。即使这些参数的值为空,也会返回 400 invalid_request。
示例请求
示例响应
| 字段 | 类型 | 说明 |
|---|---|---|
| data | array | 当前页的 Event 对象。 |
| first_id | string | null | 当前页第一个 Event 的 ID;当前页为空时为 null。 |
| last_id | string | null | 当前页最后一个 Event 的 ID;当前页为空时为 null。 |
| has_more | boolean | 是否还有更多记录。 |
错误
| HTTP | Type | Code | 触发条件 |
|---|---|---|---|
| 400 | invalid_request | invalid_limit | limit 不是 1–100 的整数。 |
| 400 | invalid_request | invalid_pagination | 同时传入 after_id 和 before_id。 |
| 400 | invalid_request | invalid_request | 传入该接口不支持的 selector。 |
| 401 | authentication_error | authentication_required | PAT 或 SAT 无效或已过期。 |
| 404 | not_found | session_not_found | Session 不存在或当前调用方不可见。 |
| 404 | not_found_error | thread_not_found | Thread 不存在或不属于该 Session。 |
| 502 | api_error | runtime_unavailable | Thread 运行服务暂时不可用。 |
备注
- Thread Event 使用 Session Event 相同的公开字段投影;未知 Event 类型只返回最小 Event envelope。
- Thread 归档后,其完整 message/tool 历史不再通过该接口提供。可从父 Session 的 Event history/stream 恢复 lifecycle Event,并通过获取 Thread 接口读取最终状态。