Uses full replacement semantics: the request body must include version along with the complete agent configuration. Omitted fields are treated as cleared. On success, version is auto-incremented.
Prerequisites
Endpoint and authentication configured. For details, see Overview and authentication.
Endpoint
POST /agents/{agent_id}
Semantics
Uses full replacement: the request body must include version (current version number, used for optimistic locking) along with the complete name, model, system, tools, and other fields. Omitted fields are treated as cleared. If version does not match the server-side value, a 409 Conflict is returned. On success, the version in the response is auto-incremented; sessions bound to a previous version are not affected.
Request bodyversionint (必选)Current version number, used for optimistic locking. Returns 409 Conflict if it does not match the server-side valuename string (必选)Agent name; omitted fields are treated as clearedmodel object (必选)Model configuration, structure {"id": "qwen3.7-max"}, required sub-field iddescription string (可选)Agent purpose description; omitted fields are treated as clearedsystem string (可选)System prompt; omitted fields are treated as clearedtools array<object> (可选)Toolkit list, same as create; omitted fields are treated as cleared. builtin_toolkit at most one, mcp_toolkit can be multiplemcp_servers array<object> (可选)MCP Server reference list, same as create; omitted fields are treated as clearedskills array<object> (可选)Mounted skill list, same as create; omitted fields are treated as clearedmultiagent object (可选)Multi-agent collaboration configuration, same as create; omitted fields are treated as clearedmetadata object (可选)Custom business key-value pairs; omitted fields are treated as clearedFor field structures, see the Request body section of Create Agent. | Request example |
Response fieldsidstringAgent IDtype stringAlways agentversion intNew version number (auto-incremented); sessions bound to a previous version are not affectedname / description / system stringNew values after replacement from the request bodymodel / tools / mcp_servers / skills / multiagent / metadata object / arrayNew values after replacement from the request body; omitted fields are emptyarchived_at string | nullArchive timestamp; null if not archivedcreated_at / updated_at stringCreation / last update timeworkspace_id stringWorkspace IDrequest_id stringUnique identifier for this request | ResponseThe response is the updated Agent object, with the same structure as the Create Agent response. Theversion is auto-incremented. Fields: |