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 的可变属性(如标题、元数据)。仅传入需要修改的字段。
请求头
| 头部 | 必选 | 说明 |
|---|
Authorization | 是 | Bearer <PAT> |
Content-Type | 是 | application/json |
路径参数
| 参数 | 类型 | 必选 | 说明 |
|---|
session_id | string | 是 | Session ID(sess_ 前缀) |
请求体
| 字段 | 类型 | 必选 | 说明 |
|---|
title | string | 否 | 新的会话标题 |
metadata | object | 否 | 新的元数据(整体替换) |
示例请求
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"
}
错误码
| HTTP | type | 触发条件 |
|---|
| 400 | invalid_request_error | 请求体格式错误 |
| 401 | authentication_error | PAT 无效或过期 |
| 404 | not_found_error | Session 不存在 |
完整错误信封说明详见 错误参考。