PhoneNumber Resource
The Phone Numbers subresource contains the list of Phone Number instances associated with a SIP Trunk.
To purchase a new phone number for your trunk or manage your numbers more generally, you'll need to use the IncomingPhoneNumbers Resource. The SIP Trunking PhoneNumbers Resource is only for adding, removing, and viewing phone numbers associated with a SIP Trunk.
PhoneNumber properties
Resource Properties in REST API format | |
---|---|
account_sid
|
The SID of the Account that created the PhoneNumber resource. |
address_requirements
|
Whether the phone number requires an Address registered with Twilio and, if so, what type. Can be: |
api_version
|
The API version used to start a new TwiML session. |
beta
|
Whether the phone number is new to the Twilio platform. Can be: |
capabilities
|
The set of Boolean properties that indicate whether a phone number can receive calls or messages. Capabilities are |
date_created
|
The date and time in GMT when the resource was created specified in RFC 2822 format. |
date_updated
|
The date and time in GMT when the resource was last updated specified in RFC 2822 format. |
friendly_name
|
The string that you assigned to describe the resource. |
links
|
The URLs of related resources. |
phone_number
|
The phone number in E.164 format, which consists of a + followed by the country code and subscriber number. |
sid
|
The unique string that we created to identify the PhoneNumber resource. |
sms_application_sid
|
The SID of the application that handles SMS messages sent to the phone number. If an |
sms_fallback_method
|
The HTTP method we use to call |
sms_fallback_url
|
The URL that we call using the |
sms_method
|
The HTTP method we use to call |
sms_url
|
The URL we call using the |
status_callback
|
The URL we call using the |
status_callback_method
|
The HTTP method we use to call |
trunk_sid
|
The SID of the Trunk that handles calls to the phone number. If a |
url
|
The absolute URL of the resource. |
voice_application_sid
|
The SID of the application that handles calls to the phone number. If a |
voice_caller_id_lookup
|
Whether we look up the caller's caller-ID name from the CNAM database ($0.01 per look up). Can be: |
voice_fallback_method
|
The HTTP method that we use to call |
voice_fallback_url
|
The URL that we call using the |
voice_method
|
The HTTP method we use to call |
voice_url
|
The URL we call using the |
Create a PhoneNumber resource
https://trunking.twilio.com/v1/Trunks/{TrunkSid}/PhoneNumbers
Parameters
Parameters in REST API format | |
---|---|
trunk_sid
Path
|
The SID of the Trunk to associate the phone number with. |
phone_number_sid
Required
|
The SID of the Incoming Phone Number that you want to associate with the trunk. |
Example 1
Read multiple PhoneNumber resources
https://trunking.twilio.com/v1/Trunks/{TrunkSid}/PhoneNumbers
Parameters
Parameters in REST API format | |
---|---|
trunk_sid
Path
|
The SID of the Trunk from which to read the PhoneNumber resources. |
Example 1
Delete a PhoneNumber resource
https://trunking.twilio.com/v1/Trunks/{TrunkSid}/PhoneNumbers/{Sid}
Parameters
Parameters in REST API format | |
---|---|
trunk_sid
Path
|
The SID of the Trunk from which to delete the PhoneNumber resource. |
sid
Path
|
The unique string that we created to identify the PhoneNumber resource to delete. |
Example 1
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 by visiting Twilio's Stack Overflow Collective or browsing the Twilio tag on Stack Overflow.