全部產品
Search
文件中心

Qoder CN 系列:更新 Session

更新時間:Jul 02, 2026

更新 Forward Session 的標題或 metadata。

要求標頭

Header

是否必填

說明

Authorization

Bearer <PAT>

Content-Type

application/json

Idempotency-Key

有副作用請求可選的等冪鍵。

路徑參數

參數

類型

是否必填

說明

session_id

string

Session ID。

請求體參數

參數

類型

是否必填

說明

title

string

新的 Session 標題。

metadata

object

metadata merge patch;傳入的 key 覆蓋已有 key,未出現的 key 保留。

樣本請求

curl -s -X POST 'https://api.qoder.com.cn/api/v1/forward/sessions/sess_xxx' \
  -H "Authorization: Bearer $QODER_PAT" \
  -H "Content-Type: application/json" \
  -d '{
  "title": "Updated session title",
  "metadata": {
    "source": "mobile",
    "biz_id": "ticket_123"
  }
}'

樣本響應

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": "Updated session title",
  "incremental_streaming_enabled": true,
  "metadata": {
    "source": "mobile",
    "biz_id": "ticket_123"
  },
  "config": {
    "environment_variables": {
      "API_KEY": "sk-xxx"
    }
  },
  "stats": {
    "active_seconds": 30,
    "duration_seconds": 3600
  },
  "usage": {
    "credits": 12.7
  },
  "created_at": "2026-06-22T10:00:00Z",
  "updated_at": "2026-06-22T12:00:00Z"
}

響應欄位

欄位

類型

說明

傳回值

object

更新後的 Session 對象。

錯誤

HTTP

Type

Code

觸發條件

400

invalid_request_error

invalid_request

更新要求體不合法。

404

not_found_error

session_not_found

Session 不存在。

409

conflict_error

session_archived

Session 已歸檔。

401

authentication_error

authentication_required

PAT 無效或已到期。

備忘

  • configresourcesincremental_streaming_enabled 是建立時配置,不能通過本介面修改。

相關