Programmable Voice

Build conversations anywhere. Make, receive, and monitor calls around the world using the Voice API that developers rely on.

Control calls with code
Conversations can happen anywhere. The Twilio Voice API lets you make, manage and route calls to a browser, an app, your phone, or anywhere else you can take a call.
When you start the phone call, the Twilio Voice API provides both a phone number to call, and a server location that will provide TwiML instructions on how to route the phone call.
1

Try a phone call from the Voice API

2
  • PHP
  • Node
  • Python
  • Ruby
  • Java
  • .NET (C#)
  • cURL
<?php

// 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
$sid    = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
$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")
               );

print($call->sid);
// 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 accountSid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
    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")
    );

    Console.WriteLine(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 ACCOUNT_SID = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
  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"),
        URI.create("http://demo.twilio.com/docs/voice.xml"))
      .create();

    System.out.println(call.getSid());
  }
}
// Download the helper library from https://www.twilio.com/docs/node/install
// Your Account Sid and Auth Token from twilio.com/console
const accountSid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX';
const authToken = 'your_auth_token';
const client = require('twilio')(accountSid, authToken);

client.calls
  .create({
    url: 'http://demo.twilio.com/docs/voice.xml',
    to: '+15558675310',
    from: '+15017122661'
  })
  .then(call => console.log(call.sid))
  .done();
# 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
account_sid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
auth_token = 'your_auth_token'
client = Client(account_sid, auth_token)

call = client.calls.create(
    url='http://demo.twilio.com/docs/voice.xml',
    to='+15558675310',
    from_='+15017122661'
)

print(call.sid)
# 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
account_sid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
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
curl -X POST https://api.twilio.com/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Calls.json \
--data-urlencode "Url=http://demo.twilio.com/docs/voice.xml" \
--data-urlencode "To=+15558675310" \
--data-urlencode "From=+15017122661" \
-u ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX:your_auth_token
Hardware is painful. Software is powerful.
Build the exact call experience you want using an intuitive API that scales beyond anything you can do with outdated hardware.
Quality calls with low latency and clear audio
Latency can break up the natural rhythm of your call. Twilio ensures call quality by routing calls to the nearest data center around the world.
Create new lines of communication
Embed PSTN, SIP, or VoIP calling into any app, site, or service. The Voice API lets you build experiences using a simple HTTP request.
Build the exact voice experience you want
With comprehensive documentation and a community of 1.6 million developers, build the custom calling experience of your dreams.
Twilio Proxy:
Connect to Your Customers Without Sacrificing Privacy
Empower front-line workers to talk with customers on their own devices without revealing personal contact information. The Proxy API handles all the hard parts of scaling masked calling, including phone number management and recycling.
Learn about Proxy
Deploy or drag & drop
Write and deploy, or drag and drop with the Twilio Studio visual editor.
Save time and sprints with Twilio Studio. Now anyone on your team can create or modify voice flows using your code or Twilio’s code, all within a common framework.
Flexible voice pricing options
As low as $0.003/min for inbound calls and $0.0095/min
for outbound calls, select the pricing option that’s right for you.
icon-pay-as-you-go
Pay-as-you-go
Pay only for what you use, when you use it. No contracts. No capacity planning.
icon-volume-discounts
Volume discounts
Automatically receive discount pricing once your application reaches volume scale.
icon-commited-use-discounts
Committed-use discounts
Receive larger discounts with monthly committed volume. Contact our sales team to learn more.
See Voice pricing
Build on Twilio. Code with confidence.
Zero maintenance windows
Twilio ships over 100k deployments every year, while maintaining 99.999% uptime.
99.999% API Success Rate
If an API is up but returns errors, it means your app is down. API success rate is critical to maintaining your application experience.
Data privacy & compliance
ISO 27001 compliance and a commitment to GDPR Compliance by May 2018 means even the largest enterprises can trust Twilio with their data.
Proactive carrier rerouting
Twilio makes over one million routing optimizations per year, ensuring that carrier downtime doesn’t affect your application.
No unwanted calls
120 Day, 7-point phone number cleaning process ensures clean numbers that don’t receive calls meant for previous owners.
Global coverage
Call any country in the world with voice-enabled local numbers in over 100 countries, and thousands of local carrier connections.