Skip to content

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.

  • 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 and pip install requests. For cURL: curl, plus jq for step 4.
  1. 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"
    Response
    {
    "object": "api_key_principal",
    "org_id": "org_7n42DGM5Tflk9n8mt7Fhc9",
    "key_id": "key_9i2E2pKO6g3z4nXl57Qb4g",
    "livemode": false,
    "scopes": ["*"],
    "api_version": "2026-11-01"
    }
  2. 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."
    }'

    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.

  3. Call a test number

    +972500000001 is 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": "דנה" }
    }'
    • purpose is required on every outbound call. It decides which compliance checks run. It is service here, because the call is about an existing appointment.
    • Idempotency-Key is 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.

  4. Follow the call and read the transcript

    A call goes from queued to ringing, in_progress and ended. 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; do
    status=$(curl -s https://api.morevoice.ai/v1/calls/$CALL_ID -H "Authorization: Bearer $MOREVOICE_API_KEY" | jq -r .status)
    [ "$status" = "ended" ] && break
    sleep 2
    done
    # Then read what was said.
    curl https://api.morevoice.ai/v1/calls/$CALL_ID/transcript \
    -H "Authorization: Bearer $MOREVOICE_API_KEY"
    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.

+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.

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.

  1. Create a live key (mv_live_sk_…) the same way, with Mode on Live.
  2. 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.
  3. Read compliance before you call customers: §30A consent for marketing, the do-not-call lists, and calling hours around Shabbat and holidays.