Outbound calls
Placing a call, and reading what happened.
curl "$TONE_API/v1/calls" -X POST \
-H "Authorization: Bearer $TONE_KEY" \
-H "Idempotency-Key: $(uuidgen)" \
-H 'content-type: application/json' \
-d "{\"agentId\":\"$AGENT\",\"numberId\":\"$NUMBER\",\"toE164\":\"+919876543210\"}"agentId is required on a number that routes to a Tone agent and
forbidden on a BYO number — the number decides which, and either mistake is a
422.
Opening in another language
An agent opens every call in its first language. To open one call in another,
send language:
curl "$TONE_API/v1/calls" -X POST \
-H "Authorization: Bearer $TONE_KEY" \
-H "Idempotency-Key: $(uuidgen)" \
-H 'content-type: application/json' \
-d "{\"agentId\":\"$AGENT\",\"numberId\":\"$NUMBER\",\"toE164\":\"+919876543210\",\"language\":\"hi-IN\"}"For that call only, the language is the agent's primary: the opening line and the introduction are spoken in it, and the agent replies in it until the caller moves the call to another of its languages, as on any call. It is exactly what listing that language first on the agent would do, without editing the agent.
It must be one of the agent's own languages — hi-IN, or hi for short. Those
are the languages its voice was checked against and its opening line translated
into when it was saved, so any other is a 422 unsupported_language naming the
ones it speaks. The check reads the agent's published version. The call returns
it as language, in the agent's spelling. It is not allowed on a number that
routes to your own stack, which chooses its own language.
What happens before the carrier is called
The compliance gate runs inside the same transaction as the call
record. So a refusal is a 403 with the audit rows already written and no
carrier contacted — the block and its evidence are the same event.
One thing runs before the gate: your concurrency quota. A dial over it is not
refused. It waits for one of your calls to end (below). Only when 400 of your
dials are already waiting do you get 429 concurrent_call_limit_reached, with no
verdict recorded, because no dial was attempted. That is a different failure
from a rate limit and needs a different response — see Limits.
Lifecycle
status | |
|---|---|
queued | Accepted; the carrier has not connected it yet |
in_progress | Connected |
ended | Finished. disposition now says how |
disposition | |
|---|---|
answered | A person picked up |
no_answer | Rang out |
busy | Engaged |
voicemail | An answering machine took it |
failed | The carrier could not complete it |
unknown | We genuinely do not know |
Treat both as open sets — new values can appear and are not a breaking change.
Two honesty rules worth knowing: a call abandoned in queued reads as ended
after 15 minutes, and one stuck in_progress past 65 minutes reads as ended with
unknown and bills nothing. For a call that waited for a slot in your limit,
both are counted from the moment it got one. We would rather report "we do not know" than
invent an outcome or charge for one.
When your organization is at its concurrent-call limit
Send your calls as fast as you like. A dial made while your organization already
has as many calls up as its limit allows is still accepted: you get
201 with status: queued, and Tone places it as soon as one of your calls
ends, in the order your dials arrived. A dial never overtakes one that is
already waiting. A batch of 50 at a limit of 7 therefore runs 7 at a time, with
nothing for you to retry.
A call that waits longer than 2 hours is not placed. It ends with
disposition: failed and endReason: concurrency_limit, and you get the usual
call.completed and call.failed events. While it waits it reads as
status: queued: the 15-minute abandoned rule above does not start until it has
a slot. Once it has one it may still wait for a carrier line, as below. More than 400 dials waiting at once is
refused with 429 concurrent_call_limit_reached, with details.waiting saying
how many wait.
Your compliance check ran when the call was accepted. Just before a call that
waited is dialled, Tone checks your do-not-call list again: a
number that opted out in the meantime is not called, and the call ends with
endReason: blocked_dnc.
When the carrier's lines are all busy
Every carrier account carries a fixed number of calls at once, shared by
everyone dialling through it. When they are all in use, your dial is still
accepted: you get 201 with status: queued, and Tone places the call the
moment a line frees, in the order calls arrived. A call that waits longer than
10 minutes is not placed. It ends with disposition: failed and
endReason: carrier_capacity, and you get the usual call.completed and
call.failed events.
A promotional call whose calling window closes while it waits ends with
endReason: calling_window_closed instead of being placed late.
Reading it back
Poll if you must, but the call log is not where you should learn a call ended:
curl "$TONE_API/v1/calls/$CALL" -H "Authorization: Bearer $TONE_KEY"Subscribe to call.completed instead. See Webhooks.
To find every call one campaign placed — retries included — filter the call log rather than reading the recipient list, which names only each recipient's last attempt:
curl -H "Authorization: Bearer $TONE_KEY" \
"$TONE_API/v1/calls?campaign_id=$CAMPAIGN&limit=100"Test mode
The magic numbers produce fixed outcomes, so CI can assert on them, and nothing rings. See Test mode.