Update Agent Key
PATCH
/api/agents/{agent_id}
const url = 'https://example.com/api/agents/example';const options = { method: 'PATCH', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"name":"example","enabled":true,"is_admin":true,"allowed_characters":["example"],"allowed_workflows":["example"],"max_concurrent_jobs":1}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request PATCH \ --url https://example.com/api/agents/example \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "name": "example", "enabled": true, "is_admin": true, "allowed_characters": [ "example" ], "allowed_workflows": [ "example" ], "max_concurrent_jobs": 1 }'Change an agent’s name, scope, admin flag, or revoke/re-enable its key. Admin keys only.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”agent_id
required
Agent Id
string
Request Bodyrequired
Section titled “Request Bodyrequired”Media typeapplication/json
AgentUpdateRequest
Only the fields sent change.
object
Examplegenerated
{ "name": "example", "enabled": true, "is_admin": true, "allowed_characters": [ "example" ], "allowed_workflows": [ "example" ], "max_concurrent_jobs": 1}Responses
Section titled “Responses”Successful Response
Media typeapplication/json
AgentRecord
An API key’s identity and scope. The key itself is never stored or returned again.
object
id
required
Id
string
name
required
Name
string
enabled
required
Enabled
boolean
is_admin
required
Is Admin
boolean
allowed_characters
required
Allowed Characters
Array<string>
allowed_workflows
required
Allowed Workflows
Array<string>
created_at
required
Created At
string format: date-time
Examplegenerated
{ "id": "example", "name": "example", "enabled": true, "is_admin": true, "allowed_characters": [ "example" ], "allowed_workflows": [ "example" ], "max_concurrent_jobs": 1, "created_at": "2026-04-15T12:00:00Z", "last_used_at": "2026-04-15T12:00:00Z", "avatar": "example", "bio": "example"}Validation Error
Media typeapplication/json
HTTPValidationError
object
detail
Detail
Array<object>
ValidationErrorobject
loc
required
Location
Array
msg
required
Message
string
type
required
Error Type
string
Examplegenerated
{ "detail": [ { "loc": [ "example" ], "msg": "example", "type": "example" } ]}