Skip to contentSkip to navigationSkip to topbar
Rate this page:
On this page

Outgoing Caller IDs


(warning)

Warning

NOTE: The order of the columns in the CSV is not defined and may change when new fields are added to the API response. Your application design should be resilient to changes in the order of the columns in the CSV response.

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

outgoingcallerid-instance-resource page anchor

Resource URI

resource-uri page anchor

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

PropertyDescription
SidA 34 character string that uniquely identifies this resource.
DateCreatedThe date that this resource was created, given in RFC 2822(link takes you to an external page) format.
DateUpdatedThe date that this resource was last updated, given in RFC 2822(link takes you to an external page) format.
FriendlyNameA 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.
AccountSidThe unique ID of the Account responsible for this Caller Id.
PhoneNumberThe incoming phone number. Formatted with a '+' and country code e.g., +16175551212 (E.164(link takes you to an external page) format).
UriThe URI for this resource, relative to https://api.twilio.com.

Get Outgoing Caller ID Details

get-outgoing-caller-id-details page anchor
Node.js
Python
C#
Java
Go
PHP
Ruby
twilio-cli
curl

_10
// Download the helper library from https://www.twilio.com/docs/node/install
_10
// Find your Account SID and Auth Token at twilio.com/console
_10
// and set the environment variables. See http://twil.io/secure
_10
const accountSid = process.env.TWILIO_ACCOUNT_SID;
_10
const authToken = process.env.TWILIO_AUTH_TOKEN;
_10
const client = require('twilio')(accountSid, authToken);
_10
_10
client.outgoingCallerIds('PNe905d7e6b410746a0fb08c57e5a186f3')
_10
.fetch()
_10
.then(outgoing_caller_id => console.log(outgoing_caller_id.friendlyName));

Output

_10
{
_10
"sid": "PNe905d7e6b410746a0fb08c57e5a186f3",
_10
"account_sid": "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_10
"friendly_name": "(415) 867-5309",
_10
"phone_number": "+141586753096",
_10
"date_created": "Fri, 21 Aug 2009 00:11:24 +0000",
_10
"date_updated": "Fri, 21 Aug 2009 00:11:24 +0000",
_10
"uri": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/OutgoingCallerIds/PNXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.json"
_10
}

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

There is only one field that you may update:

ParameterDescription
FriendlyNameA human readable description of a Caller ID, with maximum length of 64 characters. Defaults to a nicely formatted version of the phone number.

Update Outgoing Caller ID

update-outgoing-caller-id page anchor
Node.js
Python
C#
Java
Go
PHP
Ruby
twilio-cli
curl

_10
// Download the helper library from https://www.twilio.com/docs/node/install
_10
// Find your Account SID and Auth Token at twilio.com/console
_10
// and set the environment variables. See http://twil.io/secure
_10
const accountSid = process.env.TWILIO_ACCOUNT_SID;
_10
const authToken = process.env.TWILIO_AUTH_TOKEN;
_10
const client = require('twilio')(accountSid, authToken);
_10
_10
client.outgoingCallerIds('PNe536d32a3c49700934481addd5ce1659')
_10
.update({friendlyName: 'My Second Line'})
_10
.then(outgoing_caller_id => console.log(outgoing_caller_id.friendlyName));

Output

_10
{
_10
"account_sid": "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_10
"date_created": "Fri, 21 Aug 2009 00:11:24 +0000",
_10
"date_updated": "Fri, 21 Aug 2009 00:11:24 +0000",
_10
"friendly_name": "My Second Line",
_10
"phone_number": "+141586753096",
_10
"sid": "PNe536d32a3c49700934481addd5ce1659",
_10
"uri": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/OutgoingCallerIds/PNXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.json"
_10
}

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

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

Delete Outgoing Caller ID

delete-outgoing-caller-id page anchor
Node.js
Python
C#
Java
Go
PHP
Ruby
twilio-cli
curl

_10
// Download the helper library from https://www.twilio.com/docs/node/install
_10
// Find your Account SID and Auth Token at twilio.com/console
_10
// and set the environment variables. See http://twil.io/secure
_10
const accountSid = process.env.TWILIO_ACCOUNT_SID;
_10
const authToken = process.env.TWILIO_AUTH_TOKEN;
_10
const client = require('twilio')(accountSid, authToken);
_10
_10
client.outgoingCallerIds('PNe536d32a3c49700934481addd5ce1659').remove();


OutgoingCallerIds List Resource

outgoingcallerids-list-resource page anchor

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

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

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

ParameterDescription
PhoneNumberOnly show the caller id resource that exactly matches this phone number.
FriendlyNameOnly show the caller id resource that exactly matches this name.

List an Account's Outgoing Caller IDs

list-an-accounts-outgoing-caller-ids page anchor
Node.js
Python
C#
Java
Go
PHP
Ruby
twilio-cli
curl

_10
// Download the helper library from https://www.twilio.com/docs/node/install
_10
// Find your Account SID and Auth Token at twilio.com/console
_10
// and set the environment variables. See http://twil.io/secure
_10
const accountSid = process.env.TWILIO_ACCOUNT_SID;
_10
const authToken = process.env.TWILIO_AUTH_TOKEN;
_10
const client = require('twilio')(accountSid, authToken);
_10
_10
client.outgoingCallerIds.list({limit: 20})
_10
.then(outgoingCallerIds => outgoingCallerIds.forEach(o => console.log(o.sid)));

Output

_21
{
_21
"end": 0,
_21
"first_page_uri": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/OutgoingCallerIds.json?PageSize=50&Page=0",
_21
"next_page_uri": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/OutgoingCallerIds.json?PageSize=50&Page=50",
_21
"outgoing_caller_ids": [
_21
{
_21
"account_sid": "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_21
"date_created": "Fri, 21 Aug 2009 00:11:24 +0000",
_21
"date_updated": "Fri, 21 Aug 2009 00:11:24 +0000",
_21
"friendly_name": "(415) 867-5309",
_21
"phone_number": "+141586753096",
_21
"sid": "PNXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_21
"uri": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/OutgoingCallerIds/PNXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.json"
_21
}
_21
],
_21
"page": 0,
_21
"page_size": 50,
_21
"previous_page_uri": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/OutgoingCallerIds.json?PageSize=50&Page=0",
_21
"start": 0,
_21
"uri": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/OutgoingCallerIds.json?PageSize=50&Page=0"
_21
}

Show Caller ID for a Phone number

show-caller-id-for-a-phone-number page anchor

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

Node.js
Python
C#
Java
Go
PHP
Ruby
twilio-cli
curl

_10
// Download the helper library from https://www.twilio.com/docs/node/install
_10
// Find your Account SID and Auth Token at twilio.com/console
_10
// and set the environment variables. See http://twil.io/secure
_10
const accountSid = process.env.TWILIO_ACCOUNT_SID;
_10
const authToken = process.env.TWILIO_AUTH_TOKEN;
_10
const client = require('twilio')(accountSid, authToken);
_10
_10
client.outgoingCallerIds.list({phoneNumber: '+14158675310', limit: 20})
_10
.then(outgoingCallerIds => outgoingCallerIds.forEach(o => console.log(o.sid)));

Output

_21
{
_21
"end": 0,
_21
"first_page_uri": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/OutgoingCallerIds.json?PageSize=50&Page=0",
_21
"next_page_uri": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/OutgoingCallerIds.json?PageSize=50&Page=50",
_21
"outgoing_caller_ids": [
_21
{
_21
"account_sid": "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_21
"date_created": "Fri, 21 Aug 2009 00:11:24 +0000",
_21
"date_updated": "Fri, 21 Aug 2009 00:11:24 +0000",
_21
"friendly_name": "(415) 867-5309",
_21
"phone_number": "+141586753096",
_21
"sid": "PNXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_21
"uri": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/OutgoingCallerIds/PNXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.json"
_21
}
_21
],
_21
"page": 0,
_21
"page_size": 50,
_21
"previous_page_uri": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/OutgoingCallerIds.json?PageSize=50&Page=0",
_21
"start": 0,
_21
"uri": "/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/OutgoingCallerIds.json?PageSize=50&Page=0"
_21
}

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 is added to your account.

The following parameters are accepted:

ParameterDescription
PhoneNumberThe phone number to verify. Should be formatted with a '+' and country code e.g., +16175551212 (E.164(link takes you to an external page) format). Twilio will also accept unformatted US numbers e.g., (415) 555-1212, 415-555-1212.
ParameterDescription
FriendlyNameA human readable description for the new caller ID with maximum length 64 characters. Defaults to a nicely formatted version of the number.
CallDelayThe number of seconds, between 0 and 60, to delay before initiating the verification call. Defaults to 0.
ExtensionDigits to dial after connecting the verification call.
StatusCallbackA 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.
StatusCallbackMethodThe 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:

PropertyDescription
AccountSidThe unique ID of the Account to which the Validation Request belongs.
PhoneNumberThe incoming phone number being validated, formatted with a '+' and country code e.g., +16175551212 (E.164(link takes you to an external page) format).
FriendlyNameThe friendly name you provided, if any.
ValidationCodeThe 6 digit validation code that must be entered via the phone to validate this phone number for Caller ID.
CallSidThe unique id of the Call created for this validation attempt.

StatusCallback Parameter

statuscallback-parameter page anchor

After the verification call ends, Twilio makes 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 request to the StatusCallback URL as it does in a typical 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:

ParameterDescription
VerificationStatusDescribes whether or not the person called correctly entered the validation code. Possible values are success or failed.
OutgoingCallerIdSidIf the verification process was successful, the SID value of the newly-created OutgoingCallerId resource for the verified number.

Add an Outgoing Caller ID

add-an-outgoing-caller-id page anchor

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. Adding an Outgoing Caller ID via the API has the same result as verifying a number(link takes you to an external page) via the Twilio console.

Node.js
Python
C#
Java
Go
PHP
Ruby
twilio-cli
curl

_10
// Download the helper library from https://www.twilio.com/docs/node/install
_10
// Find your Account SID and Auth Token at twilio.com/console
_10
// and set the environment variables. See http://twil.io/secure
_10
const accountSid = process.env.TWILIO_ACCOUNT_SID;
_10
const authToken = process.env.TWILIO_AUTH_TOKEN;
_10
const client = require('twilio')(accountSid, authToken);
_10
_10
client.validationRequests
_10
.create({friendlyName: 'My Home Phone Number', phoneNumber: '+14158675310'})
_10
.then(validation_request => console.log(validation_request.friendlyName));

Output

_10
{
_10
"account_sid": "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_10
"call_sid": "CAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_10
"friendly_name": "My Home Phone Number",
_10
"phone_number": "+14158675310",
_10
"validation_code": "111111"
_10
}

Not supported.

Not supported.


Rate this page: