Voice API

Explore Twilio’s Programmable Voice API and create custom call experiences with speech recognition, call recording, conference calling and more.

Try a phone call from the Voice API

When you start the phone call, this code makes a request to the Twilio Voice API providing both a phone number to call, and a server location that will provide TwiML instructions on how to route the phone call.

Demo available in the U.S. and Canada.

// Update the path below to your autoload.php,
// see https://getcomposer.org/doc/01-basic-usage.md
require_once '/path/to/vendor/autoload.php';
use Twilio\Rest\Client;
// Your Account Sid and Auth Token from twilio.com/console
$token  = "your_auth_token";
$twilio = new Client($sid, $token);
$call = $twilio->calls
               ->create("+15558675310", // to
                  "+15017122661",       // from
                  array("url" => "http://demo.twilio.com/docs/voice.xml")
// Download the helper library from https://www.twilio.com/docs/node/install
// Your Account Sid and Auth Token from twilio.com/console
const authToken = "your_auth_token";
const client = require("twilio")(accountSid, authToken);
    url: "http://demo.twilio.com/docs/voice.xml",
    to: "+15558675310",
    from: "+15017122661",
  .then((call) => console.log(call.sid))
# Download the helper library from https://www.twilio.com/docs/python/install
from twilio.rest import Client
# Your Account Sid and Auth Token from twilio.com/console
auth_token = 'your_auth_token'
client = Client(account_sid, auth_token)
call = client.calls.create(
# Download the helper library from https://www.twilio.com/docs/ruby/install
require 'rubygems'
require 'twilio-ruby'
# Your Account Sid and Auth Token from twilio.com/console
auth_token = 'your_auth_token'
@client = Twilio::REST::Client.new(account_sid, auth_token)
call = @client.calls.create(
          url: 'http://demo.twilio.com/docs/voice.xml',
          to: '+15558675310',
          from: '+15017122661'
puts call.sid
// Install the Java helper library from twilio.com/docs/java/install
import com.twilio.Twilio;
import com.twilio.rest.api.v2010.account.Call;
import com.twilio.type.PhoneNumber;
import java.net.URI;
public class Example {
  // Find your Account Sid and Token at twilio.com/console
  public static final String AUTH_TOKEN = "your_auth_token";
  public static void main(String[] args) {
    Twilio.init(ACCOUNT_SID, AUTH_TOKEN);
    Call call = Call.creator(
        new com.twilio.type.PhoneNumber("+15558675310"),
        new com.twilio.type.PhoneNumber("+15017122661"),
// Install the C# / .NET helper library from twilio.com/docs/csharp/install
using System;
using Twilio;
using Twilio.Rest.Api.V2010.Account;
class Program 
  static void Main(string[] args)
    // Find your Account Sid and Token at twilio.com/console
    const string authToken = "your_auth_token";
    TwilioClient.Init(accountSid, authToken);
    var call = CallResource.Create(
      url: new Uri("http://demo.twilio.com/docs/voice.xml"),
      to: new Twilio.Types.PhoneNumber("+15558675310"),
      from: new Twilio.Types.PhoneNumber("+15017122661")

Powerful Voice API Primitives

Programmatic call control

Your app instructs Twilio in real time on how a call should proceed — build nearly any workflow you can imagine.

  <Dial action="/forward">

<Say> text and <Gather> keypad input

The basics of most call flows start with the ability to speak strings of text and gather DTMF keypad input.

  <Gather action="/process-keypad-input">
    <Say language="en-gb">
      Ahoy! Choose an option.
      For Sales press 1.
      For Support press 2.

<Queue> and <Conference> built in

TwiML provides intelligent Conference and Queue primitives to take the heavy lifting out of building seamless call experiences.


<Dial> a WebRTC‑powered <Client>        

Connect a call to a web or mobile app using the Twilio Client SDK. Your TwiML specifies to which client username to connect the call.

  <Say language="en-gb">
    Ahoy! Please hold while we
    connect you to an agent.
  <Queue url="/support-hold">

Call progress notifications  

Get webhooks notifying of call progress events as any call progresses through key events, such as Initiated, Ringing, Answered, and Completed.

      statusCallbackEvent="initiated ringing answered completed"

The Twilio Advantage

Chat bubble with globe

Communicate reliably

Experience a 99.95% uptime SLA made possible with automated failover and zero maintenance windows.

Planet Earth

Operate at scale

Extend the same app you write once to new markets with configurable features for localization and compliance.


Many channels

Use the same platform you know for voice, SMS, video, chat, two-factor authentication, and more.


No shenanigans

Get to market faster with pay‑as‑you‑go pricing, free support, and the freedom to scale up or down without contracts.