Create an agent
Creates an agent from a `config` (see the AgentConfig schema). It starts as a `draft`; publish it with publishAgent, or send `status: published`. Values outside the documented range or list, and a language, voice or model that is not available, are refused with `parameter_invalid` naming the field (for example `config.voice`).
Creates an agent from a config (see the AgentConfig schema). It starts as a draft; publish it with publishAgent, or send status: published. Values outside the documented range or list, and a language, voice or model that is not available, are refused with parameter_invalid naming the field (for example config.voice).
X-API-Key<token>Create in the console: Settings → API & webhooks.
Idempotency-Key?stringAny unique string up to 255 characters. Retrying with the same key and body within 24 hours returns the first result instead of acting twice.
length <= 255application/json- body
A new agent. It starts as a draft unless status is published.
config?Agent configuration.
name?NameDisplay name; also the name the agent introduces itself with.
length <= 255""sourceTemplateId?|Template id this agent is based on.
sourceTemplateSlug?|Template slug this agent is based on.
sourceTemplateVersion?|Template version this agent is based on.
status?|draft (default) or published.
"draft""published"OK
application/json- response
One agent.
agent*An AI agent: its live configuration, draft, status and numbers.
success?SuccessAlways true on success.
true[key: string]?anycurl -X POST 'https://api.callmitra.ai/api/v1/agents/' \ -H 'Content-Type: application/json' \ -d '{ "config": { "language": "hi-IN", "llm_model": "gpt-4o-mini", "stt": "sarvam", "template_payload": { "greeting_message": "Namaste, main Acme Realty se Priya bol rahi hoon.", "system_prompt": "You are Priya from Acme Realty. Qualify the lead'\''s budget and preferred area." }, "tts": "sarvam", "voice": "priya" }, "name": "Priya"}'{ "agent": { "config": { "language": "hi-IN", "llm_model": "gpt-4o-mini", "tts": "sarvam", "voice": "priya" }, "id": "3f0c2a9e-6a51-4c6e-9a3e-2d1b7c4e8f10", "language": "hi-IN", "name": "Priya", "rosterState": "in_training", "status": "draft", "takingCalls": false, "unpublishedChanges": false }, "success": true}