Managing agents
Create, update and retire agents from code.
Agents can be set up in the dashboard's Agent Studio or entirely through the API. Use the API when you keep many similar agents, for example one per branch, or want agent configuration under version control.
Requires agents:read to read agents and agents:write to change them.
Choose a voice
Voices are public. List them, optionally for one language, and use the voice_name:
curl "https://api.resonera.ai/voices?language_code=hi-IN"Voices with supports_code_switching: true handle mixed speech such as Hinglish naturally. Each
voice has a demo_url you can play before choosing.
Create an agent
curl -X POST https://api.resonera.ai/agents \
-H "X-API-Key: $RESONERA_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "Neha",
"voice_name": "neha_chariot",
"greeting": "Namaste, this is Neha calling from Acme Dental.",
"call_purpose": "Confirm tomorrow'\''s appointment",
"prompt": "You are Neha from Acme Dental in Pune. Confirm the patient'\''s appointment for tomorrow. If they cannot make it, offer to call back to reschedule. Never discuss treatment or prices.",
"tools": ["schedule_callback", "take_message", "summarize_call"]
}'language defaults to the voice's language. The response is the new agent with its id.
Writing a good prompt
- Say who the agent is and who it represents, in the second person: "You are Neha from…".
- State the one goal of the call.
- List what it must always and never do. "Never make up prices" prevents most bad calls.
- Keep it short and speakable. The agent's language, tone and call-ending rules are added automatically, so don't repeat them.
- Put long reference material (price lists, FAQs) in the knowledge base instead, and attach it with
kb_item_ids.
Update an agent
Send only what changes. It applies from the agent's next call; calls in progress are unaffected.
curl -X PATCH https://api.resonera.ai/agents/$AGENT_ID \
-H "X-API-Key: $RESONERA_KEY" \
-H "Content-Type: application/json" \
-d '{"greeting": "Hi, this is Neha from Acme Dental."}'Inbound agents
An agent with "direction": "inbound" answers calls to a phone number. Assign it to a number in
the dashboard, then set it live:
curl -X PATCH https://api.resonera.ai/agents/$AGENT_ID \
-H "X-API-Key: $RESONERA_KEY" -H "Content-Type: application/json" \
-d '{"status": "active"}'Your plan may limit how many agents are active at once; going over returns 402.
Delete an agent
DELETE /agents/{agent_id} removes it. Its past calls, transcripts and campaigns stay, with
agent_id set to null.
Plan limits
Creating agents counts against your plan's agent limit, and an agent's language must be one your
plan includes. Either limit returns 402 with error.limit naming which, such as
agent_limit_exceeded or language_not_allowed.