Update an Agent configuration with optimistic concurrency control.
POST /api/v1/cloud/agents/{agent_id}
Updates the configuration of the specified Agent. Uses optimistic concurrency control (OCC); the request body must include the current version.
This update publishes a new Agent version, but existing Sessions continue using their pinned runtime snapshots. To apply the Agent version's model, prompt, tool, MCP server, or Skill-binding changes to an existing Session, call Update a session with the corresponding
agent fields.Headers
| Header | Required | Description |
|---|---|---|
Authorization | Yes | Bearer <PAT or SAT> |
Content-Type | Yes | application/json |
x-qoder-beta | When using Browser Use | Must include browser-use-2026-07-14 when replacing tools with an array containing browser_toolset_20260714. See Browser Use (Beta) |
Path parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
agent_id | string | Yes | Agent unique identifier |
Request body
| Field | Type | Required | Description |
|---|---|---|---|
version | integer | Yes | Current version (OCC). Must match the server-side version. |
name | string | No | Agent name, 1-256 characters |
model | string | object | No | Model identifier. Pass a string or an Agent model object to configure effort or context_window. Use List models to discover available values |
system | string | No | System prompt, at most 100000 characters |
description | string | No | Agent description, at most 2048 characters |
tools | array of Agent tool | No | Replaces the stored tool configuration list. Maximum 128 entries |
mcp_servers | array of MCP server | No | Replaces the stored MCP server list. Maximum 20 entries. mcp_toolset entries in tools must reference names in this list |
skills | array of Skill binding | No | Replaces the stored skill binding list. Maximum 20 entries |
metadata | object | No | Metadata patch. String values upsert keys; null values delete keys from stored metadata |
multiagent | Multiagent | null | No | Replaces the orchestration configuration. Omit to keep it unchanged or pass null to clear it. Ordinary Agent or self entries require agent_toolset_20260401 in tools; an Advisor-only roster does not. See Multiagent orchestration |
version pins it to that Agent’s latest version at save time, even if the previous value was "latest". See child Agent version rules.
Example request
Example response
HTTP 200 OK
Response fields
| Field | Type | Description |
|---|---|---|
type | string | Always "agent" |
id | string | Agent unique identifier with the agent_ prefix |
name | string | Agent name |
description | string | Agent description |
model | string | object | Model identifier. See Agent model |
system | string | System prompt |
tools | array of Agent tool | Tool configuration list |
mcp_servers | array of MCP server | MCP server configuration |
skills | array of Skill binding | Skill bindings |
metadata | Metadata object | Custom metadata |
multiagent | Multiagent | null | Multiagent orchestration configuration, null when not set |
version | integer | New version after the update |
archived_at | string|null | Archive time (ISO 8601), null when not archived |
created_at | string | Creation time (ISO 8601) |
updated_at | string | Last update time (ISO 8601) |
Optimistic concurrency control (OCC)
Updates use the version number for optimistic locking:
- The client first calls
GETto obtain the currentversion. - The update sends that
versionin the request body. - The server checks whether the supplied
versionmatches the current value. - On match, the update succeeds and
versionincrements by 1. - On mismatch, the server returns
409 Conflict.
Errors
| HTTP | Type | Trigger |
|---|---|---|
| 400 | invalid_request_error | Malformed body or invalid field value |
| 400 | invalid_request_error | model.effort is not one of none, low, medium, high, xhigh, max |
| 400 | invalid_request_error | model.context_window is not a positive integer |
| 400 | invalid_request_error | model.speed was supplied; use model.effort instead |
| 400 | invalid_request_error | tools exceeds the maximum of 128 entries |
| 400 | invalid_request_error | mcp_servers exceeds the maximum of 20 entries |
| 400 | invalid_request_error | skills exceeds the maximum of 20 entries |
| 400 | invalid_request_error | Invalid multiagent configuration (including an invalid Advisor entry), or a roster with ordinary Agent / self entries lacks agent_toolset_20260401 in tools |
| 400 | invalid_request_error | browser_toolset_20260714 is used without the Browser Use Beta header |
| 401 | authentication_error | PAT or SAT invalid or expired |
| 403 | permission_error | Not authorized to update this Agent |
| 404 | not_found_error | Agent with the given ID does not exist |
| 409 | conflict_error | version mismatch (concurrent modification) |
| 503 | feature_not_available | Browser Use is temporarily unavailable |
Error response example
Version conflict (409):
Notes
versionis required; omitting it causes the update to fail.versionincrements on each successful update.- Updates use merge semantics: optional fields not included in the request body retain their current values. Only explicitly provided fields are updated.
- When
tools,mcp_servers, orskillsis provided, the supplied array replaces the stored array for that field. - When
metadatais provided, string values are merged into the stored metadata object andnullvalues delete existing keys. - View the change history with
GET /api/v1/cloud/agents/{agent_id}/versions.

