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 to learn more about the TwiML voice elements used in this guide.
Info
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
This guide teaches the basics required for the following use cases:
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.
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.
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.
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.
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.
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.
Explore the following guides to build on what you've learned in this guide:
- Respond to incoming phone calls: Learn how to handle incoming webhooks from Twilio to dynamically direct callers.
- Collect payments during calls: Use the
<Pay>TwiML verb to securely collect payment information from callers. - Make outbound phone calls: Initiate phone calls programmatically from your Node.js application.