NAME
Twilio::Rest::Proxy::V1::Service::PhoneNumber - The PhoneNumber resource
SYNOPSIS
my $client = Twilio::Rest::Client->new($account_sid, $auth_token);
my $phone_number = $client->proxy->v1->services($service_sid)->phone_numbers->create(\%options);
for my $phone_number ($client->proxy->v1->services($service_sid)->phone_numbers->read({}, 20)) {
...
}
my $phone_number = $client->proxy->v1->services($service_sid)->phone_numbers($sid)->fetch;
$client->proxy->v1->services($service_sid)->phone_numbers($sid)->update(\%options);
$client->proxy->v1->services($service_sid)->phone_numbers($sid)->delete;
DESCRIPTION
This file holds PhoneNumberList, PhoneNumberPage, PhoneNumberContext and PhoneNumberInstance. Methods that make a request throw Twilio::Exceptions::RestException on an error response.
PhoneNumberList
Returned by $client->proxy->v1->services($service_sid)->phone_numbers. See also Twilio::ListResource.
create
my $phone_number = $client->proxy->v1->services($service_sid)->phone_numbers->create(\%options);
Add a Phone Number to a Service's Proxy Number Pool. Returns a PhoneNumberInstance.
The options are:
is_reserved-
Whether the new phone number should be reserved and not be assigned to a participant using proxy pool logic. See Reserved Phone Numbers for more information.
phone_number-
The phone number 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.
sid-
The SID of a Twilio IncomingPhoneNumber resource that represents the Twilio Number you would like to assign to your Proxy Service.
read
my @records = $client->proxy->v1->services($service_sid)->phone_numbers->read(\%options, $limit, $page_size);
Retrieve a list of all Phone Numbers in the Proxy Number Pool for a Service. A maximum of 100 records will be returned per page. Returns the records as a list, fetching as many pages as it needs.
stream
my $stream = $client->proxy->v1->services($service_sid)->phone_numbers->stream(\%options, $limit, $page_size);
Takes the same arguments as "read", and returns a Twilio::Stream.
page
my $page = $client->proxy->v1->services($service_sid)->phone_numbers->page(\%options, $page_size, $page_token, $page_number);
Fetches one page, and returns a Twilio::Page.
get_page
my $page = $client->proxy->v1->services($service_sid)->phone_numbers->get_page($url);
Fetches the page at a URL given by Twilio.
get_context
my $context = $client->proxy->v1->services($service_sid)->phone_numbers->get_context($sid);
Returns a PhoneNumberContext, and makes no request.
PhoneNumberPage
A Twilio::Page of PhoneNumberInstance objects.
records_key
build_instance
Used by Twilio::Page.
PhoneNumberContext
Returned by $client->proxy->v1->services($service_sid)->phone_numbers($sid). It makes no request until one of these methods is called.
fetch
my $phone_number = $client->proxy->v1->services($service_sid)->phone_numbers($sid)->fetch;
Fetch a specific Phone Number. Returns a PhoneNumberInstance.
update
my $phone_number = $client->proxy->v1->services($service_sid)->phone_numbers($sid)->update(\%options);
Update a specific Proxy Number. Returns a PhoneNumberInstance.
The options are:
is_reserved-
Whether the phone number should be reserved and not be assigned to a participant using proxy pool logic. See Reserved Phone Numbers for more information.
delete
$client->proxy->v1->services($service_sid)->phone_numbers($sid)->delete;
Delete a specific Phone Number from a Service. Returns true.
PhoneNumberInstance
See also Twilio::InstanceResource.
It has fetch, update and delete, which work as they do on the context.
Its fields are:
- account_sid
-
The SID of the Account that created the PhoneNumber resource.
- capabilities
-
The capabilities of the phone number. A Twilio::Base::PhoneNumberCapabilities object.
- date_created
-
The ISO 8601 date and time in GMT when the resource was created. A Time::Piece object in UTC. See "date_time" in Twilio::Deserialize.
- date_updated
-
The ISO 8601 date and time in GMT when the resource was last updated. A Time::Piece object in UTC. See "date_time" in Twilio::Deserialize.
- friendly_name
-
The string that you assigned to describe the resource.
- in_use
-
The number of open session assigned to the number. See the How many Phone Numbers do I need? guide for more information.
- is_reserved
-
Whether the phone number should be reserved and not be assigned to a participant using proxy pool logic. See Reserved Phone Numbers for more information.
- iso_country
-
The ISO Country Code for the phone number.
- phone_number
-
The phone number in E.164 format, which consists of a + followed by the country code and subscriber number.
- service_sid
-
The SID of the PhoneNumber resource's parent Service resource.
- sid
-
The unique string that we created to identify the PhoneNumber resource.
- url
-
The absolute URL of the PhoneNumber resource.
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.