更新 Channel 群聊模板
curl --request PATCH \
--url https://agent-api.bigmodel.cn/api/agent/forward/v0/channels/{channelId} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'zai-beta: <zai-beta>' \
--header 'zai-version: <zai-version>' \
--data '
{
"channel_config": {
"group_prompt_template": "请结合来源说明回复。\n{{context_note}}\n{{messages}}"
}
}
'import requests
url = "https://agent-api.bigmodel.cn/api/agent/forward/v0/channels/{channelId}"
payload = { "channel_config": { "group_prompt_template": "请结合来源说明回复。
{{context_note}}
{{messages}}" } }
headers = {
"zai-version": "<zai-version>",
"zai-beta": "<zai-beta>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {
'zai-version': '<zai-version>',
'zai-beta': '<zai-beta>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
channel_config: {group_prompt_template: '请结合来源说明回复。\n{{context_note}}\n{{messages}}'}
})
};
fetch('https://agent-api.bigmodel.cn/api/agent/forward/v0/channels/{channelId}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));HttpResponse<String> response = Unirest.patch("https://agent-api.bigmodel.cn/api/agent/forward/v0/channels/{channelId}")
.header("zai-version", "<zai-version>")
.header("zai-beta", "<zai-beta>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"channel_config\": {\n \"group_prompt_template\": \"请结合来源说明回复。\\n{{context_note}}\\n{{messages}}\"\n }\n}")
.asString();package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://agent-api.bigmodel.cn/api/agent/forward/v0/channels/{channelId}"
payload := strings.NewReader("{\n \"channel_config\": {\n \"group_prompt_template\": \"请结合来源说明回复。\\n{{context_note}}\\n{{messages}}\"\n }\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("zai-version", "<zai-version>")
req.Header.Add("zai-beta", "<zai-beta>")
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://agent-api.bigmodel.cn/api/agent/forward/v0/channels/{channelId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'channel_config' => [
'group_prompt_template' => '请结合来源说明回复。
{{context_note}}
{{messages}}'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"zai-beta: <zai-beta>",
"zai-version: <zai-version>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}{
"id": "channel_xxx",
"type": "channel",
"channel_type": "feishu",
"name": "Support Feishu channel",
"template": {
"agent": {
"type": "agent",
"id": "agent_xxx",
"version": 3
},
"environment_id": "env_xxx",
"vault_ids": [
"vault_xxx"
],
"file_ids": [
"file_xxx"
],
"memory_stores": []
},
"enabled": true,
"binding_status": "bound",
"connection_status": "connected",
"channel_config": {
"response_options": {
"include_tool_calls": false,
"include_process": false,
"card_output": true
},
"group_prompt_template": null,
"private_memory_store_enabled": false
},
"last_error": null,
"created_at": "2026-09-01T00:00:00.000Z",
"updated_at": "2026-09-01T00:00:00.000Z"
}{
"type": "error",
"error": {
"type": "authentication_error",
"message": "<string>",
"details": {}
},
"request_id": "req_xxx"
}{
"type": "error",
"error": {
"type": "authentication_error",
"message": "<string>",
"details": {}
},
"request_id": "req_xxx"
}Channel
更新 Channel 群聊模板
更新 Channel 的群聊提示模板,或恢复默认模板;不支持修改其他配置。
使用说明
使用说明
仅更新 channel_config.group_prompt_template;字符串中的 {{context_note}} 与 {{messages}} 必须各一次,null 恢复默认模板。其他配置字段返回 400。成功后新准备的群聊消息使用新模板;已冻结输入继续使用原模板。
PATCH
/
agent
/
forward
/
v0
/
channels
/
{channelId}
更新 Channel 群聊模板
curl --request PATCH \
--url https://agent-api.bigmodel.cn/api/agent/forward/v0/channels/{channelId} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'zai-beta: <zai-beta>' \
--header 'zai-version: <zai-version>' \
--data '
{
"channel_config": {
"group_prompt_template": "请结合来源说明回复。\n{{context_note}}\n{{messages}}"
}
}
'import requests
url = "https://agent-api.bigmodel.cn/api/agent/forward/v0/channels/{channelId}"
payload = { "channel_config": { "group_prompt_template": "请结合来源说明回复。
{{context_note}}
{{messages}}" } }
headers = {
"zai-version": "<zai-version>",
"zai-beta": "<zai-beta>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {
'zai-version': '<zai-version>',
'zai-beta': '<zai-beta>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
channel_config: {group_prompt_template: '请结合来源说明回复。\n{{context_note}}\n{{messages}}'}
})
};
fetch('https://agent-api.bigmodel.cn/api/agent/forward/v0/channels/{channelId}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));HttpResponse<String> response = Unirest.patch("https://agent-api.bigmodel.cn/api/agent/forward/v0/channels/{channelId}")
.header("zai-version", "<zai-version>")
.header("zai-beta", "<zai-beta>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"channel_config\": {\n \"group_prompt_template\": \"请结合来源说明回复。\\n{{context_note}}\\n{{messages}}\"\n }\n}")
.asString();package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://agent-api.bigmodel.cn/api/agent/forward/v0/channels/{channelId}"
payload := strings.NewReader("{\n \"channel_config\": {\n \"group_prompt_template\": \"请结合来源说明回复。\\n{{context_note}}\\n{{messages}}\"\n }\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("zai-version", "<zai-version>")
req.Header.Add("zai-beta", "<zai-beta>")
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://agent-api.bigmodel.cn/api/agent/forward/v0/channels/{channelId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'channel_config' => [
'group_prompt_template' => '请结合来源说明回复。
{{context_note}}
{{messages}}'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"zai-beta: <zai-beta>",
"zai-version: <zai-version>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}{
"id": "channel_xxx",
"type": "channel",
"channel_type": "feishu",
"name": "Support Feishu channel",
"template": {
"agent": {
"type": "agent",
"id": "agent_xxx",
"version": 3
},
"environment_id": "env_xxx",
"vault_ids": [
"vault_xxx"
],
"file_ids": [
"file_xxx"
],
"memory_stores": []
},
"enabled": true,
"binding_status": "bound",
"connection_status": "connected",
"channel_config": {
"response_options": {
"include_tool_calls": false,
"include_process": false,
"card_output": true
},
"group_prompt_template": null,
"private_memory_store_enabled": false
},
"last_error": null,
"created_at": "2026-09-01T00:00:00.000Z",
"updated_at": "2026-09-01T00:00:00.000Z"
}{
"type": "error",
"error": {
"type": "authentication_error",
"message": "<string>",
"details": {}
},
"request_id": "req_xxx"
}{
"type": "error",
"error": {
"type": "authentication_error",
"message": "<string>",
"details": {}
},
"request_id": "req_xxx"
}Headers
Forward Channel v0 基础协议标识,当前固定为 2026-05-26。
Available options:
2026-05-26 Example:
"2026-05-26"
Channel v0 必须包含 managed-agents-2026-05-26;不要直接替换成 Managed API 推荐的新 Beta 值。多个值用逗号分隔。
Example:
"managed-agents-2026-05-26"
Path Parameters
channelId 资源标识。
Body
application/json
仅修改群聊 Prompt 模板;不支持修改凭据、Agent、Environment、名称、回复选项或私有记忆开关。
Show child attributes
Show child attributes
Response
请求成功。
Example:
"channel_xxx"
Available options:
channel 当前对外文档开放飞书;微信、企微等渠道近期支持。
Available options:
feishu Example:
"Support Feishu channel"
Show child attributes
Show child attributes
新建 Channel 固定为 true。
Example:
true
Channel 绑定状态。
Example:
"bound"
由取得 listener lease 的 Channel worker 异步推进。
Example:
"connected"
Show child attributes
Show child attributes
Example:
null
创建时间。
更新时间。
Was this page helpful?