Skip to content
DocsStart free

Build your first IVR

Build a simple IVR: “Press 1 for sales, 2 for support.” This is the smallest useful call flow.

  1. Create the flow with a menu node as the entry point.

    {
    "id": "flow_01jzqwjn803wtnhc445bvjenzc", "name": "Main IVR", "version": 1, "start": "menu",
    "nodes": [
    { "id": "menu", "type": "menu", "data": {
    "kind": "menu",
    "promptText": "Press 1 for sales, 2 for support.",
    "maxDigits": 1, "timeoutSec": 5, "maxFailures": 2 } },
    { "id": "sales", "type": "dial", "data": { "kind": "dial", "target": "2001", "targetType": "user", "timeoutSec": 25 } },
    { "id": "support", "type": "enqueue", "data": { "kind": "enqueue", "queueId": "q_01j160r23gw5zkpfjme3fwzs5k" } },
    { "id": "vm", "type": "voicemail","data": { "kind": "voicemail", "mailboxId": "vm_01jg8asp59ps9rtt7azhrhvcre" } }
    ],
    "edges": [
    { "id": "e1", "source": "menu", "target": "sales", "sourceHandle": "digit:1" },
    { "id": "e2", "source": "menu", "target": "support", "sourceHandle": "digit:2" },
    { "id": "e3", "source": "menu", "target": "vm", "sourceHandle": "timeout" },
    { "id": "e4", "source": "menu", "target": "vm", "sourceHandle": "invalid" }
    ]
    }
  2. Cover the edge cases. The timeout edge handles a caller who presses nothing; the invalid edge handles an unmapped key (after maxFailures re-prompts). Both go to voicemail here.

  3. Publish the flow by setting is_published = 1. The router only loads published flows, and the version that ran is recorded on each call.

  4. Point a number at it. Set your DID’s route target to the flow:

    { "e164": "12025550123", "dest_kind": "flow", "dest_id": "flow_01jzqwjn803wtnhc445bvjenzc" }
  5. Call the number. You’ll hear the menu. Press 1 to ring user 2001, 2 to join the support queue, or stay silent to land in voicemail.