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_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 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_characters": [ "example" ], "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”Media typeapplication/json
AgentCreateRequest
object
id
required
Id
Slug: lowercase letters, digits, - and _
string
name
required
Name
string
is_admin
Is Admin
boolean
allowed_characters
Allowed Characters
Empty allows every character
Array<string>
allowed_workflows
Allowed Workflows
Empty allows every workflow
Array<string>
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_characters
required
Allowed Characters
Array<string>
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_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" }, "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" } ]}