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.
account_sid
type: SID<AC>The SID of the Account that created the PhoneNumber resource.
^AC[0-9a-fA-F]{32}$
34
34
address_requirements
type: enum<string>Whether the phone number requires an Address registered with Twilio and, if so, what type. Can be: none
, any
, local
, or foreign
.
none
any
local
foreign
beta
type: booleanWhether the phone number is new to the Twilio platform. Can be: true
or false
.
capabilities
type: object<string-map>The set of Boolean properties that indicate whether a phone number can receive calls or messages. Capabilities are Voice
, SMS
, and MMS
and each capability can be: true
or false
.
date_created
type: string<date-time>The date and time in GMT when the resource was created specified in RFC 2822 format.
date_updated
type: string<date-time>The date and time in GMT when the resource was last updated specified in RFC 2822 format.
phone_number
type: string<phone-number>The phone number in E.164 format, which consists of a + followed by the country code and subscriber number.
sid
type: SID<PN>The unique string that we created to identify the PhoneNumber resource.
^PN[0-9a-fA-F]{32}$
34
34
sms_application_sid
type: SID<AP>The SID of the application that handles SMS messages sent to the phone number. If an sms_application_sid
is present, we ignore all sms_*_url
values and use those of the application.
^AP[0-9a-fA-F]{32}$
34
34
sms_fallback_method
type: enum<http-method>The HTTP method we use to call sms_fallback_url
. Can be: GET
or POST
.
GET
POST
sms_fallback_url
type: string<uri>The URL that we call using the sms_fallback_method
when an error occurs while retrieving or executing the TwiML from sms_url
.
sms_method
type: enum<http-method>The HTTP method we use to call sms_url
. Can be: GET
or POST
.
GET
POST
sms_url
type: string<uri>The URL we call using the sms_method
when the phone number receives an incoming SMS message.
status_callback
type: string<uri>The URL we call using the status_callback_method
to send status information to your application.
status_callback_method
type: enum<http-method>The HTTP method we use to call status_callback
. Can be: GET
or POST
.
GET
POST
trunk_sid
type: SID<TK>The SID of the Trunk that handles calls to the phone number. If a trunk_sid
is present, we ignore all of the voice URLs and voice applications and use those set on the Trunk. Setting a trunk_sid
will automatically delete your voice_application_sid
and vice versa.
^TK[0-9a-fA-F]{32}$
34
34
voice_application_sid
type: SID<AP>The SID of the application that handles calls to the phone number. If a voice_application_sid
is present, we ignore all of the voice URLs and use those set on the application. Setting a voice_application_sid
will automatically delete your trunk_sid
and vice versa.
^AP[0-9a-fA-F]{32}$
34
34
voice_caller_id_lookup
type: booleanWhether we look up the caller's caller-ID name from the CNAM database ($0.01 per look up). Can be: true
or false
.
voice_fallback_method
type: enum<http-method>The HTTP method that we use to call voice_fallback_url
. Can be: GET
or POST
.
GET
POST
voice_fallback_url
type: string<uri>The URL that we call using the voice_fallback_method
when an error occurs retrieving or executing the TwiML requested by url
.
voice_method
type: enum<http-method>The HTTP method we use to call voice_url
. Can be: GET
or POST
.
GET
POST
voice_url
type: string<uri>The URL we call using the voice_method
when the phone number receives a call. The voice_url
is not be used if a voice_application_sid
or a trunk_sid
is set.
POST https://trunking.twilio.com/v1/Trunks/{TrunkSid}/PhoneNumbers
TrunkSid
type: SID<TK>The SID of the Trunk to associate the phone number with.
^TK[0-9a-fA-F]{32}$
34
34
PhoneNumberSid
type: SID<PN>RequiredThe SID of the Incoming Phone Number that you want to associate with the trunk.
^PN[0-9a-fA-F]{32}$
34
34
GET https://trunking.twilio.com/v1/Trunks/{TrunkSid}/PhoneNumbers
TrunkSid
type: SID<TK>The SID of the Trunk from which to read the PhoneNumber resources.
^TK[0-9a-fA-F]{32}$
34
34
PageSize
type: integerHow many resources to return in each list page. The default is 50, and the maximum is 1000.
1
Page
type: integerThe page index. This value is simply for client state.
0
DELETE https://trunking.twilio.com/v1/Trunks/{TrunkSid}/PhoneNumbers/{Sid}
TrunkSid
type: SID<TK>The SID of the Trunk from which to delete the PhoneNumber resource.
^TK[0-9a-fA-F]{32}$
34
34
Sid
type: SID<PN>The unique string that we created to identify the PhoneNumber resource to delete.
^PN[0-9a-fA-F]{32}$
34
34