NAME
Twilio::Rest::Chat::V2::Service::User - The User resource
SYNOPSIS
my $client = Twilio::Rest::Client->new($account_sid, $auth_token);
my $user = $client->chat->v2->services($service_sid)->users->create($identity, \%options);
for my $user ($client->chat->v2->services($service_sid)->users->read({}, 20)) {
...
}
my $user = $client->chat->v2->services($service_sid)->users($sid)->fetch;
$client->chat->v2->services($service_sid)->users($sid)->update(\%options);
$client->chat->v2->services($service_sid)->users($sid)->delete;
DESCRIPTION
Unique chat users within a chat service
This file holds UserList, UserPage, UserContext and UserInstance. Methods that make a request throw Twilio::Exceptions::RestException on an error response.
UserList
Returned by $client->chat->v2->services($service_sid)->users. See also Twilio::ListResource.
create
my $user = $client->chat->v2->services($service_sid)->users->create($identity, \%options);
Returns a UserInstance.
The required values are:
$identity-
The
identityvalue that uniquely identifies the new resource's User within the Service. This value is often a username or email address. See the Identity documentation for more info.
The options are:
attributes-
A valid JSON string that contains application-specific data.
friendly_name-
A descriptive string that you create to describe the new resource. This value is often used for display purposes.
role_sid-
The SID of the Role to assign to the new User.
x_twilio_webhook_enabled-
The X-Twilio-Webhook-Enabled HTTP request header One of
trueorfalse.
read
my @records = $client->chat->v2->services($service_sid)->users->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($service_sid)->users->stream(\%options, $limit, $page_size);
Takes the same arguments as "read", and returns a Twilio::Stream.
page
my $page = $client->chat->v2->services($service_sid)->users->page(\%options, $page_size, $page_token, $page_number);
Fetches one page, and returns a Twilio::Page.
get_page
my $page = $client->chat->v2->services($service_sid)->users->get_page($url);
Fetches the page at a URL given by Twilio.
get_context
my $context = $client->chat->v2->services($service_sid)->users->get_context($sid);
Returns a UserContext, and makes no request.
UserPage
A Twilio::Page of UserInstance objects.
records_key
build_instance
Used by Twilio::Page.
UserContext
Returned by $client->chat->v2->services($service_sid)->users($sid). It makes no request until one of these methods is called.
fetch
my $user = $client->chat->v2->services($service_sid)->users($sid)->fetch;
Returns a UserInstance.
update
my $user = $client->chat->v2->services($service_sid)->users($sid)->update(\%options);
Returns a UserInstance.
The options are:
attributes-
A valid JSON string that contains application-specific data.
friendly_name-
A descriptive string that you create to describe the resource. It is often used for display purposes.
role_sid-
The SID of the Role to assign to the User.
x_twilio_webhook_enabled-
The X-Twilio-Webhook-Enabled HTTP request header One of
trueorfalse.
delete
$client->chat->v2->services($service_sid)->users($sid)->delete;
Returns true.
user_bindings
my $list = $object->user_bindings;
my $context = $object->user_bindings($sid);
See Twilio::Rest::Chat::V2::Service::User::UserBinding.
user_channels
my $list = $object->user_channels;
my $context = $object->user_channels($channel_sid);
See Twilio::Rest::Chat::V2::Service::User::UserChannel.
UserInstance
See also Twilio::InstanceResource.
It has fetch, update, delete, user_bindings and user_channels, which work as they do on the context.
Its fields are:
- account_sid
-
The SID of the Account that created the User resource.
- attributes
-
The JSON string that stores application-specific data. If attributes have not been set,
{}is returned. - 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.
- identity
-
The application-defined string that uniquely identifies the resource's User within the Service. This value is often a username or an email address, and is case-sensitive. See access tokens for more info.
- is_notifiable
-
Whether the User has a potentially valid Push Notification registration (APN or GCM) for the Service instance. If at least one registration exists,
true; otherwisefalse. This value is only returned by Fetch actions that return a single resource andnullis always returned by a Read action. This value isnullif the Service'sreachability_enabledisfalse, and if the User has never had a notification registration, even if the Service'sreachability_enabledistrue. - is_online
-
Whether the User is actively connected to the Service instance and online. This value is only returned by Fetch actions that return a single resource and
nullis always returned by a Read action. This value isnullif the Service'sreachability_enabledisfalse, if the User has never been online for the Service instance, even if the Service'sreachability_enabledistrue. - joined_channels_count
-
The number of Channels the User is a Member of.
- links
-
The absolute URLs of the Channel and Binding resources related to the user.
- role_sid
-
The SID of the Role assigned to the user.
- service_sid
-
The SID of the Service the User resource is associated with.
- sid
-
The unique string that we created to identify the User resource.
- url
-
The absolute URL of the User 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.