Agents
Create an agent
POST
Creates the aggregate at revision 1 and seeds exactly one mutable draft. Use the returned Location for the canonical agent representation and its ETag for conditional follow-up writes.
bearerAuthheader
AuthorizationBearer <token>Use a Voice API key or connected-app OAuth access token. Authentication.
Idempotency-Key*stringRequired. Reuse the same key to retry this write safely. Retries and idempotency.
Match
^[A-Za-z0-9!#$%&'*+.^_`|~-]+$Length
1 <= length <= 255application/json- body
slug*stringStable routing identifier. It cannot be renamed after creation.
Match
^[a-z0-9_]+$Length
2 <= length <= 48name*stringLength
1 <= length <= 200mode*"prompt"Value in
"prompt"prompt?AgentPromptTemplateOptional initial prompt template. Omit, send an empty string, or send only whitespace to seed the platform default. See AgentPromptTemplate for the complete variable contract.
Length
length <= 500000Success
application/json- response
id*stringFormat
uuidslug*stringname*stringmode*"prompt"Value in
"prompt"draft_version_id*stringFormat
uuidrevision*integerInitial aggregate revision. Supply the response ETag rather than constructing one from this number.
Format
int64Range
1 <= valueupdated_at*stringFormat
date-timecurl -X POST 'https://api.kejue.co/v1/agents' \ -H 'Idempotency-Key: string' \ -H 'Content-Type: application/json' \ -d '{ "slug": "billing_assistant", "name": "Billing Assistant", "mode": "prompt", "prompt": "Help {{lead_name}} resolve their billing question. Never request a secret; use call {{system.call_id}} for support correlation."}'Example Response
{ "id": "11111111-1111-4111-8111-111111111111", "slug": "billing_assistant", "name": "Billing Assistant", "mode": "prompt", "draft_version_id": "22222222-2222-4222-8222-222222222222", "revision": 1, "updated_at": "2026-07-20T09:00:00Z"}