Quickstart: your first AI phone call
In about five minutes you will create an AI assistant that speaks Hebrew, have it call a test number, and read the conversation. Everything runs in test mode: speech recognition, the language model and the voice are simulated, the call goes to a virtual phone network instead of a real one, and nothing is billed. When it works, a live key runs the same code on real calls.
Each step shows the request in cURL, in Node.js with @morevoice/sdk, and in Python with requests. Pick a tab once and every page follows your choice.
Before you start
Section titled “Before you start”- A MoreVoice account where you are an administrator or the owner: API keys are created in the dashboard.
- For Node.js: Node 18 or later and
npm install @morevoice/sdk. For Python: Python 3.10 or later andpip install requests. For cURL:curl, plusjqfor step 4.
-
Create a test key
In the dashboard, open DevelopersAPI keys, switch Mode to Test and select Create test key. Give the key a name, keep the type Secret, and copy the key. You see it only once. It starts with
mv_test_sk_.Keep it in an environment variable, so it never ends up in your code:
Terminal window export MOREVOICE_API_KEY=mv_test_sk_…Check that the key works. The answer says which organisation and mode it belongs to:
Terminal window # Check the key: which organisation, which mode, which scopes.curl https://api.morevoice.ai/v1/whoami \-H "Authorization: Bearer $MOREVOICE_API_KEY"check-key.ts import MoreVoice from "@morevoice/sdk";const mv = new MoreVoice(); // reads MOREVOICE_API_KEY// Check the key: which organisation, which mode, which scopes.const me = await mv.whoami.retrieve();console.log(`${me.org_id} · ${me.livemode ? "live" : "test"} mode · API version ${me.api_version}`);check_key.py import osimport requestsAPI = "https://api.morevoice.ai/v1"HEADERS = {"Authorization": f"Bearer {os.environ['MOREVOICE_API_KEY']}"}# Check the key: which organisation, which mode, which scopes.response = requests.get(f"{API}/whoami", headers=HEADERS, timeout=30)response.raise_for_status()me = response.json()mode = "live" if me["livemode"] else "test"print(f"{me['org_id']} · {mode} mode · API version {me['api_version']}")Response {"object": "api_key_principal","org_id": "org_7n42DGM5Tflk9n8mt7Fhc9","key_id": "key_9i2E2pKO6g3z4nXl57Qb4g","livemode": false,"scopes": ["*"],"api_version": "2026-11-01"} -
Create an assistant
An assistant is the AI on the call: what it says first, what it knows, how it sounds. This one calls patients to confirm an appointment.
{{customer_name}}is a variable that each call fills in.Terminal window # Create an assistant that calls patients to confirm tomorrow's appointment, in Hebrew.curl https://api.morevoice.ai/v1/assistants \-H "Authorization: Bearer $MOREVOICE_API_KEY" \-H "Content-Type: application/json" \-d '{"name": "Appointment reminders","language": "he","first_message": "שלום {{customer_name}}, כאן מרפאת השרון. רציתי לאשר את התור שלך מחר בעשר. זה עדיין מתאים?","system_prompt": "You call patients to confirm tomorrow'"'"'s appointment. Speak Hebrew and keep every answer short. If the time no longer suits them, say that the clinic will call back to find a new one."}'create-assistant.ts import MoreVoice from "@morevoice/sdk";const mv = new MoreVoice(); // reads MOREVOICE_API_KEY// Create an assistant that calls patients to confirm tomorrow's appointment, in Hebrew.const assistant = await mv.assistants.create({name: "Appointment reminders",language: "he",first_message: "שלום {{customer_name}}, כאן מרפאת השרון. רציתי לאשר את התור שלך מחר בעשר. זה עדיין מתאים?",system_prompt:"You call patients to confirm tomorrow's appointment. Speak Hebrew and keep every answer short. " +"If the time no longer suits them, say that the clinic will call back to find a new one.",});console.log(assistant.id); // asst_…create_assistant.py import osimport requestsAPI = "https://api.morevoice.ai/v1"HEADERS = {"Authorization": f"Bearer {os.environ['MOREVOICE_API_KEY']}"}# Create an assistant that calls patients to confirm tomorrow's appointment, in Hebrew.response = requests.post(f"{API}/assistants",headers=HEADERS,json={"name": "Appointment reminders","language": "he","first_message": "שלום {{customer_name}}, כאן מרפאת השרון. רציתי לאשר את התור שלך מחר בעשר. זה עדיין מתאים?","system_prompt": ("You call patients to confirm tomorrow's appointment. Speak Hebrew and keep every answer short. ""If the time no longer suits them, say that the clinic will call back to find a new one."),},timeout=30,)response.raise_for_status()assistant = response.json()print(assistant["id"]) # asst_…The answer is the whole assistant, with defaults for everything you didn’t set (the voice, speech recognition, turn-taking). Keep its ID:
Terminal window export ASSISTANT_ID=asst_…Create and configure an assistant explains every setting, with tips for Hebrew.
-
Call a test number
+972500000001is a test number that answers: a simulated caller talks to your assistant for a few turns, then hangs up.Terminal window # Call the test number that answers. With a test key the call is simulated: no phone rings.curl https://api.morevoice.ai/v1/calls \-H "Authorization: Bearer $MOREVOICE_API_KEY" \-H "Content-Type: application/json" \-H "Idempotency-Key: $(uuidgen)" \-d '{"to": "+972500000001","assistant_id": "'"$ASSISTANT_ID"'","purpose": "service","variables": { "customer_name": "דנה" }}'call-test-number.ts import MoreVoice from "@morevoice/sdk";const mv = new MoreVoice(); // reads MOREVOICE_API_KEY// Call the test number that answers. With a test key the call is simulated: no phone rings.// The SDK sends an Idempotency-Key with every POST, so a retry never places a second call.const call = await mv.calls.create({to: "+972500000001",assistant_id: process.env.ASSISTANT_ID!,purpose: "service",variables: { customer_name: "דנה" },});console.log(call.id, call.status); // call_… queuedcall_test_number.py import osimport uuidimport requestsAPI = "https://api.morevoice.ai/v1"HEADERS = {"Authorization": f"Bearer {os.environ['MOREVOICE_API_KEY']}"}# Call the test number that answers. With a test key the call is simulated: no phone rings.# The Idempotency-Key is required: retrying with the same key never places a second call.response = requests.post(f"{API}/calls",headers={**HEADERS, "Idempotency-Key": str(uuid.uuid4())},json={"to": "+972500000001","assistant_id": os.environ["ASSISTANT_ID"],"purpose": "service","variables": {"customer_name": "דנה"},},timeout=30,)response.raise_for_status()call = response.json()print(call["id"], call["status"]) # call_… queuedpurposeis required on every outbound call. It decides which compliance checks run. It isservicehere, because the call is about an existing appointment.Idempotency-Keyis required too. If your request times out, send it again with the same key: MoreVoice returns the first answer and never dials twice. The SDK adds a key for you.
The call starts as
queued. Keep its ID:Response (201 Created) {"id": "call_8tRPaZp5hLMbrGqdJ9AmNa","object": "call","type": "ai","direction": "outbound","transport": "sip","status": "queued","from": null,"to": "+972500000001","assistant_id": "asst_4Gk2LmN9pQ4rS6tV8wX0yZ","purpose": "service","started_at": "2026-11-03T09:14:22.000Z","answered_at": null,"ended_at": null,"duration_ms": null,"end_reason": null,"summary": null,"cost": null,"variables": { "customer_name": "דנה" },"metadata": {},"livemode": false}The call object has more fields than shown here; call objects lists them all.
-
Follow the call and read the transcript
A call goes from
queuedtoringing,in_progressandended. Wait for the end, then read what was said:Terminal window # Wait for the call to end (a call.ended webhook tells you without polling).while true; dostatus=$(curl -s https://api.morevoice.ai/v1/calls/$CALL_ID -H "Authorization: Bearer $MOREVOICE_API_KEY" | jq -r .status)[ "$status" = "ended" ] && breaksleep 2done# Then read what was said.curl https://api.morevoice.ai/v1/calls/$CALL_ID/transcript \-H "Authorization: Bearer $MOREVOICE_API_KEY"follow-call.ts import MoreVoice from "@morevoice/sdk";const mv = new MoreVoice(); // reads MOREVOICE_API_KEYconst callId = process.env.CALL_ID!;// Wait for the call to end (a call.ended webhook tells you without polling).const call = await mv.calls.waitUntilEnded(callId);console.log(`Ended: ${call.end_reason}, ${call.duration_ms} ms`);// Then read what was said.const transcript = await mv.calls.retrieveTranscript(callId);for (const segment of transcript.segments) console.log(`${segment.speaker}: ${segment.text}`);follow_call.py import osimport timeimport requestsAPI = "https://api.morevoice.ai/v1"HEADERS = {"Authorization": f"Bearer {os.environ['MOREVOICE_API_KEY']}"}call_id = os.environ["CALL_ID"]# Wait for the call to end (a call.ended webhook tells you without polling).while True:response = requests.get(f"{API}/calls/{call_id}", headers=HEADERS, timeout=30)response.raise_for_status()call = response.json()if call["status"] == "ended":breaktime.sleep(2)print(f"Ended: {call['end_reason']}, {call['duration_ms']} ms")# Then read what was said.response = requests.get(f"{API}/calls/{call_id}/transcript", headers=HEADERS, timeout=30)response.raise_for_status()for segment in response.json()["segments"]:print(f"{segment['speaker']}: {segment['text']}")Transcript {"object": "transcript","call_id": "call_8tRPaZp5hLMbrGqdJ9AmNa","language": "he","segments": [{ "speaker": "assistant", "text": "שלום דנה, כאן מרפאת השרון. רציתי לאשר את התור שלך מחר בעשר. זה עדיין מתאים?", "start_ms": 820, "end_ms": 5900, "interrupted": false, "tool": null },{ "speaker": "customer", "text": "כן, מתאים לי", "start_ms": 6400, "end_ms": 7700, "interrupted": false, "tool": null }]}In test mode the caller’s lines come from a script and the AI’s from a simulated model, so they read like a test, not like a real conversation. The post-call summary is a fixed stand-in too: no AI model runs in test mode.
Test numbers
Section titled “Test numbers”+972500000001 answers, as in step 3. Other test numbers are busy, reach an answering machine, are on the do-not-call list, ring with no answer or fail, so you can test every path of your code: see test mode. Test numbers exist only in test mode; a live key dials them like any other number.
Get told when the call ends
Section titled “Get told when the call ends”Polling is fine for a first test. In production, let MoreVoice tell you: add a webhook endpoint and handle the call.ended event, then call.analyzed when the summary is ready. Test-mode events go only to test-mode endpoints, so your tests never reach production systems. See webhooks.
Go live
Section titled “Go live”- Create a live key (
mv_live_sk_…) the same way, with Mode on Live. - Connect a phone line and choose the number to call from: phone numbers and SIP shows how to connect a SIP trunk, and outbound calls how to set the caller ID with
from_number_id. - Read compliance before you call customers: §30A consent for marketing, the do-not-call lists, and calling hours around Shabbat and holidays.
Next steps
Section titled “Next steps”- Authentication and API keys: key types, scopes and rotation; test mode: what is simulated and what isn’t.
- Outbound calls: variables, metadata, the call purpose and idempotency.
- Campaigns: call a whole list within calling hours.
- The API reference, with a test-mode playground.