歸檔一個 Forward Session。
POST /api/v1/forward/sessions/{session_id}/archive
歸檔 Session 後,列表介面預設不再返回該 Session。
要求標頭
Header | 是否必填 | 說明 |
Authorization | 是 |
|
Idempotency-Key | 否 | 有副作用請求可選的等冪鍵。 |
路徑參數
參數 | 類型 | 是否必填 | 說明 |
| string | 是 | Session ID。 |
樣本請求
curl -s -X POST 'https://api.qoder.com.cn/api/v1/forward/sessions/sess_xxx/archive' \
-H "Authorization: Bearer $QODER_PAT"
樣本響應
HTTP 200 OK
{
"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": true,
"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 對象, |
錯誤
HTTP | Type | Code | 觸發條件 |
404 |
|
| Session 不存在。 |
409 |
|
| Session 已歸檔。 |
401 |
|
| PAT 無效或已到期。 |
備忘
當前不提供恢複介面。
使用 List Sessions 的
include_archived=true查詢已歸檔 Session。