Voice API

Voice with the power of programmability

Build a scalable voice experience with the Voice API that’s connecting millions around the world.

Illustration showing how a company can analyze and extract information from a customer phone call.

How Twilio Voice APIs work

Diagram of a communication cloud network with various message and communication icons.

Quickly scale and modify your voice experience with a wide array of customization options and resources, like our Voice SDK. Unlock actionable insights from your conversations with Voice Intelligence

Add features like Interactive Voice Response (IVR), voice recording, and speech recognition. And get connectivity you can trust through Voice API’s reliable, high-quality connections, supported by the Twilio Super Network.

The Twilio difference


Twilio named a Leader in CPaaS for second consecutive year

Voice API use cases

Create stronger connections through any voice calling experience.

 

Interactive Voice Response (IVR)

Increase customer engagement and reduce operation costs with a scalable IVR system that can respond to commands, build text-to-speech experiences in hundreds of languages, and more.

Marks & Spencer built an AI-powered IVR with Twilio to route customers to the right person with greater accuracy, in less time. 

Call forwarding

90%

call routing accuracy

Chat bubble with clock

10 secs

saved on contact center calls

Trust and compliance with voice calling

Combat distrust in voice calling—87% of consumers believe unidentified calls may be fraudulent. Prove your calls are trustworthy and increase answer rates.

Keep customers and data secure

Emergency calling

Route calls to local public safety answering points.

Secure media

Encrypt the call media and associated signaling during transmission.

Fight unlawful robocalls and caller ID spoofing

Branded Calling - Display your name, logo, and call purpose on mobile.

CNAM  - Present your company name with caller ID to increase answer rates.

SHAKEN/STIR - Combat robocalls with “caller verified” signals.

Voice Integrity - Monitor and improve phone number reputation.

Voice API Features

The Voice API that just works—and features that make it work even harder.

Voice intelligence turns voice calls into data

Sign up now

Unlock ROI from your customer calls with Voice Intelligence

Turn conversations into knowledge and extract customer data at scale with natural language intelligence. Voice Intelligence is your gateway to AI-powered business transformation.

  • Media streams

    Get secure, real-time access to the raw data of your phone calls.

  • Voice Insights

    Deliver top-of-the-line calling with this real-time call quality monitoring tool.

  • Voice SDK

    Quickly embed Voice into your iOS, Android, or Javascript applications.

Get started with Twilio Voice

Make your first outgoing phone call with just a few lines of code. Add a few more and your app can respond to incoming callers. Then choose your programming for quick and confident deployment.

// Download the helper library from https://www.twilio.com/docs/node/install
const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";

// Find your Account SID and Auth Token at twilio.com/console
// and set the environment variables. See http://twil.io/secure
const accountSid = process.env.TWILIO_ACCOUNT_SID;
const authToken = process.env.TWILIO_AUTH_TOKEN;
const client = twilio(accountSid, authToken);

async function createCall() {
  const call = await client.calls.create({
    from: "+15558675310",
    to: "+15017122661",
    url: "http://demo.twilio.com/docs/voice.xml",
  });

  console.log(call.sid);
}

createCall();
# Download the helper library from https://www.twilio.com/docs/python/install
import os
from twilio.rest import Client

# Find your Account SID and Auth Token at twilio.com/console
# and set the environment variables. See http://twil.io/secure
account_sid = os.environ["TWILIO_ACCOUNT_SID"]
auth_token = os.environ["TWILIO_AUTH_TOKEN"]
client = Client(account_sid, auth_token)

call = client.calls.create(
    from_="+15558675310",
    to="+15017122661",
    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;
using System.Threading.Tasks;

class Program {
    public static async Task Main(string[] args) {
        // Find your Account SID and Auth Token at twilio.com/console
        // and set the environment variables. See http://twil.io/secure
        string accountSid = Environment.GetEnvironmentVariable("TWILIO_ACCOUNT_SID");
        string authToken = Environment.GetEnvironmentVariable("TWILIO_AUTH_TOKEN");

        TwilioClient.Init(accountSid, authToken);

        var call = await CallResource.CreateAsync(
            from: new Twilio.Types.PhoneNumber("+15558675310"),
            to: new Twilio.Types.PhoneNumber("+15017122661"),
            url: new Uri("http://demo.twilio.com/docs/voice.xml"));

        Console.WriteLine(call.Sid);
    }
}
// Install the Java helper library from twilio.com/docs/java/install

import java.net.URI;
import com.twilio.Twilio;
import com.twilio.rest.api.v2010.account.Call;

public class Example {
    // Find your Account SID and Auth Token at twilio.com/console
    // and set the environment variables. See http://twil.io/secure
    public static final String ACCOUNT_SID = System.getenv("TWILIO_ACCOUNT_SID");
    public static final String AUTH_TOKEN = System.getenv("TWILIO_AUTH_TOKEN");

    public static void main(String[] args) {
        Twilio.init(ACCOUNT_SID, AUTH_TOKEN);
        Call call = Call.creator(new com.twilio.type.PhoneNumber("+15017122661"),
                            new com.twilio.type.PhoneNumber("+15558675310"),
                            URI.create("http://demo.twilio.com/docs/voice.xml"))
                        .create();

        System.out.println(call.getSid());
    }
}
<?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;

// Find your Account SID and Auth Token at twilio.com/console
// and set the environment variables. See http://twil.io/secure
$sid = getenv("TWILIO_ACCOUNT_SID");
$token = getenv("TWILIO_AUTH_TOKEN");
$twilio = new Client($sid, $token);

$call = $twilio->calls->create(
    "+15017122661", // To
    "+15558675310", // From
    ["url" => "http://demo.twilio.com/docs/voice.xml"]
);

print $call->sid;
# Download the helper library from https://www.twilio.com/docs/ruby/install
require 'rubygems'
require 'twilio-ruby'

# Find your Account SID and Auth Token at twilio.com/console
# and set the environment variables. See http://twil.io/secure
account_sid = ENV['TWILIO_ACCOUNT_SID']
auth_token = ENV['TWILIO_AUTH_TOKEN']
@client = Twilio::REST::Client.new(account_sid, auth_token)

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

puts call.sid
# Install the twilio-cli from https://twil.io/cli

twilio api:core:calls:create \
   --from +15558675310 \
   --to +15017122661 \
   --url http://demo.twilio.com/docs/voice.xml
curl -X POST "https://api.twilio.com/2010-04-01/Accounts/$TWILIO_ACCOUNT_SID/Calls.json" \
--data-urlencode "From=+15558675310" \
--data-urlencode "To=+15017122661" \
--data-urlencode "Url=http://demo.twilio.com/docs/voice.xml" \
-u $TWILIO_ACCOUNT_SID:$TWILIO_AUTH_TOKEN

Need help building? 
No problem.

Work with one of our trusted partners to get coding support or explore a pre-built voice solution. Find a partner

Why Twilio Voice

Handle your biggest voice workloads with reliable scale and quality.

19.9B+

calls handled in 2023*

76M+

calls daily*

240+

number types*

50B+

voice minutes handled*

Voice pricing to match your business needs

Build the engaging call experience you’ve always wanted without worrying about the price. Only pay for what you use. There are no commitments necessary.

Cartoon woman in an orange jacket holding a divided card near a large phone and a cloud

FAQ

A voice API is a tool that enables your web application to make and receive phone calls. It can immediately connect you to the Public Switched Telephone Network (PSTN) so you can call people anywhere in the world, on any device, through any network via an internet connection. It can also place calls over the internet, through VoIP calling, to reach applications connected to the internet.

A voice calling app is an application that can make and receive phone calls. It can connect you to the Public Switched Telephony Network (PSTN) and VoIP applications so you can reach people anywhere, on any device.

A voice calling application usually includes additional features and functionality, like call transcription, voice recording, interactive voice response (IVR), SIP interfacing, text-to-speech and more.

See more features you can build into a voice app.

Alerts and notifications - Automated phone calls to notify customers about password resets, low-balance alerts, upcoming appointments, and fraud warnings. 

IVR - A customer interactive voice response system for self-service that can respond to commands, support text-to-speech in hundreds of languages, and route customers to the right representative when they need one. 

Call tracking - A way to tie incoming calls to specific digital campaigns for ROI measurement, as well as routing leads to the right representative. 

Embedded calling - A WebRTC-powered voice calling app that works across browsers and devices. 

Global conferencing - Multiparty calling experiences for up to 250 participants.

Masked calling - A way to connect customers to employees without revealing personal phone numbers of either parties.

Yes. As a default security measure, Twilio Voice uses encryption at rest for call recordings stored with Twilio.

We also have a Call Recording Encryption feature that encrypts all records with a public key which can only be accessed by the holder of the corresponding private key.



Learn more about call recording encryption.

Twilio Voice is pay as you go, which means you pay per call and duration. There are different charges depending on the type of call you’re making, the number you’re calling, and the features you’re using.

You can visit our voice pricing page to see a detailed breakdown.

Twilio Voice Intelligence is a feature that uses AI-powered language operators in addition to call transcription to identify and extract important signals from unstructured voice calls at scale. 

Learn more about Voice Intelligence

Twilio also recently introduced CustomerAI Perception Engine, which can gather insights from customer calls and use that information to build or enrich customer profiles. 

Learn more about Perception Engine