Skip to content

Outbound calls

POST /v1/calls calls one person with an assistant. MoreVoice checks the call against the compliance rules, dials it, and answers straight away with the call object; the conversation then runs on its own. To call a list of people within calling hours, with retries, use a campaign instead.

Terminal window
# A reminder call. The Idempotency-Key is your own ID for this call: a retry with the same key
# returns the first answer and never dials twice.
curl https://api.morevoice.ai/v1/calls \
-H "Authorization: Bearer $MOREVOICE_API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: reminder-$APPOINTMENT_ID" \
-d '{
"to": "+972501234567",
"from_number_id": "'"$FROM_NUMBER_ID"'",
"assistant_id": "'"$ASSISTANT_ID"'",
"purpose": "service",
"variables": { "customer_name": "דנה", "appointment": "יום שלישי ב-10:30" },
"metadata": { "crm_contact_id": "0031x00000AbCdE", "appointment_id": "'"$APPOINTMENT_ID"'" },
"max_duration_s": 300
}'
Field Required What it does
to Yes The number to call, in E.164 format: +972501234567.
purpose Yes service, marketing or survey. It decides the compliance checks.
assistant_id One of the two The assistant that talks.
flow_id One of the two A published voice flow, which runs with the assistant linked to it.
from_number_id Live mode The number to call from (pn_…, from GET /v1/phone_numbers): it sets the SIP connection and the caller ID.
connection_id, caller_id Instead of from_number_id: a SIP connection (by default, the organisation’s default one) and a number it is allowed to present.
variables Values for the {{variables}} of the instructions, first message and flow.
first_message What the assistant says first on this call, instead of its own first message. See a first message per call.
metadata Your own key–value strings, kept on the call.
max_duration_s End the call after this many seconds (10–14,400). By default, the assistant’s limit.
amd Answering-machine detection for this call: see answering machines. By default, the assistant’s setting.

The answer is 201 Created with the call object, in status queued. metadata, variables and purpose are on it from the start.

Variables personalise one call without changing the assistant. Write {{customer_name}} in the assistant’s first_message or system_prompt, and pass "variables": { "customer_name": "דנה" } with each call.

  • Up to 50 per call. Names are letters, digits and _ (up to 40 characters, not starting with a digit); values are strings of up to 1,000 characters.
  • The call keeps its variables, so you can see later what each call was told.

first_message replaces the assistant’s own first message for one call, so the greeting can name the person and the reason for the call without a new assistant: "first_message": "Hi {{customer_name}}, this is Noa from Acme about your order.".

  • The assistant speaks first on that call. When the call needs an AI disclosure, it is still said before your text.
  • Up to 500 characters, and up to 2,000 once the variables are filled in. Each {{name}} must be one of the call’s variables (pass "" to say nothing there), and with a first_message no variable value may contain {{ or }}. A value is never read as a placeholder itself.
  • It works with assistant_id. A voice flow (flow_id, or an assistant that runs one) starts with the flow’s Start node instead, and a connect-mode stream lets your bot speak first, so those requests are refused with 400 parameter_invalid on first_message.
  • Empty or left out, the assistant’s own first message plays, as before. The call object doesn’t return it.

metadata is for you: your CRM’s contact ID, the order the call is about, the campaign in your own system. MoreVoice never reads it: it keeps it on the call and sends it back in the call object and in the call’s webhook events. Up to 50 keys of up to 40 characters, values of up to 500 characters.

Use metadata to find your record when an event arrives; use variables for what the assistant should say.

Every outbound call states why it is made, and live calls pass the same compliance gate as every other outbound call before anything is dialled:

purpose Checked before the call
service The organisation’s do-not-call list.
survey The organisation’s do-not-call list.
marketing The do-not-call list, a recorded consent to marketing calls (§30A), and the national do-not-call registry for Israeli numbers. A number the registry can’t confirm is blocked too.

A blocked call isn’t dialled. The request answers 403 with a compliance_error whose code names the rule (dnc_listed, registry_listed, registry_unavailable, consent_missing or compliance_blocked) and whose details.verdict lists every check. Compliance explains each rule.

Calling hours, Shabbat and holidays are kept by campaigns, which wait for an allowed moment. A call you place with POST /v1/calls goes out when you place it, so place it within your calling hours, or ask for a callback and let MoreVoice pick the moment.

When you call from your own list, ask first instead of handling a 403 per call. POST /v1/dnc/check takes up to 100 numbers and a purpose, and answers for each one whether a call would be allowed now, and why not:

Terminal window
# Would a marketing call to these numbers be allowed? Your do-not-call list, consent and the national registry.
curl https://api.morevoice.ai/v1/dnc/check \
-H "Authorization: Bearer $MOREVOICE_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"phones": ["+972501234567", "0527654321"],
"purpose": "marketing"
}'

The check reads the same do-not-call list, consent records and national registry as the dialer, so a number marked callable is dialled unless something changes in between (the person opts out, a consent is revoked). Compliance over the API has the details.

POST /v1/calls requires an Idempotency-Key header, so a call is never placed twice:

  • Send the same key again, with the same body, and you get the first answer back, with an Idempotent-Replayed: true header. Nobody is dialled again.
  • Use a key that means something in your system, such as reminder-<appointment ID>, so that two copies of the same job can’t both call.
  • Keys are kept for 24 hours, per organisation and mode, and are up to 255 printable characters.
  • The same key with a different body answers 409 with the code idempotency_mismatch. While the first request is still running, a retry answers 409 with request_in_progress: wait a moment and retry.
  • A 5xx, 409 or 429 answer doesn’t use up the key, so retry with the same one.

The SDK sends a key with every POST and reuses it when it retries; pass idempotencyKey to choose your own. Every other POST and DELETE of the API accepts Idempotency-Key too, but only POST /v1/calls requires it.

HTTP Code Why
400 parameter_missing, parameter_invalid A field is missing or wrong; param says which. An unknown assistant or flow is parameter_invalid on assistant_id or flow_id.
400 dial_rejected The connection or the caller ID can’t place this call.
402 balance_exhausted, spend_cap, trial_limit, … Billing doesn’t allow new calls; details.reason says why.
403 dnc_listed, consent_missing, … A compliance rule blocks the call.
429 concurrency_limit As many calls are in progress as your plan allows; details has active and limit.
429 rate_limited More than the new calls per second your plan allows.
429 capacity_exceeded No line is free right now.

A 429 carries Retry-After: wait, then send the same request with the same key. Errors, rate limits and concurrency has the details.

With answering-machine detection on, MoreVoice listens to the first seconds after the call is answered and decides whether a person or a machine picked up. Set it per call with amd, or leave it out to use the assistant’s setting:

amd What happens on a machine
{ "enabled": false } Nothing special: the assistant talks to whatever answered.
{ "enabled": true, "on_machine": "hangup" } The call ends at once, with the end reason amd-machine.
{ "enabled": true, "on_machine": "leave_message", "message": "…" } MoreVoice waits for the beep, leaves message (by default, the assistant’s voicemail message), after the AI disclosure when one applies, and hangs up with amd-left-message. Without any message to leave, it hangs up as with hangup.
Terminal window
# A reminder that is left as a voicemail when a machine answers.
curl https://api.morevoice.ai/v1/calls \
-H "Authorization: Bearer $MOREVOICE_API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: reminder-$APPOINTMENT_ID" \
-d '{
"to": "+972501234567",
"from_number_id": "'"$FROM_NUMBER_ID"'",
"assistant_id": "'"$ASSISTANT_ID"'",
"purpose": "service",
"variables": { "customer_name": "דנה" },
"amd": {
"enabled": true,
"on_machine": "leave_message",
"message": "שלום דנה, מזכירים שיש לך תור ביום שלישי ב-10:30. לשינוי, אפשר לחזור אלינו."
}
}'

The verdict is on the call as answered_by (human, machine or unknown) and in the call.answered event. A person gets the assistant’s first message as usual; unknown is treated as a person.

A call goes from queued to ringing, in_progress (answered) and ended. Once it has ended, the call object carries ended_at, duration_ms, end_reason and cost, and the summary follows a few seconds later. The events arrive in this order:

Event When
call.created The call was accepted and is being dialled.
call.ringing The far end rings.
call.answered Someone (or something: answered_by) picked up.
call.ended The call ended, with end_reason and duration_ms. Unanswered calls end here too.
call.analyzed The summary, outcome and extracted details are ready.
call.cost_finalized The price is final.

end_reason tells you what to do next:

end_reason Meaning What to do
customer-ended-call, assistant-ended-call, assistant-said-end-call-phrase, flow-ended, tool-requested The conversation ended as designed. Read the summary (call.analyzed).
transferred The call was handed to a queue, a number or a person. Follow it in your queue or contact centre.
customer-busy The line was busy. Try again later.
customer-did-not-answer, customer-declined Nobody answered, or the call was rejected. Try again later, or schedule a callback.
amd-machine, amd-left-message A machine answered; with leave_message, your message was left. Don’t call straight back.
opted-out The person asked not to be called again: the number is on your do-not-call list now. Don’t call again; update your CRM (contact.opted_out arrives too).
exceeded-max-duration, silence-timed-out The call hit max_duration_s, or nobody spoke. Check the transcript.
api-ended-call, operator-ended-call You hung up through the API or the dashboard. —
invalid-number, peer-rtp-timeout, sip-… The number or the network failed. Check the number and the SIP connection.

Campaigns read the same reasons to decide on retries.

Follow a call with the webhooks above, or read it with GET /v1/calls/{id}. The SDK’s calls.waitUntilEnded() polls until the call has ended (the quickstart shows it). To find calls, list them with filters:

Terminal window
# Ended calls of one assistant, newest first.
curl "https://api.morevoice.ai/v1/calls?assistant_id=$ASSISTANT_ID&status=ended&limit=20" \
-H "Authorization: Bearer $MOREVOICE_API_KEY"

End a call from your side:

Terminal window
curl -X POST https://api.morevoice.ai/v1/calls/$CALL_ID/hangup \
-H "Authorization: Bearer $MOREVOICE_API_KEY"

Or hand it to people: a queue, a phone number, another assistant or a specific agent. cold hands the call over; warm lets the assistant whisper your note to whoever takes it (with a human call, the agent talks to the target first):

Terminal window
# Hand the call to the people in a queue, with a note they see next to it.
curl https://api.morevoice.ai/v1/calls/$CALL_ID/transfer \
-H "Authorization: Bearer $MOREVOICE_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"to": { "queue_id": "'"$QUEUE_ID"'" },
"mode": "cold",
"note": "Wants to move Tuesday'"'"'s appointment to next week"
}'

Both answer 409 with the code call_not_active when the call has already ended. Calls handled by people can also be put on hold, sent DTMF tones, consulted on and joined by more participants: see live control of agents’ calls.

When the time isn’t right (outside calling hours, the person asked for tomorrow, nobody answered), don’t keep the job in your own scheduler: ask MoreVoice for a callback. With route: "assistant" the AI calls back by itself; with agent_queue or agent your people do (see callbacks for agents):

Terminal window
# Ask the AI to call the customer back tomorrow morning. The time moves into your calling hours.
curl https://api.morevoice.ai/v1/callbacks \
-H "Authorization: Bearer $MOREVOICE_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"phone": "+972501234567",
"name": "Dana Levi",
"due_at": "2026-11-04T09:00:00+02:00",
"route": "assistant",
"assistant_id": "'"$ASSISTANT_ID"'",
"max_attempts": 2,
"note": "Wants to hear about the renewal offer",
"metadata": { "crm_contact_id": "0031x00000AbCdE" }
}'
  • When. due_at is the earliest time to call (by default now, at most 90 days ahead). It is moved into your callback hours, which follow the calling hours, Shabbat and holidays, and window_end says when it is too late.
  • Attempts. max_attempts (1–10) tries before the callback failed. Each attempt is a call with its own call object; call_id points to the one that got through.
  • One per person. A second request for the same number while one is open is merged into it (merged_requests counts them); call_id on the request ties it to the call it came from, so repeating the request for the same call returns the first callback.
  • Events. callback.scheduled, then callback.completed, callback.failed or callback.cancelled.
  • What the call carries. The call that returns the callback gets its metadata, on the call object and in its call.* events, so you can match it to your record. With route: "assistant", variables and first_message work as on POST /v1/calls: the assistant also has the callback’s own {{name}}, {{phone}}, {{callback_reason}} (the note), {{callback_summary}} and {{callback_context}}, and your variables win over them. variables and first_message are not returned on the callback, and are deleted once it is closed.

The callback’s calls go through the same compliance gate as every other outbound call.

With a test key, POST /v1/calls places a simulated call on the virtual carrier: no phone network is reached, nothing is billed (cost is 0), and the test numbers let you play out a busy line, a voicemail or a do-not-call refusal. from_number_id is optional in test mode; when you send one, it must be one of your sandbox numbers (GET /v1/phone_numbers with a test key).