curl --request POST \
--url https://agent-api.bigmodel.cn/api/agent/managed/v1/agents/{agentId} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'zai-beta: <zai-beta>' \
--header 'zai-version: <zai-version>' \
--data '
{
"version": 2,
"name": "<string>",
"model": "glm-5.3",
"system": "<string>",
"description": "<string>",
"tools": [
{
"type": "agent_toolset_20260601",
"default_config": {
"enabled": true,
"permission_policy": {
"type": "always_allow"
}
},
"configs": []
}
],
"skills": [
{
"skill_id": "<string>",
"version": "<string>"
}
],
"mcp_servers": [
{
"type": "url",
"name": "knowledge-base",
"url": "https://mcp.example.com/mcp"
}
],
"metadata": {}
}
'import requests
url = "https://agent-api.bigmodel.cn/api/agent/managed/v1/agents/{agentId}"
payload = {
"version": 2,
"name": "<string>",
"model": "glm-5.3",
"system": "<string>",
"description": "<string>",
"tools": [
{
"type": "agent_toolset_20260601",
"default_config": {
"enabled": True,
"permission_policy": { "type": "always_allow" }
},
"configs": []
}
],
"skills": [
{
"skill_id": "<string>",
"version": "<string>"
}
],
"mcp_servers": [
{
"type": "url",
"name": "knowledge-base",
"url": "https://mcp.example.com/mcp"
}
],
"metadata": {}
}
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({
version: 2,
name: '<string>',
model: 'glm-5.3',
system: '<string>',
description: '<string>',
tools: [
{
type: 'agent_toolset_20260601',
default_config: {enabled: true, permission_policy: {type: 'always_allow'}},
configs: []
}
],
skills: [{skill_id: '<string>', version: '<string>'}],
mcp_servers: [{type: 'url', name: 'knowledge-base', url: 'https://mcp.example.com/mcp'}],
metadata: {}
})
};
fetch('https://agent-api.bigmodel.cn/api/agent/managed/v1/agents/{agentId}', 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/managed/v1/agents/{agentId}")
.header("zai-version", "<zai-version>")
.header("zai-beta", "<zai-beta>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"version\": 2,\n \"name\": \"<string>\",\n \"model\": \"glm-5.3\",\n \"system\": \"<string>\",\n \"description\": \"<string>\",\n \"tools\": [\n {\n \"type\": \"agent_toolset_20260601\",\n \"default_config\": {\n \"enabled\": true,\n \"permission_policy\": {\n \"type\": \"always_allow\"\n }\n },\n \"configs\": []\n }\n ],\n \"skills\": [\n {\n \"skill_id\": \"<string>\",\n \"version\": \"<string>\"\n }\n ],\n \"mcp_servers\": [\n {\n \"type\": \"url\",\n \"name\": \"knowledge-base\",\n \"url\": \"https://mcp.example.com/mcp\"\n }\n ],\n \"metadata\": {}\n}")
.asString();package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://agent-api.bigmodel.cn/api/agent/managed/v1/agents/{agentId}"
payload := strings.NewReader("{\n \"version\": 2,\n \"name\": \"<string>\",\n \"model\": \"glm-5.3\",\n \"system\": \"<string>\",\n \"description\": \"<string>\",\n \"tools\": [\n {\n \"type\": \"agent_toolset_20260601\",\n \"default_config\": {\n \"enabled\": true,\n \"permission_policy\": {\n \"type\": \"always_allow\"\n }\n },\n \"configs\": []\n }\n ],\n \"skills\": [\n {\n \"skill_id\": \"<string>\",\n \"version\": \"<string>\"\n }\n ],\n \"mcp_servers\": [\n {\n \"type\": \"url\",\n \"name\": \"knowledge-base\",\n \"url\": \"https://mcp.example.com/mcp\"\n }\n ],\n \"metadata\": {}\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/managed/v1/agents/{agentId}",
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([
'version' => 2,
'name' => '<string>',
'model' => 'glm-5.3',
'system' => '<string>',
'description' => '<string>',
'tools' => [
[
'type' => 'agent_toolset_20260601',
'default_config' => [
'enabled' => true,
'permission_policy' => [
'type' => 'always_allow'
]
],
'configs' => [
]
]
],
'skills' => [
[
'skill_id' => '<string>',
'version' => '<string>'
]
],
'mcp_servers' => [
[
'type' => 'url',
'name' => 'knowledge-base',
'url' => 'https://mcp.example.com/mcp'
]
],
'metadata' => [
]
]),
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": "agent_01911111-1111-7111-8111-111111111111",
"type": "agent",
"name": "support-agent",
"description": null,
"model": {
"id": "glm-5.3",
"effort": "max",
"speed": "standard"
},
"system": null,
"tools": [
{
"type": "agent_toolset_20260601"
}
],
"skills": [],
"mcp_servers": [],
"metadata": {},
"multiagent": null,
"version": 1,
"created_at": "2026-08-31T08:00:00.000Z",
"updated_at": "2026-08-31T08:00:00.000Z",
"archived_at": null
}{
"type": "error",
"error": {
"type": "invalid_request_error",
"message": "<string>",
"details": {}
},
"request_id": "req_01J..."
}更新 Agent
更新指定 Agent 并生成新的不可变版本。可带当前 version;不一致时返回 409,避免覆盖刚发生的改动。仅所有者可更新,已归档 Agent 不可更新。MCP Server 与 mcp_toolset 必须按名称一一对应。点击 Try it 按钮可快速试用。
curl --request POST \
--url https://agent-api.bigmodel.cn/api/agent/managed/v1/agents/{agentId} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'zai-beta: <zai-beta>' \
--header 'zai-version: <zai-version>' \
--data '
{
"version": 2,
"name": "<string>",
"model": "glm-5.3",
"system": "<string>",
"description": "<string>",
"tools": [
{
"type": "agent_toolset_20260601",
"default_config": {
"enabled": true,
"permission_policy": {
"type": "always_allow"
}
},
"configs": []
}
],
"skills": [
{
"skill_id": "<string>",
"version": "<string>"
}
],
"mcp_servers": [
{
"type": "url",
"name": "knowledge-base",
"url": "https://mcp.example.com/mcp"
}
],
"metadata": {}
}
'import requests
url = "https://agent-api.bigmodel.cn/api/agent/managed/v1/agents/{agentId}"
payload = {
"version": 2,
"name": "<string>",
"model": "glm-5.3",
"system": "<string>",
"description": "<string>",
"tools": [
{
"type": "agent_toolset_20260601",
"default_config": {
"enabled": True,
"permission_policy": { "type": "always_allow" }
},
"configs": []
}
],
"skills": [
{
"skill_id": "<string>",
"version": "<string>"
}
],
"mcp_servers": [
{
"type": "url",
"name": "knowledge-base",
"url": "https://mcp.example.com/mcp"
}
],
"metadata": {}
}
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({
version: 2,
name: '<string>',
model: 'glm-5.3',
system: '<string>',
description: '<string>',
tools: [
{
type: 'agent_toolset_20260601',
default_config: {enabled: true, permission_policy: {type: 'always_allow'}},
configs: []
}
],
skills: [{skill_id: '<string>', version: '<string>'}],
mcp_servers: [{type: 'url', name: 'knowledge-base', url: 'https://mcp.example.com/mcp'}],
metadata: {}
})
};
fetch('https://agent-api.bigmodel.cn/api/agent/managed/v1/agents/{agentId}', 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/managed/v1/agents/{agentId}")
.header("zai-version", "<zai-version>")
.header("zai-beta", "<zai-beta>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"version\": 2,\n \"name\": \"<string>\",\n \"model\": \"glm-5.3\",\n \"system\": \"<string>\",\n \"description\": \"<string>\",\n \"tools\": [\n {\n \"type\": \"agent_toolset_20260601\",\n \"default_config\": {\n \"enabled\": true,\n \"permission_policy\": {\n \"type\": \"always_allow\"\n }\n },\n \"configs\": []\n }\n ],\n \"skills\": [\n {\n \"skill_id\": \"<string>\",\n \"version\": \"<string>\"\n }\n ],\n \"mcp_servers\": [\n {\n \"type\": \"url\",\n \"name\": \"knowledge-base\",\n \"url\": \"https://mcp.example.com/mcp\"\n }\n ],\n \"metadata\": {}\n}")
.asString();package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://agent-api.bigmodel.cn/api/agent/managed/v1/agents/{agentId}"
payload := strings.NewReader("{\n \"version\": 2,\n \"name\": \"<string>\",\n \"model\": \"glm-5.3\",\n \"system\": \"<string>\",\n \"description\": \"<string>\",\n \"tools\": [\n {\n \"type\": \"agent_toolset_20260601\",\n \"default_config\": {\n \"enabled\": true,\n \"permission_policy\": {\n \"type\": \"always_allow\"\n }\n },\n \"configs\": []\n }\n ],\n \"skills\": [\n {\n \"skill_id\": \"<string>\",\n \"version\": \"<string>\"\n }\n ],\n \"mcp_servers\": [\n {\n \"type\": \"url\",\n \"name\": \"knowledge-base\",\n \"url\": \"https://mcp.example.com/mcp\"\n }\n ],\n \"metadata\": {}\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/managed/v1/agents/{agentId}",
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([
'version' => 2,
'name' => '<string>',
'model' => 'glm-5.3',
'system' => '<string>',
'description' => '<string>',
'tools' => [
[
'type' => 'agent_toolset_20260601',
'default_config' => [
'enabled' => true,
'permission_policy' => [
'type' => 'always_allow'
]
],
'configs' => [
]
]
],
'skills' => [
[
'skill_id' => '<string>',
'version' => '<string>'
]
],
'mcp_servers' => [
[
'type' => 'url',
'name' => 'knowledge-base',
'url' => 'https://mcp.example.com/mcp'
]
],
'metadata' => [
]
]),
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": "agent_01911111-1111-7111-8111-111111111111",
"type": "agent",
"name": "support-agent",
"description": null,
"model": {
"id": "glm-5.3",
"effort": "max",
"speed": "standard"
},
"system": null,
"tools": [
{
"type": "agent_toolset_20260601"
}
],
"skills": [],
"mcp_servers": [],
"metadata": {},
"multiagent": null,
"version": 1,
"created_at": "2026-08-31T08:00:00.000Z",
"updated_at": "2026-08-31T08:00:00.000Z",
"archived_at": null
}{
"type": "error",
"error": {
"type": "invalid_request_error",
"message": "<string>",
"details": {}
},
"request_id": "req_01J..."
}Headers
Managed Agents API 协议版本,固定为 2026-05-26。
2026-05-26 "2026-05-26"
必须包含 managed-agents-2026-05-26;可与其他 beta 标识用逗号分隔。
"managed-agents-2026-05-26"
Path Parameters
agentId 资源标识。
Body
可选。带上当前版本号时,若期间配置已被他人改过则返回 409;省略则按本次提交覆盖。须为正整数。
x >= 1替换 Agent 名称;省略时保持不变。
1 - 256替换完整模型配置;省略时保持不变。
glm-5.3, glm-5.3-flash "glm-5.3"
替换系统提示词;null 表示清空,省略时保持不变。
100000替换用途说明;null 表示清空,省略时保持不变。
2048整体替换工具列表;null 或空数组表示清空,省略时保持不变。若包含 mcp_toolset,必须同时提交 mcp_servers。
128- agent_toolset_20260601
- mcp_toolset
- custom
Show child attributes
Show child attributes
整体替换 Skill 列表;null 或空数组表示清空,省略时保持不变。有效配置必须包含 agent_toolset_20260601。
20Show child attributes
Show child attributes
整体替换 MCP Server 列表;仅能与 tools 同时提交,null 或空数组表示清空。最终配置必须与 mcp_toolset 按名称一一对应。
20Show child attributes
Show child attributes
元数据补丁;省略整个字段时保持不变,键值为 null 时删除对应键。最多 16 个键,键名长度不超过 64 字符,字符串值不超过 512 字符。
Show child attributes
Show child attributes
Response
请求成功。
Agent ID。
"agent_01911111-1111-7111-8111-111111111111"
agent 用途说明。
Show child attributes
Show child attributes
系统提示词。
- agent_toolset_20260601
- mcp_toolset
- custom
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
客户端自定义元数据;省略时默认为空对象。最多 16 个键,键名长度不超过 64 字符,值必须是长度不超过 512 字符的字符串。
Show child attributes
Show child attributes
x >= 0创建时间。
更新时间。
归档时间;未归档时为 null。
当前暂未支持,默认为 null。
Was this page helpful?