NAME
Twilio::Rest::Taskrouter::V1::Workspace::TaskQueue - The TaskQueue resource
SYNOPSIS
my $client = Twilio::Rest::Client->new($account_sid, $auth_token);
my $task_queue = $client->taskrouter->v1->workspaces($workspace_sid)->task_queues->create($friendly_name, \%options);
for my $task_queue ($client->taskrouter->v1->workspaces($workspace_sid)->task_queues->read({}, 20)) {
...
}
my $task_queue = $client->taskrouter->v1->workspaces($workspace_sid)->task_queues($sid)->fetch;
$client->taskrouter->v1->workspaces($workspace_sid)->task_queues($sid)->update(\%options);
$client->taskrouter->v1->workspaces($workspace_sid)->task_queues($sid)->delete;
DESCRIPTION
This file holds TaskQueueList, TaskQueuePage, TaskQueueContext and TaskQueueInstance. Methods that make a request throw Twilio::Exceptions::RestException on an error response.
TaskQueueList
Returned by $client->taskrouter->v1->workspaces($workspace_sid)->task_queues. See also Twilio::ListResource.
create
my $task_queue = $client->taskrouter->v1->workspaces($workspace_sid)->task_queues->create($friendly_name, \%options);
Returns a TaskQueueInstance.
The required values are:
$friendly_name-
A descriptive string that you create to describe the TaskQueue. For example
Support-Tier 1,Sales, orEscalation.
The options are:
assignment_activity_sid-
The SID of the Activity to assign Workers when a task is assigned to them.
max_reserved_workers-
The maximum number of Workers to reserve for the assignment of a Task in the queue. Can be an integer between 1 and 50, inclusive and defaults to 1.
reservation_activity_sid-
The SID of the Activity to assign Workers when a task is reserved for them.
target_workers-
A string that describes the Worker selection criteria for any Tasks that enter the TaskQueue. For example,
'"language" == "spanish"'. The default value is1==1. If this value is empty, Tasks will wait in the TaskQueue until they are deleted or moved to another TaskQueue. For more information about Worker selection, see Describing Worker selection criteria. task_order-
One of
FIFOorLIFO.
read
my @records = $client->taskrouter->v1->workspaces($workspace_sid)->task_queues->read(\%options, $limit, $page_size);
Returns the records as a list, fetching as many pages as it needs.
The options are:
evaluate_worker_attributes-
The attributes of the Workers to read. Returns the TaskQueues with Workers that match the attributes specified in this parameter.
friendly_name-
The
friendly_nameof the TaskQueue resources to read. ordering-
Sorting parameter for TaskQueues
worker_sid-
The SID of the Worker with the TaskQueue resources to read.
stream
my $stream = $client->taskrouter->v1->workspaces($workspace_sid)->task_queues->stream(\%options, $limit, $page_size);
Takes the same arguments as "read", and returns a Twilio::Stream.
page
my $page = $client->taskrouter->v1->workspaces($workspace_sid)->task_queues->page(\%options, $page_size, $page_token, $page_number);
Fetches one page, and returns a Twilio::Page.
get_page
my $page = $client->taskrouter->v1->workspaces($workspace_sid)->task_queues->get_page($url);
Fetches the page at a URL given by Twilio.
get_context
my $context = $client->taskrouter->v1->workspaces($workspace_sid)->task_queues->get_context($sid);
Returns a TaskQueueContext, and makes no request.
bulk_real_time_statistics
my $list = $object->bulk_real_time_statistics;
See Twilio::Rest::Taskrouter::V1::Workspace::TaskQueue::TaskQueueBulkRealTimeStatistics.
statistics
my $list = $object->statistics;
See Twilio::Rest::Taskrouter::V1::Workspace::TaskQueue::TaskQueuesStatistics.
TaskQueuePage
A Twilio::Page of TaskQueueInstance objects.
records_key
build_instance
Used by Twilio::Page.
TaskQueueContext
Returned by $client->taskrouter->v1->workspaces($workspace_sid)->task_queues($sid). It makes no request until one of these methods is called.
fetch
my $task_queue = $client->taskrouter->v1->workspaces($workspace_sid)->task_queues($sid)->fetch;
Returns a TaskQueueInstance.
update
my $task_queue = $client->taskrouter->v1->workspaces($workspace_sid)->task_queues($sid)->update(\%options);
Returns a TaskQueueInstance.
The options are:
assignment_activity_sid-
The SID of the Activity to assign Workers when a task is assigned for them.
friendly_name-
A descriptive string that you create to describe the TaskQueue. For example
Support-Tier 1,Sales, orEscalation. max_reserved_workers-
The maximum number of Workers to create reservations for the assignment of a task while in the queue. Maximum of 50.
reservation_activity_sid-
The SID of the Activity to assign Workers when a task is reserved for them.
target_workers-
A string describing the Worker selection criteria for any Tasks that enter the TaskQueue. For example '"language" == "spanish"' If no TargetWorkers parameter is provided, Tasks will wait in the queue until they are either deleted or moved to another queue. Additional examples on how to describing Worker selection criteria below.
task_order-
One of
FIFOorLIFO.
delete
$client->taskrouter->v1->workspaces($workspace_sid)->task_queues($sid)->delete;
Returns true.
cumulative_statistics
my $context = $object->cumulative_statistics;
See Twilio::Rest::Taskrouter::V1::Workspace::TaskQueue::TaskQueueCumulativeStatistics.
real_time_statistics
my $context = $object->real_time_statistics;
See Twilio::Rest::Taskrouter::V1::Workspace::TaskQueue::TaskQueueRealTimeStatistics.
statistics
my $context = $object->statistics;
See Twilio::Rest::Taskrouter::V1::Workspace::TaskQueue::TaskQueueStatistics.
TaskQueueInstance
See also Twilio::InstanceResource.
It has fetch, update, delete, cumulative_statistics, real_time_statistics and statistics, which work as they do on the context.
Its fields are:
- account_sid
-
The SID of the Account that created the TaskQueue resource.
- assignment_activity_name
-
The name of the Activity to assign Workers when a task is assigned for them.
- assignment_activity_sid
-
The SID of the Activity to assign Workers when a task is assigned for them.
- 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.
- links
-
The URLs of related resources.
- max_reserved_workers
-
The maximum number of Workers to reserve for the assignment of a task in the queue. Can be an integer between 1 and 50, inclusive and defaults to 1.
- reservation_activity_name
-
The name of the Activity to assign Workers once a task is reserved for them.
- reservation_activity_sid
-
The SID of the Activity to assign Workers once a task is reserved for them.
- sid
-
The unique string that we created to identify the TaskQueue resource.
- target_workers
-
A string describing the Worker selection criteria for any Tasks that enter the TaskQueue. For example
'"language" == "spanish"'If no TargetWorkers parameter is provided, Tasks will wait in the TaskQueue until they are either deleted or moved to another TaskQueue. Additional examples on how to describing Worker selection criteria below. Defaults to 1==1. - task_order
-
One of
FIFOorLIFO. - url
-
The absolute URL of the TaskQueue resource.
- workspace_sid
-
The SID of the Workspace that contains the TaskQueue.
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.