NAME
Twilio::Rest::Sync::V1::Service - The Service resource
SYNOPSIS
my $client = Twilio::Rest::Client->new($account_sid, $auth_token);
my $service = $client->sync->v1->services->create(\%options);
for my $service ($client->sync->v1->services->read({}, 20)) {
...
}
my $service = $client->sync->v1->services($sid)->fetch;
$client->sync->v1->services($sid)->update(\%options);
$client->sync->v1->services($sid)->delete;
DESCRIPTION
Containers for sync objects
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->sync->v1->services. See also Twilio::ListResource.
create
my $service = $client->sync->v1->services->create(\%options);
Returns a ServiceInstance.
The options are:
acl_enabled-
Whether token identities in the Service must be granted access to Sync objects by using the Permissions resource.
friendly_name-
A string that you assign to describe the resource.
reachability_debouncing_enabled-
Whether every
endpoint_disconnectedevent should occur after a configurable delay. The default isfalse, where theendpoint_disconnectedevent occurs immediately after disconnection. Whentrue, intervening reconnections can prevent theendpoint_disconnectedevent. reachability_debouncing_window-
The reachability event delay in milliseconds if
reachability_debouncing_enabled=true. Must be between 1,000 and 30,000 and defaults to 5,000. This is the number of milliseconds after the last running client disconnects, and a Sync identity is declared offline, before thewebhook_urlis called if all endpoints remain offline. A reconnection from the same identity by any endpoint during this interval prevents the call towebhook_url. reachability_webhooks_enabled-
Whether the service instance should call
webhook_urlwhen client endpoints connect to Sync. The default isfalse. webhook_url-
The URL we should call when Sync objects are manipulated.
webhooks_from_rest_enabled-
Whether the Service instance should call
webhook_urlwhen the REST API is used to update Sync objects. The default isfalse.
read
my @records = $client->sync->v1->services->read(\%options, $limit, $page_size);
Returns the records as a list, fetching as many pages as it needs.
stream
my $stream = $client->sync->v1->services->stream(\%options, $limit, $page_size);
Takes the same arguments as "read", and returns a Twilio::Stream.
page
my $page = $client->sync->v1->services->page(\%options, $page_size, $page_token, $page_number);
Fetches one page, and returns a Twilio::Page.
get_page
my $page = $client->sync->v1->services->get_page($url);
Fetches the page at a URL given by Twilio.
get_context
my $context = $client->sync->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->sync->v1->services($sid). It makes no request until one of these methods is called.
fetch
my $service = $client->sync->v1->services($sid)->fetch;
Returns a ServiceInstance.
update
my $service = $client->sync->v1->services($sid)->update(\%options);
Returns a ServiceInstance.
The options are:
acl_enabled-
Whether token identities in the Service must be granted access to Sync objects by using the Permissions resource.
friendly_name-
A string that you assign to describe the resource.
reachability_debouncing_enabled-
Whether every
endpoint_disconnectedevent should occur after a configurable delay. The default isfalse, where theendpoint_disconnectedevent occurs immediately after disconnection. Whentrue, intervening reconnections can prevent theendpoint_disconnectedevent. reachability_debouncing_window-
The reachability event delay in milliseconds if
reachability_debouncing_enabled=true. Must be between 1,000 and 30,000 and defaults to 5,000. This is the number of milliseconds after the last running client disconnects, and a Sync identity is declared offline, before the webhook is called if all endpoints remain offline. A reconnection from the same identity by any endpoint during this interval prevents the webhook from being called. reachability_webhooks_enabled-
Whether the service instance should call
webhook_urlwhen client endpoints connect to Sync. The default isfalse. webhook_url-
The URL we should call when Sync objects are manipulated.
webhooks_from_rest_enabled-
Whether the Service instance should call
webhook_urlwhen the REST API is used to update Sync objects. The default isfalse.
delete
$client->sync->v1->services($sid)->delete;
Returns true.
documents
my $list = $object->documents;
my $context = $object->documents($sid);
See Twilio::Rest::Sync::V1::Service::Document.
sync_lists
my $list = $object->sync_lists;
my $context = $object->sync_lists($sid);
See Twilio::Rest::Sync::V1::Service::SyncList.
sync_maps
my $list = $object->sync_maps;
my $context = $object->sync_maps($sid);
See Twilio::Rest::Sync::V1::Service::SyncMap.
sync_streams
my $list = $object->sync_streams;
my $context = $object->sync_streams($sid);
See Twilio::Rest::Sync::V1::Service::SyncStream.
ServiceInstance
See also Twilio::InstanceResource.
It has fetch, update, delete, documents, sync_lists, sync_maps and sync_streams, which work as they do on the context.
Its fields are:
- account_sid
-
The SID of the Account that created the Service resource.
- acl_enabled
-
Whether token identities in the Service must be granted access to Sync objects by using the Permissions resource. It is disabled (false) by default.
- date_created
-
The date and time in GMT when the resource was created specified in ISO 8601 format. A Time::Piece object in UTC. See "date_time" in Twilio::Deserialize.
- date_updated
-
The date and time in GMT when the resource was last updated specified in ISO 8601 format. A Time::Piece object in UTC. See "date_time" in Twilio::Deserialize.
- friendly_name
-
The string that you assigned to describe the resource.
- links
-
The URLs of related resources.
- reachability_debouncing_enabled
-
Whether every
endpoint_disconnectedevent should occur after a configurable delay. The default isfalse, where theendpoint_disconnectedevent occurs immediately after disconnection. Whentrue, intervening reconnections can prevent theendpoint_disconnectedevent. - reachability_debouncing_window
-
The reachability event delay in milliseconds if
reachability_debouncing_enabled=true. Must be between 1,000 and 30,000 and defaults to 5,000. This is the number of milliseconds after the last running client disconnects, and a Sync identity is declared offline, beforewebhook_urlis called, if all endpoints remain offline. A reconnection from the same identity by any endpoint during this interval prevents the reachability event from occurring. - reachability_webhooks_enabled
-
Whether the service instance calls
webhook_urlwhen client endpoints connect to Sync. The default isfalse. - sid
-
The unique string that we created to identify the Service resource.
- unique_name
-
An application-defined string that uniquely identifies the resource. It can be used in place of the resource's
sidin the URL to address the resource. It is a read-only property, it cannot be assigned using REST API. - url
-
The absolute URL of the Service resource.
- webhook_url
-
The URL we call when Sync objects are manipulated.
- webhooks_from_rest_enabled
-
Whether the Service instance should call
webhook_urlwhen the REST API is used to update Sync objects. The default isfalse.
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.