列出 Session 的公开事件。
GET /api/v1/cloud/sessions/{session_id}/events
使用游标分页读取 Session 公开事件。如果 Accept header 请求 text/event-stream,该路由会切换到 SSE streaming;需要 JSON 分页响应时请使用 Accept: application/json 或省略 SSE media type。
路径参数
| 参数 | 类型 | 说明 |
|---|---|---|
session_id | string | 以 sess_ 为前缀的 Session ID |
请求头
| 头部 | 必选 | 说明 |
|---|---|---|
Authorization | 是 | Bearer $QODER_ACCESS_TOKEN |
查询参数
| 参数 | 类型 | 必填 | 说明 |
|---|---|---|---|
limit | integer | 否 | 最大返回事件数。默认 20,范围 1-100。超过 100 返回 400 invalid_request_error |
page | string | 否 | 上一次响应 next_page 返回的不透明游标。与 before_id、after_id 互斥 |
before_id | string | 否 | 返回排在该事件 ID 之前的事件。与 page、after_id 互斥 |
after_id | string | 否 | 返回排在该事件 ID 之后的事件。与 page、before_id 互斥 |
order | string | 否 | 排序方向:asc(默认)或 desc |
types | string 或 array | 否 | 按事件类型过滤。无法识别的事件类型会被静默忽略——响应中不会包含匹配项 |
created_at[gt] | string | 否 | 返回创建时间晚于该 RFC 3339 时间的事件 |
created_at[gte] | string | 否 | 返回创建时间不早于该 RFC 3339 时间的事件 |
created_at[lt] | string | 否 | 返回创建时间早于该 RFC 3339 时间的事件 |
created_at[lte] | string | 否 | 返回创建时间不晚于该 RFC 3339 时间的事件 |
示例请求
示例响应
HTTP 200 OK
响应字段
| 字段 | 类型 | 说明 |
|---|---|---|
data | array | 公开 Event 对象 列表 |
has_more | boolean | 当前结果集之后还有更多页时为 true |
first_id | string | null | 当前页第一个事件的 ID |
last_id | string | null | 当前页最后一个事件的 ID |
next_page | string | null | 下一页的不透明游标,无更多结果时为 null |
错误码
| HTTP | 类型 | 触发条件 |
|---|---|---|
| 400 | invalid_request_error | limit 非正整数、order 非法、时间戳过滤非法,或 page 与 before_id/after_id 同时提供 |
| 401 | authentication_error | PAT 或 SAT 无效或过期 |
| 404 | not_found_error | Session 不存在;错误消息为 Session '<session_id>' was not found. |