全部產品
Search
文件中心

Qoder CN 系列:更新 Channel

更新時間:Jul 03, 2026

更新 Channel 綁定、展示名、啟停狀態或回複選項。

要求標頭

Header

是否必填

說明

Authorization

Bearer <PAT>

Content-Type

application/json

Idempotency-Key

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

路徑參數

參數

類型

是否必填

說明

channel_id

string

Channel ID。

請求體參數

參數

類型

是否必填

說明

name

string

Channel 展示名。

identity_id

string

新的綁定 Forward Identity ID。

template_id

string

新的綁定 Forward Template ID。

enabled

boolean

人工啟停開關。

channel_config.credentials

object

更新渠道憑據,用於憑據輪換。

channel_config.response_options

object

回複內容可見度配置。

樣本請求

curl -s -X POST 'https://api.qoder.com.cn/api/v1/forward/channels/channel-019eabc123' \
  -H "Authorization: Bearer $QODER_PAT" \
  -H "Content-Type: application/json" \
  -d '{
  "enabled": false,
  "channel_config": {
    "response_options": {
      "include_tool_calls": true,
      "include_thinking": false
    }
  }
}'

樣本響應

HTTP 200 OK

{
  "id": "channel-019eabc123",
  "identity_id": "idn_019eabc123",
  "template_id": "tmpl_support",
  "channel_type": "feishu",
  "name": "Support Feishu channel",
  "enabled": false,
  "binding_status": "bound",
  "channel_config": {
    "response_options": {
      "include_tool_calls": true,
      "include_thinking": false
    }
  },
  "created_at": "2026-06-18T10:00:00Z",
  "updated_at": "2026-06-18T10:30:00Z"
}

響應欄位

欄位

類型

說明

傳回值

object

更新後的 Channel 對象。

錯誤

HTTP

Type

Code

觸發條件

400

invalid_request_error

invalid_request

請求體不合法。

404

not_found_error

channel_not_found

Channel 不存在。

404

not_found_error

channel_template_not_found

新的 Template 不存在。

404

not_found_error

channel_identity_not_found

新的 Identity 不存在。

409

conflict_error

channel_identity_disabled

新的 Identity 已停用。

401

authentication_error

authentication_required

PAT 無效或已到期。

備忘

  • idtypechannel_type 不允許更新。

  • binding_status 由系統維護。

  • enabled=true 只開啟人工開關,不改變 binding_status

  • 更新 identity_idtemplate_id 後,舊 active ChannelConversation 會關閉,新訊息按新綁定建立會話。

相關