更新 Channel 綁定、展示名、啟停狀態或回複選項。
要求標頭
Header | 是否必填 | 說明 |
Authorization | 是 |
|
Content-Type | 是 |
|
Idempotency-Key | 否 | 有副作用請求可選的等冪鍵。 |
路徑參數
參數 | 類型 | 是否必填 | 說明 |
| string | 是 | Channel ID。 |
請求體參數
參數 | 類型 | 是否必填 | 說明 |
| string | 否 | Channel 展示名。 |
| string | 否 | 新的綁定 Forward Identity ID。 |
| string | 否 | 新的綁定 Forward Template ID。 |
| boolean | 否 | 人工啟停開關。 |
| object | 否 | 更新渠道憑據,用於憑據輪換。 |
| 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 |
|
| 請求體不合法。 |
404 |
|
| Channel 不存在。 |
404 |
|
| 新的 Template 不存在。 |
404 |
|
| 新的 Identity 不存在。 |
409 |
|
| 新的 Identity 已停用。 |
401 |
|
| PAT 無效或已到期。 |
備忘
id、type和channel_type不允許更新。binding_status由系統維護。enabled=true只開啟人工開關,不改變binding_status。更新
identity_id或template_id後,舊 active ChannelConversation 會關閉,新訊息按新綁定建立會話。