跳转到主要内容

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.

POST /v1/sessions/{session_id} 更新 Session 的可变属性(如标题、元数据)。仅传入需要修改的字段。

请求头

头部必选说明
AuthorizationBearer <PAT>
Content-Typeapplication/json

路径参数

参数类型必选说明
session_idstringSession ID(sess_ 前缀)

请求体

字段类型必选说明
titlestring新的会话标题
metadataobject新的元数据(整体替换)

示例请求

curl -X POST "https://openapi.qoder.sh/api/v1/cloud/sessions/sess_019e3bb1e8c171fd9abbb1477ffb84cc" \
  -H "Authorization: Bearer $QODER_PAT" \
  -H "Content-Type: application/json" \
  -d '{
    "title": "新标题",
    "metadata": {"priority": "high"}
  }'

示例响应

HTTP 200 OK 返回更新后的完整 Session 对象,updated_at 字段会被刷新。
{
  "id": "sess_019e3bb1e8c171fd9abbb1477ffb84cc",
  "type": "session",
  "title": "新标题",
  "status": "idle",
  "updated_at": "2026-05-18T15:26:25.865347Z"
}

错误码

HTTPtype触发条件
400invalid_request_error请求体格式错误
401authentication_errorPAT 无效或过期
404not_found_errorSession 不存在
完整错误信封说明详见 错误参考