curl --request POST \
--url https://agent-api.bigmodel.cn/api/agent/forward/v0/channels \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'zai-beta: <zai-beta>' \
--header 'zai-version: <zai-version>' \
--data '
{
"channel_type": "feishu",
"name": "Support Feishu channel",
"template": {
"agent": {
"type": "agent",
"id": "agent_01911111-1111-7111-8111-111111111111",
"version": 3
},
"environment_id": "env_019e8f00-1ac2-7a6b-8000-3f2d5c8b9a01"
},
"channel_config": {
"credentials": {
"app_id": "cli_xxx",
"app_secret": "<app-secret>"
}
}
}
'import requests
url = "https://agent-api.bigmodel.cn/api/agent/forward/v0/channels"
payload = {
"channel_type": "feishu",
"name": "Support Feishu channel",
"template": {
"agent": {
"type": "agent",
"id": "agent_01911111-1111-7111-8111-111111111111",
"version": 3
},
"environment_id": "env_019e8f00-1ac2-7a6b-8000-3f2d5c8b9a01"
},
"channel_config": { "credentials": {
"app_id": "cli_xxx",
"app_secret": "<app-secret>"
} }
}
headers = {
"zai-version": "<zai-version>",
"zai-beta": "<zai-beta>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'zai-version': '<zai-version>',
'zai-beta': '<zai-beta>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
channel_type: 'feishu',
name: 'Support Feishu channel',
template: {
agent: {type: 'agent', id: 'agent_01911111-1111-7111-8111-111111111111', version: 3},
environment_id: 'env_019e8f00-1ac2-7a6b-8000-3f2d5c8b9a01'
},
channel_config: {credentials: {app_id: 'cli_xxx', app_secret: '<app-secret>'}}
})
};
fetch('https://agent-api.bigmodel.cn/api/agent/forward/v0/channels', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));HttpResponse<String> response = Unirest.post("https://agent-api.bigmodel.cn/api/agent/forward/v0/channels")
.header("zai-version", "<zai-version>")
.header("zai-beta", "<zai-beta>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"channel_type\": \"feishu\",\n \"name\": \"Support Feishu channel\",\n \"template\": {\n \"agent\": {\n \"type\": \"agent\",\n \"id\": \"agent_01911111-1111-7111-8111-111111111111\",\n \"version\": 3\n },\n \"environment_id\": \"env_019e8f00-1ac2-7a6b-8000-3f2d5c8b9a01\"\n },\n \"channel_config\": {\n \"credentials\": {\n \"app_id\": \"cli_xxx\",\n \"app_secret\": \"<app-secret>\"\n }\n }\n}")
.asString();package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://agent-api.bigmodel.cn/api/agent/forward/v0/channels"
payload := strings.NewReader("{\n \"channel_type\": \"feishu\",\n \"name\": \"Support Feishu channel\",\n \"template\": {\n \"agent\": {\n \"type\": \"agent\",\n \"id\": \"agent_01911111-1111-7111-8111-111111111111\",\n \"version\": 3\n },\n \"environment_id\": \"env_019e8f00-1ac2-7a6b-8000-3f2d5c8b9a01\"\n },\n \"channel_config\": {\n \"credentials\": {\n \"app_id\": \"cli_xxx\",\n \"app_secret\": \"<app-secret>\"\n }\n }\n}")
req, _ := http.NewRequest("POST", 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",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'channel_type' => 'feishu',
'name' => 'Support Feishu channel',
'template' => [
'agent' => [
'type' => 'agent',
'id' => 'agent_01911111-1111-7111-8111-111111111111',
'version' => 3
],
'environment_id' => 'env_019e8f00-1ac2-7a6b-8000-3f2d5c8b9a01'
],
'channel_config' => [
'credentials' => [
'app_id' => 'cli_xxx',
'app_secret' => '<app-secret>'
]
]
]),
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": "disabled",
"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"
}{
"type": "error",
"error": {
"type": "authentication_error",
"message": "<string>",
"details": {}
},
"request_id": "req_xxx"
}创建 Channel
创建飞书 Channel,将 Agent 绑定到飞书机器人。连接异步建立,创建后可查询连接状态。
使用说明
使用说明
创建飞书 Channel。Caller 必须有目标 Agent 的 owner 权限,所有资源必须属于同一 customer。Agent ID 字符串或省略 version 时在创建时固定最新版本;template 不接受 Tools/MCP/Skills override。
owner 或资源预检调用失败时统一返回固定 500,且不创建 Channel。凭据已识别的鉴权拒绝返回 400;Provider 瞬态故障或并发预检忙返回 503。HTTP 201 只表示预检与保存成功;连接由后台异步建立,请读取 connection_status 与 last_error 判断状态。凭据不会回显。
完整配置 JSON 不得超过 65,535 UTF-8 字节。群聊模板必须包含两个占位符各一次。
curl --request POST \
--url https://agent-api.bigmodel.cn/api/agent/forward/v0/channels \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'zai-beta: <zai-beta>' \
--header 'zai-version: <zai-version>' \
--data '
{
"channel_type": "feishu",
"name": "Support Feishu channel",
"template": {
"agent": {
"type": "agent",
"id": "agent_01911111-1111-7111-8111-111111111111",
"version": 3
},
"environment_id": "env_019e8f00-1ac2-7a6b-8000-3f2d5c8b9a01"
},
"channel_config": {
"credentials": {
"app_id": "cli_xxx",
"app_secret": "<app-secret>"
}
}
}
'import requests
url = "https://agent-api.bigmodel.cn/api/agent/forward/v0/channels"
payload = {
"channel_type": "feishu",
"name": "Support Feishu channel",
"template": {
"agent": {
"type": "agent",
"id": "agent_01911111-1111-7111-8111-111111111111",
"version": 3
},
"environment_id": "env_019e8f00-1ac2-7a6b-8000-3f2d5c8b9a01"
},
"channel_config": { "credentials": {
"app_id": "cli_xxx",
"app_secret": "<app-secret>"
} }
}
headers = {
"zai-version": "<zai-version>",
"zai-beta": "<zai-beta>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'zai-version': '<zai-version>',
'zai-beta': '<zai-beta>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
channel_type: 'feishu',
name: 'Support Feishu channel',
template: {
agent: {type: 'agent', id: 'agent_01911111-1111-7111-8111-111111111111', version: 3},
environment_id: 'env_019e8f00-1ac2-7a6b-8000-3f2d5c8b9a01'
},
channel_config: {credentials: {app_id: 'cli_xxx', app_secret: '<app-secret>'}}
})
};
fetch('https://agent-api.bigmodel.cn/api/agent/forward/v0/channels', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));HttpResponse<String> response = Unirest.post("https://agent-api.bigmodel.cn/api/agent/forward/v0/channels")
.header("zai-version", "<zai-version>")
.header("zai-beta", "<zai-beta>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"channel_type\": \"feishu\",\n \"name\": \"Support Feishu channel\",\n \"template\": {\n \"agent\": {\n \"type\": \"agent\",\n \"id\": \"agent_01911111-1111-7111-8111-111111111111\",\n \"version\": 3\n },\n \"environment_id\": \"env_019e8f00-1ac2-7a6b-8000-3f2d5c8b9a01\"\n },\n \"channel_config\": {\n \"credentials\": {\n \"app_id\": \"cli_xxx\",\n \"app_secret\": \"<app-secret>\"\n }\n }\n}")
.asString();package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://agent-api.bigmodel.cn/api/agent/forward/v0/channels"
payload := strings.NewReader("{\n \"channel_type\": \"feishu\",\n \"name\": \"Support Feishu channel\",\n \"template\": {\n \"agent\": {\n \"type\": \"agent\",\n \"id\": \"agent_01911111-1111-7111-8111-111111111111\",\n \"version\": 3\n },\n \"environment_id\": \"env_019e8f00-1ac2-7a6b-8000-3f2d5c8b9a01\"\n },\n \"channel_config\": {\n \"credentials\": {\n \"app_id\": \"cli_xxx\",\n \"app_secret\": \"<app-secret>\"\n }\n }\n}")
req, _ := http.NewRequest("POST", 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",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'channel_type' => 'feishu',
'name' => 'Support Feishu channel',
'template' => [
'agent' => [
'type' => 'agent',
'id' => 'agent_01911111-1111-7111-8111-111111111111',
'version' => 3
],
'environment_id' => 'env_019e8f00-1ac2-7a6b-8000-3f2d5c8b9a01'
],
'channel_config' => [
'credentials' => [
'app_id' => 'cli_xxx',
'app_secret' => '<app-secret>'
]
]
]),
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": "disabled",
"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"
}{
"type": "error",
"error": {
"type": "authentication_error",
"message": "<string>",
"details": {}
},
"request_id": "req_xxx"
}Headers
Forward Channel v0 基础协议标识,当前固定为 2026-05-26。
2026-05-26 "2026-05-26"
Channel v0 必须包含 managed-agents-2026-05-26;不要直接替换成 Managed API 推荐的新 Beta 值。多个值用逗号分隔。
"managed-agents-2026-05-26"
Body
当前公开接入使用 feishu;不要提前使用尚未公开开放的渠道类型。
feishu 必填;trim 后长度为 1–128。
1 - 128"Support Feishu channel"
收到消息后创建 Managed Session 所用的固定模板。
Show child attributes
Show child attributes
飞书凭据、输出选项、私有记忆和群聊 Prompt 模板。
Show child attributes
Show child attributes
Response
请求成功。
"channel_xxx"
channel 当前对外文档开放飞书;微信、企微等渠道近期支持。
feishu "Support Feishu channel"
Show child attributes
Show child attributes
新建 Channel 固定为 true。
true
Channel 绑定状态。
"bound"
由取得 listener lease 的 Channel worker 异步推进。
"connected"
Show child attributes
Show child attributes
null
创建时间。
更新时间。
Was this page helpful?