mv.testHelpersInboundCalls
Simulate calls and events in test mode. These methods are on mv.testHelpersInboundCalls, where mv is your client (see the Node.js SDK). Each one returns the response object and throws when the API answers with an error.
create()
Section titled “create()”Simulate an inbound call. 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.
mv.testHelpersInboundCalls.create(body: TestHelpersInboundCallsCreateData["body"], options?: RequestOptions): Promise<TestHelpersInboundCallsCreateResponse>POST /test_helpers/inbound_calls · API reference
Parameters
Section titled “Parameters”| Name | Type | Required | Description |
|---|---|---|---|
body.to |
string |
yes | A sandbox number of yours (POST /v1/phone_numbers with a test key). |
body.from |
string |
no | The simulated caller’s number (default +972521234567). |
body.script |
string |
no | 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. |
options.headers["MoreVoice-Version"] |
string |
no | The API version to use for this request. Defaults to the version the API key is pinned to. |
options.headers["Idempotency-Key"] |
string |
no | A 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. |
options |
RequestOptions |
no | idempotencyKey, extra headers and an abort signal: see retries and idempotency. |
Returns
Section titled “Returns”Call:
| Field | Type | Description |
|---|---|---|
id |
string |
A call ID (prefix call_). |
object |
"call" |
Always call. |
type |
CallType |
Who handles the call: an AI assistant, a human agent, an IVR flow, a conference room, or a voicemail box. |
direction |
CallDirection | null |
— |
transport |
"sip" | "webrtc" |
sip for phone calls, webrtc for browser calls, conference rooms and WhatsApp calls. |
channel |
"phone" | "web" | "whatsapp" |
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. |
status |
CallStatus |
queued (placed, not ringing yet), ringing, in_progress (answered, or an inbound call being handled) or ended. |
from |
string | null |
The calling number (E.164 when it is a phone number) or name. |
to |
string | null |
The called number (E.164 when it is a phone number) or destination. |
assistant_id |
string | null |
asst_… ID. |
flow_id |
string | null |
flow_… ID. |
flow_version |
integer | null |
The flow version that ran (0: an unpublished draft). |
queue_id |
string | null |
q_… ID. |
agent_id |
string | null |
The human agent who handled the call (usr_…). |
campaign_id |
string | null |
cmp_… ID. |
contact_id |
string | null |
ctc_… ID. |
connection_id |
string | null |
conn_… ID. |
api_key_id |
string | null |
The API key that created the call (key_…). |
purpose |
CallPurpose | null |
— |
started_at |
string |
When the call started: dialled out, or rang in. |
answered_at |
string | null |
— |
ended_at |
string | null |
— |
duration_ms |
integer | null |
— |
end_reason |
string | null |
Why the call ended, e.g. customer-ended-call, assistant-ended-call, customer-busy, customer-did-not-answer. |
answered_by |
CallAnsweredBy | null |
— |
disposition |
string | null |
The business outcome recorded on the call (set_outcome tool, or the summary). |
has_recording |
boolean |
— |
ai_generated |
boolean |
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. |
ai_segments |
CallAiSegment[] |
When AI-generated speech was played, in ms from the start of the call (empty when ai_generated is false). |
recording_announced |
boolean |
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. |
recording_announced_at |
string | null |
When the recording notice finished playing; null when recording_announced is false. |
ai_disclosure_played |
boolean |
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. |
ai_disclosure_played_at |
string | null |
When the AI disclosure finished playing; null when ai_disclosure_played is false. |
consent_basis |
CallConsentBasis | null |
PROVISIONAL (values pending legal review): the basis on record for recording the call and processing what was said; null when there is none on record. Gate recording-based processing (for example AI analysis of the transcript) on a basis you accept. |
summary |
CallSummary | null |
— |
cost |
CallCost | null |
Set once the call has ended (never null then); null while it is in progress. |
variables |
Record<string, string> |
The variables the call was created with. |
metadata |
Metadata |
Up to 50 key/value pairs (keys up to 40 characters, values up to 500) you attach to an object. Returned as sent. |
whatsapp |
CallWhatsApp | null |
A WhatsApp call’s ids (channel whatsapp); null for every other call. Its metadata carries the labels the messaging platform relayed with the call. |
livemode |
boolean |
true in live mode, false in test mode. |
assistant |
CallAssistant |
The assistant of the call (expand[]=assistant). |
assistant_version |
string | null |
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. |
prompt_version |
string | null |
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. |
Example
Section titled “Example”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);