NAME

Twilio::Rest::Chat::V2::Service::User::UserChannel - The UserChannel resource

SYNOPSIS

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

for my $user_channel ($client->chat->v2->services($service_sid)->users($user_sid)->user_channels->read({}, 20)) {
  ...
}
my $user_channel = $client->chat->v2->services($service_sid)->users($user_sid)->user_channels($channel_sid)->fetch;
$client->chat->v2->services($service_sid)->users($user_sid)->user_channels($channel_sid)->update(\%options);
$client->chat->v2->services($service_sid)->users($user_sid)->user_channels($channel_sid)->delete;

DESCRIPTION

List of channels for a given user

This file holds UserChannelList, UserChannelPage, UserChannelContext and UserChannelInstance. Methods that make a request throw Twilio::Exceptions::RestException on an error response.

UserChannelList

Returned by $client->chat->v2->services($service_sid)->users($user_sid)->user_channels. See also Twilio::ListResource.

read

my @records = $client->chat->v2->services($service_sid)->users($user_sid)->user_channels->read(\%options, $limit, $page_size);

List all Channels for a given User. Returns the records as a list, fetching as many pages as it needs.

stream

my $stream = $client->chat->v2->services($service_sid)->users($user_sid)->user_channels->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($user_sid)->user_channels->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($user_sid)->user_channels->get_page($url);

Fetches the page at a URL given by Twilio.

get_context

my $context = $client->chat->v2->services($service_sid)->users($user_sid)->user_channels->get_context($channel_sid);

Returns a UserChannelContext, and makes no request.

UserChannelPage

A Twilio::Page of UserChannelInstance objects.

records_key

build_instance

Used by Twilio::Page.

UserChannelContext

Returned by $client->chat->v2->services($service_sid)->users($user_sid)->user_channels($channel_sid). It makes no request until one of these methods is called.

fetch

my $user_channel = $client->chat->v2->services($service_sid)->users($user_sid)->user_channels($channel_sid)->fetch;

Returns a UserChannelInstance.

update

my $user_channel = $client->chat->v2->services($service_sid)->users($user_sid)->user_channels($channel_sid)->update(\%options);

Returns a UserChannelInstance.

The options are:

last_consumed_message_index

The index of the last Message in the Channel that the Member has read.

last_consumption_timestamp

The ISO 8601 timestamp of the last Message read event for the Member within the Channel. A string, or an object with an epoch method. See "iso8601_date_time" in Twilio::Serialize.

notification_level

One of default or muted.

delete

$client->chat->v2->services($service_sid)->users($user_sid)->user_channels($channel_sid)->delete(\%options);

Removes User from selected Channel. Returns true.

The options are:

x_twilio_webhook_enabled

The X-Twilio-Webhook-Enabled HTTP request header One of true or false.

UserChannelInstance

See also Twilio::InstanceResource.

It has fetch, update and delete, which work as they do on the context.

Its fields are:

account_sid

The SID of the Account that created the User Channel resource.

channel_sid

The SID of the Channel the User Channel resource belongs to.

last_consumed_message_index

The index of the last Message in the Channel that the Member has read.

The absolute URLs of the Members, Messages , Invites and, if it exists, the last Message for the Channel.

member_sid

The SID of a Member that represents the User on the Channel.

notification_level

One of default or muted.

service_sid

The SID of the Service the User Channel resource is associated with.

status

One of joined, invited or notParticipating.

unread_messages_count

The number of unread Messages in the Channel for the User. Note that retrieving messages on a client endpoint does not mean that messages are consumed or read. See Consumption Horizon feature to learn how to mark messages as consumed.

url

The absolute URL of the User Channel resource.

user_sid

The SID of the User the User Channel belongs to.

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.