---
"@context": https://schema.org
"@type": TechArticle
"@id": https://www.twilio.com/docs/voice/tutorials/build-interactive-voice-response-ivr-phone-tree#article
headline: Build an Interactive Voice Response (IVR) Phone Tree
description: Find links to step-by-step tutorials complete with sample code to learn how to build an Interactive Voice Response (IVR) phone tree in your programming language of choice.
url: https://www.twilio.com/docs/voice/tutorials/build-interactive-voice-response-ivr-phone-tree
inLanguage: en
dateModified: 2026-08-19T18:30:57.000Z
author:
  "@type": Organization
  name: Twilio Developer Education Team
publisher:
  "@type": Organization
  name: Twilio
---

# Build an Interactive Voice Response (IVR) Phone Tree

Learn to create an interactive voice response (IVR) system with Twilio Programmable Voice by using the `<Gather>`, `<Say>`, and `<Dial>` TwiML elements to handle phone tree logic inside an application. You can use this guide to send notifications, create self-service automation, build inbound call centers, build outbound call centers, or implement AI or ML transcription.

See [Related reference documentation](#related-reference-documentation) to learn more about the TwiML voice elements used in this guide.

[All Advanced Programmable Voice features guides](/docs/voice/guides/by-feature-product#advanced-programmable-voice-features)

> \[!NOTE]
>
> Find your language and framework of choice to get to the source code in your language and follow step-by-step instructions to learn how to build an IVR phone tree yourself

* **[C# & ASP.NET MVC](/docs/voice/tutorials/build-interactive-voice-response-ivr-phone-tree/csharp)**
* **[Java & Servlets](/docs/voice/tutorials/build-interactive-voice-response-ivr-phone-tree/java)**
* **[Node.js & Express](/docs/voice/tutorials/build-interactive-voice-response-ivr-phone-tree/node)**
* **[PHP & Laravel](/docs/voice/tutorials/build-interactive-voice-response-ivr-phone-tree/php)**
* **[Python & Flask](/docs/voice/tutorials/build-interactive-voice-response-ivr-phone-tree/python)**
* **[Ruby & Rails](/docs/voice/tutorials/build-interactive-voice-response-ivr-phone-tree/ruby)**

## Use cases for IVR systems with Twilio Programmable Voice

This guide teaches the basics required for the following use cases:

### Send notifications with Twilio Programmable Voice

You can use this guide to build automated systems that deliver critical information to your users by using voice calls. Programmatically trigger outbound calls to broadcast urgent alerts, fraud notifications, appointment reminders, or multi-factor authentication (MFA) codes, ensuring high-priority messages reach users instantly.

To learn more advanced features that you can use with notifications, see [Voice notifications](/docs/voice/guides/notifications).

### Create self-service automation with Twilio Programmable Voice

You can use this guide to automate inbound or outbound calls that collect user input by using the keypad or speech recognition. Create interactive menus that allow customers to look up account balances, verify identities, or check order statuses seamlessly without interacting with a live agent.

To learn more advanced features that you can use with self-service automation, see [Voice self-service automation](/docs/voice/guides/self-service-automation).

### Build inbound call centers with Twilio Programmable Voice

You can use this guide as a foundation for routing incoming customer calls to the right agents or departments. By combining IVR menus with Twilio call queuing and routing capabilities, you can minimize wait times, handle high call volumes efficiently, and deliver a streamlined customer support experience.

To learn more advanced features that you can use with inbound call centers, see [Voice inbound call centers](/docs/voice/guides/inbound-call-center).

### Build outbound call centers with Twilio Programmable Voice

You can use this guide to power sales dialers, proactive customer outreach programs, or telemarketing campaigns. Automate outbound dialing workflows, manage agent queues, and connect your team with customers efficiently while maintaining compliance and optimizing connection rates.

To learn more advanced features that you can use with outbound call centers, see [Voice outbound call centers](/docs/voice/guides/outbound-call-center).

### Implement AI or ML transcription with Twilio Programmable Voice

Together with Twilio real-time streaming and speech-to-text capabilities, you can use this guide to convert spoken conversations into text. Leverage artificial intelligence and machine learning to analyze agent-customer interactions, power live sentiment analysis, log call transcripts for compliance, or feed data into conversational AI bots.

To learn more advanced features that you can use with AI or ML transcription, see [Voice AI and ML transcription](/docs/voice/guides/ai-ml-transcription).

## Result

After following this guide, you can successfully process incoming voice calls and present an interactive menu using Twilio Programmable Voice in your application. You will have a live IVR system capable of listening to dual-tone multi-frequency (DTMF) keypad inputs, executing logic conditionally based on user choice, and dynamically forwarding or terminating calls based on your response payload.

## Next steps

Explore the following guides to build on what you've learned in this guide:

* [Respond to incoming phone calls](/docs/voice/tutorials/how-to-respond-to-incoming-phone-calls): Learn how to handle incoming webhooks from Twilio to dynamically direct callers.
* [Collect payments during calls](/docs/voice/tutorials/how-capture-your-first-payment-using-pay): Use the `<Pay>` TwiML verb to securely collect payment information from callers.
* [Make outbound phone calls](/docs/voice/tutorials/how-to-make-outbound-phone-calls): Initiate phone calls programmatically from your Node.js application.

## Related reference documentation

Find reference documentation for the topics on this page.

* [TwiML™ Voice: `<Gather>`](/docs/voice/twiml/gather)
* [TwiML™ Voice: `<Say>`](/docs/voice/twiml/say)
* [TwiML™ Voice: `<Dial>`](/docs/voice/twiml/dial)
* [TwiML™ Voice: `<Redirect>`](/docs/voice/twiml/redirect)
