PUT /v1/agents/{agent_id}
Updates the configuration of the specified Agent. Uses optimistic concurrency control (OCC); the request body must include the current version.
Headers
| Header | Required | Description |
|---|---|---|
Authorization | Yes | Bearer <PAT> |
Content-Type | Yes | application/json |
X-CAS-Include-Extended | No | Set to true to include extended fields (skills, metadata) in the response |
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 |
instructions | string | No | System prompt |
description | string | No | Agent description |
tools | array | No | Tool configuration list |
mcp_servers | array | No | MCP server configuration list |
skills | array | No | Skill bindings, format [{"type":"custom","skill_id":"<skill_id>"}], up to 20 entries |
metadata | object | No | Custom metadata key-value pairs |
default_environment | string | No | Default runtime environment |
Example request
Example response
HTTP 200 OKOptimistic 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 | skills exceeds the maximum of 20 entries |
| 401 | authentication_error | PAT 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) |
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.
- View the change history with
GET /v1/agents/{agent_id}/versions.