Simulate an inbound call
import MoreVoice from "@morevoice/sdk";
const mv = new MoreVoice(); // MOREVOICE_API_KEY from the environment
const call = await mv.testHelpersInboundCalls.create({ from: "+972521234567", script: "dtmf:1", to: "+972509991234",});console.log(call);from morevoice import MoreVoice
client = MoreVoice() # MOREVOICE_API_KEY from the environment
call = client.test_helpers_inbound_calls.create({ "from": "+972521234567", "script": "dtmf:1", "to": "+972509991234",})print(call)curl -X POST https://api.morevoice.ai/v1/test_helpers/inbound_calls \ -H "Authorization: Bearer $MOREVOICE_API_KEY" \ -H "Content-Type: application/json" \ -H "Idempotency-Key: $(uuidgen)" \ -d '{ "from": "+972521234567", "script": "dtmf:1", "to": "+972509991234"}'Test mode only. A simulated caller dials one of your sandbox numbers: the call is routed like a real one (the number’s assistant, flow or inbound route), runs on the virtual carrier with simulated speech and AI, and sends every call event to your test-mode webhook endpoints. Returns the call (status ringing); it is answered within a second.
Try it in the API playground with a test-mode key.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Header Parameters
Section titled “Header Parameters”The API version to use for this request. Defaults to the version the API key is pinned to.
Example
2026-11-01A unique key (for example a UUID) that makes this request safe to retry: for 24 hours, a retry with the same key and parameters returns the first response instead of acting twice.
Example
5f0c1e8a-7b2d-4c3e-9f1a-2b6d8e4c0a17Request Bodyrequired
Section titled “Request Bodyrequired”A simulated inbound call to a sandbox number.
object
The simulated caller’s number (default +972521234567).
What the simulated caller does: answer (default) talks for a few turns and hangs up; silent says nothing (and hangs up after 30 s); dtmf:123 presses the keys after the greeting, then talks.
A sandbox number of yours (POST /v1/phone_numbers with a test key).
Example
{ "from": "+972521234567", "script": "dtmf:1", "to": "+972509991234"}Responses
Section titled “Responses”Created
An inbound, outbound or browser call.
object
The caller heard, in full, that they are speaking with an AI (the AI disclosure). false when none played, or the caller left before it ended. Calls made before these facts were recorded say false.
Machine-readable marking (EU AI Act Art. 50(2)): true when the call contains speech generated by AI — an AI voice agent, or synthetic-voice IVR prompts. Recordings of such calls carry the same tag in their file metadata.
When AI-generated speech was played, in ms from the start of the call (empty when ai_generated is false).
A stretch of the call during which AI-generated speech was played to the other party.
The assistant, with expand[]=assistant.
object
A assistant ID (prefix asst_).
The version of the assistant’s settings the call ran with (everything but its name and metadata). Opaque (16 hex characters): equal values mean the same settings, a new value means they changed. With turn tracing on; null for a call no assistant or flow ran.
How the call came in or went out: phone (a phone number or SIP trunk), web (a browser call, a conference room, the web widget) or whatsapp (a WhatsApp call: its media is WebRTC, so transport is webrtc). New channels may be added: treat an unknown value as other.
PROVISIONAL: the values are pending legal review and more may be added (treat a value you don’t know as no basis). The basis on record for recording the call and processing what was said: notice = the caller heard, in full, that the call is recorded, and stayed on the line.
What the call cost (an ended call with no recorded provider usage costs 0). Our provider-cost estimate in USD; when customer prices are enabled for your organization it is replaced by the amount at your own prices, in ILS.
object
The amount in the currency’s minor unit (cents, agorot), rounded.
The exact amount in minor units, as a decimal string (sub-cent precision).
ISO 4217 currency code.
True: an estimate from provider usage, not a billed amount.
The business outcome recorded on the call (set_outcome tool, or the summary).
Why the call ended, e.g. customer-ended-call, assistant-ended-call, customer-busy, customer-did-not-answer.
The calling number (E.164 when it is a phone number) or name.
A call ID (prefix call_).
true in live mode, false in test mode.
Up to 50 key/value pairs (keys up to 40 characters, values up to 500) you attach to an object. Returned as sent.
object
The version of what the assistant was told to say: its system prompt, first, idle and end-of-call messages, and the flow and flow version. Opaque (16 hex characters): equal values mean the same settings, a new value means they changed. With turn tracing on; null for a call no assistant or flow ran.
The caller heard, in full, that the call is recorded: the recording notice of a call with agents, or an AI disclosure that includes it. false when no such notice played (or played only in part). Calls made before these facts were recorded say false.
When the call started: dialled out, or rang in.
queued (placed, not ringing yet), ringing, in_progress (answered, or an inbound call being handled) or ended.
The AI summary of a call.
object
Follow-ups for your business; empty when there are none.
A call ID (prefix call_).
What the caller wanted.
How the call ended, or what was agreed.
A two-to-four sentence summary, in the language of the call.
The called number (E.164 when it is a phone number) or destination.
sip for phone calls, webrtc for browser calls, conference rooms and WhatsApp calls.
Who handles the call: an AI assistant, a human agent, an IVR flow, a conference room, or a voicemail box.
The variables the call was created with.
object
A WhatsApp call’s WhatsApp-side ids, and what the caller’s WhatsApp sent with a call they placed (their profile name, the call button’s or link’s payload).
object
On a call placed with POST /v1/whatsapp_calls: the biz_opaque_callback_data it was placed with, as sent to WhatsApp; null otherwise.
WhatsApp’s id of the call; null on a call placed with POST /v1/whatsapp_calls until WhatsApp names it.
The WhatsApp number the call is on (wan_…, GET /v1/whatsapp_numbers/{id}).
WhatsApp’s ID of that business phone number (digits).
The caller’s WhatsApp user ID when WhatsApp sent one (callers who hide their number have only this); on a call placed to a recipient, that user ID; null otherwise. The caller’s number, when visible, is from.
Example
{ "agent_id": null, "ai_disclosure_played": true, "ai_disclosure_played_at": "2026-11-03T09:14:35.020Z", "ai_generated": true, "ai_segments": [ { "end_ms": 99710, "source": "assistant", "start_ms": 0 } ], "answered_at": "2026-11-03T09:14:29.410Z", "answered_by": "human", "api_key_id": "key_9i2E2pKO6g3z4nXl57Qb4g", "assistant_id": "asst_4Gk2LmN9pQ4rS6tV8wX0yZ", "campaign_id": null, "channel": "phone", "connection_id": "conn_2bF8kQ1nR7sT3vW5xY9zA0", "consent_basis": "notice", "contact_id": null, "cost": { "amount": 4, "amount_decimal": "4.2310", "currency": "USD", "estimate": true }, "direction": "outbound", "disposition": null, "duration_ms": 99710, "end_reason": "customer-ended-call", "ended_at": "2026-11-03T09:16:02.120Z", "flow_id": null, "flow_version": null, "from": "+97237654321", "has_recording": true, "id": "call_8tRPaZp5hLMbrGqdJ9AmNa", "livemode": true, "metadata": { "crm_contact_id": "0031x00000AbCdE" }, "object": "call", "purpose": "service", "queue_id": null, "recording_announced": true, "recording_announced_at": "2026-11-03T09:14:35.020Z", "started_at": "2026-11-03T09:14:22.000Z", "status": "ended", "summary": null, "to": "+972501234567", "transport": "sip", "type": "ai", "variables": { "customer_name": "Dana" }, "whatsapp": null}The request is invalid: a parameter is missing, malformed or unknown, or the version header is unknown.
Every /v1 error.
object
object
A stable, machine-readable code from the error-code catalogue.
Structured context, e.g. required_scope or the compliance verdict.
object
A link to the documentation of this code.
A human-readable explanation. Do not parse it.
The request parameter the error relates to, e.g. to or metadata[order_id].
The X-Request-Id of this request. Quote it when you contact support.
The category of the error.
Example
{ "error": { "code": "parameter_missing", "doc_url": "https://docs.morevoice.ai/api/errors#parameter-missing", "message": "Missing required parameter: to.", "param": "to", "request_id": "req_7Hk2LmN9pQ4rS6tV8wX0yZ", "type": "invalid_request_error" }}Headers
Section titled “Headers”The request’s ID (req_…). Quote it when you contact support.
No valid API key was sent.
Every /v1 error.
object
object
A stable, machine-readable code from the error-code catalogue.
Structured context, e.g. required_scope or the compliance verdict.
object
A link to the documentation of this code.
A human-readable explanation. Do not parse it.
The request parameter the error relates to, e.g. to or metadata[order_id].
The X-Request-Id of this request. Quote it when you contact support.
The category of the error.
Example
{ "error": { "code": "invalid_api_key", "doc_url": "https://docs.morevoice.ai/api/errors#invalid-api-key", "message": "Invalid API key.", "request_id": "req_7Hk2LmN9pQ4rS6tV8wX0yZ", "type": "authentication_error" }}Headers
Section titled “Headers”The request’s ID (req_…). Quote it when you contact support.
The key may not do this (a missing scope, a plan limit, or a compliance block).
Every /v1 error.
object
object
A stable, machine-readable code from the error-code catalogue.
Structured context, e.g. required_scope or the compliance verdict.
object
A link to the documentation of this code.
A human-readable explanation. Do not parse it.
The request parameter the error relates to, e.g. to or metadata[order_id].
The X-Request-Id of this request. Quote it when you contact support.
The category of the error.
Example
{ "error": { "code": "missing_scope", "doc_url": "https://docs.morevoice.ai/api/errors#missing-scope", "message": "This API key lacks the calls:write scope.", "request_id": "req_7Hk2LmN9pQ4rS6tV8wX0yZ", "type": "permission_error" }}Headers
Section titled “Headers”The request’s ID (req_…). Quote it when you contact support.
No object with this ID (in the path or the body) exists in this organisation and mode.
Every /v1 error.
object
object
A stable, machine-readable code from the error-code catalogue.
Structured context, e.g. required_scope or the compliance verdict.
object
A link to the documentation of this code.
A human-readable explanation. Do not parse it.
The request parameter the error relates to, e.g. to or metadata[order_id].
The X-Request-Id of this request. Quote it when you contact support.
The category of the error.
Example
{ "error": { "code": "resource_missing", "doc_url": "https://docs.morevoice.ai/api/errors#resource-missing", "message": "No such object: 'call_4Gk2'.", "param": "id", "request_id": "req_7Hk2LmN9pQ4rS6tV8wX0yZ", "type": "not_found" }}Headers
Section titled “Headers”The request’s ID (req_…). Quote it when you contact support.
The request conflicts with the object’s state, or the Idempotency-Key was reused with other parameters.
Every /v1 error.
object
object
A stable, machine-readable code from the error-code catalogue.
Structured context, e.g. required_scope or the compliance verdict.
object
A link to the documentation of this code.
A human-readable explanation. Do not parse it.
The request parameter the error relates to, e.g. to or metadata[order_id].
The X-Request-Id of this request. Quote it when you contact support.
The category of the error.
Example
{ "error": { "code": "idempotency_mismatch", "doc_url": "https://docs.morevoice.ai/api/errors#idempotency-mismatch", "message": "This Idempotency-Key was already used with different parameters.", "request_id": "req_7Hk2LmN9pQ4rS6tV8wX0yZ", "type": "idempotency_error" }}Headers
Section titled “Headers”The request’s ID (req_…). Quote it when you contact support.
The request body is larger than the endpoint accepts, or has more parts or files than it takes.
Every /v1 error.
object
object
A stable, machine-readable code from the error-code catalogue.
Structured context, e.g. required_scope or the compliance verdict.
object
A link to the documentation of this code.
A human-readable explanation. Do not parse it.
The request parameter the error relates to, e.g. to or metadata[order_id].
The X-Request-Id of this request. Quote it when you contact support.
The category of the error.
Example
{ "error": { "code": "body_too_large", "doc_url": "https://docs.morevoice.ai/api/errors#body-too-large", "message": "The request body is larger than the endpoint accepts.", "request_id": "req_7Hk2LmN9pQ4rS6tV8wX0yZ", "type": "invalid_request_error" }}Headers
Section titled “Headers”The request’s ID (req_…). Quote it when you contact support.
The request body’s Content-Type is not one the endpoint takes.
Every /v1 error.
object
object
A stable, machine-readable code from the error-code catalogue.
Structured context, e.g. required_scope or the compliance verdict.
object
A link to the documentation of this code.
A human-readable explanation. Do not parse it.
The request parameter the error relates to, e.g. to or metadata[order_id].
The X-Request-Id of this request. Quote it when you contact support.
The category of the error.
Example
{ "error": { "code": "unsupported_media_type", "doc_url": "https://docs.morevoice.ai/api/errors#unsupported-media-type", "message": "This endpoint takes application/json.", "request_id": "req_7Hk2LmN9pQ4rS6tV8wX0yZ", "type": "invalid_request_error" }}Headers
Section titled “Headers”The request’s ID (req_…). Quote it when you contact support.
Too many requests, or no call capacity right now. Retry after the Retry-After delay.
Every /v1 error.
object
object
A stable, machine-readable code from the error-code catalogue.
Structured context, e.g. required_scope or the compliance verdict.
object
A link to the documentation of this code.
A human-readable explanation. Do not parse it.
The request parameter the error relates to, e.g. to or metadata[order_id].
The X-Request-Id of this request. Quote it when you contact support.
The category of the error.
Example
{ "error": { "code": "rate_limited", "doc_url": "https://docs.morevoice.ai/api/errors#rate-limited", "message": "Too many requests. Retry after 1 second.", "request_id": "req_7Hk2LmN9pQ4rS6tV8wX0yZ", "type": "rate_limit_error" }}Headers
Section titled “Headers”Seconds to wait before retrying.
The request’s ID (req_…). Quote it when you contact support.
Something went wrong on MoreVoice’s side. Retry with the same Idempotency-Key.
Every /v1 error.
object
object
A stable, machine-readable code from the error-code catalogue.
Structured context, e.g. required_scope or the compliance verdict.
object
A link to the documentation of this code.
A human-readable explanation. Do not parse it.
The request parameter the error relates to, e.g. to or metadata[order_id].
The X-Request-Id of this request. Quote it when you contact support.
The category of the error.
Example
{ "error": { "code": "internal_error", "doc_url": "https://docs.morevoice.ai/api/errors#internal-error", "message": "Something went wrong on MoreVoice's side.", "request_id": "req_7Hk2LmN9pQ4rS6tV8wX0yZ", "type": "api_error" }}Headers
Section titled “Headers”The request’s ID (req_…). Quote it when you contact support.