Get Started

The cloud powered voice API.

A user calls your number

Carriers route any landline or mobile call to the Twilio cloud.

Twilio receives the call

Twilio receives the call and makes a request to your application.

Your app responds

Your app receives that request and responds with XML back to Twilio.

Make phone calls in one line of code.

Meet the REST API.

curl -X POST https://api.twilio.com/2010-04-01/Accounts/{AccountSid}/Calls \
--data-urlencode "To=+14155551212" \
--data-urlencode "From=+14158675309" \
--data-urlencode "Url=http://www.drawtheowl.com/ahoy.php" \
-u {AccountSid}:{AuthToken}

To

The number you want to ring. Can be any valid number in supported countries.

From

The number you'd like to appear in the recipient's caller ID. Can be any purchased or validated number.

URL

The URL Twilio should retrieve TwiML from to decide how to proceed with the phone call when answered.

Control call flow with your app’s logic.

Meet TwiML.

<Gather>keypad digits, and POST the result to your server, where your application decides what to do next.

<Play> audio to the caller just by passing the URL of the audio file.

<Say> lets you speak any text to the caller, using a man or woman's voice.

   
1 <Response>
2   <Gather numDigits="1" action="foo.php">
3     <Play>welcome.mp3</Play>
4     <Say>
5       Press "1" to be connected to hear
6       about Alexander Graham Bell, the
7       inventor of the telephone. Press "2"
8       to hear why Thomas Edison was a
9       dastardly villian.
10     </Say>
11   </Gather>
12 </Response>
   

<Dial> any phone number you want, or even pass us multiple numbers and we will call them simultaneously.

   
1 <Response>
2   <Say voice="man">
3     Welcome to the fancy transit hotline connector -
4     please wait while we connect you to the San
5     Francisco Municipal Transit Authority hotline.
6   </Say>
7   <Dial>415.701.2311</Dial>
8 </Response>
   

<Play> audio to the caller just by passing the URl of the audio file. We'll grab it, cache it, and make it instantly ready for your callers.

Twilio handles pretty much any audio format and transcodes it to be phone-friendly so you don't.

   
1 <Response>
2   <Say voice="man">
3     The following is an mp3 audio recording of an
4     NPR program on the the controversy surrounding
5     Alexander Graham Bell. Enjoy!
6   </Say>
7   <Play>nprOnAlexBell.mp3</Play>
8 </Response>
   

<Say> lets you speak any text to the caller, using a man or woman's voice.

Twilio’s a polyglot. We can speak to callers in English, British, Spanish, French, and German.

   
1 <Response>
2   <Say>Twilio can speak text.</Say>
3   <Say voice="man">It can sound like a man.</Say>
4   <Say voice="woman">Or a lady.</Say>
5   <Say language="es">O en espanol.</Say>
6   <Say voice="woman">Tada!</Say>
7 </Response>
   

Twilio <Say> lets you speak any text to the caller, so you can build dynamic data-driven voice apps.

Creating a conference call is as simple as <Dial>'ing the caller to a <Conference> room. You pick the name.

   
1 <Response>
2   <Say>
3     Welcome to the Alexander Graham Bell memorial
4     conference room. Chat with other Twilio
5     customers about Alexander Graham Bell and
6     his legacy. You will be placed on hold until
7     another enthusiast joins the conference.
8     Have a friend call in!
9   </Say>
10   <Dial>
11     <Conference startConferenceOnEnter="false" endConferenceOnExit="true">
12     AGB
13     </Conference>
14   </Dial>
15 </Response>
   
 

The new telephone hook.

Twilio talks to your web app via webhooks - realtime HTTP requests to your web app. When your users call, Twilio will answer and synchronously make a webhook request to your app and ask for TwiML instructions about how to proceed with the call. The platform is a well-behaved HTTP client, and even supports cookies.

We speak your language.

We designed Twilio for web developers like you who want to build applications that communicate. That's why Twilio supports a rich REST API as well as helper libraries for your favorite programming language. No need to learn some foreign software or hardware stack to make a phone ring. Use the tools you know, and rock the phone grid.

 

Test for free

If robustness and reliability are as important to your application as they are to us, you'll be writing tests to ensure your customers always have a great experience. With Twilio's Test Credentials you can test those pesky telecom edge-cases, from buying a phone-number in Portugal to placing a call to Peru. All without spending a penny.

Find out more about Test Credentials »

 

Documentation

REST API request & parameter details and examples of constructing requests

Learn more »

Quickstarts

Step by step guides walk through building basic web apps that control the phone network.

Learn more »

Ready to get started?

Create an account. Build an app that makes phone calls in under five minutes flat. No credit card required.