NAME
Twilio::Rest::Proxy::V1::Service - The Service resource
SYNOPSIS
my $client = Twilio::Rest::Client->new($account_sid, $auth_token);
my $service = $client->proxy->v1->services->create($unique_name, \%options);
for my $service ($client->proxy->v1->services->read({}, 20)) {
...
}
my $service = $client->proxy->v1->services($sid)->fetch;
$client->proxy->v1->services($sid)->update(\%options);
$client->proxy->v1->services($sid)->delete;
DESCRIPTION
This file holds ServiceList, ServicePage, ServiceContext and ServiceInstance. Methods that make a request throw Twilio::Exceptions::RestException on an error response.
ServiceList
Returned by $client->proxy->v1->services. See also Twilio::ListResource.
create
my $service = $client->proxy->v1->services->create($unique_name, \%options);
Create a new Service for Twilio Proxy. Returns a ServiceInstance.
The required values are:
$unique_name-
An application-defined string that uniquely identifies the resource. This value must be 191 characters or fewer in length and be unique. This value should not have PII.
The options are:
callback_url-
The URL we should call when the interaction status changes.
chat_instance_sid-
The SID of the Chat Service Instance managed by Proxy Service. The Chat Service enables Proxy to forward SMS and channel messages to this chat instance. This is a one-to-one relationship.
default_ttl-
The default
ttlvalue to set for Sessions created in the Service. The TTL (time to live) is measured in seconds after the Session's last create or last Interaction. The default value of0indicates an unlimited Session length. You can override a Session's default TTL value by setting itsttlvalue. geo_match_level-
One of
area-code,overlay,radiusorcountry. intercept_callback_url-
The URL we call on each interaction. If we receive a 403 status, we block the interaction; otherwise the interaction continues.
number_selection_behavior-
One of
avoid-stickyorprefer-sticky. out_of_session_callback_url-
The URL we should call when an inbound call or SMS action occurs on a closed or non-existent Session. If your server (or a Twilio function) responds with valid TwiML, we will process it. This means it is possible, for example, to play a message for a call, send an automated text message response, or redirect a call to another Phone Number. See Out-of-Session Callback Response Guide for more information.
read
my @records = $client->proxy->v1->services->read(\%options, $limit, $page_size);
Retrieve a list of all Services for Twilio Proxy. 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->stream(\%options, $limit, $page_size);
Takes the same arguments as "read", and returns a Twilio::Stream.
page
my $page = $client->proxy->v1->services->page(\%options, $page_size, $page_token, $page_number);
Fetches one page, and returns a Twilio::Page.
get_page
my $page = $client->proxy->v1->services->get_page($url);
Fetches the page at a URL given by Twilio.
get_context
my $context = $client->proxy->v1->services->get_context($sid);
Returns a ServiceContext, and makes no request.
ServicePage
A Twilio::Page of ServiceInstance objects.
records_key
build_instance
Used by Twilio::Page.
ServiceContext
Returned by $client->proxy->v1->services($sid). It makes no request until one of these methods is called.
fetch
my $service = $client->proxy->v1->services($sid)->fetch;
Fetch a specific Service. Returns a ServiceInstance.
update
my $service = $client->proxy->v1->services($sid)->update(\%options);
Update a specific Service. Returns a ServiceInstance.
The options are:
callback_url-
The URL we should call when the interaction status changes.
chat_instance_sid-
The SID of the Chat Service Instance managed by Proxy Service. The Chat Service enables Proxy to forward SMS and channel messages to this chat instance. This is a one-to-one relationship.
default_ttl-
The default
ttlvalue to set for Sessions created in the Service. The TTL (time to live) is measured in seconds after the Session's last create or last Interaction. The default value of0indicates an unlimited Session length. You can override a Session's default TTL value by setting itsttlvalue. geo_match_level-
One of
area-code,overlay,radiusorcountry. intercept_callback_url-
The URL we call on each interaction. If we receive a 403 status, we block the interaction; otherwise the interaction continues.
number_selection_behavior-
One of
avoid-stickyorprefer-sticky. out_of_session_callback_url-
The URL we should call when an inbound call or SMS action occurs on a closed or non-existent Session. If your server (or a Twilio function) responds with valid TwiML, we will process it. This means it is possible, for example, to play a message for a call, send an automated text message response, or redirect a call to another Phone Number. See Out-of-Session Callback Response Guide for more information.
unique_name-
An application-defined string that uniquely identifies the resource. This value must be 191 characters or fewer in length and be unique. This value should not have PII.
delete
$client->proxy->v1->services($sid)->delete;
Delete a specific Service. Returns true.
phone_numbers
my $list = $object->phone_numbers;
my $context = $object->phone_numbers($sid);
See Twilio::Rest::Proxy::V1::Service::PhoneNumber.
sessions
my $list = $object->sessions;
my $context = $object->sessions($sid);
See Twilio::Rest::Proxy::V1::Service::Session.
ServiceInstance
See also Twilio::InstanceResource.
It has fetch, update, delete, phone_numbers and sessions, which work as they do on the context.
Its fields are:
- account_sid
-
The SID of the Account that created the Service resource.
- callback_url
-
The URL we call when the interaction status changes.
- chat_instance_sid
-
The SID of the Chat Service Instance managed by Proxy Service. The Chat Service enables Proxy to forward SMS and channel messages to this chat instance. This is a one-to-one relationship.
- 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.
- default_ttl
-
The default
ttlvalue for Sessions created in the Service. The TTL (time to live) is measured in seconds after the Session's last create or last Interaction. The default value of0indicates an unlimited Session length. You can override a Session's default TTL value by setting itsttlvalue. - geo_match_level
-
One of
area-code,overlay,radiusorcountry. - intercept_callback_url
-
The URL we call on each interaction. If we receive a 403 status, we block the interaction; otherwise the interaction continues.
- links
-
The URLs of resources related to the Service.
- number_selection_behavior
-
One of
avoid-stickyorprefer-sticky. - out_of_session_callback_url
-
The URL we call when an inbound call or SMS action occurs on a closed or non-existent Session. If your server (or a Twilio function) responds with valid TwiML, we will process it. This means it is possible, for example, to play a message for a call, send an automated text message response, or redirect a call to another Phone Number. See Out-of-Session Callback Response Guide for more information.
- sid
-
The unique string that we created to identify the Service resource.
- unique_name
-
An application-defined string that uniquely identifies the resource. This value must be 191 characters or fewer in length and be unique. Supports UTF-8 characters. This value should not have PII.
- url
-
The absolute URL of the Service 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.