SUPPORT.TWILIO.COM END OF LIFE NOTICE: This site, support.twilio.com, is scheduled to go End of Life on February 27, 2024. All Twilio Support content has been migrated to help.twilio.com, where you can continue to find helpful Support articles, API docs, and Twilio blog content, and escalate your issues to our Support team. We encourage you to update your bookmarks and begin using the new site today for all your Twilio Support needs.

Getting started with TwiML Bins

TwiML Bins let users create and post TwiML response scripts that tell us how to handle incoming communications. TwiML Bins are free to use, and easy to setup, making them our first recommendation for simple automated replies, or phone number forwarding. This guide explains how to setup and use TwiML Bins, and covers the following topics:

TwiML Overview

When you receive an incoming call, message, or fax to your Twilio phone number, we need instructions that tell us how to process the communication. We accept these instructions in the form of TwiML - our XML-based markup language.

TwiML Bins allow you to post your own TwiML response scripts through Console. And since it's XML-based, there's no previous coding knowledge needed. You can find our guides for composing TwiML responses here:

 

Create a TwiML Bin

  1. Access the TwiML Bins page in Console.
    • Projects with no existing TwiML Bins will see a notice advising of this. Click Create new TwiML Bin to continue.
      createfirst.png
    • Projects with other live TwiML Bins can click the blue plus sign + button.
       plus.png
  2. Enter the desired name for your TwiML Bin. This is only for your reference.
    name.png
  3. Enter the desired TwiML code in XML format.
    enter.png
  4. When finished, you should see aValid TwiMLmessage below your code. Click Save to continue.
    Note: If you see an Invalid message, please review the documentation for TwiML commands.
    create.png

Configure your phone number to use a TwiML Bin

You can enable your TwiML Bin for incoming communications from the Active Numbers page in Console. Click the desired phone number to modify, and then follow the below steps for each communication type.

Programmable Messaging: Scroll to the "Messaging" section, and then select the following options. Click Save when finished.

  • Configure with: Webhooks, TwiML Bins, Functions, Studio, or Proxy
  • A Message Comes in: TwiML Bin
  • Empty field: Select the desired saved TwiML Bin from the drop-down menu.

Programmable Voice: Scroll to the "Voice" or "Voice & Fax" section, and then select thefollowing options. Click Save when finished.

  • Accept incoming: Voice Calls
  • Configure with: Webhooks, TwiML Bins, Functions, Studio, or Proxy
  • A Call Comes in: TwiML Bin
  • Empty field: Select the desired saved TwiML Bin from the drop-down menu.
Have more questions? Submit a request
Powered by Zendesk