跳转到主要内容
Agent

更新 Agent

全量替换更新 Agent 配置

POST
/api/v1/agentstudio/agents/{agent_id}
cURL
curl --request POST \
  --url 'https://dashscope.aliyuncs.com/api/v1/agentstudio/agents/{agent_id}' \
  --header 'Authorization: Bearer <YOUR_API_KEY>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "version": 1,
  "name": "data-analyst",
  "description": "数据分析助手",
  "model": {
    "id": "qwen3-max"
  },
  "system": "你是资深数据分析师,输出结论时附带置信度。",
  "tools": [],
  "mcp_servers": [],
  "skills": [],
  "multiagent": {
    "type": "coordinator",
    "agents": [
      {
        "type": "self"
      },
      {
        "type": "agent",
        "id": "agent_researcher",
        "version": 3
      }
    ]
  },
  "metadata": {
    "team": "data"
  }
}
'
{
  "id": "agent_xxx",
  "type": "agent",
  "version": 2,
  "name": "data-analyst",
  "description": "数据分析助手",
  "model": {
    "id": "qwen3-max"
  },
  "system": "你是资深数据分析师,输出结论时附带置信度。",
  "tools": [],
  "mcp_servers": [],
  "skills": [],
  "multiagent": {
    "type": "coordinator",
    "agents": [
      {
        "type": "self"
      },
      {
        "type": "agent",
        "id": "agent_researcher",
        "version": 3
      }
    ]
  },
  "metadata": {
    "team": "data"
  },
  "created_at": "2026-05-28T16:23:11.456+08:00",
  "updated_at": "2026-05-28T17:10:02.789+08:00",
  "archived_at": null,
  "workspace_id": "ws_xxx",
  "request_id": "req_xxx"
}

鉴权

string
header
必填

DashScope API Key

路径参数

string
必填

请求体

application/json
integer
必填

当前版本号,用于乐观锁。若与服务端不一致返回 409 冲突

string
必填

智能体名称,缺省视为清空

object
必填

模型配置,id 必填,可选 enable_thinking、temperature、max_tokens、thinking_budget

string

智能体用途说明,缺省视为清空

string

系统提示词,缺省视为清空

object[]

工具包列表,含义同创建,缺省视为清空。builtin_toolkit 至多一项,mcp_toolkit 可多项

object[]

MCP Server 引用列表,含义同创建,缺省视为清空

object[]

挂载的技能列表,含义同创建,缺省视为清空

object

多智能体协作配置,含义同创建,缺省视为清空

object

业务自定义键值,缺省视为清空

响应

200-application/json
string

智能体 ID

string

固定为 agent

integer

新版本号(自动递增);已绑定旧版本的会话不受影响

string

智能体名称

string

智能体用途说明

object

模型配置

string

系统提示词

object[]

工具包列表

object[]

MCP Server 引用列表

object[]

挂载技能列表

object

多智能体协作配置。不传或为空表示单智能体

object

业务自定义键值

string | null

归档时间,未归档时为 null

string

创建时间,ISO 8601

string

最近更新时间,ISO 8601

string

所属业务空间 ID

string

本次请求的唯一标识