获取当前账号下所有 Session 的列表,支持分页。
请求头
头部 | 必选 | 说明 |
| 是 |
|
查询参数
参数 | 类型 | 必选 | 说明 |
| integer | 否 | 返回数量上限,默认 20 |
| string | 否 | 游标分页:返回该 ID 之后的记录 |
| string | 否 | 游标分页:返回该 ID 之前的记录 |
完整分页规范详见 分页。
示例请求
curl -X GET "https://api.qoder.com.cn/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
}响应字段
字段 | 类型 | 说明 |
| array | Session 对象列表 |
| string | 当前页第一条记录的 ID |
| string | 当前页最后一条记录的 ID |
| boolean | 是否还有更多记录 |
使用 last_id 作为下一次请求的 after_id 参数实现向后翻页。
错误码
HTTP | type | 触发条件 |
401 |
| PAT 无效或过期 |
完整错误信封说明详见 错误参考。
该文章对您有帮助吗?