NAME

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

SYNOPSIS

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

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

create

my $user = $client->chat->v1->services($service_sid)->users->create($identity, \%options);

Returns a UserInstance.

The required values are:

$identity

The identity value 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 details.

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 assigned to the new User.

read

my @records = $client->chat->v1->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->v1->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->v1->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->v1->services($service_sid)->users->get_page($url);

Fetches the page at a URL given by Twilio.

get_context

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

fetch

my $user = $client->chat->v1->services($service_sid)->users($sid)->fetch;

Returns a UserInstance.

update

my $user = $client->chat->v1->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 assigned to this user.

delete

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

Returns true.

user_channels

my $list = $object->user_channels;

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

UserInstance

See also Twilio::InstanceResource.

It has fetch, update, delete 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. Note If this property has been assigned a value, it's only displayed in a FETCH action that returns a single resource; otherwise, it's null. If the attributes have not been set, {} is returned.

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.

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. 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; otherwise false. This value is only returned by Fetch actions that return a single resource and null is always returned by a Read action. This value is null if the Service's reachability_enabled is false, and if the User has never had a notification registration, even if the Service's reachability_enabled is true.

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 null is always returned by a Read action. This value is null if the Service's reachability_enabled is false, if the User has never been online for the Service instance, even if the Service's reachability_enabled is true.

joined_channels_count

The number of Channels this User is a Member of.

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 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.