Outgoing Caller IDs

An OutgoingCallerId instance resource represents a single verified number that may be used as a caller ID when making outgoing calls via the REST API and within the TwiML <Dial> verb. The OutgoingCallerIds list resource represents the set of an account's verified phone numbers.

OutgoingCallerId Instance Resource 

Resource URI

/2010-04-01/Accounts/{AccountSid}/OutgoingCallerIds/{OutgoingCallerIdSid}
Property Description
Sid A 34 character string that uniquely identifies this resource.
DateCreated The date that this resource was created, given in RFC 2822 format.
DateUpdated The date that this resource was last updated, given in RFC 2822 format.
FriendlyName A human readable descriptive text for this resource, up to 64 characters long. By default, the FriendlyName is a nicely formatted version of the phone number.
AccountSid The unique ID of the Account responsible for this Caller Id.
PhoneNumber The incoming phone number. Formatted with a '+' and country code e.g., +16175551212 (E.164 format).
Uri The URI for this resource, relative to https://api.twilio.com.
Loading Code Samples...
Language
SDK Version:
  • 4.x
  • 5.x
Response Format:
  • json
  • xml
SDK Version:
  • 6.x
  • 7.x
SDK Version:
  • 2.x
  • 3.x
SDK Version:
  • 4.x
  • 5.x
SDK Version:
  • 5.x
  • 6.x
SDK Version:
  • 4.x
  • 5.x
Format:
  • JSON
  • XML
// Download the Node helper library from twilio.com/docs/node/install
// These vars are your accountSid and authToken from twilio.com/user/account
var accountSid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX';
var authToken = "your_auth_token";
var client = require('twilio')(accountSid, authToken);

client.outgoingCallerIds("PNe905d7e6b410746a0fb08c57e5a186f3").get(function(err, callerId) {
    console.log(callerId.phoneNumber);
});
// Download the Node helper library from twilio.com/docs/node/install
// These consts are your accountSid and authToken from https://www.twilio.com/console
const accountSid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX';
const authToken = 'your_auth_token';
const client = require('twilio')(accountSid, authToken);

client.api.accounts(accountSid)
  .outgoingCallerIds('PNe905d7e6b410746a0fb08c57e5a186f3')
  .fetch()
  .then((callerId) => console.log(callerId.phoneNumber));
// Download the twilio-csharp library from twilio.com/docs/csharp/install
using System;
using Twilio;
class Example 
{
  static void Main(string[] args) 
  {
    // Find your Account Sid and Auth Token at twilio.com/user/account
    string AccountSid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
    string AuthToken = "your_auth_token";
    var twilio = new TwilioRestClient(AccountSid, AuthToken);

    var callerId = twilio.GetOutgoingCallerId("PNe905d7e6b410746a0fb08c57e5a186f3");
    
    Console.WriteLine(callerId.PhoneNumber);
  }
}
<?php
// Get the PHP helper library from twilio.com/docs/php/install
require_once('/path/to/twilio-php/Services/Twilio.php'); // Loads the library

// Your Account Sid and Auth Token from twilio.com/user/account
$sid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"; 
$token = "your_auth_token"; 
$client = new Services_Twilio($sid, $token);

// Get an object from its sid. If you do not have a sid,
// check out the list resource examples on this page
$caller_id = $client->account->outgoing_caller_ids->get("PNe905d7e6b410746a0fb08c57e5a186f3");
echo $caller_id->phone_number;
# Get twilio-ruby from twilio.com/docs/ruby/install
require 'rubygems' # This line not needed for ruby > 1.8
require 'twilio-ruby'

# Get your Account Sid and Auth Token from twilio.com/user/account
account_sid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
auth_token = 'your_auth_token'
client = Twilio::REST::Client.new account_sid, auth_token

# Get an object from its sid. If you do not have a sid,
# check out the list resource examples on this page
caller_id = client.account.outgoing_caller_ids
                  .get('PNe905d7e6b410746a0fb08c57e5a186f3')
puts caller_id.phone_number
// Download the twilio-csharp library from twilio.com/docs/libraries/csharp
using System;
using Twilio;
using Twilio.Rest.Api.V2010.Account;

class Example
{
    static void Main(string[] args)
    {
        // Find your Account Sid and Auth Token at twilio.com/console
        const string accountSid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
        const string authToken = "your_auth_token";
        TwilioClient.Init(accountSid, authToken);

        var callerId = OutgoingCallerIdResource.Fetch("PNe905d7e6b410746a0fb08c57e5a186f3");

        Console.WriteLine(callerId.PhoneNumber);
    }
}
<?php
// Get the PHP helper library from twilio.com/docs/php/install
require_once '/path/to/vendor/autoload.php'; // Loads the library
use Twilio\Rest\Client;

// Your Account Sid and Auth Token from twilio.com/user/account
$sid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
$token = "your_auth_token";
$client = new Client($sid, $token);

// Get an object from its sid. If you do not have a sid,
// check out the list resource examples on this page
$callerId = $client
    ->outgoingCallerIds("PNe905d7e6b410746a0fb08c57e5a186f3")
    ->fetch();

echo $callerId->phoneNumber;
# Download the Python helper library from twilio.com/docs/python/install
from twilio.rest import TwilioRestClient

# Your Account Sid and Auth Token from twilio.com/user/account
account_sid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
auth_token = "your_auth_token"
client = TwilioRestClient(account_sid, auth_token)

caller_id = client.caller_ids.get("PNe905d7e6b410746a0fb08c57e5a186f3")
print(caller_id.phone_number)
require 'rubygems' # not necessary with ruby 1.9 but included for completeness
require 'twilio-ruby'

# put your own credentials here
account_sid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
auth_token = 'your_auth_token'

# set up a client to talk to the Twilio REST API
@client = Twilio::REST::Client.new(account_sid, auth_token)

@caller_id = @client.account
                    .outgoing_caller_ids('PNe905d7e6b410746a0fb08c57e5a186f3')
                    .fetch

puts @caller_id.phone_number
// Install the Java helper library from twilio.com/docs/java/install
import com.twilio.sdk.TwilioRestClient;
import com.twilio.sdk.TwilioRestException;
import com.twilio.sdk.resource.instance.OutgoingCallerId;

public class Example { 

  // Find your Account Sid and Token at twilio.com/user/account
  public static final String ACCOUNT_SID = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
  public static final String AUTH_TOKEN = "your_auth_token";

  public static void main(String[] args) throws TwilioRestException {
    TwilioRestClient client = new TwilioRestClient(ACCOUNT_SID, AUTH_TOKEN);

    // Get an object from its sid. If you do not have a sid,
    // check out the list resource examples on this page
    OutgoingCallerId callerId = client.getAccount().getOutgoingCallerId("PNe905d7e6b410746a0fb08c57e5a186f3");
    System.out.println(callerId.getPhoneNumber()); 
  }
}
# Download the Python helper library from twilio.com/docs/python/install
from twilio.rest import Client

# Your Account Sid and Auth Token from twilio.com/user/account
account_sid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
auth_token = "your_auth_token"
client = Client(account_sid, auth_token)

caller_id = client.outgoing_caller_ids("PNe905d7e6b410746a0fb08c57e5a186f3") \
                  .fetch()

print(caller_id.phone_number)
// Install the Java helper library from twilio.com/docs/java/install
import com.twilio.Twilio;
import com.twilio.rest.api.v2010.account.OutgoingCallerId;

public class Example {
  /// Find your Account Sid and Token at twilio.com/user/account
  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);

    // Get an object from its sid. If you do not have a sid,
    // check out the list resource examples on this page
    OutgoingCallerId callerId =
        OutgoingCallerId.fetcher("PNe905d7e6b410746a0fb08c57e5a186f3").fetch();

    System.out.println(callerId.getPhoneNumber());
  }
}
$ curl -G https://api.twilio.com/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/OutgoingCallerIds/PNe905d7e6b410746a0fb08c57e5a186f3 \
    -u 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX:your_auth_token'
$ curl -G https://api.twilio.com/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/OutgoingCallerIds/PNe905d7e6b410746a0fb08c57e5a186f3.json \
    -u 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX:your_auth_token'
{
	"sid": "PNe905d7e6b410746a0fb08c57e5a186f3",
	"account_sid": "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
	"friendly_name": "(510) 555-5555",
	"phone_number": "+15105555555",
	"date_created": "Tue, 27 Jul 2010 20:21:11 +0000",
	"date_updated": "Tue, 27 Jul 2010 20:21:11 +0000",
	"uri": "\/2010-04-01\/Accounts\/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX\/OutgoingCallerIds\/PNe905d7e6b410746a0fb08c57e5a186f3.json"
}
<TwilioResponse>
	<OutgoingCallerId>
		<Sid>PNe905d7e6b410746a0fb08c57e5a186f3</Sid>
		<AccountSid>ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX</AccountSid>
		<FriendlyName>(510) 555-5555</FriendlyName>
		<PhoneNumber>+15105555555</PhoneNumber>
		<DateCreated>Tue, 27 Jul 2010 20:21:11 +0000</DateCreated>
		<DateUpdated>Tue, 27 Jul 2010 20:21:11 +0000</DateUpdated>
		<Uri>/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/OutgoingCallerIds/PNe905d7e6b410746a0fb08c57e5a186f3</Uri>
	</OutgoingCallerId>
</TwilioResponse>
Get Outgoing Caller ID Details

HTTP POST or PUT

Updates the caller ID, and returns the updated resource if successful.

Optional Parameters

There is only one field that you may update:

Parameter Description
FriendlyName A human readable description of a Caller ID, with maximum length of 64 characters. Defaults to a nicely formatted version of the phone number.
Loading Code Samples...
Language
SDK Version:
  • 4.x
  • 5.x
Response Format:
  • json
  • xml
SDK Version:
  • 6.x
  • 7.x
SDK Version:
  • 2.x
  • 3.x
SDK Version:
  • 4.x
  • 5.x
SDK Version:
  • 5.x
  • 6.x
SDK Version:
  • 4.x
  • 5.x
// Download the Node helper library from twilio.com/docs/node/install
// These vars are your accountSid and authToken from twilio.com/user/account
var accountSid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX';
var authToken = "your_auth_token";
var client = require('twilio')(accountSid, authToken);

client.outgoingCallerIds("PNe536d32a3c49700934481addd5ce1659").update({
    friendlyName: "My Second Line"
}, function(err, callerId) {
    console.log(callerId.phoneNumber);
});
// Download the Node helper library from twilio.com/docs/node/install
// These consts are your accountSid and authToken from https://www.twilio.com/console
const accountSid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX';
const authToken = 'your_auth_token';
const client = require('twilio')(accountSid, authToken);

client.api.accounts(accountSid)
  .outgoingCallerIds('PNe536d32a3c49700934481addd5ce1659')
  .update({friendlyName: 'My Second Line'})
  .then((callerId) => console.log(callerId.phoneNumber));
// Download the twilio-csharp library from twilio.com/docs/csharp/install
using System;
using Twilio;
class Example 
{
  static void Main(string[] args) 
  {
    // Find your Account Sid and Auth Token at twilio.com/user/account
    string AccountSid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
    string AuthToken = "your_auth_token";
    var twilio = new TwilioRestClient(AccountSid, AuthToken); 
    
    twilio.UpdateOutgoingCallerIdName("PNe536d32a3c49700934481addd5ce1659", "My Second Line");
  }
}
<?php
// Get the PHP helper library from twilio.com/docs/php/install
require_once('/path/to/twilio-php/Services/Twilio.php'); // Loads the library

// Your Account Sid and Auth Token from twilio.com/user/account
$sid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"; 
$token = "your_auth_token"; 
$client = new Services_Twilio($sid, $token);

// Get an object from its sid. If you do not have a sid,
// check out the list resource examples on this page
$caller_id = $client->account->outgoing_caller_ids->get("PNe536d32a3c49700934481addd5ce1659");
$caller_id->update(array(
        "FriendlyName" => "My Second Line"
    ));
echo $caller_id->phone_number;
# Get twilio-ruby from twilio.com/docs/ruby/install
require 'rubygems'          # This line not needed for ruby > 1.8
require 'twilio-ruby'

# Get your Account Sid and Auth Token from twilio.com/user/account
account_sid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
auth_token = 'your_auth_token'
@client = Twilio::REST::Client.new account_sid, auth_token

# Get an object from its sid. If you do not have a sid,
# check out the list resource examples on this page
@caller_id = @client.account.outgoing_caller_ids.get("PNe536d32a3c49700934481addd5ce1659")
@caller_id.update(:friendly_name => "My Second Line")
puts @caller_id.phone_number
// Download the twilio-csharp library from twilio.com/docs/libraries/csharp
using System;
using Twilio;
using Twilio.Rest.Api.V2010.Account;

class Example
{
    static void Main(string[] args)
    {
        // Find your Account Sid and Auth Token at twilio.com/console
        const string accountSid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
        const string authToken = "your_auth_token";
        TwilioClient.Init(accountSid, authToken);

        OutgoingCallerIdResource.Update("PNe536d32a3c49700934481addd5ce1659",
                                        friendlyName: "My Second Line");
    }
}
<?php
// Get the PHP helper library from twilio.com/docs/php/install
require_once '/path/to/vendor/autoload.php'; // Loads the library
use Twilio\Rest\Client;

// Your Account Sid and Auth Token from twilio.com/user/account
$sid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
$token = "your_auth_token";
$client = new Client($sid, $token);

// Get an object from its sid. If you do not have a sid,
// check out the list resource examples on this page
$callerId = $client
    ->outgoingCallerIds("PNe536d32a3c49700934481addd5ce1659")
    ->update(
        array("friendlyName" => "My Second Line")
    );

echo $callerId->phoneNumber;
# Download the Python helper library from twilio.com/docs/python/install
from twilio.rest import TwilioRestClient

# Your Account Sid and Auth Token from twilio.com/user/account
account_sid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
auth_token  = "your_auth_token"
client = TwilioRestClient(account_sid, auth_token)

caller_id = client.caller_ids.update("PNe536d32a3c49700934481addd5ce1659", friendly_name="My Second Line")
print(caller_id.phone_number)
require 'rubygems' # not necessary with ruby 1.9 but included for completeness
require 'twilio-ruby'

# put your own credentials here
account_sid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
auth_token = 'your_auth_token'

# set up a client to talk to the Twilio REST API
@client = Twilio::REST::Client.new(account_sid, auth_token)

@caller_id = @client.api
                    .outgoing_caller_ids('PNe536d32a3c49700934481addd5ce1659')
                    .fetch

@caller_id.update(friendly_name: 'My Second Line')

puts @caller_id.friendly_name
// Install the Java helper library from twilio.com/docs/java/install
import com.twilio.sdk.TwilioRestClient;
import com.twilio.sdk.TwilioRestException;
import com.twilio.sdk.resource.instance.OutgoingCallerId;
import com.twilio.sdk.resource.list.OutgoingCallerIdList;
import java.util.ArrayList;
import java.util.List;
import org.apache.http.NameValuePair;
import org.apache.http.message.BasicNameValuePair;

public class Example { 

  // Find your Account Sid and Token at twilio.com/user/account
  public static final String ACCOUNT_SID = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
  public static final String AUTH_TOKEN = "your_auth_token";

  public static void main(String[] args) throws TwilioRestException {
    TwilioRestClient client = new TwilioRestClient(ACCOUNT_SID, AUTH_TOKEN);

    // Get an object from its sid. If you do not have a sid,
    // check out the list resource examples on this page
    OutgoingCallerId callerId = client.getAccount().getOutgoingCallerId("PNe536d32a3c49700934481addd5ce1659");
    // Build a filter for the OutgoingCallerIdList
    List<NameValuePair> params = new ArrayList<NameValuePair>();
    params.add(new BasicNameValuePair("FriendlyName", "My Second Line"));
    callerId.update(params); 
  }
}
# Download the Python helper library from twilio.com/docs/python/install
from twilio.rest import Client

# Your Account Sid and Auth Token from twilio.com/user/account
account_sid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
auth_token = "your_auth_token"
client = Client(account_sid, auth_token)

caller_id = client.outgoing_caller_ids("PNe536d32a3c49700934481addd5ce1659") \
                  .update(friendly_name="My Second Line")

print(caller_id.phone_number)
// Install the Java helper library from twilio.com/docs/java/install
import com.twilio.Twilio;
import com.twilio.rest.api.v2010.account.OutgoingCallerId;

public class Example {
  /// Find your Account Sid and Token at twilio.com/user/account
  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);

    // Get an object from its sid. If you do not have a sid,
    // check out the list resource examples on this page
    OutgoingCallerId callerId = OutgoingCallerId.updater("PNe536d32a3c49700934481addd5ce1659")
        .setFriendlyName("My Second Line")
        .update();

    System.out.println(callerId.getFriendlyName());
  }
}
$ curl -XPOST https://api.twilio.com/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/OutgoingCallerIds/PNe536d32a3c49700934481addd5ce1659 \
    -d "FriendlyName=My%20Second%20Line" \
    -u 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX:your_auth_token'
$ curl -XPOST https://api.twilio.com/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/OutgoingCallerIds/PNe536d32a3c49700934481addd5ce1659.json \
    -d "FriendlyName=My%20Second%20Line" \
    -u 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX:your_auth_token'
Update Outgoing Caller ID

The response format is identical to the HTTP GET response documented above.

HTTP DELETE

Deletes the caller ID from the account. Returns an HTTP 204 response if successful, with no body.

Delete Outgoing Caller ID

Loading Code Samples...
Language
SDK Version:
  • 4.x
  • 5.x
Response Format:
  • json
  • xml
SDK Version:
  • 6.x
  • 7.x
SDK Version:
  • 2.x
  • 3.x
SDK Version:
  • 4.x
  • 5.x
SDK Version:
  • 5.x
  • 6.x
SDK Version:
  • 4.x
  • 5.x
// Download the Node helper library from twilio.com/docs/node/install
// These vars are your accountSid and authToken from twilio.com/user/account
var accountSid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX';
var authToken = "your_auth_token";
var client = require('twilio')(accountSid, authToken);

client.outgoingCallerIds("PNe536d32a3c49700934481addd5ce1659").delete(function(err, data) {
    if (err) {
        console.log(err.status);
        throw err.message;
    } else {
        console.log("Sid PNe536d32a3c49700934481addd5ce1659 deleted successfully.");
    }
});
// Download the Node helper library from twilio.com/docs/node/install
// These consts are your accountSid and authToken from https://www.twilio.com/console
const accountSid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX';
const authToken = 'your_auth_token';
const Twilio = require('twilio');
const client = new Twilio(accountSid, authToken);

const outgoingCalledIdSid = 'PNe536d32a3c49700934481addd5ce1659';

client.outgoingCallerIds(outgoingCalledIdSid)
  .remove()
  .then(() => console.log(`Sid ${outgoingCalledIdSid} deleted successfully.`))
  .done();
// Download the twilio-csharp library from twilio.com/docs/csharp/install
using System;
using Twilio;
class Example 
{
  static void Main(string[] args) 
  {
    // Find your Account Sid and Auth Token at twilio.com/user/account
    string AccountSid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
    string AuthToken = "your_auth_token";
    var twilio = new TwilioRestClient(AccountSid, AuthToken);

    twilio.DeleteOutgoingCallerId("PNe536d32a3c49700934481addd5ce1659");
  }
}
<?php
// Get the PHP helper library from twilio.com/docs/php/install
require_once('/path/to/twilio-php/Services/Twilio.php'); // Loads the library

// Your Account Sid and Auth Token from twilio.com/user/account
$sid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"; 
$token = "your_auth_token"; 
$client = new Services_Twilio($sid, $token);

$client->account->outgoing_caller_ids->delete("PNe536d32a3c49700934481addd5ce1659");
# Get twilio-ruby from twilio.com/docs/ruby/install
require 'rubygems'          # This line not needed for ruby > 1.8
require 'twilio-ruby'

# Get your Account Sid and Auth Token from twilio.com/user/account
account_sid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
auth_token = 'your_auth_token'
@client = Twilio::REST::Client.new account_sid, auth_token

@caller_id = @client.account.outgoing_caller_ids.get("PNe536d32a3c49700934481addd5ce1659")
@caller_id.delete
// Download the twilio-csharp library from twilio.com/docs/libraries/csharp
using System;
using Twilio;
using Twilio.Rest.Api.V2010.Account;

class Example
{
    static void Main(string[] args)
    {
        // Find your Account Sid and Auth Token at twilio.com/console
        const string accountSid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
        const string authToken = "your_auth_token";
        TwilioClient.Init(accountSid, authToken);

        OutgoingCallerIdResource.Delete("PNe536d32a3c49700934481addd5ce1659");
    }
}
<?php
// Get the PHP helper library from twilio.com/docs/php/install
require_once '/path/to/vendor/autoload.php'; // Loads the library
use Twilio\Rest\Client;

// Your Account Sid and Auth Token from twilio.com/user/account
$sid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
$token = "your_auth_token";
$client = new Client($sid, $token);

$client->outgoingCallerIds("PNe536d32a3c49700934481addd5ce1659")->delete();
# Download the Python helper library from twilio.com/docs/python/install
from twilio.rest import TwilioRestClient

# Your Account Sid and Auth Token from twilio.com/user/account
account_sid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
auth_token = "your_auth_token"
client = TwilioRestClient(account_sid, auth_token)

client.caller_ids.delete("PNe536d32a3c49700934481addd5ce1659")
require 'rubygems' # not necessary with ruby 1.9 but included for completeness
require 'twilio-ruby'

# put your own credentials here
account_sid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
auth_token = 'your_auth_token'

# set up a client to talk to the Twilio REST API
@client = Twilio::REST::Client.new(account_sid, auth_token)

@caller_id = @client.api
                    .outgoing_caller_ids('PNe536d32a3c49700934481addd5ce1659')
                    .fetch

@caller_id.delete
// Install the Java helper library from twilio.com/docs/java/install
import com.twilio.sdk.TwilioRestClient;
import com.twilio.sdk.TwilioRestException;
import com.twilio.sdk.resource.instance.OutgoingCallerId;

public class Example { 

  // Find your Account Sid and Token at twilio.com/user/account
  public static final String ACCOUNT_SID = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
  public static final String AUTH_TOKEN = "your_auth_token";

  public static void main(String[] args) throws TwilioRestException {
    TwilioRestClient client = new TwilioRestClient(ACCOUNT_SID, AUTH_TOKEN);

    // Get an object from its sid. If you do not have a sid,
    // check out the list resource examples on this page
    OutgoingCallerId callerId = client.getAccount().getOutgoingCallerId("PNe536d32a3c49700934481addd5ce1659");
    
    callerId.delete(); 
  }
}
# Download the Python helper library from twilio.com/docs/python/install
from twilio.rest import Client

# Your Account Sid and Auth Token from twilio.com/user/account
account_sid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
auth_token = "your_auth_token"
client = Client(account_sid, auth_token)

client.outgoing_caller_ids("PNe536d32a3c49700934481addd5ce1659") \
      .delete()
// Install the Java helper library from twilio.com/docs/java/install
import com.twilio.Twilio;
import com.twilio.rest.api.v2010.account.OutgoingCallerId;

public class Example {
  /// Find your Account Sid and Token at twilio.com/user/account
  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);

    // Get an object from its sid. If you do not have a sid,
    // check out the list resource examples on this page
    OutgoingCallerId.deleter("PNe536d32a3c49700934481addd5ce1659").delete();
  }
}
curl -XDELETE https://api.twilio.com/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/OutgoingCallerIds/PNe536d32a3c49700934481addd5ce1659 \
    -u 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX:your_auth_token'
curl -XDELETE https://api.twilio.com/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/OutgoingCallerIds/PNe536d32a3c49700934481addd5ce1659.json \
    -u 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX:your_auth_token'
Delete Outgoing Caller ID

OutgoingCallerIds List Resource

Resource URI

/2010-04-01/Accounts/{AccountSid}/OutgoingCallerIds

HTTP GET

Returns a list of OutgoingCallerId resource representations, each representing a Caller ID number valid for an account. The list includes paging information.

List Filters

The following GET query string parameters allow you to limit the list returned. Note, parameters are case-sensitive:

Parameter Description
PhoneNumber Only show the caller id resource that exactly matches this phone number.
FriendlyName Only show the caller id resource that exactly matches this name.
Loading Code Samples...
Language
SDK Version:
  • 4.x
  • 5.x
Response Format:
  • json
  • xml
SDK Version:
  • 6.x
  • 7.x
SDK Version:
  • 2.x
  • 3.x
SDK Version:
  • 4.x
  • 5.x
SDK Version:
  • 5.x
  • 6.x
SDK Version:
  • 4.x
  • 5.x
Format:
  • JSON
  • XML
// Download the Node helper library from twilio.com/docs/node/install
// These vars are your accountSid and authToken from twilio.com/user/account
const accountSid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX';
const authToken = 'your_auth_token';
const client = require('twilio')(accountSid, authToken);

client.outgoingCallerIds.list((err, data) => {
  data.outgoingCallerIds.forEach(callerId => {
    console.log(callerId.phoneNumber);
  });
});
// Download the Node helper library from twilio.com/docs/node/install
// These consts are your accountSid and authToken from https://www.twilio.com/console
const accountSid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX';
const authToken = 'your_auth_token';
const client = require('twilio')(accountSid, authToken);

client.api
  .accounts(accountSid)
  .outgoingCallerIds.each(callerId => console.log(callerId.phoneNumber));
// Download the twilio-csharp library from twilio.com/docs/csharp/install
using System;
using Twilio;
class Example 
{
  static void Main(string[] args) 
  {
    // Find your Account Sid and Auth Token at twilio.com/user/account
    string AccountSid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
    string AuthToken = "your_auth_token";
    var twilio = new TwilioRestClient(AccountSid, AuthToken);

    var callerIds = twilio.ListOutgoingCallerIds(null, null, null, null);
    
    foreach (var callerId in callerIds.OutgoingCallerIds)
    {
      Console.WriteLine(callerId.PhoneNumber);
    }
  }
}
<?php
// Get the PHP helper library from twilio.com/docs/php/install
require_once('/path/to/twilio-php/Services/Twilio.php'); // Loads the library

// Your Account Sid and Auth Token from twilio.com/user/account
$sid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"; 
$token = "your_auth_token"; 
$client = new Services_Twilio($sid, $token);

// Loop over the list of caller_ids and echo a property for each one
foreach ($client->account->outgoing_caller_ids as $caller_id) {
    echo $caller_id->phone_number;
}
# Get twilio-ruby from twilio.com/docs/ruby/install
require 'rubygems'          # This line not needed for ruby > 1.8
require 'twilio-ruby'

# Get your Account Sid and Auth Token from twilio.com/user/account
account_sid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
auth_token = 'your_auth_token'
@client = Twilio::REST::Client.new account_sid, auth_token

# Loop over caller_ids and print out a property for each one
@client.account.outgoing_caller_ids.list.each do |caller_id|
  puts caller_id.phone_number
end
// Download the twilio-csharp library from twilio.com/docs/libraries/csharp
using System;
using Twilio;
using Twilio.Rest.Api.V2010.Account;

class Example
{
    static void Main(string[] args)
    {
        // Find your Account Sid and Auth Token at twilio.com/console
        const string accountSid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
        const string authToken = "your_auth_token";
        TwilioClient.Init(accountSid, authToken);

        var callerIds = OutgoingCallerIdResource.Read();

        foreach (var callerId in callerIds)
        {
            Console.WriteLine(callerId.PhoneNumber);
        }
    }
}
<?php
// Get the PHP helper library from twilio.com/docs/php/install
require_once '/path/to/vendor/autoload.php'; // Loads the library
use Twilio\Rest\Client;

// Your Account Sid and Auth Token from twilio.com/user/account
$sid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
$token = "your_auth_token";
$client = new Client($sid, $token);

// Loop over the list of caller_ids and echo a property for each one
foreach ($client->outgoingCallerIds->read() as $callerId) {
    echo $callerId->phoneNumber;
}
# Download the Python helper library from twilio.com/docs/python/install
from twilio.rest import TwilioRestClient

# Your Account Sid and Auth Token from twilio.com/user/account
account_sid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
auth_token = "your_auth_token"
client = TwilioRestClient(account_sid, auth_token)

# A list of caller_id objects with the properties described above
caller_ids = client.caller_ids.list()
require 'rubygems' # not necessary with ruby 1.9 but included for completeness
require 'twilio-ruby'

# put your own credentials here
account_sid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
auth_token = 'your_auth_token'

# set up a client to talk to the Twilio REST API
@client = Twilio::REST::Client.new(account_sid, auth_token)

# Loop over caller_ids and print out a property for each one
@client.outgoing_caller_ids.list.each do |caller_id|
  puts caller_id.phone_number
end
// Install the Java helper library from twilio.com/docs/java/install
import com.twilio.sdk.TwilioRestClient;
import com.twilio.sdk.TwilioRestException;
import com.twilio.sdk.resource.instance.OutgoingCallerId;
import com.twilio.sdk.resource.list.OutgoingCallerIdList;

public class Example {

  // Find your Account Sid and Token at twilio.com/user/account
  public static final String ACCOUNT_SID = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
  public static final String AUTH_TOKEN = "your_auth_token";

  public static void main(String[] args) throws TwilioRestException {
    TwilioRestClient client = new TwilioRestClient(ACCOUNT_SID, AUTH_TOKEN);

    OutgoingCallerIdList callerIds = client.getAccount().getOutgoingCallerIds();

    // Loop over callerIds and print out a property for each one.
    for (OutgoingCallerId callerId : callerIds) {
      System.out.println(callerId.getPhoneNumber());
    }
  }
}
# Download the Python helper library from twilio.com/docs/python/install
from twilio.rest import Client

# Your Account Sid and Auth Token from twilio.com/user/account
account_sid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
auth_token = "your_auth_token"
client = Client(account_sid, auth_token)

# A list of caller_id objects with the properties described above
for caller_id in client.outgoing_caller_ids.list():
    print(caller_id.phone_number)
// Install the Java helper library from twilio.com/docs/java/install
import com.twilio.Twilio;
import com.twilio.base.ResourceSet;
import com.twilio.rest.api.v2010.account.OutgoingCallerId;

public class Example {
  /// Find your Account Sid and Token at twilio.com/user/account
  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);

    ResourceSet<OutgoingCallerId> callerIds = OutgoingCallerId.reader().read();

    // Loop over callerIds and print out a property for each one.
    for (OutgoingCallerId callerId : callerIds) {
      System.out.println(callerId.getPhoneNumber());
    }
  }
}
$ curl -G https://api.twilio.com/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/OutgoingCallerIds \
    -u 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX:your_auth_token'
$ curl -G https://api.twilio.com/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/OutgoingCallerIds.json \
    -u 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX:your_auth_token'
{
	"page": 0,
	"page_size": 50,
	"uri": "\/2010-04-01\/Accounts\/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX\/OutgoingCallerIds.json",
	"first_page_uri": "\/2010-04-01\/Accounts\/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX\/OutgoingCallerIds.json?Page=0&PageSize=50",
	"previous_page_uri": null,
	"next_page_uri": null,
	"outgoing_caller_ids": [
		{
			"sid": "PNe905d7e6b410746a0fb08c57e5a186f3",
			"account_sid": "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
			"friendly_name": "(510) 555-5555",
			"phone_number": "+15105555555",
			"date_created": "Tue, 27 Jul 2010 20:21:11 +0000",
			"date_updated": "Tue, 27 Jul 2010 20:21:11 +0000",
			"uri": "\/2010-04-01\/Accounts\/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX\/OutgoingCallerIds\/PNe905d7e6b410746a0fb08c57e5a186f3.json"
		},
		...
	]
}
<TwilioResponse>
	<OutgoingCallerIds page="0" pagesize="50" uri="/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/OutgoingCallerIds" firstpageuri="/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/OutgoingCallerIds?Page=0&amp;PageSize=50" previouspageuri="" nextpageuri="">
		<OutgoingCallerId>
			<Sid>PNe905d7e6b410746a0fb08c57e5a186f3</Sid>
			<AccountSid>ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX</AccountSid>
			<FriendlyName>(510) 555-5555</FriendlyName>
			<PhoneNumber>+15105555555</PhoneNumber>
			<DateCreated>Tue, 27 Jul 2010 20:21:11 +0000</DateCreated>
			<DateUpdated>Tue, 27 Jul 2010 20:21:11 +0000</DateUpdated>
			<Uri>/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/OutgoingCallerIds/PNe905d7e6b410746a0fb08c57e5a186f3</Uri>
		</OutgoingCallerId>
		...
	</OutgoingCallerIds>
List an Account's Outgoing Caller IDs

Show Caller ID for a Phone number

Only show the caller id record for phone number (415) 867-5309.

Loading Code Samples...
Language
SDK Version:
  • 4.x
  • 5.x
Response Format:
  • json
  • xml
SDK Version:
  • 6.x
  • 7.x
SDK Version:
  • 2.x
  • 3.x
SDK Version:
  • 4.x
  • 5.x
SDK Version:
  • 5.x
  • 6.x
SDK Version:
  • 4.x
  • 5.x
// Download the Node helper library from twilio.com/docs/node/install
// These vars are your accountSid and authToken from twilio.com/user/account
var accountSid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX';
var authToken = "your_auth_token";
var client = require('twilio')(accountSid, authToken);

client.outgoingCallerIds.list({ phoneNumber: "+14158675309" }, function(err, data) {
    data.outgoingCallerIds.forEach(function(callerId) {
        console.log(callerId.phoneNumber);
    });
});
// Download the Node helper library from twilio.com/docs/node/install
// These consts are your accountSid and authToken from https://www.twilio.com/console
const accountSid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX';
const authToken = 'your_auth_token';
const client = require('twilio')(accountSid, authToken);

client.api.accounts(accountSid)
  .outgoingCallerIds
  // filter callerids to include only those that have the following number
  .each({phoneNumber: '+14158675309'},
        (callerId) => console.log(callerId.sid));
// Download the twilio-csharp library from twilio.com/docs/csharp/install
using System;
using Twilio;
class Example 
{
  static void Main(string[] args) 
  {
    // Find your Account Sid and Auth Token at twilio.com/user/account
    string AccountSid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
    string AuthToken = "your_auth_token";
    var twilio = new TwilioRestClient(AccountSid, AuthToken);

    var callerIds = twilio.ListOutgoingCallerIds("+14158675309", null, null, null);
    
    foreach (var callerId in callerIds.OutgoingCallerIds)
    {
      Console.WriteLine(callerId.PhoneNumber);
    }
  }
}
<?php
// Get the PHP helper library from twilio.com/docs/php/install
require_once('/path/to/twilio-php/Services/Twilio.php'); // Loads the library

// Your Account Sid and Auth Token from twilio.com/user/account
$sid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"; 
$token = "your_auth_token"; 
$client = new Services_Twilio($sid, $token);

// Loop over the list of caller_ids and echo a property for each one
foreach ($client->account->outgoing_caller_ids->getIterator(0, 50, array(
        "PhoneNumber" => "+14158675309"
    )) as $caller_id
) {
    echo $caller_id->phone_number;
}
# Get twilio-ruby from twilio.com/docs/ruby/install
require 'rubygems'          # This line not needed for ruby > 1.8
require 'twilio-ruby'

# Get your Account Sid and Auth Token from twilio.com/user/account
account_sid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
auth_token = 'your_auth_token'
@client = Twilio::REST::Client.new account_sid, auth_token


# Loop over caller_ids and print out a property for each one
@client.account.outgoing_caller_ids.list({
  :phone_number => "+14158675309"}).each do |caller_id|
  puts caller_id.phone_number
end
// Download the twilio-csharp library from twilio.com/docs/libraries/csharp
using System;
using Twilio;
using Twilio.Rest.Api.V2010.Account;
using Twilio.Types;

class Example
{
    static void Main(string[] args)
    {
        // Find your Account Sid and Auth Token at twilio.com/console
        const string accountSid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
        const string authToken = "your_auth_token";
        TwilioClient.Init(accountSid, authToken);

        var callerIds = OutgoingCallerIdResource.Read(
            phoneNumber: new PhoneNumber("+14158675309"));

        foreach (var callerId in callerIds)
        {
            Console.WriteLine(callerId.PhoneNumber);
        }
    }
}
<?php
// Get the PHP helper library from twilio.com/docs/php/install
require_once '/path/to/vendor/autoload.php'; // Loads the library
use Twilio\Rest\Client;

// Your Account Sid and Auth Token from twilio.com/user/account
$sid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
$token = "your_auth_token";
$client = new Client($sid, $token);

$outgoingCallerIds = $client->outgoingCallerIds->read(
    array("phoneNumber" => "+14158675309")
);
// Loop over the list of caller_ids and echo a property for each one
foreach ($outgoingCallerIds as $outgoingCallerId) {
    echo $outgoingCallerId->phoneNumber;
}
# Download the Python helper library from twilio.com/docs/python/install
from twilio.rest import TwilioRestClient

# Your Account Sid and Auth Token from twilio.com/user/account
account_sid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
auth_token  = "your_auth_token"
client = TwilioRestClient(account_sid, auth_token)

# A list of caller_id objects with the properties described above
caller_ids = client.caller_ids.list(phone_number="+14158675309")
require 'rubygems' # not necessary with ruby 1.9 but included for completeness
require 'twilio-ruby'

# put your own credentials here
account_sid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
auth_token = 'your_auth_token'

# set up a client to talk to the Twilio REST API
@client = Twilio::REST::Client.new(account_sid, auth_token)

# Loop over caller_ids and print out a property for each one
@client.outgoing_caller_ids.list(
  phone_number: '+14158675309'
).each do |caller_id|
  puts caller_id.phone_number
end
// Install the Java helper library from twilio.com/docs/java/install
import com.twilio.sdk.TwilioRestClient;
import com.twilio.sdk.TwilioRestException;
import com.twilio.sdk.resource.instance.OutgoingCallerId;
import com.twilio.sdk.resource.list.OutgoingCallerIdList;
import java.util.HashMap;
import java.util.Map;

public class Example { 

  // Find your Account Sid and Token at twilio.com/user/account
  public static final String ACCOUNT_SID = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
  public static final String AUTH_TOKEN = "your_auth_token";

  public static void main(String[] args) throws TwilioRestException {
    TwilioRestClient client = new TwilioRestClient(ACCOUNT_SID, AUTH_TOKEN);

    // Build a filter for the OutgoingCallerIdList
    Map<String, String> params = new HashMap<String, String>();
    
    params.put("PhoneNumber", "+14158675309");
    
    OutgoingCallerIdList callerIds = client.getAccount().getOutgoingCallerIds(params);
    
    // Loop over callerIds and print out a property for each one.
    for (OutgoingCallerId callerId : callerIds) {
      System.out.println(callerId.getPhoneNumber());
    }
    
  }
}
# Download the Python helper library from twilio.com/docs/python/install
from twilio.rest import Client

# Your Account Sid and Auth Token from twilio.com/user/account
account_sid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
auth_token = "your_auth_token"
client = Client(account_sid, auth_token)

# A list of caller_id objects with the properties described above
caller_ids = client.outgoing_caller_ids \
                   .list(phone_number="+14158675309")

for caller_id in caller_ids:
    print(caller_id.phone_number)
// Install the Java helper library from twilio.com/docs/java/install
import com.twilio.Twilio;
import com.twilio.base.ResourceSet;
import com.twilio.rest.api.v2010.account.OutgoingCallerId;
import com.twilio.type.PhoneNumber;

public class Example {
  /// Find your Account Sid and Token at twilio.com/user/account
  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);

    ResourceSet<OutgoingCallerId> callerIds = OutgoingCallerId.reader()
        .setPhoneNumber(new PhoneNumber("+14158675309"))
        .read();

    // Loop over callerIds and print out a property for each one.
    for (OutgoingCallerId callerId : callerIds) {
      System.out.println(callerId.getPhoneNumber());
    }
  }
}
$ curl -G https://api.twilio.com/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/OutgoingCallerIds \
    -d "PhoneNumber=%2B14158675309" \
    -u 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX:your_auth_token'
$ curl -G https://api.twilio.com/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/OutgoingCallerIds.json \
    -d "PhoneNumber=%2B14158675309" \
    -u 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX:your_auth_token'
Caller ID for Phone Number

HTTP POST

Adds a new CallerID to your account. After making this request, Twilio will return to you a validation code and Twilio will dial the phone number given to perform validation. The code returned must be entered via the phone before the CallerID will be added to your account. The following parameters are accepted:

Required Parameters

Parameter Description
PhoneNumber The phone number to verify. Should be formatted with a '+' and country code e.g., +16175551212 (E.164 format). Twilio will also accept unformatted US numbers e.g., (415) 555-1212, 415-555-1212.
Parameter Description
FriendlyName A human readable description for the new caller ID with maximum length 64 characters. Defaults to a nicely formatted version of the number.
CallDelay The number of seconds, between 0 and 60, to delay before initiating the verification call. Defaults to 0.
Extension Digits to dial after connecting the verification call.
StatusCallback A URL that Twilio will request when the verification call ends to notify your app if the verification process was successful or not. See StatusCallback parameter below.
StatusCallbackMethod The HTTP method Twilio should use when requesting the above URL. Defaults to POST.

This will create a new CallerID validation request within Twilio, which initiates a call to the phone number provided and listens for a validation code. The validation request is represented in the response by the following properties:

Response Properties

Property Description
AccountSid The unique ID of the Account to which the Validation Request belongs.
PhoneNumber The incoming phone number being validated, formatted with a '+' and country code e.g., +16175551212 (E.164 format).
FriendlyName The friendly name you provided, if any.
ValidationCode The 6 digit validation code that must be entered via the phone to validate this phone number for Caller ID.
CallSid The unique id of the Call created for this validation attempt.

StatusCallback Parameter

After the verification call ends, Twilio will make an asynchronous HTTP request to the StatusCallback URL if you provided one in your API request. By capturing this request, you can determine when the call ended and whether or not the number called was successfully verified.Twilio passes the same parameters to your application in its asynchronous

Twilio passes the same parameters to your application in its asynchronous request to the StatusCallback URL as it does in a normal status callback request. The full list of parameters and descriptions of each are in the TwiML Voice: Twilio's Request documentation.

The verification status callback request also passes these additional parameters:

Parameter Description
VerificationStatus Describes whether or not the person called correctly entered the validation code. Possible values are success or failed.
OutgoingCallerIdSid If the verification process was successful, the SID value of the newly-created OutgoingCallerId resource for the verified number.

Add an Outgoing Caller ID

Here are a typical request and response. Typically, you would present the validation code from the response to the user who is trying to verify their phone number. If you verify a number via the Twilio console, this is exactly what we're doing. 

Loading Code Samples...
Language
SDK Version:
  • 4.x
  • 5.x
Response Format:
  • json
  • xml
SDK Version:
  • 6.x
  • 7.x
SDK Version:
  • 2.x
  • 3.x
SDK Version:
  • 4.x
  • 5.x
SDK Version:
  • 5.x
  • 6.x
SDK Version:
  • 4.x
  • 5.x
Format:
  • JSON
  • XML
// Download the Node helper library from twilio.com/docs/node/install
// These vars are your accountSid and authToken from twilio.com/user/account
const accountSid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX';
const authToken = 'your_auth_token';
const Client = require('twilio').RestClient;

const client = new Client(accountSid, authToken);

client.outgoingCallerIds.create(
  {
    friendlyName: 'My Home Phone Number',
    phoneNumber: '+14158675309',
  },
  (err, callerId) => {
    if (err) {
      console.error(err);
    } else {
      console.log(callerId.sid);
    }
  }
);
// Download the Node helper library from twilio.com/docs/node/install
// These consts are your accountSid and authToken from https://www.twilio.com/console
const accountSid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX';
const authToken = 'your_auth_token';
const client = require('twilio')(accountSid, authToken);

client.validationRequests
  .create({
    friendlyName: 'My Home Phone Number',
    phoneNumber: '+14158675309',
  })
  .then(data => console.log(data.validationCode));
// Download the twilio-csharp library from twilio.com/docs/csharp/install
using System;
using Twilio;
class Example 
{
  static void Main(string[] args) 
  {
    // Find your Account Sid and Auth Token at twilio.com/user/account
    string AccountSid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
    string AuthToken = "your_auth_token";
    var twilio = new TwilioRestClient(AccountSid, AuthToken); 
    
    var callerId = twilio.AddOutgoingCallerId("+14158675309", "My Home Phone Number", null, null);
    
    Console.WriteLine(callerId.ValidationCode);
  }
}
<?php
// Get the PHP helper library from twilio.com/docs/php/install
require_once('/path/to/twilio-php/Services/Twilio.php'); // Loads the library

// Your Account Sid and Auth Token from twilio.com/user/account
$sid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
$token = "your_auth_token";
$client = new Services_Twilio($sid, $token);

$caller_id = $client->account->outgoing_caller_ids->create("+14158675309", array(
        "FriendlyName" => "My Home Phone Number"
    ));
echo $caller_id->validation_code;
# Get twilio-ruby from twilio.com/docs/ruby/install
require 'rubygems'          # This line not needed for ruby > 1.8
require 'twilio-ruby'

# Get your Account Sid and Auth Token from twilio.com/user/account
account_sid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
auth_token = 'your_auth_token'
@client = Twilio::REST::Client.new account_sid, auth_token

caller_id = @client.account.outgoing_caller_ids.create(
  :friendly_name => "My Home Phone Number",
  :phone_number => "+14158675309")
puts caller_id.phone_number
// Download the twilio-csharp library from twilio.com/docs/libraries/csharp
using System;
using Twilio;
using Twilio.Rest.Api.V2010.Account;
using Twilio.Types;

class Example
{
    static void Main(string[] args)
    {
        // Find your Account Sid and Auth Token at twilio.com/console
        const string accountSid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
        const string authToken = "your_auth_token";
        TwilioClient.Init(accountSid, authToken);

        var phoneNumber = new PhoneNumber("+14158675309");
        var validationRequest = ValidationRequestResource.Create(
            phoneNumber,
            friendlyName: "My Home Phone Number");

        Console.WriteLine(validationRequest.ValidationCode);
    }
}
<?php
// Get the PHP helper library from twilio.com/docs/php/install
require_once '/path/to/vendor/autoload.php'; // Loads the library
use Twilio\Rest\Client;

// Your Account Sid and Auth Token from twilio.com/user/account
$sid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
$token = "your_auth_token";
$client = new Client($sid, $token);

$validationRequest = $client->validationRequests->create(
    "+14158675309",
    array(
        "friendlyName" => "My Home Phone Number"
    )
);

echo $validationRequest->validationCode;
# Download the Python helper library from twilio.com/docs/python/install
from twilio.rest import TwilioRestClient

# Your Account Sid and Auth Token from twilio.com/user/account
account_sid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
auth_token = "your_auth_token"
client = TwilioRestClient(account_sid, auth_token)

caller_id = client.caller_ids.validate(
    "+14158675309", friendly_name="My Home Phone Number"
)

print(caller_id)
# Get twilio-ruby from twilio.com/docs/ruby/install
require 'twilio-ruby'

# Get your Account SID and Auth Token from twilio.com/console
account_sid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
auth_token = 'your_auth_token'

# Initialize Twilio Client
@client = Twilio::REST::Client.new(account_sid, auth_token)

@caller_id = @client.validation_requests
                 .create(
                   friendly_name: 'My Company Line',
                   phone_number: '+14158675309'
                 )
puts @caller_id.phone_number
puts @caller_id.friendly_name
puts @caller_id.validation_code
// Install the Java helper library from twilio.com/docs/java/install
import com.twilio.sdk.TwilioRestClient;
import com.twilio.sdk.TwilioRestException;
import com.twilio.sdk.resource.factory.OutgoingCallerIdFactory;
import com.twilio.sdk.resource.instance.CallerIdValidation;
import com.twilio.sdk.resource.list.OutgoingCallerIdList;
import java.util.HashMap;
import java.util.Map;

public class Example { 

  // Find your Account Sid and Token at twilio.com/user/account
  public static final String ACCOUNT_SID = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
  public static final String AUTH_TOKEN = "your_auth_token";

  public static void main(String[] args) throws TwilioRestException {
    TwilioRestClient client = new TwilioRestClient(ACCOUNT_SID, AUTH_TOKEN);

    // Build a filter for the OutgoingCallerIdList
    Map<String, String> params = new HashMap<String, String>();
    
    params.put("FriendlyName", "My Home Phone Number");
    params.put("PhoneNumber", "+14158675309");
    
    OutgoingCallerIdFactory callerIdFactory = client.getAccount().getOutgoingCallerIdFactory();
    CallerIdValidation validationAttempt = callerIdFactory.create(params);
    System.out.println(validationAttempt.getValidationCode());
  }
}
# Download the Python helper library from twilio.com/docs/python/install
from twilio.rest import Client

# Your Account Sid and Auth Token from twilio.com/user/account
account_sid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
auth_token = "your_auth_token"
client = Client(account_sid, auth_token)

validation_request = client.validation_requests \
                           .create("+14158675309",
                                   friendly_name="My Home Phone Number")

print(validation_request.validation_code)
// Install the Java helper library from twilio.com/docs/java/install
import com.twilio.Twilio;
import com.twilio.rest.api.v2010.account.ValidationRequest;
import com.twilio.type.PhoneNumber;

public class Example {
  /// Find your Account Sid and Token at twilio.com/user/account
  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);

    ValidationRequest validationRequest = ValidationRequest.creator(new PhoneNumber("+14158675309"))
        .setFriendlyName("My Home Phone Number")
        .create();

    System.out.println(validationRequest.getValidationCode());
  }
}
$ curl -XPOST https://api.twilio.com/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/OutgoingCallerIds \
    -d "FriendlyName=My%20Home%20Phone%20Number" \
    -d "PhoneNumber=%2B14158675309" \
    -u 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX:your_auth_token'
$ curl -XPOST https://api.twilio.com/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/OutgoingCallerIds.json \
    -d "FriendlyName=My%20Home%20Phone%20Number" \
    -d "PhoneNumber=%2B14158675309" \
    -u 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX:your_auth_token'
{
	"account_sid": "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
	"phone_number": "+14158675309",
	"friendly_name": "My Home Phone Number",
	"validation_code": 123456,
	"call_sid": "CA378358ccf6a2c88abc67859aa2e0bffa"
}
<TwilioResponse>
	<ValidationRequest>
		<AccountSid>ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX</AccountSid>
		<PhoneNumber>+14158675309</PhoneNumber>
		<FriendlyName>My Home Phone Number</FriendlyName>
		<ValidationCode>123456</ValidationCode>
		<CallSid>CA378358ccf6a2c88abc67859aa2e0bffa</CallSid>
	</ValidationRequest>
</TwilioResponse>
Add A New Outgoing Caller ID

HTTP PUT

Not supported.

HTTP DELETE

Not supported.

Need some help?

We all do sometimes; code is hard. Get help now from our support team, or lean on the wisdom of the crowd browsing the Twilio tag on Stack Overflow.

1 / 1
Loading Code Samples...
SDK Version:
  • 4.x
  • 5.x
Response Format:
  • json
  • xml
SDK Version:
  • 6.x
  • 7.x
SDK Version:
  • 2.x
  • 3.x
SDK Version:
  • 4.x
  • 5.x
SDK Version:
  • 5.x
  • 6.x
SDK Version:
  • 4.x
  • 5.x
Format:
  • JSON
  • XML
// Download the Node helper library from twilio.com/docs/node/install
// These vars are your accountSid and authToken from twilio.com/user/account
var accountSid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX';
var authToken = "your_auth_token";
var client = require('twilio')(accountSid, authToken);

client.outgoingCallerIds("PNe905d7e6b410746a0fb08c57e5a186f3").get(function(err, callerId) {
    console.log(callerId.phoneNumber);
});
// Download the Node helper library from twilio.com/docs/node/install
// These consts are your accountSid and authToken from https://www.twilio.com/console
const accountSid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX';
const authToken = 'your_auth_token';
const client = require('twilio')(accountSid, authToken);

client.api.accounts(accountSid)
  .outgoingCallerIds('PNe905d7e6b410746a0fb08c57e5a186f3')
  .fetch()
  .then((callerId) => console.log(callerId.phoneNumber));
// Download the twilio-csharp library from twilio.com/docs/csharp/install
using System;
using Twilio;
class Example 
{
  static void Main(string[] args) 
  {
    // Find your Account Sid and Auth Token at twilio.com/user/account
    string AccountSid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
    string AuthToken = "your_auth_token";
    var twilio = new TwilioRestClient(AccountSid, AuthToken);

    var callerId = twilio.GetOutgoingCallerId("PNe905d7e6b410746a0fb08c57e5a186f3");
    
    Console.WriteLine(callerId.PhoneNumber);
  }
}
<?php
// Get the PHP helper library from twilio.com/docs/php/install
require_once('/path/to/twilio-php/Services/Twilio.php'); // Loads the library

// Your Account Sid and Auth Token from twilio.com/user/account
$sid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"; 
$token = "your_auth_token"; 
$client = new Services_Twilio($sid, $token);

// Get an object from its sid. If you do not have a sid,
// check out the list resource examples on this page
$caller_id = $client->account->outgoing_caller_ids->get("PNe905d7e6b410746a0fb08c57e5a186f3");
echo $caller_id->phone_number;
# Get twilio-ruby from twilio.com/docs/ruby/install
require 'rubygems' # This line not needed for ruby > 1.8
require 'twilio-ruby'

# Get your Account Sid and Auth Token from twilio.com/user/account
account_sid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
auth_token = 'your_auth_token'
client = Twilio::REST::Client.new account_sid, auth_token

# Get an object from its sid. If you do not have a sid,
# check out the list resource examples on this page
caller_id = client.account.outgoing_caller_ids
                  .get('PNe905d7e6b410746a0fb08c57e5a186f3')
puts caller_id.phone_number
// Download the twilio-csharp library from twilio.com/docs/libraries/csharp
using System;
using Twilio;
using Twilio.Rest.Api.V2010.Account;

class Example
{
    static void Main(string[] args)
    {
        // Find your Account Sid and Auth Token at twilio.com/console
        const string accountSid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
        const string authToken = "your_auth_token";
        TwilioClient.Init(accountSid, authToken);

        var callerId = OutgoingCallerIdResource.Fetch("PNe905d7e6b410746a0fb08c57e5a186f3");

        Console.WriteLine(callerId.PhoneNumber);
    }
}
<?php
// Get the PHP helper library from twilio.com/docs/php/install
require_once '/path/to/vendor/autoload.php'; // Loads the library
use Twilio\Rest\Client;

// Your Account Sid and Auth Token from twilio.com/user/account
$sid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
$token = "your_auth_token";
$client = new Client($sid, $token);

// Get an object from its sid. If you do not have a sid,
// check out the list resource examples on this page
$callerId = $client
    ->outgoingCallerIds("PNe905d7e6b410746a0fb08c57e5a186f3")
    ->fetch();

echo $callerId->phoneNumber;
# Download the Python helper library from twilio.com/docs/python/install
from twilio.rest import TwilioRestClient

# Your Account Sid and Auth Token from twilio.com/user/account
account_sid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
auth_token = "your_auth_token"
client = TwilioRestClient(account_sid, auth_token)

caller_id = client.caller_ids.get("PNe905d7e6b410746a0fb08c57e5a186f3")
print(caller_id.phone_number)
require 'rubygems' # not necessary with ruby 1.9 but included for completeness
require 'twilio-ruby'

# put your own credentials here
account_sid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
auth_token = 'your_auth_token'

# set up a client to talk to the Twilio REST API
@client = Twilio::REST::Client.new(account_sid, auth_token)

@caller_id = @client.account
                    .outgoing_caller_ids('PNe905d7e6b410746a0fb08c57e5a186f3')
                    .fetch

puts @caller_id.phone_number
// Install the Java helper library from twilio.com/docs/java/install
import com.twilio.sdk.TwilioRestClient;
import com.twilio.sdk.TwilioRestException;
import com.twilio.sdk.resource.instance.OutgoingCallerId;

public class Example { 

  // Find your Account Sid and Token at twilio.com/user/account
  public static final String ACCOUNT_SID = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
  public static final String AUTH_TOKEN = "your_auth_token";

  public static void main(String[] args) throws TwilioRestException {
    TwilioRestClient client = new TwilioRestClient(ACCOUNT_SID, AUTH_TOKEN);

    // Get an object from its sid. If you do not have a sid,
    // check out the list resource examples on this page
    OutgoingCallerId callerId = client.getAccount().getOutgoingCallerId("PNe905d7e6b410746a0fb08c57e5a186f3");
    System.out.println(callerId.getPhoneNumber()); 
  }
}
# Download the Python helper library from twilio.com/docs/python/install
from twilio.rest import Client

# Your Account Sid and Auth Token from twilio.com/user/account
account_sid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
auth_token = "your_auth_token"
client = Client(account_sid, auth_token)

caller_id = client.outgoing_caller_ids("PNe905d7e6b410746a0fb08c57e5a186f3") \
                  .fetch()

print(caller_id.phone_number)
// Install the Java helper library from twilio.com/docs/java/install
import com.twilio.Twilio;
import com.twilio.rest.api.v2010.account.OutgoingCallerId;

public class Example {
  /// Find your Account Sid and Token at twilio.com/user/account
  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);

    // Get an object from its sid. If you do not have a sid,
    // check out the list resource examples on this page
    OutgoingCallerId callerId =
        OutgoingCallerId.fetcher("PNe905d7e6b410746a0fb08c57e5a186f3").fetch();

    System.out.println(callerId.getPhoneNumber());
  }
}
$ curl -G https://api.twilio.com/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/OutgoingCallerIds/PNe905d7e6b410746a0fb08c57e5a186f3 \
    -u 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX:your_auth_token'
$ curl -G https://api.twilio.com/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/OutgoingCallerIds/PNe905d7e6b410746a0fb08c57e5a186f3.json \
    -u 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX:your_auth_token'
{
	"sid": "PNe905d7e6b410746a0fb08c57e5a186f3",
	"account_sid": "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
	"friendly_name": "(510) 555-5555",
	"phone_number": "+15105555555",
	"date_created": "Tue, 27 Jul 2010 20:21:11 +0000",
	"date_updated": "Tue, 27 Jul 2010 20:21:11 +0000",
	"uri": "\/2010-04-01\/Accounts\/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX\/OutgoingCallerIds\/PNe905d7e6b410746a0fb08c57e5a186f3.json"
}
<TwilioResponse>
	<OutgoingCallerId>
		<Sid>PNe905d7e6b410746a0fb08c57e5a186f3</Sid>
		<AccountSid>ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX</AccountSid>
		<FriendlyName>(510) 555-5555</FriendlyName>
		<PhoneNumber>+15105555555</PhoneNumber>
		<DateCreated>Tue, 27 Jul 2010 20:21:11 +0000</DateCreated>
		<DateUpdated>Tue, 27 Jul 2010 20:21:11 +0000</DateUpdated>
		<Uri>/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/OutgoingCallerIds/PNe905d7e6b410746a0fb08c57e5a186f3</Uri>
	</OutgoingCallerId>
</TwilioResponse>
SDK Version:
  • 4.x
  • 5.x
Response Format:
  • json
  • xml
SDK Version:
  • 6.x
  • 7.x
SDK Version:
  • 2.x
  • 3.x
SDK Version:
  • 4.x
  • 5.x
SDK Version:
  • 5.x
  • 6.x
SDK Version:
  • 4.x
  • 5.x
// Download the Node helper library from twilio.com/docs/node/install
// These vars are your accountSid and authToken from twilio.com/user/account
var accountSid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX';
var authToken = "your_auth_token";
var client = require('twilio')(accountSid, authToken);

client.outgoingCallerIds("PNe536d32a3c49700934481addd5ce1659").update({
    friendlyName: "My Second Line"
}, function(err, callerId) {
    console.log(callerId.phoneNumber);
});
// Download the Node helper library from twilio.com/docs/node/install
// These consts are your accountSid and authToken from https://www.twilio.com/console
const accountSid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX';
const authToken = 'your_auth_token';
const client = require('twilio')(accountSid, authToken);

client.api.accounts(accountSid)
  .outgoingCallerIds('PNe536d32a3c49700934481addd5ce1659')
  .update({friendlyName: 'My Second Line'})
  .then((callerId) => console.log(callerId.phoneNumber));
// Download the twilio-csharp library from twilio.com/docs/csharp/install
using System;
using Twilio;
class Example 
{
  static void Main(string[] args) 
  {
    // Find your Account Sid and Auth Token at twilio.com/user/account
    string AccountSid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
    string AuthToken = "your_auth_token";
    var twilio = new TwilioRestClient(AccountSid, AuthToken); 
    
    twilio.UpdateOutgoingCallerIdName("PNe536d32a3c49700934481addd5ce1659", "My Second Line");
  }
}
<?php
// Get the PHP helper library from twilio.com/docs/php/install
require_once('/path/to/twilio-php/Services/Twilio.php'); // Loads the library

// Your Account Sid and Auth Token from twilio.com/user/account
$sid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"; 
$token = "your_auth_token"; 
$client = new Services_Twilio($sid, $token);

// Get an object from its sid. If you do not have a sid,
// check out the list resource examples on this page
$caller_id = $client->account->outgoing_caller_ids->get("PNe536d32a3c49700934481addd5ce1659");
$caller_id->update(array(
        "FriendlyName" => "My Second Line"
    ));
echo $caller_id->phone_number;
# Get twilio-ruby from twilio.com/docs/ruby/install
require 'rubygems'          # This line not needed for ruby > 1.8
require 'twilio-ruby'

# Get your Account Sid and Auth Token from twilio.com/user/account
account_sid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
auth_token = 'your_auth_token'
@client = Twilio::REST::Client.new account_sid, auth_token

# Get an object from its sid. If you do not have a sid,
# check out the list resource examples on this page
@caller_id = @client.account.outgoing_caller_ids.get("PNe536d32a3c49700934481addd5ce1659")
@caller_id.update(:friendly_name => "My Second Line")
puts @caller_id.phone_number
// Download the twilio-csharp library from twilio.com/docs/libraries/csharp
using System;
using Twilio;
using Twilio.Rest.Api.V2010.Account;

class Example
{
    static void Main(string[] args)
    {
        // Find your Account Sid and Auth Token at twilio.com/console
        const string accountSid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
        const string authToken = "your_auth_token";
        TwilioClient.Init(accountSid, authToken);

        OutgoingCallerIdResource.Update("PNe536d32a3c49700934481addd5ce1659",
                                        friendlyName: "My Second Line");
    }
}
<?php
// Get the PHP helper library from twilio.com/docs/php/install
require_once '/path/to/vendor/autoload.php'; // Loads the library
use Twilio\Rest\Client;

// Your Account Sid and Auth Token from twilio.com/user/account
$sid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
$token = "your_auth_token";
$client = new Client($sid, $token);

// Get an object from its sid. If you do not have a sid,
// check out the list resource examples on this page
$callerId = $client
    ->outgoingCallerIds("PNe536d32a3c49700934481addd5ce1659")
    ->update(
        array("friendlyName" => "My Second Line")
    );

echo $callerId->phoneNumber;
# Download the Python helper library from twilio.com/docs/python/install
from twilio.rest import TwilioRestClient

# Your Account Sid and Auth Token from twilio.com/user/account
account_sid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
auth_token  = "your_auth_token"
client = TwilioRestClient(account_sid, auth_token)

caller_id = client.caller_ids.update("PNe536d32a3c49700934481addd5ce1659", friendly_name="My Second Line")
print(caller_id.phone_number)
require 'rubygems' # not necessary with ruby 1.9 but included for completeness
require 'twilio-ruby'

# put your own credentials here
account_sid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
auth_token = 'your_auth_token'

# set up a client to talk to the Twilio REST API
@client = Twilio::REST::Client.new(account_sid, auth_token)

@caller_id = @client.api
                    .outgoing_caller_ids('PNe536d32a3c49700934481addd5ce1659')
                    .fetch

@caller_id.update(friendly_name: 'My Second Line')

puts @caller_id.friendly_name
// Install the Java helper library from twilio.com/docs/java/install
import com.twilio.sdk.TwilioRestClient;
import com.twilio.sdk.TwilioRestException;
import com.twilio.sdk.resource.instance.OutgoingCallerId;
import com.twilio.sdk.resource.list.OutgoingCallerIdList;
import java.util.ArrayList;
import java.util.List;
import org.apache.http.NameValuePair;
import org.apache.http.message.BasicNameValuePair;

public class Example { 

  // Find your Account Sid and Token at twilio.com/user/account
  public static final String ACCOUNT_SID = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
  public static final String AUTH_TOKEN = "your_auth_token";

  public static void main(String[] args) throws TwilioRestException {
    TwilioRestClient client = new TwilioRestClient(ACCOUNT_SID, AUTH_TOKEN);

    // Get an object from its sid. If you do not have a sid,
    // check out the list resource examples on this page
    OutgoingCallerId callerId = client.getAccount().getOutgoingCallerId("PNe536d32a3c49700934481addd5ce1659");
    // Build a filter for the OutgoingCallerIdList
    List<NameValuePair> params = new ArrayList<NameValuePair>();
    params.add(new BasicNameValuePair("FriendlyName", "My Second Line"));
    callerId.update(params); 
  }
}
# Download the Python helper library from twilio.com/docs/python/install
from twilio.rest import Client

# Your Account Sid and Auth Token from twilio.com/user/account
account_sid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
auth_token = "your_auth_token"
client = Client(account_sid, auth_token)

caller_id = client.outgoing_caller_ids("PNe536d32a3c49700934481addd5ce1659") \
                  .update(friendly_name="My Second Line")

print(caller_id.phone_number)
// Install the Java helper library from twilio.com/docs/java/install
import com.twilio.Twilio;
import com.twilio.rest.api.v2010.account.OutgoingCallerId;

public class Example {
  /// Find your Account Sid and Token at twilio.com/user/account
  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);

    // Get an object from its sid. If you do not have a sid,
    // check out the list resource examples on this page
    OutgoingCallerId callerId = OutgoingCallerId.updater("PNe536d32a3c49700934481addd5ce1659")
        .setFriendlyName("My Second Line")
        .update();

    System.out.println(callerId.getFriendlyName());
  }
}
$ curl -XPOST https://api.twilio.com/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/OutgoingCallerIds/PNe536d32a3c49700934481addd5ce1659 \
    -d "FriendlyName=My%20Second%20Line" \
    -u 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX:your_auth_token'
$ curl -XPOST https://api.twilio.com/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/OutgoingCallerIds/PNe536d32a3c49700934481addd5ce1659.json \
    -d "FriendlyName=My%20Second%20Line" \
    -u 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX:your_auth_token'
SDK Version:
  • 4.x
  • 5.x
Response Format:
  • json
  • xml
SDK Version:
  • 6.x
  • 7.x
SDK Version:
  • 2.x
  • 3.x
SDK Version:
  • 4.x
  • 5.x
SDK Version:
  • 5.x
  • 6.x
SDK Version:
  • 4.x
  • 5.x
// Download the Node helper library from twilio.com/docs/node/install
// These vars are your accountSid and authToken from twilio.com/user/account
var accountSid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX';
var authToken = "your_auth_token";
var client = require('twilio')(accountSid, authToken);

client.outgoingCallerIds("PNe536d32a3c49700934481addd5ce1659").delete(function(err, data) {
    if (err) {
        console.log(err.status);
        throw err.message;
    } else {
        console.log("Sid PNe536d32a3c49700934481addd5ce1659 deleted successfully.");
    }
});
// Download the Node helper library from twilio.com/docs/node/install
// These consts are your accountSid and authToken from https://www.twilio.com/console
const accountSid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX';
const authToken = 'your_auth_token';
const Twilio = require('twilio');
const client = new Twilio(accountSid, authToken);

const outgoingCalledIdSid = 'PNe536d32a3c49700934481addd5ce1659';

client.outgoingCallerIds(outgoingCalledIdSid)
  .remove()
  .then(() => console.log(`Sid ${outgoingCalledIdSid} deleted successfully.`))
  .done();
// Download the twilio-csharp library from twilio.com/docs/csharp/install
using System;
using Twilio;
class Example 
{
  static void Main(string[] args) 
  {
    // Find your Account Sid and Auth Token at twilio.com/user/account
    string AccountSid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
    string AuthToken = "your_auth_token";
    var twilio = new TwilioRestClient(AccountSid, AuthToken);

    twilio.DeleteOutgoingCallerId("PNe536d32a3c49700934481addd5ce1659");
  }
}
<?php
// Get the PHP helper library from twilio.com/docs/php/install
require_once('/path/to/twilio-php/Services/Twilio.php'); // Loads the library

// Your Account Sid and Auth Token from twilio.com/user/account
$sid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"; 
$token = "your_auth_token"; 
$client = new Services_Twilio($sid, $token);

$client->account->outgoing_caller_ids->delete("PNe536d32a3c49700934481addd5ce1659");
# Get twilio-ruby from twilio.com/docs/ruby/install
require 'rubygems'          # This line not needed for ruby > 1.8
require 'twilio-ruby'

# Get your Account Sid and Auth Token from twilio.com/user/account
account_sid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
auth_token = 'your_auth_token'
@client = Twilio::REST::Client.new account_sid, auth_token

@caller_id = @client.account.outgoing_caller_ids.get("PNe536d32a3c49700934481addd5ce1659")
@caller_id.delete
// Download the twilio-csharp library from twilio.com/docs/libraries/csharp
using System;
using Twilio;
using Twilio.Rest.Api.V2010.Account;

class Example
{
    static void Main(string[] args)
    {
        // Find your Account Sid and Auth Token at twilio.com/console
        const string accountSid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
        const string authToken = "your_auth_token";
        TwilioClient.Init(accountSid, authToken);

        OutgoingCallerIdResource.Delete("PNe536d32a3c49700934481addd5ce1659");
    }
}
<?php
// Get the PHP helper library from twilio.com/docs/php/install
require_once '/path/to/vendor/autoload.php'; // Loads the library
use Twilio\Rest\Client;

// Your Account Sid and Auth Token from twilio.com/user/account
$sid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
$token = "your_auth_token";
$client = new Client($sid, $token);

$client->outgoingCallerIds("PNe536d32a3c49700934481addd5ce1659")->delete();
# Download the Python helper library from twilio.com/docs/python/install
from twilio.rest import TwilioRestClient

# Your Account Sid and Auth Token from twilio.com/user/account
account_sid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
auth_token = "your_auth_token"
client = TwilioRestClient(account_sid, auth_token)

client.caller_ids.delete("PNe536d32a3c49700934481addd5ce1659")
require 'rubygems' # not necessary with ruby 1.9 but included for completeness
require 'twilio-ruby'

# put your own credentials here
account_sid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
auth_token = 'your_auth_token'

# set up a client to talk to the Twilio REST API
@client = Twilio::REST::Client.new(account_sid, auth_token)

@caller_id = @client.api
                    .outgoing_caller_ids('PNe536d32a3c49700934481addd5ce1659')
                    .fetch

@caller_id.delete
// Install the Java helper library from twilio.com/docs/java/install
import com.twilio.sdk.TwilioRestClient;
import com.twilio.sdk.TwilioRestException;
import com.twilio.sdk.resource.instance.OutgoingCallerId;

public class Example { 

  // Find your Account Sid and Token at twilio.com/user/account
  public static final String ACCOUNT_SID = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
  public static final String AUTH_TOKEN = "your_auth_token";

  public static void main(String[] args) throws TwilioRestException {
    TwilioRestClient client = new TwilioRestClient(ACCOUNT_SID, AUTH_TOKEN);

    // Get an object from its sid. If you do not have a sid,
    // check out the list resource examples on this page
    OutgoingCallerId callerId = client.getAccount().getOutgoingCallerId("PNe536d32a3c49700934481addd5ce1659");
    
    callerId.delete(); 
  }
}
# Download the Python helper library from twilio.com/docs/python/install
from twilio.rest import Client

# Your Account Sid and Auth Token from twilio.com/user/account
account_sid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
auth_token = "your_auth_token"
client = Client(account_sid, auth_token)

client.outgoing_caller_ids("PNe536d32a3c49700934481addd5ce1659") \
      .delete()
// Install the Java helper library from twilio.com/docs/java/install
import com.twilio.Twilio;
import com.twilio.rest.api.v2010.account.OutgoingCallerId;

public class Example {
  /// Find your Account Sid and Token at twilio.com/user/account
  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);

    // Get an object from its sid. If you do not have a sid,
    // check out the list resource examples on this page
    OutgoingCallerId.deleter("PNe536d32a3c49700934481addd5ce1659").delete();
  }
}
curl -XDELETE https://api.twilio.com/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/OutgoingCallerIds/PNe536d32a3c49700934481addd5ce1659 \
    -u 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX:your_auth_token'
curl -XDELETE https://api.twilio.com/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/OutgoingCallerIds/PNe536d32a3c49700934481addd5ce1659.json \
    -u 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX:your_auth_token'
SDK Version:
  • 4.x
  • 5.x
Response Format:
  • json
  • xml
SDK Version:
  • 6.x
  • 7.x
SDK Version:
  • 2.x
  • 3.x
SDK Version:
  • 4.x
  • 5.x
SDK Version:
  • 5.x
  • 6.x
SDK Version:
  • 4.x
  • 5.x
Format:
  • JSON
  • XML
// Download the Node helper library from twilio.com/docs/node/install
// These vars are your accountSid and authToken from twilio.com/user/account
const accountSid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX';
const authToken = 'your_auth_token';
const client = require('twilio')(accountSid, authToken);

client.outgoingCallerIds.list((err, data) => {
  data.outgoingCallerIds.forEach(callerId => {
    console.log(callerId.phoneNumber);
  });
});
// Download the Node helper library from twilio.com/docs/node/install
// These consts are your accountSid and authToken from https://www.twilio.com/console
const accountSid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX';
const authToken = 'your_auth_token';
const client = require('twilio')(accountSid, authToken);

client.api
  .accounts(accountSid)
  .outgoingCallerIds.each(callerId => console.log(callerId.phoneNumber));
// Download the twilio-csharp library from twilio.com/docs/csharp/install
using System;
using Twilio;
class Example 
{
  static void Main(string[] args) 
  {
    // Find your Account Sid and Auth Token at twilio.com/user/account
    string AccountSid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
    string AuthToken = "your_auth_token";
    var twilio = new TwilioRestClient(AccountSid, AuthToken);

    var callerIds = twilio.ListOutgoingCallerIds(null, null, null, null);
    
    foreach (var callerId in callerIds.OutgoingCallerIds)
    {
      Console.WriteLine(callerId.PhoneNumber);
    }
  }
}
<?php
// Get the PHP helper library from twilio.com/docs/php/install
require_once('/path/to/twilio-php/Services/Twilio.php'); // Loads the library

// Your Account Sid and Auth Token from twilio.com/user/account
$sid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"; 
$token = "your_auth_token"; 
$client = new Services_Twilio($sid, $token);

// Loop over the list of caller_ids and echo a property for each one
foreach ($client->account->outgoing_caller_ids as $caller_id) {
    echo $caller_id->phone_number;
}
# Get twilio-ruby from twilio.com/docs/ruby/install
require 'rubygems'          # This line not needed for ruby > 1.8
require 'twilio-ruby'

# Get your Account Sid and Auth Token from twilio.com/user/account
account_sid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
auth_token = 'your_auth_token'
@client = Twilio::REST::Client.new account_sid, auth_token

# Loop over caller_ids and print out a property for each one
@client.account.outgoing_caller_ids.list.each do |caller_id|
  puts caller_id.phone_number
end
// Download the twilio-csharp library from twilio.com/docs/libraries/csharp
using System;
using Twilio;
using Twilio.Rest.Api.V2010.Account;

class Example
{
    static void Main(string[] args)
    {
        // Find your Account Sid and Auth Token at twilio.com/console
        const string accountSid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
        const string authToken = "your_auth_token";
        TwilioClient.Init(accountSid, authToken);

        var callerIds = OutgoingCallerIdResource.Read();

        foreach (var callerId in callerIds)
        {
            Console.WriteLine(callerId.PhoneNumber);
        }
    }
}
<?php
// Get the PHP helper library from twilio.com/docs/php/install
require_once '/path/to/vendor/autoload.php'; // Loads the library
use Twilio\Rest\Client;

// Your Account Sid and Auth Token from twilio.com/user/account
$sid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
$token = "your_auth_token";
$client = new Client($sid, $token);

// Loop over the list of caller_ids and echo a property for each one
foreach ($client->outgoingCallerIds->read() as $callerId) {
    echo $callerId->phoneNumber;
}
# Download the Python helper library from twilio.com/docs/python/install
from twilio.rest import TwilioRestClient

# Your Account Sid and Auth Token from twilio.com/user/account
account_sid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
auth_token = "your_auth_token"
client = TwilioRestClient(account_sid, auth_token)

# A list of caller_id objects with the properties described above
caller_ids = client.caller_ids.list()
require 'rubygems' # not necessary with ruby 1.9 but included for completeness
require 'twilio-ruby'

# put your own credentials here
account_sid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
auth_token = 'your_auth_token'

# set up a client to talk to the Twilio REST API
@client = Twilio::REST::Client.new(account_sid, auth_token)

# Loop over caller_ids and print out a property for each one
@client.outgoing_caller_ids.list.each do |caller_id|
  puts caller_id.phone_number
end
// Install the Java helper library from twilio.com/docs/java/install
import com.twilio.sdk.TwilioRestClient;
import com.twilio.sdk.TwilioRestException;
import com.twilio.sdk.resource.instance.OutgoingCallerId;
import com.twilio.sdk.resource.list.OutgoingCallerIdList;

public class Example {

  // Find your Account Sid and Token at twilio.com/user/account
  public static final String ACCOUNT_SID = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
  public static final String AUTH_TOKEN = "your_auth_token";

  public static void main(String[] args) throws TwilioRestException {
    TwilioRestClient client = new TwilioRestClient(ACCOUNT_SID, AUTH_TOKEN);

    OutgoingCallerIdList callerIds = client.getAccount().getOutgoingCallerIds();

    // Loop over callerIds and print out a property for each one.
    for (OutgoingCallerId callerId : callerIds) {
      System.out.println(callerId.getPhoneNumber());
    }
  }
}
# Download the Python helper library from twilio.com/docs/python/install
from twilio.rest import Client

# Your Account Sid and Auth Token from twilio.com/user/account
account_sid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
auth_token = "your_auth_token"
client = Client(account_sid, auth_token)

# A list of caller_id objects with the properties described above
for caller_id in client.outgoing_caller_ids.list():
    print(caller_id.phone_number)
// Install the Java helper library from twilio.com/docs/java/install
import com.twilio.Twilio;
import com.twilio.base.ResourceSet;
import com.twilio.rest.api.v2010.account.OutgoingCallerId;

public class Example {
  /// Find your Account Sid and Token at twilio.com/user/account
  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);

    ResourceSet<OutgoingCallerId> callerIds = OutgoingCallerId.reader().read();

    // Loop over callerIds and print out a property for each one.
    for (OutgoingCallerId callerId : callerIds) {
      System.out.println(callerId.getPhoneNumber());
    }
  }
}
$ curl -G https://api.twilio.com/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/OutgoingCallerIds \
    -u 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX:your_auth_token'
$ curl -G https://api.twilio.com/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/OutgoingCallerIds.json \
    -u 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX:your_auth_token'
{
	"page": 0,
	"page_size": 50,
	"uri": "\/2010-04-01\/Accounts\/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX\/OutgoingCallerIds.json",
	"first_page_uri": "\/2010-04-01\/Accounts\/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX\/OutgoingCallerIds.json?Page=0&PageSize=50",
	"previous_page_uri": null,
	"next_page_uri": null,
	"outgoing_caller_ids": [
		{
			"sid": "PNe905d7e6b410746a0fb08c57e5a186f3",
			"account_sid": "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
			"friendly_name": "(510) 555-5555",
			"phone_number": "+15105555555",
			"date_created": "Tue, 27 Jul 2010 20:21:11 +0000",
			"date_updated": "Tue, 27 Jul 2010 20:21:11 +0000",
			"uri": "\/2010-04-01\/Accounts\/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX\/OutgoingCallerIds\/PNe905d7e6b410746a0fb08c57e5a186f3.json"
		},
		...
	]
}
<TwilioResponse>
	<OutgoingCallerIds page="0" pagesize="50" uri="/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/OutgoingCallerIds" firstpageuri="/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/OutgoingCallerIds?Page=0&amp;PageSize=50" previouspageuri="" nextpageuri="">
		<OutgoingCallerId>
			<Sid>PNe905d7e6b410746a0fb08c57e5a186f3</Sid>
			<AccountSid>ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX</AccountSid>
			<FriendlyName>(510) 555-5555</FriendlyName>
			<PhoneNumber>+15105555555</PhoneNumber>
			<DateCreated>Tue, 27 Jul 2010 20:21:11 +0000</DateCreated>
			<DateUpdated>Tue, 27 Jul 2010 20:21:11 +0000</DateUpdated>
			<Uri>/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/OutgoingCallerIds/PNe905d7e6b410746a0fb08c57e5a186f3</Uri>
		</OutgoingCallerId>
		...
	</OutgoingCallerIds>
SDK Version:
  • 4.x
  • 5.x
Response Format:
  • json
  • xml
SDK Version:
  • 6.x
  • 7.x
SDK Version:
  • 2.x
  • 3.x
SDK Version:
  • 4.x
  • 5.x
SDK Version:
  • 5.x
  • 6.x
SDK Version:
  • 4.x
  • 5.x
// Download the Node helper library from twilio.com/docs/node/install
// These vars are your accountSid and authToken from twilio.com/user/account
var accountSid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX';
var authToken = "your_auth_token";
var client = require('twilio')(accountSid, authToken);

client.outgoingCallerIds.list({ phoneNumber: "+14158675309" }, function(err, data) {
    data.outgoingCallerIds.forEach(function(callerId) {
        console.log(callerId.phoneNumber);
    });
});
// Download the Node helper library from twilio.com/docs/node/install
// These consts are your accountSid and authToken from https://www.twilio.com/console
const accountSid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX';
const authToken = 'your_auth_token';
const client = require('twilio')(accountSid, authToken);

client.api.accounts(accountSid)
  .outgoingCallerIds
  // filter callerids to include only those that have the following number
  .each({phoneNumber: '+14158675309'},
        (callerId) => console.log(callerId.sid));
// Download the twilio-csharp library from twilio.com/docs/csharp/install
using System;
using Twilio;
class Example 
{
  static void Main(string[] args) 
  {
    // Find your Account Sid and Auth Token at twilio.com/user/account
    string AccountSid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
    string AuthToken = "your_auth_token";
    var twilio = new TwilioRestClient(AccountSid, AuthToken);

    var callerIds = twilio.ListOutgoingCallerIds("+14158675309", null, null, null);
    
    foreach (var callerId in callerIds.OutgoingCallerIds)
    {
      Console.WriteLine(callerId.PhoneNumber);
    }
  }
}
<?php
// Get the PHP helper library from twilio.com/docs/php/install
require_once('/path/to/twilio-php/Services/Twilio.php'); // Loads the library

// Your Account Sid and Auth Token from twilio.com/user/account
$sid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"; 
$token = "your_auth_token"; 
$client = new Services_Twilio($sid, $token);

// Loop over the list of caller_ids and echo a property for each one
foreach ($client->account->outgoing_caller_ids->getIterator(0, 50, array(
        "PhoneNumber" => "+14158675309"
    )) as $caller_id
) {
    echo $caller_id->phone_number;
}
# Get twilio-ruby from twilio.com/docs/ruby/install
require 'rubygems'          # This line not needed for ruby > 1.8
require 'twilio-ruby'

# Get your Account Sid and Auth Token from twilio.com/user/account
account_sid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
auth_token = 'your_auth_token'
@client = Twilio::REST::Client.new account_sid, auth_token


# Loop over caller_ids and print out a property for each one
@client.account.outgoing_caller_ids.list({
  :phone_number => "+14158675309"}).each do |caller_id|
  puts caller_id.phone_number
end
// Download the twilio-csharp library from twilio.com/docs/libraries/csharp
using System;
using Twilio;
using Twilio.Rest.Api.V2010.Account;
using Twilio.Types;

class Example
{
    static void Main(string[] args)
    {
        // Find your Account Sid and Auth Token at twilio.com/console
        const string accountSid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
        const string authToken = "your_auth_token";
        TwilioClient.Init(accountSid, authToken);

        var callerIds = OutgoingCallerIdResource.Read(
            phoneNumber: new PhoneNumber("+14158675309"));

        foreach (var callerId in callerIds)
        {
            Console.WriteLine(callerId.PhoneNumber);
        }
    }
}
<?php
// Get the PHP helper library from twilio.com/docs/php/install
require_once '/path/to/vendor/autoload.php'; // Loads the library
use Twilio\Rest\Client;

// Your Account Sid and Auth Token from twilio.com/user/account
$sid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
$token = "your_auth_token";
$client = new Client($sid, $token);

$outgoingCallerIds = $client->outgoingCallerIds->read(
    array("phoneNumber" => "+14158675309")
);
// Loop over the list of caller_ids and echo a property for each one
foreach ($outgoingCallerIds as $outgoingCallerId) {
    echo $outgoingCallerId->phoneNumber;
}
# Download the Python helper library from twilio.com/docs/python/install
from twilio.rest import TwilioRestClient

# Your Account Sid and Auth Token from twilio.com/user/account
account_sid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
auth_token  = "your_auth_token"
client = TwilioRestClient(account_sid, auth_token)

# A list of caller_id objects with the properties described above
caller_ids = client.caller_ids.list(phone_number="+14158675309")
require 'rubygems' # not necessary with ruby 1.9 but included for completeness
require 'twilio-ruby'

# put your own credentials here
account_sid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
auth_token = 'your_auth_token'

# set up a client to talk to the Twilio REST API
@client = Twilio::REST::Client.new(account_sid, auth_token)

# Loop over caller_ids and print out a property for each one
@client.outgoing_caller_ids.list(
  phone_number: '+14158675309'
).each do |caller_id|
  puts caller_id.phone_number
end
// Install the Java helper library from twilio.com/docs/java/install
import com.twilio.sdk.TwilioRestClient;
import com.twilio.sdk.TwilioRestException;
import com.twilio.sdk.resource.instance.OutgoingCallerId;
import com.twilio.sdk.resource.list.OutgoingCallerIdList;
import java.util.HashMap;
import java.util.Map;

public class Example { 

  // Find your Account Sid and Token at twilio.com/user/account
  public static final String ACCOUNT_SID = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
  public static final String AUTH_TOKEN = "your_auth_token";

  public static void main(String[] args) throws TwilioRestException {
    TwilioRestClient client = new TwilioRestClient(ACCOUNT_SID, AUTH_TOKEN);

    // Build a filter for the OutgoingCallerIdList
    Map<String, String> params = new HashMap<String, String>();
    
    params.put("PhoneNumber", "+14158675309");
    
    OutgoingCallerIdList callerIds = client.getAccount().getOutgoingCallerIds(params);
    
    // Loop over callerIds and print out a property for each one.
    for (OutgoingCallerId callerId : callerIds) {
      System.out.println(callerId.getPhoneNumber());
    }
    
  }
}
# Download the Python helper library from twilio.com/docs/python/install
from twilio.rest import Client

# Your Account Sid and Auth Token from twilio.com/user/account
account_sid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
auth_token = "your_auth_token"
client = Client(account_sid, auth_token)

# A list of caller_id objects with the properties described above
caller_ids = client.outgoing_caller_ids \
                   .list(phone_number="+14158675309")

for caller_id in caller_ids:
    print(caller_id.phone_number)
// Install the Java helper library from twilio.com/docs/java/install
import com.twilio.Twilio;
import com.twilio.base.ResourceSet;
import com.twilio.rest.api.v2010.account.OutgoingCallerId;
import com.twilio.type.PhoneNumber;

public class Example {
  /// Find your Account Sid and Token at twilio.com/user/account
  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);

    ResourceSet<OutgoingCallerId> callerIds = OutgoingCallerId.reader()
        .setPhoneNumber(new PhoneNumber("+14158675309"))
        .read();

    // Loop over callerIds and print out a property for each one.
    for (OutgoingCallerId callerId : callerIds) {
      System.out.println(callerId.getPhoneNumber());
    }
  }
}
$ curl -G https://api.twilio.com/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/OutgoingCallerIds \
    -d "PhoneNumber=%2B14158675309" \
    -u 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX:your_auth_token'
$ curl -G https://api.twilio.com/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/OutgoingCallerIds.json \
    -d "PhoneNumber=%2B14158675309" \
    -u 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX:your_auth_token'
SDK Version:
  • 4.x
  • 5.x
Response Format:
  • json
  • xml
SDK Version:
  • 6.x
  • 7.x
SDK Version:
  • 2.x
  • 3.x
SDK Version:
  • 4.x
  • 5.x
SDK Version:
  • 5.x
  • 6.x
SDK Version:
  • 4.x
  • 5.x
Format:
  • JSON
  • XML
// Download the Node helper library from twilio.com/docs/node/install
// These vars are your accountSid and authToken from twilio.com/user/account
const accountSid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX';
const authToken = 'your_auth_token';
const Client = require('twilio').RestClient;

const client = new Client(accountSid, authToken);

client.outgoingCallerIds.create(
  {
    friendlyName: 'My Home Phone Number',
    phoneNumber: '+14158675309',
  },
  (err, callerId) => {
    if (err) {
      console.error(err);
    } else {
      console.log(callerId.sid);
    }
  }
);
// Download the Node helper library from twilio.com/docs/node/install
// These consts are your accountSid and authToken from https://www.twilio.com/console
const accountSid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX';
const authToken = 'your_auth_token';
const client = require('twilio')(accountSid, authToken);

client.validationRequests
  .create({
    friendlyName: 'My Home Phone Number',
    phoneNumber: '+14158675309',
  })
  .then(data => console.log(data.validationCode));
// Download the twilio-csharp library from twilio.com/docs/csharp/install
using System;
using Twilio;
class Example 
{
  static void Main(string[] args) 
  {
    // Find your Account Sid and Auth Token at twilio.com/user/account
    string AccountSid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
    string AuthToken = "your_auth_token";
    var twilio = new TwilioRestClient(AccountSid, AuthToken); 
    
    var callerId = twilio.AddOutgoingCallerId("+14158675309", "My Home Phone Number", null, null);
    
    Console.WriteLine(callerId.ValidationCode);
  }
}
<?php
// Get the PHP helper library from twilio.com/docs/php/install
require_once('/path/to/twilio-php/Services/Twilio.php'); // Loads the library

// Your Account Sid and Auth Token from twilio.com/user/account
$sid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
$token = "your_auth_token";
$client = new Services_Twilio($sid, $token);

$caller_id = $client->account->outgoing_caller_ids->create("+14158675309", array(
        "FriendlyName" => "My Home Phone Number"
    ));
echo $caller_id->validation_code;
# Get twilio-ruby from twilio.com/docs/ruby/install
require 'rubygems'          # This line not needed for ruby > 1.8
require 'twilio-ruby'

# Get your Account Sid and Auth Token from twilio.com/user/account
account_sid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
auth_token = 'your_auth_token'
@client = Twilio::REST::Client.new account_sid, auth_token

caller_id = @client.account.outgoing_caller_ids.create(
  :friendly_name => "My Home Phone Number",
  :phone_number => "+14158675309")
puts caller_id.phone_number
// Download the twilio-csharp library from twilio.com/docs/libraries/csharp
using System;
using Twilio;
using Twilio.Rest.Api.V2010.Account;
using Twilio.Types;

class Example
{
    static void Main(string[] args)
    {
        // Find your Account Sid and Auth Token at twilio.com/console
        const string accountSid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
        const string authToken = "your_auth_token";
        TwilioClient.Init(accountSid, authToken);

        var phoneNumber = new PhoneNumber("+14158675309");
        var validationRequest = ValidationRequestResource.Create(
            phoneNumber,
            friendlyName: "My Home Phone Number");

        Console.WriteLine(validationRequest.ValidationCode);
    }
}
<?php
// Get the PHP helper library from twilio.com/docs/php/install
require_once '/path/to/vendor/autoload.php'; // Loads the library
use Twilio\Rest\Client;

// Your Account Sid and Auth Token from twilio.com/user/account
$sid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
$token = "your_auth_token";
$client = new Client($sid, $token);

$validationRequest = $client->validationRequests->create(
    "+14158675309",
    array(
        "friendlyName" => "My Home Phone Number"
    )
);

echo $validationRequest->validationCode;
# Download the Python helper library from twilio.com/docs/python/install
from twilio.rest import TwilioRestClient

# Your Account Sid and Auth Token from twilio.com/user/account
account_sid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
auth_token = "your_auth_token"
client = TwilioRestClient(account_sid, auth_token)

caller_id = client.caller_ids.validate(
    "+14158675309", friendly_name="My Home Phone Number"
)

print(caller_id)
# Get twilio-ruby from twilio.com/docs/ruby/install
require 'twilio-ruby'

# Get your Account SID and Auth Token from twilio.com/console
account_sid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
auth_token = 'your_auth_token'

# Initialize Twilio Client
@client = Twilio::REST::Client.new(account_sid, auth_token)

@caller_id = @client.validation_requests
                 .create(
                   friendly_name: 'My Company Line',
                   phone_number: '+14158675309'
                 )
puts @caller_id.phone_number
puts @caller_id.friendly_name
puts @caller_id.validation_code
// Install the Java helper library from twilio.com/docs/java/install
import com.twilio.sdk.TwilioRestClient;
import com.twilio.sdk.TwilioRestException;
import com.twilio.sdk.resource.factory.OutgoingCallerIdFactory;
import com.twilio.sdk.resource.instance.CallerIdValidation;
import com.twilio.sdk.resource.list.OutgoingCallerIdList;
import java.util.HashMap;
import java.util.Map;

public class Example { 

  // Find your Account Sid and Token at twilio.com/user/account
  public static final String ACCOUNT_SID = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
  public static final String AUTH_TOKEN = "your_auth_token";

  public static void main(String[] args) throws TwilioRestException {
    TwilioRestClient client = new TwilioRestClient(ACCOUNT_SID, AUTH_TOKEN);

    // Build a filter for the OutgoingCallerIdList
    Map<String, String> params = new HashMap<String, String>();
    
    params.put("FriendlyName", "My Home Phone Number");
    params.put("PhoneNumber", "+14158675309");
    
    OutgoingCallerIdFactory callerIdFactory = client.getAccount().getOutgoingCallerIdFactory();
    CallerIdValidation validationAttempt = callerIdFactory.create(params);
    System.out.println(validationAttempt.getValidationCode());
  }
}
# Download the Python helper library from twilio.com/docs/python/install
from twilio.rest import Client

# Your Account Sid and Auth Token from twilio.com/user/account
account_sid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
auth_token = "your_auth_token"
client = Client(account_sid, auth_token)

validation_request = client.validation_requests \
                           .create("+14158675309",
                                   friendly_name="My Home Phone Number")

print(validation_request.validation_code)
// Install the Java helper library from twilio.com/docs/java/install
import com.twilio.Twilio;
import com.twilio.rest.api.v2010.account.ValidationRequest;
import com.twilio.type.PhoneNumber;

public class Example {
  /// Find your Account Sid and Token at twilio.com/user/account
  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);

    ValidationRequest validationRequest = ValidationRequest.creator(new PhoneNumber("+14158675309"))
        .setFriendlyName("My Home Phone Number")
        .create();

    System.out.println(validationRequest.getValidationCode());
  }
}
$ curl -XPOST https://api.twilio.com/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/OutgoingCallerIds \
    -d "FriendlyName=My%20Home%20Phone%20Number" \
    -d "PhoneNumber=%2B14158675309" \
    -u 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX:your_auth_token'
$ curl -XPOST https://api.twilio.com/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/OutgoingCallerIds.json \
    -d "FriendlyName=My%20Home%20Phone%20Number" \
    -d "PhoneNumber=%2B14158675309" \
    -u 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX:your_auth_token'
{
	"account_sid": "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
	"phone_number": "+14158675309",
	"friendly_name": "My Home Phone Number",
	"validation_code": 123456,
	"call_sid": "CA378358ccf6a2c88abc67859aa2e0bffa"
}
<TwilioResponse>
	<ValidationRequest>
		<AccountSid>ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX</AccountSid>
		<PhoneNumber>+14158675309</PhoneNumber>
		<FriendlyName>My Home Phone Number</FriendlyName>
		<ValidationCode>123456</ValidationCode>
		<CallSid>CA378358ccf6a2c88abc67859aa2e0bffa</CallSid>
	</ValidationRequest>
</TwilioResponse>