Skip to main content
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 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

The request body uses to_number (not to). Sending to will fail with missing_field. (to is used by the SMS endpoints, not by outbound calls.)

How the dialing number is chosen

You do not have to pass from_number. The engine works out which of your numbers to dial from in this order:
  1. 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 get from_number_not_found.
  2. You omitted from_number → the engine picks the agent’s first outbound-enabled number.
  3. 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.
If none of these produce a usable number, you get agent_missing_phone_number.

Dynamic variables

Anything in dynamic_vars is interpolated into the prompt. Reference each value with curly braces:
The engine replaces {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:
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 webhook_url set.

Validation order

The engine checks these in order and stops at the first failure:
  1. agent_id, to_number, and prompt are all present (and prompt is not blank).
  2. to_number is valid E.164 (e.g. +447386172392, not 07386172392).
  3. The agent exists and belongs to your API key.
  4. 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.
  5. Carrier credentials exist for that number.
Each failure returns a 400 with a specific code (see below).

Errors

What happens next

After you trigger the call:
  1. Your carrier dials the to_number using the chosen outbound number.
  2. Voicemail detection runs - the AI reads the first thing it hears.
  3. If voicemail is detected, the agent leaves a short message from your prompt and ends the call. See Voicemail detection.
  4. If a human answers, the agent starts the conversation using your prompt.
  5. The call ends naturally, or via [END_CALL], or on timeout.
  6. The recording is saved and post-call analysis runs.
  7. A call.completed webhook fires to your webhook_url if one is set.
See Outbound calls for the full conceptual overview.