归档 Session

更新时间:
复制为 MD 格式

将 Session 归档。归档后的 Session 不再出现在默认列表中(需传 include_archived=true 查询参数才能列出),但数据保留。

与 Environment 和 Vault 不同,Session 归档后 status 字段保持为 "idle",不会变为 "archived"。归档效果仅体现在默认列表不返回该 Session。当前 API 无 unarchive/restore 端点。

请求头

头部

必选

说明

Authorization

Bearer <PAT>

Content-Type

application/json

路径参数

参数

类型

必选

说明

session_id

string

Session ID(sess_ 前缀)

示例请求

curl -X POST "https://api.qoder.com.cn/api/v1/cloud/sessions/sess_019e3bb1e8c171fd9abbb1477ffb84cc/archive" \
  -H "Authorization: Bearer $QODER_PAT" \
  -H "Content-Type: application/json"

示例响应

HTTP 200 OK

返回完整的 Session 对象。

{
  "id": "sess_019e3bb1e8c171fd9abbb1477ffb84cc",
  "type": "session",
  "agent_id": "agent_019e390add9f7bac9b6cc806db46fcbd",
  "environment_id": "env_019e2590d33f711fabf42f2857cecd8a",
  "title": "API-doc-verification-session-updated",
  "status": "idle",
  "resources": [],
  "vault_ids": [],
  "memory_store_ids": [],
  "created_at": "2026-05-18T15:26:15.747298Z",
  "updated_at": "2026-05-18T15:26:35.5596Z"
}

错误码

HTTP

type

触发条件

401

authentication_error

PAT 无效或过期

404

not_found_error

Session 不存在

完整错误信封说明详见 错误参考