Create outbound call
Calls
Create outbound call
POST /v1/calls/outbound
POST
Create outbound call
Triggers Nixflex to call a phone number. The agent dials, waits for pickup, runs voicemail detection, and starts the conversation when a human answers.
The call is fire-and-forget: the request returns immediately with a
The engine replaces
The response returns immediately. Your carrier dials within about 5 seconds. The actual call lifecycle (ringing → connected → ended) happens asynchronously — you will receive a webhook when the call ends if you have a
call_id, then the actual ringing, conversation, and ending all happen asynchronously. If you want the result, set a webhook_url on the agent (or on the number) and you will receive a call.completed event when the call ends.
The number you dial from must be outbound-enabled. A number that only handles inbound calls will not place outbound calls. Enable outbound on the Phone Numbers page (or when you import the number). Inbound working does not mean outbound works — they are separate switches.
Request
Body parameters
How the dialing number is chosen
You do not have to passfrom_number. The engine works out which of your numbers to dial from in this order:
- You passed
from_number→ the engine uses exactly that number, but only if it is outbound-enabled and belongs to this agent under your API key. If it is not, you getfrom_number_not_found. - You omitted
from_number→ the engine picks the agent’s first outbound-enabled number. - Legacy fallback → if the agent has no rows in the phone numbers table, it falls back to the single number stored on the agent itself.
agent_missing_phone_number.
Dynamic variables
Anything indynamic_vars is interpolated into the prompt. Reference each value with curly braces:
{patient_name} with "Sarah" before the agent speaks. If the prompt references a variable that is not in dynamic_vars, it is left as-is — the agent will see the literal {patient_name} text, so double-check your keys match.
Response
201 Created:
webhook_url set.
Validation order
The engine checks these in order and stops at the first failure:agent_id,to_number, andpromptare all present (andpromptis not blank).to_numberis valid E.164 (e.g.+447386172392, not07386172392).- The agent exists and belongs to your API key.
- The agent has an outbound-enabled number assigned. Inbound-only numbers do not count. If you passed a specific
from_number, it must be outbound-enabled on this agent. - Carrier credentials exist for that number.
400 with a specific code (see below).
Errors
What happens next
After you trigger the call:- Your carrier dials the
to_numberusing the chosen outbound number. - Voicemail detection runs - the AI reads the first thing it hears.
- If voicemail is detected, the agent leaves a short message from your prompt and ends the call. See Voicemail detection.
- If a human answers, the agent starts the conversation using your
prompt. - The call ends naturally, or via
[END_CALL], or on timeout. - The recording is saved and post-call analysis runs.
- A
call.completedwebhook fires to yourwebhook_urlif one is set.