Managed Agents - Agent

更新 Agent 配置并生成新版本,支持通过 version 防止并发覆盖。

<Accordion title="使用说明">

更新指定 Agent 并生成新的不可变版本。可带当前 version;不一致时返回 409,避免覆盖刚发生的改动。仅所有者可更新,已归档 Agent 不可更新。MCP Server 与 mcp_toolset 必须按名称一一对应。

</Accordion>
post/agent/managed/v1/agents/{agentId}

Request

  • Base URL
    https://agent-api.bigmodel.cn/api
  • Auth
    HTTP bearer

Path parameters

agentIdstring required

agentId 资源标识。

Headers

zai-version'2026-05-26' required
Example:2026-05-26

Managed Agents API 入口要求的基础协议标识,当前只接受 2026-05-26;响应兼容形态由 zai-beta 选择。两个头均需携带。

zai-betastring required
Example:managed-agents-2026-09-22

声明 Managed Agents Beta 协议并选择响应字段与兼容行为。新接入使用 managed-agents-2026-09-22;旧客户端仍可使用 managed-agents-2026-05-26。必须同时携带 zai-version: 2026-05-26。字段差异见 /cn/managed-agents/protocol-versions。

Request body

versionnumber

可选。带上当前版本号时,若期间配置已被他人改过则返回 409;省略则按本次提交覆盖。须为正整数。

namestring

替换 Agent 名称;省略时保持不变。

systemstring nullable

替换系统提示词;null 表示清空,省略时保持不变。

descriptionstring nullable

替换用途说明;null 表示清空,省略时保持不变。

metadataManagedMetadataPatch nullable

元数据补丁;省略整个字段时保持不变,键值为 null 时删除对应键。最多 16 个键,键名长度不超过 64 字符,字符串值不超过 512 字符。

Example request

{
  "model": "glm-5.3",
  "skills": [
    {
      "version": "latest"
    }
  ],
  "mcp_servers": [
    {
      "type": "url",
      "name": "knowledge-base",
      "url": "https://mcp.example.com/mcp"
    }
  ]
}

Response

请求成功。

idstring required

Agent ID。

type'agent' required
namestring required
descriptionstring nullable required

用途说明。

systemstring nullable required

系统提示词。

metadataManagedMetadata required

客户端自定义元数据;省略时默认为空对象。最多 16 个键,键名长度不超过 64 字符,值必须是长度不超过 512 字符的字符串。

versioninteger required
created_atstring date-time required

创建时间。

updated_atstring date-time required

更新时间。

archived_atstring nullable required

归档时间;未归档时为 null。

Example response

{
  "id": "agent_01911111-1111-7111-8111-111111111111",
  "type": "agent",
  "name": "support-agent",
  "description": null,
  "model": {
    "id": "glm-5.3",
    "effort": {
      "type": "max"
    },
    "speed": "standard"
  },
  "system": null,
  "tools": [
    {
      "type": "agent_toolset_20260601",
      "default_config": {
        "enabled": true,
        "permission_policy": {
          "type": "always_allow"
        }
      },
      "configs": []
    }
  ],
  "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
}

Changes