POST /api/v1/forward/sessions/{session_id}/archive
归档 Session 后,列表接口默认不再返回该 Session。
请求头
路径参数
示例请求
示例响应
HTTP 200 OK响应字段
错误
注意事项
- 当前不提供恢复接口。
- 使用 List Sessions 的
include_archived=true查询已归档 Session。
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
归档一个 Forward Session。
POST /api/v1/forward/sessions/{session_id}/archive
归档 Session 后,列表接口默认不再返回该 Session。
| Header | 是否必填 | 说明 |
|---|---|---|
| Authorization | 是 | Bearer <PAT> |
| Idempotency-Key | 否 | 有副作用请求可选的幂等键。 |
| 参数 | 类型 | 是否必填 | 说明 |
|---|---|---|---|
| session_id | string | 是 | Session ID。 |
curl -s -X POST 'https://api.qoder.com/api/v1/forward/sessions/sess_xxx/archive' \
-H "Authorization: Bearer $QODER_PAT"
{
"id": "sess_xxx",
"type": "session",
"identity_id": "idn_xxx",
"template": {
"id": "tmpl_support",
"type": "template",
"name": "Support assistant",
"model": "ultimate",
"version": 3
},
"source_type": "api",
"status": "idle",
"title": "Customer support session",
"incremental_streaming_enabled": false,
"metadata": {},
"config": {
"environment_variables": {
"API_KEY": "sk-xxx"
}
},
"stats": {
"active_seconds": 0,
"duration_seconds": 0
},
"usage": {
"credits": 13.0
},
"archived_at": "2026-06-22T12:00:00Z",
"created_at": "2026-06-22T10:00:00Z",
"updated_at": "2026-06-22T12:00:00Z"
}
| 字段 | 类型 | 说明 |
|---|---|---|
| 返回值 | object | 归档后的 Session 对象,archived_at 非空。 |
| HTTP | Type | Code | 触发条件 |
|---|---|---|---|
| 404 | not_found_error | session_not_found | Session 不存在。 |
| 409 | conflict_error | session_archived | Session 已归档。 |
| 401 | authentication_error | authentication_required | PAT 无效或已过期。 |
include_archived=true 查询已归档 Session。