Create Agent Key
POST
/api/agents
const url = 'https://example.com/api/agents';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"id":"example","name":"example","is_admin":false,"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 POST \ --url https://example.com/api/agents \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "id": "example", "name": "example", "is_admin": false, "allowed_workflows": [ "example" ], "max_concurrent_jobs": 1 }'Create an agent and its API key. The key is in this response only. Admin keys only.
Authorizations
Section titled “Authorizations”Request Bodyrequired
Section titled “Request Bodyrequired”Responses
Section titled “Responses”Successful Response
Media typeapplication/json
AgentKeyResponse
object
agent
required
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_workflows
required
Allowed Workflows
Array<string>
created_at
required
Created At
string format: date-time
key
required
Key
Shown once. Only its hash is stored.
string
Examplegenerated
{ "agent": { "id": "example", "name": "example", "enabled": true, "is_admin": true, "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" }, "key": "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" } ]}