Documentation Index
Fetch the complete documentation index at: https://docs.qoder.com/llms.txt
Use this file to discover all available pages before exploring further.
GET /v1/sessions
获取当前账号下所有 Session 的列表,支持分页。结果按创建时间倒序排列(最新的在前)。
请求头
| 头部 | 必选 | 说明 |
|---|
Authorization | 是 | Bearer <PAT> |
查询参数
| 参数 | 类型 | 必选 | 说明 |
|---|
limit | integer | 否 | 返回数量上限,默认 20 |
after_id | string | 否 | 游标分页:返回该 ID 之后的记录 |
before_id | string | 否 | 游标分页:返回该 ID 之前的记录 |
完整分页规范详见 分页。
示例请求
curl -X GET "https://openapi.qoder.sh/api/v1/cloud/sessions?limit=3" \
-H "Authorization: Bearer $QODER_PAT"
示例响应
HTTP 200 OK
{
"data": [
{
"id": "sess_019e3bb1e8c171fd9abbb1477ffb84cc",
"type": "session",
"agent_id": "agent_019e390add9f7bac9b6cc806db46fcbd",
"environment_id": "env_019e2590d33f711fabf42f2857cecd8a",
"title": "API-doc-verification-session",
"status": "idle",
"resources": [],
"vault_ids": [],
"memory_store_ids": [],
"usage": {
"input_tokens": 0,
"output_tokens": 0
},
"created_at": "2026-05-18T15:26:15.747298Z",
"updated_at": "2026-05-18T15:26:15.747298Z"
}
],
"first_id": "sess_019e3bb1e8c171fd9abbb1477ffb84cc",
"last_id": "sess_019e259100f573c08b0b20005cce9828",
"has_more": false
}
响应字段
| 字段 | 类型 | 说明 |
|---|
data | array | Session 对象列表 |
first_id | string | 当前页第一条记录的 ID |
last_id | string | 当前页最后一条记录的 ID |
has_more | boolean | 是否还有更多记录 |
使用 last_id 作为下一次请求的 after_id 参数实现向后翻页。
错误码
| HTTP | type | 触发条件 |
|---|
| 401 | authentication_error | PAT 无效或过期 |
完整错误信封说明详见 错误参考。