version must be supplied in the request body.
POST /api/v1/cloud/agents/{agent_id}
Request headers
| Header | Required | Description |
|---|---|---|
Authorization | Yes | Bearer <PAT> |
Content-Type | Yes | application/json |
Path parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
agent_id | string | Yes | Unique agent identifier. |
Request body
Field | Type | Required | Description |
| integer | Yes | Current version number for OCC. Must match the server-side value. |
| string | No | Agent name, 1-256 characters. |
| string|object | No | Model identifier. Pass a string, or an Agent model object to also set |
| string | No | System prompt, up to 100000 characters. |
| string | No | Agent description, up to 2048 characters. |
| array | No | Replaces the saved tool configuration list. Up to 128 entries. |
| array | No | Replaces the saved MCP server list. Up to 20 entries. Any |
| array | No | Replaces the saved Skill binding list. Up to 20 entries. |
| object | No | Metadata patch. A string value adds or updates a key; a |
Example request
Example response
HTTP 200 OK
Response fields
Field | Type | Description |
| string | Always |
| string | Unique agent identifier, prefixed with |
| string | Agent name. |
| string | Agent description. |
| string|object | Model identifier. |
| string | System prompt. |
| array | Tool configuration list. |
| array | MCP server configuration. |
| array | Skill binding list. |
| object | Custom metadata. |
| object|null | Agents configuration, or |
| integer | New version number after the update. |
| string|null | Archive time (ISO 8601), or |
| string | Creation time (ISO 8601). |
| string | Last update time (ISO 8601). |
Optimistic concurrency control (OCC)
Update requests use the version number for optimistic locking:
- The client first calls GET to obtain the agent's current
version. - The client sends the update with that
versionin the request body. - The server verifies that
versionmatches the current server-side value. - If they match, the update succeeds and
versionis incremented by 1. - If they do not match, the server returns 409 Conflict.
Errors
| HTTP | Type | Trigger |
|---|---|---|
| 400 | invalid_request_error | Request body or field value is invalid. |
| 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 provided; 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. |
| 401 | authentication_error | PAT is invalid or has expired. |
| 403 | permission_error | Caller is not authorized to update this agent. |
| 404 | not_found_error | No agent exists with the given ID. |
| 409 | conflict_error | version does not match: concurrent modification. |
Notes
versionis required; omitting it causes the update to fail.versionis incremented on every successful update.- Updates use partial-update (merge) semantics: optional fields not present in the request body keep their previous values, and only explicitly provided fields are updated.
- When
tools,mcp_servers, orskillsis provided explicitly, that field's array is replaced in full by the array in the request. - When
metadatais provided explicitly, string values are merged into the saved metadata object, andnullvalues remove existing keys. - Use List Agent versions to view historical versions.