NAME

Twilio::Rest::Chat::V1::Service - The Service resource

SYNOPSIS

my $client = Twilio::Rest::Client->new($account_sid, $auth_token);

my $service = $client->chat->v1->services->create($friendly_name);
for my $service ($client->chat->v1->services->read({}, 20)) {
  ...
}
my $service = $client->chat->v1->services($sid)->fetch;
$client->chat->v1->services($sid)->update(\%options);
$client->chat->v1->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->v1->services. See also Twilio::ListResource.

create

my $service = $client->chat->v1->services->create($friendly_name);

Returns a ServiceInstance.

The required values are:

$friendly_name

A descriptive string that you create to describe the resource. It can be up to 64 characters long.

read

my @records = $client->chat->v1->services->read(\%options, $limit, $page_size);

Returns the records as a list, fetching as many pages as it needs.

stream

my $stream = $client->chat->v1->services->stream(\%options, $limit, $page_size);

Takes the same arguments as "read", and returns a Twilio::Stream.

page

my $page = $client->chat->v1->services->page(\%options, $page_size, $page_token, $page_number);

Fetches one page, and returns a Twilio::Page.

get_page

my $page = $client->chat->v1->services->get_page($url);

Fetches the page at a URL given by Twilio.

get_context

my $context = $client->chat->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->chat->v1->services($sid). It makes no request until one of these methods is called.

fetch

my $service = $client->chat->v1->services($sid)->fetch;

Returns a ServiceInstance.

update

my $service = $client->chat->v1->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 Roles endpoint for more details.

default_channel_role_sid

The channel role assigned to users when they are added to a channel. See the Roles endpoint for more details.

default_service_role_sid

The service role assigned to users when they are added to the service. See the Roles endpoint for more details.

friendly_name

A descriptive string that you create to describe the resource. It can be up to 64 characters long.

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.

notifications_added_to_channel_enabled

Whether to send a notification when a member is added to a channel. Can be: true or false and the default is false.

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.enabled is true.

notifications_invited_to_channel_enabled

Whether to send a notification when a user is invited to a channel. Can be: true or false and the default is false.

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.enabled is true.

notifications_new_message_enabled

Whether to send a notification when a new message is added to a channel. Can be: true or false and the default is false.

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.enabled is true.

notifications_removed_from_channel_enabled

Whether to send a notification to a user when they are removed from a channel. Can be: true or false and the default is false.

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.enabled is true.

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_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 typing event until clients should assume that user is no longer typing, even if no ended typing message 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_url and post_webhook_url webhooks. Can be: POST or GET and the default is POST. See Webhook Events for more details. One of GET or POST.

webhooks_on_channel_add_method

The HTTP method to use when calling the webhooks.on_channel_add.url. One of GET or POST.

webhooks_on_channel_add_url

The URL of the webhook to call in response to the on_channel_add event using the webhooks.on_channel_add.method HTTP method.

webhooks_on_channel_added_method

The URL of the webhook to call in response to the on_channel_added event`. One of GET or POST.

webhooks_on_channel_added_url

The URL of the webhook to call in response to the on_channel_added event using the webhooks.on_channel_added.method HTTP method.

webhooks_on_channel_destroy_method

The HTTP method to use when calling the webhooks.on_channel_destroy.url. One of GET or POST.

webhooks_on_channel_destroy_url

The URL of the webhook to call in response to the on_channel_destroy event using the webhooks.on_channel_destroy.method HTTP method.

webhooks_on_channel_destroyed_method

The HTTP method to use when calling the webhooks.on_channel_destroyed.url. One of GET or POST.

webhooks_on_channel_destroyed_url

The URL of the webhook to call in response to the on_channel_added event using the webhooks.on_channel_destroyed.method HTTP method.

webhooks_on_channel_update_method

The HTTP method to use when calling the webhooks.on_channel_update.url. One of GET or POST.

webhooks_on_channel_update_url

The URL of the webhook to call in response to the on_channel_update event using the webhooks.on_channel_update.method HTTP method.

webhooks_on_channel_updated_method

The HTTP method to use when calling the webhooks.on_channel_updated.url. One of GET or POST.

webhooks_on_channel_updated_url

The URL of the webhook to call in response to the on_channel_updated event using the webhooks.on_channel_updated.method HTTP method.

webhooks_on_member_add_method

The HTTP method to use when calling the webhooks.on_member_add.url. One of GET or POST.

webhooks_on_member_add_url

The URL of the webhook to call in response to the on_member_add event using the webhooks.on_member_add.method HTTP method.

webhooks_on_member_added_method

The HTTP method to use when calling the webhooks.on_channel_updated.url. One of GET or POST.

webhooks_on_member_added_url

The URL of the webhook to call in response to the on_channel_updated event using the webhooks.on_channel_updated.method HTTP method.

webhooks_on_member_remove_method

The HTTP method to use when calling the webhooks.on_member_remove.url. One of GET or POST.

webhooks_on_member_remove_url

The URL of the webhook to call in response to the on_member_remove event using the webhooks.on_member_remove.method HTTP method.

webhooks_on_member_removed_method

The HTTP method to use when calling the webhooks.on_member_removed.url. One of GET or POST.

webhooks_on_member_removed_url

The URL of the webhook to call in response to the on_member_removed event using the webhooks.on_member_removed.method HTTP method.

webhooks_on_message_remove_method

The HTTP method to use when calling the webhooks.on_message_remove.url. One of GET or POST.

webhooks_on_message_remove_url

The URL of the webhook to call in response to the on_message_remove event using the webhooks.on_message_remove.method HTTP method.

webhooks_on_message_removed_method

The HTTP method to use when calling the webhooks.on_message_removed.url. One of GET or POST.

webhooks_on_message_removed_url

The URL of the webhook to call in response to the on_message_removed event using the webhooks.on_message_removed.method HTTP method.

webhooks_on_message_send_method

The HTTP method to use when calling the webhooks.on_message_send.url. One of GET or POST.

webhooks_on_message_send_url

The URL of the webhook to call in response to the on_message_send event using the webhooks.on_message_send.method HTTP method.

webhooks_on_message_sent_method

The URL of the webhook to call in response to the on_message_sent event`. One of GET or POST.

webhooks_on_message_sent_url

The URL of the webhook to call in response to the on_message_sent event using the webhooks.on_message_sent.method HTTP method.

webhooks_on_message_update_method

The HTTP method to use when calling the webhooks.on_message_update.url. One of GET or POST.

webhooks_on_message_update_url

The URL of the webhook to call in response to the on_message_update event using the webhooks.on_message_update.method HTTP method.

webhooks_on_message_updated_method

The HTTP method to use when calling the webhooks.on_message_updated.url. One of GET or POST.

webhooks_on_message_updated_url

The URL of the webhook to call in response to the on_message_updated event using the webhooks.on_message_updated.method HTTP method.

delete

$client->chat->v1->services($sid)->delete;

Returns true.

channels

my $list = $object->channels;

my $context = $object->channels($sid);

See Twilio::Rest::Chat::V1::Service::Channel.

roles

my $list = $object->roles;

my $context = $object->roles($sid);

See Twilio::Rest::Chat::V1::Service::Role.

users

my $list = $object->users;

my $context = $object->users($sid);

See Twilio::Rest::Chat::V1::Service::User.

ServiceInstance

See also Twilio::InstanceResource.

It has fetch, update, delete, 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 RFC 2822 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 RFC 2822 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 Roles endpoint for more details.

default_channel_role_sid

The channel role assigned to users when they are added to a channel. See the Roles endpoint for more details.

default_service_role_sid

The service role assigned to users when they are added to the service. See the Roles endpoint for more details.

friendly_name

The string that you assigned to describe the resource.

limits

An object that describes the limits of the service instance. The limits object contains channel_members to describe the members/channel limit and user_channels to describe the channels/user limit. channel_members can be 1,000 or less, with a default of 250. user_channels can be 1,000 or less, with a default value of 100.

The absolute URLs of the Service's Channels, Roles, and Users.

notifications

The notification configuration for the Service instance. See Push Notification Configuration for more information.

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_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 typing event until clients should assume that user is no longer typing, even if no ended typing message 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_url and post_webhook_url webhooks. Can be: POST or GET and the default is POST. See Webhook Events for more details.

webhooks

An object that contains information about the webhooks configured for this service.

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.