Skip to main content

Outbound Call Dispatch

The Outbound Call Dispatch API queues one or more outbound calls from a voice agent — its published version, or its draft. Dispatch is asynchronous: the API returns 202 Accepted immediately with a batch identifier, and you poll a status endpoint to track each call as it dials, then ends answered, unanswered, or failed.

When to Use This​

  • Place outbound calls programmatically from your backend, CRM, or scheduler.
  • Dial a list of numbers in one request and track them as a single batch.
  • Retry safely with an idempotency key so duplicate requests don't dispatch twice.

Prerequisites​

  • A voice agent. Calls run its published version; to call with unpublished changes, send "agent_version": "draft" — see Calling with the draft.
  • A number to call from: the outbound FROM number of the version you call (Call Configuration → Outbound Settings), or any active number in your workspace, sent as source_phone_number.
  • An API Key with the Calls scope, or the older Voice Agent scope. If the key uses a specific Agent Access list, the target agent_id must be on that list.

Authentication​

Every request must include your key, in the api-key header or as a Bearer token — see API Keys for how to generate and manage tokens. The examples on this page use api-key.

api-key: sk_<your-secret>

or

Authorization: Bearer sk_<your-secret>

A missing, invalid, disabled, expired, scope-mismatched, or agent-denied key fails with 401/403. Requests made with one of your keys, refused ones included, are recorded in Request Logs with a matching error code. A request with no key or an unknown key can't be tied to your workspace, so it isn't.

Create a dispatch​

POST /voice/outbound/dispatch

Headers​

HeaderRequiredDescription
api-keyYesYour API key secret, which must have the Calls scope. You can send Authorization: Bearer <key> instead
Content-TypeYesapplication/json
Idempotency-KeyNoAny string up to 255 characters. Re-sending a key returns the original batch instead of creating a new one — see Idempotency.

Body​

FieldTypeRequiredDescription
agent_idstringYesUUID of the voice agent to dispatch from. It must be published, unless agent_version is draft
destination_phonenumberstring or array of stringsYesOne or more destination numbers in E.164 format (e.g., +14155551234): +, country code, number. Spaces, dashes and brackets are allowed; numbers come back in plain E.164. Up to 500 numbers per request by default. A number repeated in the request is dialed once — see Duplicate numbers.
source_phone_numberstringNoThe number to dial from, in E.164. Any active phone number in your workspace — it does not have to be one this agent is configured with. Omit it to use the outbound FROM number of the version the calls run (published, or the draft's).
agent_versionstringNopublished (default) or draft. draft runs the agent's current unpublished configuration — see Calling with the draft
agent_overridesobjectNoPer-call changes to the agent's configuration, for these calls only — see Agent overrides
metadataobjectNoFree-form key/value pairs for your own correlation, echoed back in webhooks. Up to 8 KB as JSON. Keys the platform uses for its own routing (batch_id, dispatch_index, dispatch_attempt, dynamic_variables, campaign_uuid, campaign_row_index, campaign_fields, is_alternate_number) are dropped.

Any other top-level field is ignored, not rejected, and named in the response's ignored_fields — check it to catch a misspelt field name.

Example request​

curl -X POST https://<your-dronahq-host>/voice/outbound/dispatch \
-H "api-key: sk_your-generated-secret-here" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: campaign-2026-06-23-batch-7" \
-d '{
"agent_id": "<voice-agent-uuid>",
"destination_phonenumber": [
"+14155551234",
"+919876543210"
],
"metadata": {
"campaign_id": "spring-renewal",
"tier": "premium"
}
}'

Agent overrides​

agent_overrides changes the agent for the calls in this request only; the published agent is untouched. Send blocks in the same shape the agent's published snapshot uses — every key is optional, and anything you leave out keeps its published value.

KeyWhat it changes
llmModel, provider, prompt and generation settings
voiceThe text-to-speech voice and its settings
transcriberSpeech-to-text provider, model and settings
greetingThe first message and how the call opens (firstMessage, agentSpeaksFirst, speakingBehaviourType, silence and welcome-delay settings). A firstMessage is spoken as written even when the agent's greeting is set to Dynamic message; send "speakingBehaviourType": "dynamic" with it to keep the generated greeting
firstMessageShorthand for greeting.firstMessage
languagesThe languages the agent recognises and speaks (legacy language is also accepted)
timezoneThe agent's timezone
speech_recoveryHow the agent recovers from unclear or missed speech
conversation_settingsCall-level conversation limits, such as the total call timeout
runtime_behaviourConversation behaviour — interruption handling, backchanneling, conversation memory
dynamic_variablesValues for the agent's {{variable.name}} placeholders. Names the agent doesn't define are dropped and listed in the response's ignored_variables, not in ignored_overrides

Anything else is ignored, not rejected — including tools, knowledge_base, memory, privacy, webhook_settings, structured_outputs_json, and the rest of call (phone numbers, transfer targets, data sources). Those belong to the agent and change only by publishing it. A listed key with the wrong type is ignored too: firstMessage and timezone take a plain value, languages a list, and every other key an object. The response names each ignored key in ignored_overrides, spelt as you sent it.

If an override switches the llm, voice, or transcriber provider, a usable key for that provider must be configured in your workspace and the model must exist for that provider — otherwise the request fails with 400 before anything is queued.

Example request with overrides​

curl -X POST https://<your-dronahq-host>/voice/outbound/dispatch \
-H "api-key: sk_your-generated-secret-here" \
-H "Content-Type: application/json" \
-d '{
"agent_id": "<voice-agent-uuid>",
"destination_phonenumber": ["+91XXXXXXX210"],
"agent_overrides": {
"languages": ["en"],
"timezone": "Asia/Calcutta",
"greeting": {
"firstMessage": "Hello! I am Parijit from GreatTrips, how may I help you today?",
"agentSpeaksFirst": true,
"speakingBehaviourType": "custom"
},
"llm": {
"model": "gpt-4o",
"provider": "openai",
"system_instructions": "<your system prompt>",
"promptCache": {
"enabled": true
},
"config": {
"temperature": 0.7,
"max_tokens": 4000,
"recursion_limit": 25
}
},
"voice": {
"model": "eleven_turbo_v2_5",
"voiceId": "inputyourvoiceid007",
"provider": "elevenlabs",
"generation_config": {
"speed": 1.1,
"style": 0.8,
"stability": 0.6,
"similarity_boost": 0.8,
"use_speaker_boost": true,
"apply_text_normalization": "auto",
"ambiance": {
"backgroundSound": "off",
"backgroundSoundUrl": null,
"backgroundSoundVolume": 0,
"backgroundNoisingEnabled": false
},
"chunkPlan": {
"enabled": false,
"bufferPlan": {
"type": "fixed",
"bufferSeconds": 0.1
},
"minCharacters": 30,
"punctuationBoundaries": [".", "!", "?", ",", ";", ":"]
},
"formatPlan": {
"enabled": false,
"replacements": [],
"numToDigitCutoff": 2
}
}
},
"transcriber": {
"model": "nova-3",
"provider": "deepgram",
"generation_config": {
"keyterm": [],
"numerals": false,
"profanityFilter": false,
"confidenceThreshold": 0.6,
"smartEndpointingEnabled": true,
"backgroundDenoisingEnabled": false
}
},
"dynamic_variables": {
"customer_name": "Aarav",
"booking_id_last4": "4821"
}
}
}'

greeting​

FieldTypeDescription
firstMessagestringWhat the agent says when the call connects
agentSpeaksFirstbooleanIf true, the agent speaks before the caller
speakingBehaviourTypestringHow the greeting is delivered (e.g., custom)

llm​

FieldTypeDescription
modelstringModel name (e.g., gpt-4o)
providerstringModel provider (e.g., openai)
system_instructionsstringThe agent's system prompt
promptCache.enabledbooleanEnables prompt caching
configobjecttemperature, max_tokens, and recursion_limit

voice​

FieldTypeDescription
modelstringText-to-speech model (e.g., eleven_turbo_v2_5)
providerstringVoice provider (e.g., elevenlabs)
voiceIdstringVoice identifier from the provider
generation_configobjectSpeech settings: speed, style, stability, similarity_boost, use_speaker_boost, apply_text_normalization, ambiance, chunkPlan, formatPlan

transcriber​

FieldTypeDescription
modelstringSpeech-to-text model (e.g., nova-3)
providerstringTranscription provider (e.g., deepgram)
generation_configobjectkeyterm, numerals, profanityFilter, confidenceThreshold, smartEndpointingEnabled, backgroundDenoisingEnabled

dynamic_variables​

dynamic_variables passes runtime values into the agent for the calls in this dispatch. Each key is a variable name, and each value is the data the agent uses for that variable.

Reference a variable in the agent’s instructions, greeting, or tool parameters with the standard notation: {{variable.<name>}}.

When a key matches a variable already defined in the agent’s Variables section, the value you send overrides the saved value for these calls. See Variables for how to define variables in the builder, or define them through the Voice Agents API. Publish the agent after you add one: a dispatch checks names against the version it calls.

FieldTypeDescription
<variable_name>stringThe value for the agent variable with this name. One entry per variable

Calling with the draft​

Send "agent_version": "draft" to test changes before you publish them. The calls run the agent's current draft — configuration, skills and variables — exactly as Test call in the agent builder does, and the agent doesn't need to have been published.

  • agent_overrides apply on top of the draft, and dynamic_variables are checked against the draft's variables.
  • Without source_phone_number, the calls dial from the draft's outbound FROM number. If the draft sets none, they dial from the one active phone number linked to the agent. If there is no such number, or there are several, the request fails with 400 before anything is queued.
  • Draft calls, answered or not, are billed and recorded like any other call. They show agent_draft: true in the Call Data API, and their post-call webhook goes to the draft's webhook settings, with agent.draft: true.

Duplicate numbers​

Each number is dialed once per request. Repeats — including the same number written differently (+1 415 555 1234 and +14155551234) — are dropped, the first occurrence is kept, and the order of the rest is preserved. The response reports how many were dropped in duplicates_removed.

Calls are numbered after duplicates are removed: a call's index in the status response, and dispatch_index in webhooks, is its position in the de-duplicated list, not in your request. Sending [A, B, A, C] gives A = 0, B = 1, C = 2. The 202's calls lists each number with its index, so you can match them to your own records straight away. You can also send your own ID in metadata.

Response — 202 Accepted​

FieldTypeDescription
dispatch_idstringUUID for this batch; use it with the status endpoint below
acceptedintegerCount of numbers accepted into the batch, after duplicates are removed
duplicates_removedintegerRepeated numbers dropped from the request
ignored_overridesarray of stringsagent_overrides keys that were ignored, spelt as you sent them — see Agent overrides. Empty when none were
ignored_fieldsarray of stringsTop-level request fields dispatch doesn't take, ignored rather than rejected. Empty when every field was recognised
ignored_variablesarray of stringsagent_overrides.dynamic_variables names the agent doesn't define, dropped. Empty when every name was known, and always empty on an idempotent replay
callsarray of objectsEach accepted number as {index, phone_number}, in the order they dial. index is the call's position in the status response — see Duplicate numbers
status_urlstringRelative URL to poll for batch status
{
"dispatch_id": "f0c1a3f2-9e1c-4b21-9b8b-5a9c0f0a1e3a",
"accepted": 2,
"duplicates_removed": 0,
"ignored_overrides": [],
"ignored_fields": [],
"ignored_variables": [],
"calls": [
{ "index": 0, "phone_number": "+14155551234" },
{ "index": 1, "phone_number": "+919876543210" }
],
"status_url": "/voice/outbound/dispatch/f0c1a3f2-9e1c-4b21-9b8b-5a9c0f0a1e3a"
}

Get batch status​

GET /voice/outbound/dispatch/{dispatch_id}

Returns the current state of every call in the batch.

Headers​

HeaderRequiredDescription
api-keyYesYour API key secret, which must have the Calls scope and access to the batch's agent_id. You can send Authorization: Bearer <key> instead

Example response — 200 OK​

{
"dispatch_id": "f0c1a3f2-9e1c-4b21-9b8b-5a9c0f0a1e3a",
"agent_id": "a1d3...",
"created_at": "2026-06-23T10:14:02.418312+00:00",
"total": 2,
"queued": 0,
"dialing": 1,
"completed": 1,
"answered": 1,
"unanswered": 0,
"failed": 0,
"retrying": 0,
"cancelled": 0,
"finished": false,
"calls": [
{
"index": 0,
"phone_number": "+14155551234",
"status": "answered",
"attempts": 1,
"error_code": null,
"error_message": null,
"started_at": "2026-06-23T10:14:05.102947+00:00",
"completed_at": "2026-06-23T10:15:22.880113+00:00",
"call_id": "3f9a1c7e2b8d4f6a9e0b1c2d3e4f5a6b",
"updated_at": "2026-06-23T10:15:22.894507+00:00"
},
{
"index": 1,
"phone_number": "+919876543210",
"status": "dialing",
"attempts": 1,
"error_code": null,
"error_message": null,
"started_at": "2026-06-23T10:14:05.231806+00:00",
"completed_at": null,
"call_id": "7c2e9b4d1f6a4e3b9d0c5a8f2b1e6d47",
"updated_at": "2026-06-23T10:14:05.240118+00:00"
}
]
}

Timestamps are UTC, in ISO 8601 with a +00:00 offset and usually microseconds.

Call fields​

FieldDescription
indexThe call's position in the batch, after duplicates are removed — see Duplicate numbers
phone_numberThe number dialed, in E.164
statusSee Call status values
attemptsDial attempts so far, including retries
error_code, error_messageWhy the call failed, or why its last attempt failed when it is being retried — see Per-call error codes
started_atWhen the latest attempt started dialing
completed_atWhen the call ended, failed or was cancelled
call_idThe latest attempt's call ID; null until the call first dials. Each attempt gets a new one. Use it with live call control while the call is on, and with the Call Data API once its record is written — see the note below
updated_atWhen this call's entry last changed. Poll and skip the calls whose updated_at you have already seen
When the Call Data API has the call

A call's record is written when the agent finishes with it, a few minutes after hang-up. Until then the Call Data API answers 404 for its call_id. An agent with Zero Data Retention or call logging turned off keeps no record of an answered call, so its call_id stays a 404 there.

While a dispatched call is live, live call control's GET also shows which API key placed it: "created_by": {"kind": "api_key", "id": "<key id>"}.

Call status values​

StatusMeaning
queuedWaiting for a free concurrency slot; not dialed yet — see Limits
dialingThe call is being placed, ringing, or in conversation — it hasn't ended
answeredA person picked up, and the call has ended
unansweredThe call ended without a person picking up — no answer, busy, voicemail, or a carrier failure after dialing
failedThe call couldn't be placed, never got a free concurrency slot, or no end-of-call signal arrived; error_code and error_message describe why
retryingThe call failed before it was placed and will be retried (subject to the retry budget)
cancelledStopped with Cancel calls before it dialed. A call cancelled while queued has no call_id, no call log and no webhook. One cancelled while retrying keeps the call_id of its last failed attempt

Voicemail counts as unanswered: a machine picked up, not a person. For the detailed outcome, transcript and recording of a call, use its call_id with the Call Data API, once its record is written — see When the Call Data API has the call.

The batch-level completed count is every call that has ended, whether answered or unanswered (answered + unanswered). A batch is finished when completed + failed + cancelled equals total; finished is then true.

completed before this change

Calls that ended before the answered / unanswered split still have the status completed until the batch ages out of retention. They are included in the completed count, but not in answered or unanswered.

Cancel calls​

POST /voice/outbound/dispatch/{dispatch_id}/cancel

Stops calls that haven't dialed yet — queued (waiting for a free slot) or retrying (waiting for their next attempt). They move to cancelled straight away and are never dialed.

A call that is already dialing is not stopped here. End it with end_call through live call control (POST /voice/control/{call_id}), using the call_id from the status response. Live call control takes no API key: the call_id is the credential, so keep it private.

Body​

Optional. Send no body, {}, or {"indexes": null} to cancel every call in the batch that hasn't dialed.

FieldTypeRequiredDescription
indexesarray of integersNoOnly these calls, by their index in the status response. At least one

Unlike create, an unknown field is rejected (422): leaving indexes out cancels everything, so a misspelt index must not be read as "all".

curl -X POST https://<your-dronahq-host>/voice/outbound/dispatch/f0c1a3f2-9e1c-4b21-9b8b-5a9c0f0a1e3a/cancel \
-H "api-key: sk_your-generated-secret-here" \
-H "Content-Type: application/json" \
-d '{"indexes": [1, 2]}'

Response — 200 OK​

Every call you asked about, with what happened to it. cancelled counts the calls this request cancelled.

{
"dispatch_id": "f0c1a3f2-9e1c-4b21-9b8b-5a9c0f0a1e3a",
"cancelled": 1,
"calls": [
{
"index": 1,
"phone_number": "+919876543210",
"status": "dialing",
"cancelled": false,
"call_id": "7c2e9b4d1f6a4e3b9d0c5a8f2b1e6d47",
"detail": "Already dialing. End it with live call control: POST /voice/control/7c2e9b4d1f6a4e3b9d0c5a8f2b1e6d47 with {\"type\": \"end_call\", \"command_id\": \"<your unique id: 8-64 letters, digits, - or _>\"}."
},
{
"index": 2,
"phone_number": "+14155550199",
"status": "cancelled",
"cancelled": true,
"call_id": null,
"detail": null
}
]
}
  • call_id is the one the status response shows. null for a call cancelled while queued; the last failed attempt's for one cancelled while retrying.
  • Cancelling twice is not an error. A call cancelled earlier comes back with cancelled: true and detail: "Already cancelled.", and isn't counted again.
  • Nothing cancellable → 409. If none of the calls could be cancelled — they had all dialed or ended — the response is 409, with detail.error: "nothing_to_cancel", a detail.message, and the same per-call list in detail.calls.
  • A cancel and a dial can't both win. If a call starts dialing at the moment you cancel it, exactly one of the two happens, and the response tells you which.
  • A cancelled call that was waiting for a slot gives the slot up without dialing.

Idempotency​

Send Idempotency-Key: <your-string> on the create request to make retries safe. Use any stable string up to 255 characters that your system can regenerate on retry — a campaign-batch ID, a job ID from your scheduler, or a UUID you store before the call. Keys are per workspace and remembered for 24 hours by default.

You re-send the key…Response
With the same body, after the original was accepted202 with the original dispatch_id, accepted count and calls, plus the header Idempotent-Replayed: true. ignored_variables is empty on a replay: it is only checked when the batch is created. Nothing new is dialed
With the same body, while the original is still being accepted409 with Retry-After: 5. Retry after that, and you get the replay
After the original request failedProcessed as a new request
With a different body422 with detail.error: "idempotency_key_reused". Nothing is dialed

Fields dispatch ignores, and the formatting of the numbers, don't make a body different.

Limits​

LimitDefaultNotes
Numbers per request500Counted after duplicates are removed. Requests exceeding this fail with 400.
metadata size8 KBAs JSON. Larger requests fail with 422.
Concurrent calls3 per workspaceShared with outbound test calls placed from the app. A call holds its slot until it ends; beyond this, calls stay queued.
Wait for a free slot5 minutesPer call, from when the batch is accepted (or from its retry). A call still waiting then fails with QUEUE_QUEUE_TIMEOUT.
Calls waiting for a slot500 per workspaceBeyond this, a call fails at once with QUEUE_QUEUE_FULL.
Attempts per call3In total, so up to 2 retries, a few seconds apart. Only for retriable failures (see below).

Every call in a batch starts waiting for a slot as soon as the batch is accepted. If your workspace can't dial the whole batch within the wait, the calls left over fail with QUEUE_QUEUE_TIMEOUT — send smaller batches, or raise the limits.

Concurrent calls (the Public API share), queue size and queue timeout are workspace settings under Concurrency Management. The other defaults are operator-configurable; check with your administrator if you need them tuned.

Errors​

API errors (entire request fails)​

Every error body is {"detail": ...}. detail is a string, except:

  • idempotency_key_reused (422) and nothing_to_cancel (409): an object with error and message — plus calls for the cancel.
  • Other 422s: an array with one entry per problem, each naming the field (loc) and the reason (msg).
HTTP statusCauseFix
400Too many numbers in one requestSplit into batches of ≤ 500
400Invalid agent or given agent is not published — the agent exists but isn't publishedPublish the agent, or send "agent_version": "draft"
400No source_phone_number sent and the agent has no active outbound FROM numberPick an outbound number in Call Configuration → Outbound Settings, or send source_phone_number
400Agent is not ready to dispatch draft calls: …A draft call with no source_phone_number, and the draft has no usable outbound FROM number. The message says why. Set one in the draft's Call Configuration, or send source_phone_number
400source_phone_number is not a phone number in your workspace, or is inactiveAdd or reactivate it under Phone Numbers
400An override switches to a provider with no usable key, or a model that provider doesn't offerConfigure the provider key, or fix the model
400Cancel named an index the batch doesn't haveUse the indexes from the status response
401 / 403Auth failure on the API keyA missing or unknown key is a 401 and isn't logged. Otherwise see the error-code chip in Request Logs (disabled, expired, scope_denied, agent_denied). An agent_id that doesn't exist in your workspace, or a dispatch_id from another workspace, is also 403 agent_denied
404No batch with this dispatch_id, on the status or cancel endpointDouble-check the UUID. Batches are kept for 30 days
409A request with this Idempotency-Key is still being acceptedRetry after Retry-After seconds — see Idempotency
409Cancel found nothing to cancel — every call had dialed or endedEnd a live call with end_call through live call control
422A number that isn't valid E.164, an empty number list, metadata larger than 8 KB, an agent_version other than published or draft, or an Idempotency-Key longer than 255 charactersFix the field named in detail
422idempotency_key_reused — this Idempotency-Key was already used with a different bodyUse a new key for a new request
422Cancel body has an unknown field, or an empty / non-list indexesSend {"indexes": [..]}, or no body to cancel all

Per-call error codes​

When a single call inside a batch fails, the call's error_code is one of:

CodeRetriable?Meaning
INVALID_NUMBERNoNumber was rejected by the carrier as malformed or unreachable
PROVIDER_REJECTEDNoTelephony provider refused to place the call (geo block, balance, etc.), or the agent was unpublished after the request was accepted
PROVIDER_UNAVAILABLEYesProvider was temporarily unavailable and refused the request (HTTP 429 or 503)
PROVIDER_ERRORNoProvider returned a server error (HTTP 500, 502 or 504). The call may already have been placed
LIVEKIT_ERRORYesThe voice session could not be prepared, before anything was dialed
TIMEOUTNoPlacing the call took longer than 2 minutes
INTERNAL_ERRORNoUnexpected failure inside DronaHQ
TIMEOUT_NO_TERMINALNoThe call was placed, but no end-of-call signal arrived. A live call is never marked this: from 5 minutes after it was placed, it is checked every 30 seconds and keeps its concurrency slot while it is live. It is marked only once it has ended with no signal, or after 4 h 10 min
QUEUE_QUEUE_TIMEOUTNoNo concurrency slot freed up within the wait (5 minutes by default). Never dialed
QUEUE_QUEUE_FULLNoToo many calls were already waiting for a slot in your workspace (500 by default). Never dialed
QUEUE_FAIL_CLOSEDNoConcurrency couldn't be checked, and this deployment refuses calls when that happens. Never dialed

Only failures that happen before the carrier places the call are retried. TIMEOUT, INTERNAL_ERROR and PROVIDER_ERROR can happen after the call has already gone out, and retrying them could ring the same person twice, so they end the call as failed instead. The QUEUE_ codes aren't retried either, but those calls never dialed: dispatch the number again once capacity frees up.

A call that rings out, is busy, or reaches voicemail is not an error: it ends as unanswered.