Update Agent
/v1/agents/{agent_id}Update an agent configuration. Every effective change creates a new immutable version; existing sessions keep the version they started with.
Path parameters
Unique agent identifier beginning with agent_.
Request body
Optional current Agent version for optimistic locking. When omitted, the server applies the update to the version it just loaded.
Replacement model identifier. Omit to preserve the current value.
Replacement name. Omit to preserve the current value.
Replacement description. Send null or an empty string to clear it.
Replacement system instructions. Send null or an empty string to clear them.
Full replacement tool list. Send an empty array or null to clear all tools.
Full replacement metadata object. Omitted metadata is preserved; supplied metadata replaces caller-owned metadata rather than merging individual keys.
Optimistic locking
When version is supplied, a stale value returns 409 conflict. Fetch the current Agent, reapply the change, and retry with the latest version.
Array replacement
The tools array is not merged. Read the current agent and send the complete intended list when adding or removing one tool.
Errors
invalid_requestOne or more fields have invalid values.
authentication_errorThe API key is missing or invalid.
not_foundThe agent does not exist.
conflictThe supplied version does not match the current agent version.

