NAME
Twilio::Rest::Chat::V2::Service - The Service resource
SYNOPSIS
my $client = Twilio::Rest::Client->new($account_sid, $auth_token);
my $service = $client->chat->v2->services->create($friendly_name);
for my $service ($client->chat->v2->services->read({}, 20)) {
...
}
my $service = $client->chat->v2->services($sid)->fetch;
$client->chat->v2->services($sid)->update(\%options);
$client->chat->v2->services($sid)->delete;
DESCRIPTION
Top level scope for all chat resources
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->chat->v2->services. See also Twilio::ListResource.
create
my $service = $client->chat->v2->services->create($friendly_name);
Returns a ServiceInstance.
The required values are:
read
my @records = $client->chat->v2->services->read(\%options, $limit, $page_size);
Returns the records as a list, fetching as many pages as it needs.
stream
my $stream = $client->chat->v2->services->stream(\%options, $limit, $page_size);
Takes the same arguments as "read", and returns a Twilio::Stream.
page
my $page = $client->chat->v2->services->page(\%options, $page_size, $page_token, $page_number);
Fetches one page, and returns a Twilio::Page.
get_page
my $page = $client->chat->v2->services->get_page($url);
Fetches the page at a URL given by Twilio.
get_context
my $context = $client->chat->v2->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->chat->v2->services($sid). It makes no request until one of these methods is called.
fetch
my $service = $client->chat->v2->services($sid)->fetch;
Returns a ServiceInstance.
update
my $service = $client->chat->v2->services($sid)->update(\%options);
Returns a ServiceInstance.
The options are:
consumption_report_interval-
DEPRECATED. The interval in seconds between consumption reports submission batches from client endpoints.
default_channel_creator_role_sid-
The channel role assigned to a channel creator when they join a new channel. See the Role resource for more info about roles.
default_channel_role_sid-
The channel role assigned to users when they are added to a channel. See the Role resource for more info about roles.
default_service_role_sid-
The service role assigned to users when they are added to the service. See the Role resource for more info about roles.
friendly_name-
A descriptive string that you create to describe the resource.
limits_channel_members-
The maximum number of Members that can be added to Channels within this Service. Can be up to 1,000.
limits_user_channels-
The maximum number of Channels Users can be a Member of within this Service. Can be up to 1,000.
media_compatibility_message-
The message to send when a media message has no text. Can be used as placeholder message.
notifications_added_to_channel_enabled-
Whether to send a notification when a member is added to a channel. The default is
false. notifications_added_to_channel_sound-
The name of the sound to play when a member is added to a channel and
notifications.added_to_channel.enabledistrue. notifications_added_to_channel_template-
The template to use to create the notification text displayed when a member is added to a channel and
notifications.added_to_channel.enabledistrue. notifications_invited_to_channel_enabled-
Whether to send a notification when a user is invited to a channel. The default is
false. notifications_invited_to_channel_sound-
The name of the sound to play when a user is invited to a channel and
notifications.invited_to_channel.enabledistrue. notifications_invited_to_channel_template-
The template to use to create the notification text displayed when a user is invited to a channel and
notifications.invited_to_channel.enabledistrue. notifications_log_enabled-
Whether to log notifications. The default is
false. notifications_new_message_badge_count_enabled-
Whether the new message badge is enabled. The default is
false. notifications_new_message_enabled-
Whether to send a notification when a new message is added to a channel. The default is
false. notifications_new_message_sound-
The name of the sound to play when a new message is added to a channel and
notifications.new_message.enabledistrue. notifications_new_message_template-
The template to use to create the notification text displayed when a new message is added to a channel and
notifications.new_message.enabledistrue. notifications_removed_from_channel_enabled-
Whether to send a notification to a user when they are removed from a channel. The default is
false. notifications_removed_from_channel_sound-
The name of the sound to play to a user when they are removed from a channel and
notifications.removed_from_channel.enabledistrue. notifications_removed_from_channel_template-
The template to use to create the notification text displayed to a user when they are removed from a channel and
notifications.removed_from_channel.enabledistrue. post_webhook_retry_count-
The number of times to retry a call to the
post_webhook_urlif the request times out (after 5 seconds) or it receives a 429, 503, or 504 HTTP response. The default is 0, which means the call won't be retried. post_webhook_url-
The URL for post-event webhooks, which are called by using the
webhook_method. See Webhook Events for more details. pre_webhook_retry_count-
The number of times to retry a call to the
pre_webhook_urlif the request times out (after 5 seconds) or it receives a 429, 503, or 504 HTTP response. Default retry count is 0 times, which means the call won't be retried. pre_webhook_url-
The URL for pre-event webhooks, which are called by using the
webhook_method. See Webhook Events for more details. reachability_enabled-
Whether to enable the Reachability Indicator for this Service instance. The default is
false. read_status_enabled-
Whether to enable the Message Consumption Horizon feature. The default is
true. typing_indicator_timeout-
How long in seconds after a
started typingevent until clients should assume that user is no longer typing, even if noended typingmessage was received. The default is 5 seconds. webhook_filters-
The list of webhook events that are enabled for this Service instance. See Webhook Events for more details. An array reference.
webhook_method-
The HTTP method to use for calls to the
pre_webhook_urlandpost_webhook_urlwebhooks. Can be:POSTorGETand the default isPOST. See Webhook Events for more details. One ofGETorPOST.
delete
$client->chat->v2->services($sid)->delete;
Returns true.
bindings
my $list = $object->bindings;
my $context = $object->bindings($sid);
See Twilio::Rest::Chat::V2::Service::Binding.
channels
my $list = $object->channels;
my $context = $object->channels($sid);
See Twilio::Rest::Chat::V2::Service::Channel.
roles
my $list = $object->roles;
my $context = $object->roles($sid);
See Twilio::Rest::Chat::V2::Service::Role.
users
my $list = $object->users;
my $context = $object->users($sid);
See Twilio::Rest::Chat::V2::Service::User.
ServiceInstance
See also Twilio::InstanceResource.
It has fetch, update, delete, bindings, channels, roles and users, which work as they do on the context.
Its fields are:
- account_sid
-
The SID of the Account that created the Service resource.
- consumption_report_interval
-
DEPRECATED. The interval in seconds between consumption reports submission batches from client endpoints.
- 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.
- default_channel_creator_role_sid
-
The channel role assigned to a channel creator when they join a new channel. See the Role resource for more info about roles.
- default_channel_role_sid
-
The channel role assigned to users when they are added to a channel. See the Role resource for more info about roles.
- default_service_role_sid
-
The service role assigned to users when they are added to the service. See the Role resource for more info about roles.
- friendly_name
-
The string that you assigned to describe the resource.
- limits
-
An object that describes the limits of the service instance. The
limitsobject containschannel_membersto describe the members/channel limit anduser_channelsto describe the channels/user limit.channel_memberscan be 1,000 or less, with a default of 250.user_channelscan be 1,000 or less, with a default value of 100. - links
-
The absolute URLs of the Service's Channels, Roles, Bindings, and Users.
- media
-
An object that describes the properties of media that the service supports. The object contains the
size_limit_mbproperty, which describes the size of the largest media file in MB; and thecompatibility_messageproperty, which contains the message text to send when a media message does not have any text. - notifications
-
The notification configuration for the Service instance. See Push Notification Configuration for more info.
- post_webhook_retry_count
-
The number of times to retry a call to the
post_webhook_urlif the request times out (after 5 seconds) or it receives a 429, 503, or 504 HTTP response. The default is 0, which means the call won't be retried. - post_webhook_url
-
The URL for post-event webhooks, which are called by using the
webhook_method. See Webhook Events for more details. - pre_webhook_retry_count
-
The number of times to retry a call to the
pre_webhook_urlif the request times out (after 5 seconds) or it receives a 429, 503, or 504 HTTP response. Default retry count is 0 times, which means the call won't be retried. - pre_webhook_url
-
The URL for pre-event webhooks, which are called by using the
webhook_method. See Webhook Events for more details. - reachability_enabled
-
Whether the Reachability Indicator is enabled for this Service instance. The default is
false. - read_status_enabled
-
Whether the Message Consumption Horizon feature is enabled. The default is
true. - sid
-
The unique string that we created to identify the Service resource.
- typing_indicator_timeout
-
How long in seconds after a
started typingevent until clients should assume that user is no longer typing, even if noended typingmessage was received. The default is 5 seconds. - url
-
The absolute URL of the Service resource.
- webhook_filters
-
The list of webhook events that are enabled for this Service instance. See Webhook Events for more details.
- webhook_method
-
The HTTP method to use for calls to the
pre_webhook_urlandpost_webhook_urlwebhooks. Can be:POSTorGETand the default isPOST. See Webhook Events for more details.
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.