NAME
Twilio::Rest::Api::V2010::Account::IncomingPhoneNumber::TollFree - The TollFree resource
SYNOPSIS
my $client = Twilio::Rest::Client->new($account_sid, $auth_token);
my $toll_free = $client->incoming_phone_numbers->toll_free->create($phone_number, \%options);
for my $toll_free ($client->incoming_phone_numbers->toll_free->read({}, 20)) {
...
}
DESCRIPTION
Incoming toll free phone numbers on a Twilio account/project
This file holds TollFreeList, TollFreePage and TollFreeInstance. Methods that make a request throw Twilio::Exceptions::RestException on an error response.
TollFreeList
Returned by $client->incoming_phone_numbers->toll_free. See also Twilio::ListResource.
create
my $toll_free = $client->incoming_phone_numbers->toll_free->create($phone_number, \%options);
Returns a TollFreeInstance.
The required values are:
$phone_number-
The phone number to purchase specified in E.164 format. E.164 phone numbers consist of a + followed by the country code and subscriber number without punctuation characters. For example, +14155551234.
The options are:
address_sid-
The SID of the Address resource we should associate with the new phone number. Some regions require addresses to meet local regulations.
api_version-
The API version to use for incoming calls made to the new phone number. The default is
2010-04-01. bundle_sid-
The SID of the Bundle resource that you associate with the phone number. Some regions require a Bundle to meet local Regulations.
emergency_address_sid-
The SID of the emergency address configuration to use for emergency calling from the new phone number.
emergency_status-
One of
ActiveorInactive. friendly_name-
A descriptive string that you created to describe the new phone number. It can be up to 64 characters long. By default, this is a formatted version of the phone number.
identity_sid-
The SID of the Identity resource that we should associate with the new phone number. Some regions require an Identity to meet local regulations.
sms_application_sid-
The SID of the application that should handle SMS messages sent to the new phone number. If an
sms_application_sidis present, we ignore allsms_*_urlvalues and use those of the application. sms_fallback_method-
The HTTP method that we should use to call
sms_fallback_url. Can be:GETorPOSTand defaults toPOST. One ofGETorPOST. sms_fallback_url-
The URL that we should call when an error occurs while requesting or executing the TwiML defined by
sms_url. sms_method-
The HTTP method that we should use to call
sms_url. Can be:GETorPOSTand defaults toPOST. One ofGETorPOST. sms_url-
The URL we should call when the new phone number receives an incoming SMS message.
status_callback-
The URL we should call using the
status_callback_methodto send status information to your application. status_callback_method-
The HTTP method we should use to call
status_callback. Can be:GETorPOSTand defaults toPOST. One ofGETorPOST. trunk_sid-
The SID of the Trunk we should use to handle calls to the new phone number. If a
trunk_sidis present, we ignore all of the voice urls and voice applications and use only those set on the Trunk. Setting atrunk_sidwill automatically delete yourvoice_application_sidand vice versa. voice_application_sid-
The SID of the application we should use to handle calls to the new phone number. If a
voice_application_sidis present, we ignore all of the voice urls and use those set on the application. Setting avoice_application_sidwill automatically delete yourtrunk_sidand vice versa. voice_caller_id_lookup-
Whether to lookup the caller's name from the CNAM database and post it to your app. Can be:
trueorfalseand defaults tofalse. voice_fallback_method-
The HTTP method that we should use to call
voice_fallback_url. Can be:GETorPOSTand defaults toPOST. One ofGETorPOST. voice_fallback_url-
The URL that we should call when an error occurs retrieving or executing the TwiML requested by
url. voice_method-
The HTTP method that we should use to call
voice_url. Can be:GETorPOSTand defaults toPOST. One ofGETorPOST. voice_receive_mode-
One of
voiceorfax. voice_url-
The URL that we should call to answer a call to the new phone number. The
voice_urlwill not be called if avoice_application_sidor atrunk_sidis set.
read
my @records = $client->incoming_phone_numbers->toll_free->read(\%options, $limit, $page_size);
Returns the records as a list, fetching as many pages as it needs.
The options are:
beta-
Whether to include phone numbers new to the Twilio platform. Can be:
trueorfalseand the default istrue. friendly_name-
A string that identifies the resources to read.
origin-
Whether to include phone numbers based on their origin. Can be:
twilioorhosted. By default, phone numbers of all origin are included. phone_number-
The phone numbers of the IncomingPhoneNumber resources to read. You can specify partial numbers and use '*' as a wildcard for any digit.
stream
my $stream = $client->incoming_phone_numbers->toll_free->stream(\%options, $limit, $page_size);
Takes the same arguments as "read", and returns a Twilio::Stream.
page
my $page = $client->incoming_phone_numbers->toll_free->page(\%options, $page_size, $page_token, $page_number);
Fetches one page, and returns a Twilio::Page.
get_page
my $page = $client->incoming_phone_numbers->toll_free->get_page($url);
Fetches the page at a URL given by Twilio.
TollFreePage
A Twilio::Page of TollFreeInstance objects.
records_key
build_instance
Used by Twilio::Page.
TollFreeInstance
See also Twilio::InstanceResource.
Its fields are:
- account_sid
-
The SID of the Account that created the resource.
- address_requirements
-
One of
none,any,localorforeign. - address_sid
-
The SID of the Address resource associated with the phone number.
- 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:
trueorfalse. - bundle_sid
-
The SID of the Bundle resource that you associate with the phone number. Some regions require a Bundle to meet local Regulations.
- capabilities
-
The set of Boolean properties that indicate whether a phone number can receive calls or messages. Capabilities are
Voice,SMS, andMMSand each capability can be:trueorfalse. A Twilio::Base::PhoneNumberCapabilities object. - date_created
-
The date and time in GMT that the resource was created specified in RFC 2822 format. A Time::Piece object in UTC. See "date_time" in Twilio::Deserialize.
- date_updated
-
The date and time in GMT that the resource was last updated specified in RFC 2822 format. A Time::Piece object in UTC. See "date_time" in Twilio::Deserialize.
- emergency_address_sid
-
The SID of the emergency address configuration that we use for emergency calling from this phone number.
- emergency_address_status
-
One of
registered,unregistered,pending-registration,registration-failure,pending-unregistrationorunregistration-failure. - emergency_status
-
One of
ActiveorInactive. - friendly_name
-
The string that you assigned to describe the resource.
- identity_sid
-
The SID of the Identity resource that we associate with the phone number. Some regions require an Identity to meet local regulations.
- origin
-
The phone number's origin.
twilioidentifies Twilio-owned phone numbers andhostedidentifies hosted phone numbers. - 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 that we created to identify the resource.
- sms_application_sid
-
The SID of the application that handles SMS messages sent to the phone number. If an
sms_application_sidis present, we ignore allsms_*_urlvalues and use those of the application. - sms_fallback_method
-
The HTTP method we use to call
sms_fallback_url. Can be:GETorPOST. One ofGETorPOST. - sms_fallback_url
-
The URL that we call when an error occurs while retrieving or executing the TwiML from
sms_url. - sms_method
-
The HTTP method we use to call
sms_url. Can be:GETorPOST. One ofGETorPOST. - sms_url
-
The URL we call when the phone number receives an incoming SMS message.
- status
-
No description in the specification.
- status_callback
-
The URL we call using the
status_callback_methodto send status information to your application. - status_callback_method
-
The HTTP method we use to call
status_callback. Can be:GETorPOST. One ofGETorPOST. - trunk_sid
-
The SID of the Trunk that handles calls to the phone number. If a
trunk_sidis present, we ignore all of the voice urls and voice applications and use those set on the Trunk. Setting atrunk_sidwill automatically delete yourvoice_application_sidand vice versa. - uri
-
The URI of the resource, relative to
https://api.twilio.com. - voice_application_sid
-
The SID of the application that handles calls to the phone number. If a
voice_application_sidis present, we ignore all of the voice urls and use those set on the application. Setting avoice_application_sidwill automatically delete yourtrunk_sidand vice versa. - 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:
trueorfalse. - voice_fallback_method
-
The HTTP method we use to call
voice_fallback_url. Can be:GETorPOST. One ofGETorPOST. - voice_fallback_url
-
The URL that we call when an error occurs retrieving or executing the TwiML requested by
url. - voice_method
-
The HTTP method we use to call
voice_url. Can be:GETorPOST. One ofGETorPOST. - voice_receive_mode
-
One of
voiceorfax. - voice_url
-
The URL we call when the phone number receives a call. The
voice_urlwill not be used if avoice_application_sidor atrunk_sidis set.
CONSTRUCTORS
new
Objects here come from the methods above, so there is no need to call new directly.
LICENSE
Copyright (c) 2026 Francisco Zarabozo. Released under the MIT License.