NAME

Twilio::Rest::FlexApi::V1::Channel - The Channel resource

SYNOPSIS

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

my $channel = $client->flex_api->v1->channel->create($flex_flow_sid, $identity, $chat_user_friendly_name, $chat_friendly_name, \%options);
for my $channel ($client->flex_api->v1->channel->read({}, 20)) {
  ...
}
my $channel = $client->flex_api->v1->channel($sid)->fetch;
$client->flex_api->v1->channel($sid)->delete;

DESCRIPTION

Flex chat channels

This file holds ChannelList, ChannelPage, ChannelContext and ChannelInstance. Methods that make a request throw Twilio::Exceptions::RestException on an error response.

ChannelList

Returned by $client->flex_api->v1->channel. See also Twilio::ListResource.

create

my $channel = $client->flex_api->v1->channel->create($flex_flow_sid, $identity, $chat_user_friendly_name, $chat_friendly_name, \%options);

Returns a ChannelInstance.

The required values are:

$flex_flow_sid

The SID of the Flex Flow.

$identity

The identity value that uniquely identifies the new resource's chat User.

$chat_user_friendly_name

The chat participant's friendly name.

$chat_friendly_name

The chat channel's friendly name.

The options are:

chat_unique_name

The chat channel's unique name.

long_lived

Whether to create the channel as long-lived.

pre_engagement_data

The pre-engagement data.

target

The Target Contact Identity, for example the phone number of an SMS.

task_attributes

The Task attributes to be added for the TaskRouter Task.

task_sid

The SID of the TaskRouter Task. Only valid when integration type is task. null for integration types studio & external

read

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

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

stream

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

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

page

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

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

get_page

my $page = $client->flex_api->v1->channel->get_page($url);

Fetches the page at a URL given by Twilio.

get_context

my $context = $client->flex_api->v1->channel->get_context($sid);

Returns a ChannelContext, and makes no request.

ChannelPage

A Twilio::Page of ChannelInstance objects.

records_key

build_instance

Used by Twilio::Page.

ChannelContext

Returned by $client->flex_api->v1->channel($sid). It makes no request until one of these methods is called.

fetch

my $channel = $client->flex_api->v1->channel($sid)->fetch;

Returns a ChannelInstance.

delete

$client->flex_api->v1->channel($sid)->delete;

Returns true.

ChannelInstance

See also Twilio::InstanceResource.

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

Its fields are:

account_sid

The SID of the Account that created the Channel resource and owns this Workflow.

date_created

The date and time in GMT when the Flex chat channel 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 Flex chat channel was last updated specified in ISO 8601 format. A Time::Piece object in UTC. See "date_time" in Twilio::Deserialize.

flex_flow_sid

The SID of the Flex Flow.

sid

The unique string that we created to identify the Channel resource.

task_sid

The SID of the TaskRouter Task. Only valid when integration type is task. null for integration types studio & external

url

The absolute URL of the Flex chat channel resource.

user_sid

The SID of the chat user.

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.