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:
trueorfalseand the default isfalse. 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. Can be:
trueorfalseand the default isfalse. 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_new_message_enabled-
Whether to send a notification when a new message is added to a channel. Can be:
trueorfalseand the default isfalse. 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. Can be:
trueorfalseand the default isfalse. 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_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 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. webhooks_on_channel_add_method-
The HTTP method to use when calling the
webhooks.on_channel_add.url. One ofGETorPOST. webhooks_on_channel_add_url-
The URL of the webhook to call in response to the
on_channel_addevent using thewebhooks.on_channel_add.methodHTTP method. webhooks_on_channel_added_method-
The URL of the webhook to call in response to the
on_channel_addedevent`. One ofGETorPOST. webhooks_on_channel_added_url-
The URL of the webhook to call in response to the
on_channel_addedevent using thewebhooks.on_channel_added.methodHTTP method. webhooks_on_channel_destroy_method-
The HTTP method to use when calling the
webhooks.on_channel_destroy.url. One ofGETorPOST. webhooks_on_channel_destroy_url-
The URL of the webhook to call in response to the
on_channel_destroyevent using thewebhooks.on_channel_destroy.methodHTTP method. webhooks_on_channel_destroyed_method-
The HTTP method to use when calling the
webhooks.on_channel_destroyed.url. One ofGETorPOST. webhooks_on_channel_destroyed_url-
The URL of the webhook to call in response to the
on_channel_addedevent using thewebhooks.on_channel_destroyed.methodHTTP method. webhooks_on_channel_update_method-
The HTTP method to use when calling the
webhooks.on_channel_update.url. One ofGETorPOST. webhooks_on_channel_update_url-
The URL of the webhook to call in response to the
on_channel_updateevent using thewebhooks.on_channel_update.methodHTTP method. webhooks_on_channel_updated_method-
The HTTP method to use when calling the
webhooks.on_channel_updated.url. One ofGETorPOST. webhooks_on_channel_updated_url-
The URL of the webhook to call in response to the
on_channel_updatedevent using thewebhooks.on_channel_updated.methodHTTP method. webhooks_on_member_add_method-
The HTTP method to use when calling the
webhooks.on_member_add.url. One ofGETorPOST. webhooks_on_member_add_url-
The URL of the webhook to call in response to the
on_member_addevent using thewebhooks.on_member_add.methodHTTP method. webhooks_on_member_added_method-
The HTTP method to use when calling the
webhooks.on_channel_updated.url. One ofGETorPOST. webhooks_on_member_added_url-
The URL of the webhook to call in response to the
on_channel_updatedevent using thewebhooks.on_channel_updated.methodHTTP method. webhooks_on_member_remove_method-
The HTTP method to use when calling the
webhooks.on_member_remove.url. One ofGETorPOST. webhooks_on_member_remove_url-
The URL of the webhook to call in response to the
on_member_removeevent using thewebhooks.on_member_remove.methodHTTP method. webhooks_on_member_removed_method-
The HTTP method to use when calling the
webhooks.on_member_removed.url. One ofGETorPOST. webhooks_on_member_removed_url-
The URL of the webhook to call in response to the
on_member_removedevent using thewebhooks.on_member_removed.methodHTTP method. webhooks_on_message_remove_method-
The HTTP method to use when calling the
webhooks.on_message_remove.url. One ofGETorPOST. webhooks_on_message_remove_url-
The URL of the webhook to call in response to the
on_message_removeevent using thewebhooks.on_message_remove.methodHTTP method. webhooks_on_message_removed_method-
The HTTP method to use when calling the
webhooks.on_message_removed.url. One ofGETorPOST. webhooks_on_message_removed_url-
The URL of the webhook to call in response to the
on_message_removedevent using thewebhooks.on_message_removed.methodHTTP method. webhooks_on_message_send_method-
The HTTP method to use when calling the
webhooks.on_message_send.url. One ofGETorPOST. webhooks_on_message_send_url-
The URL of the webhook to call in response to the
on_message_sendevent using thewebhooks.on_message_send.methodHTTP method. webhooks_on_message_sent_method-
The URL of the webhook to call in response to the
on_message_sentevent`. One ofGETorPOST. webhooks_on_message_sent_url-
The URL of the webhook to call in response to the
on_message_sentevent using thewebhooks.on_message_sent.methodHTTP method. webhooks_on_message_update_method-
The HTTP method to use when calling the
webhooks.on_message_update.url. One ofGETorPOST. webhooks_on_message_update_url-
The URL of the webhook to call in response to the
on_message_updateevent using thewebhooks.on_message_update.methodHTTP method. webhooks_on_message_updated_method-
The HTTP method to use when calling the
webhooks.on_message_updated.url. One ofGETorPOST. webhooks_on_message_updated_url-
The URL of the webhook to call in response to the
on_message_updatedevent using thewebhooks.on_message_updated.methodHTTP 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
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, 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 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. - 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.