NAME
Twilio::Rest::Taskrouter::V1::Workspace - The Workspace resource
SYNOPSIS
my $client = Twilio::Rest::Client->new($account_sid, $auth_token);
my $workspace = $client->taskrouter->v1->workspaces->create($friendly_name, \%options);
for my $workspace ($client->taskrouter->v1->workspaces->read({}, 20)) {
...
}
my $workspace = $client->taskrouter->v1->workspaces($sid)->fetch;
$client->taskrouter->v1->workspaces($sid)->update(\%options);
$client->taskrouter->v1->workspaces($sid)->delete;
DESCRIPTION
This file holds WorkspaceList, WorkspacePage, WorkspaceContext and WorkspaceInstance. Methods that make a request throw Twilio::Exceptions::RestException on an error response.
WorkspaceList
Returned by $client->taskrouter->v1->workspaces. See also Twilio::ListResource.
create
my $workspace = $client->taskrouter->v1->workspaces->create($friendly_name, \%options);
Returns a WorkspaceInstance.
The required values are:
$friendly_name-
A descriptive string that you create to describe the Workspace resource. It can be up to 64 characters long. For example:
Customer Supportor2014 Election Campaign.
The options are:
event_callback_url-
The URL we should call when an event occurs. If provided, the Workspace will publish events to this URL, for example, to collect data for reporting. See Workspace Events for more information. This parameter supports Twilio's Webhooks (HTTP callbacks) Connection Overrides.
events_filter-
The list of Workspace events for which to call event_callback_url. For example, if
EventsFilter=task.created, task.canceled, worker.activity.update, then TaskRouter will call event_callback_url only when a task is created, canceled, or a Worker activity is updated. multi_task_enabled-
Whether to enable multi-tasking. Can be:
trueto enable multi-tasking, orfalseto disable it. However, all workspaces should be created as multi-tasking. The default istrue. Multi-tasking allows Workers to handle multiple Tasks simultaneously. When enabled (true), each Worker can receive parallel reservations up to the per-channel maximums defined in the Workers section. In single-tasking mode (legacy mode), each Worker will only receive a new reservation when the previous task is completed. Learn more at Multitasking. prioritize_queue_order-
One of
FIFOorLIFO. template-
An available template name. Can be:
NONEorFIFOand the default isNONE. Pre-configures the Workspace with the Workflow and Activities specified in the template.NONEwill create a Workspace with only a set of default activities.FIFOwill configure TaskRouter with a set of default activities and a single TaskQueue for first-in, first-out distribution, which can be useful when you are getting started with TaskRouter.
read
my @records = $client->taskrouter->v1->workspaces->read(\%options, $limit, $page_size);
Returns the records as a list, fetching as many pages as it needs.
The options are:
friendly_name-
The
friendly_nameof the Workspace resources to read. For exampleCustomer Supportor2014 Election Campaign.
stream
my $stream = $client->taskrouter->v1->workspaces->stream(\%options, $limit, $page_size);
Takes the same arguments as "read", and returns a Twilio::Stream.
page
my $page = $client->taskrouter->v1->workspaces->page(\%options, $page_size, $page_token, $page_number);
Fetches one page, and returns a Twilio::Page.
get_page
my $page = $client->taskrouter->v1->workspaces->get_page($url);
Fetches the page at a URL given by Twilio.
get_context
my $context = $client->taskrouter->v1->workspaces->get_context($sid);
Returns a WorkspaceContext, and makes no request.
WorkspacePage
A Twilio::Page of WorkspaceInstance objects.
records_key
build_instance
Used by Twilio::Page.
WorkspaceContext
Returned by $client->taskrouter->v1->workspaces($sid). It makes no request until one of these methods is called.
fetch
my $workspace = $client->taskrouter->v1->workspaces($sid)->fetch;
Returns a WorkspaceInstance.
update
my $workspace = $client->taskrouter->v1->workspaces($sid)->update(\%options);
Returns a WorkspaceInstance.
The options are:
default_activity_sid-
The SID of the Activity that will be used when new Workers are created in the Workspace.
event_callback_url-
The URL we should call when an event occurs. See Workspace Events for more information. This parameter supports Twilio's Webhooks (HTTP callbacks) Connection Overrides.
events_filter-
The list of Workspace events for which to call event_callback_url. For example if
EventsFilter=task.created,task.canceled,worker.activity.update, then TaskRouter will call event_callback_url only when a task is created, canceled, or a Worker activity is updated. friendly_name-
A descriptive string that you create to describe the Workspace resource. For example:
Sales Call CenterorCustomer Support Team. multi_task_enabled-
Whether to enable multi-tasking. Can be:
trueto enable multi-tasking, orfalseto disable it. However, all workspaces should be maintained as multi-tasking. There is no default when omitting this parameter. A multi-tasking Workspace can't be updated to single-tasking unless it is not a Flex Project and another (legacy) single-tasking Workspace exists. Multi-tasking allows Workers to handle multiple Tasks simultaneously. In multi-tasking mode, each Worker can receive parallel reservations up to the per-channel maximums defined in the Workers section. In single-tasking mode (legacy mode), each Worker will only receive a new reservation when the previous task is completed. Learn more at Multitasking. prioritize_queue_order-
One of
FIFOorLIFO. timeout_activity_sid-
The SID of the Activity that will be assigned to a Worker when a Task reservation times out without a response.
delete
$client->taskrouter->v1->workspaces($sid)->delete;
Returns true.
activities
my $list = $object->activities;
my $context = $object->activities($sid);
See Twilio::Rest::Taskrouter::V1::Workspace::Activity.
events
my $list = $object->events;
my $context = $object->events($sid);
See Twilio::Rest::Taskrouter::V1::Workspace::Event.
tasks
my $list = $object->tasks;
my $context = $object->tasks($sid);
See Twilio::Rest::Taskrouter::V1::Workspace::Task.
task_channels
my $list = $object->task_channels;
my $context = $object->task_channels($sid);
See Twilio::Rest::Taskrouter::V1::Workspace::TaskChannel.
task_queues
my $list = $object->task_queues;
my $context = $object->task_queues($sid);
See Twilio::Rest::Taskrouter::V1::Workspace::TaskQueue.
workers
my $list = $object->workers;
my $context = $object->workers($sid);
See Twilio::Rest::Taskrouter::V1::Workspace::Worker.
workflows
my $list = $object->workflows;
my $context = $object->workflows($sid);
See Twilio::Rest::Taskrouter::V1::Workspace::Workflow.
cumulative_statistics
my $context = $object->cumulative_statistics;
See Twilio::Rest::Taskrouter::V1::Workspace::WorkspaceCumulativeStatistics.
real_time_statistics
my $context = $object->real_time_statistics;
See Twilio::Rest::Taskrouter::V1::Workspace::WorkspaceRealTimeStatistics.
statistics
my $context = $object->statistics;
See Twilio::Rest::Taskrouter::V1::Workspace::WorkspaceStatistics.
WorkspaceInstance
See also Twilio::InstanceResource.
It has fetch, update, delete, activities, events, tasks, task_channels, task_queues, workers, workflows, 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 Workspace resource.
- 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.
- default_activity_name
-
The name of the default activity.
- default_activity_sid
-
The SID of the Activity that will be used when new Workers are created in the Workspace.
- event_callback_url
-
The URL we call when an event occurs. If provided, the Workspace will publish events to this URL, for example, to collect data for reporting. See Workspace Events for more information. This parameter supports Twilio's Webhooks (HTTP callbacks) Connection Overrides.
- events_filter
-
The list of Workspace events for which to call
event_callback_url. For example, ifEventsFilter=task.created, task.canceled, worker.activity.update, then TaskRouter will call event_callback_url only when a task is created, canceled, or a Worker activity is updated. - friendly_name
-
The string that you assigned to describe the Workspace resource. For example
Customer Supportor2014 Election Campaign. - links
-
The URLs of related resources.
- multi_task_enabled
-
Whether multi-tasking is enabled. The default is
true, which enables multi-tasking. Multi-tasking allows Workers to handle multiple Tasks simultaneously. When enabled (true), each Worker can receive parallel reservations up to the per-channel maximums defined in the Workers section. In single-tasking each Worker would only receive a new reservation when the previous task is completed. Learn more at Multitasking. - prioritize_queue_order
-
One of
FIFOorLIFO. - sid
-
The unique string that we created to identify the Workspace resource.
- timeout_activity_name
-
The name of the timeout activity.
- timeout_activity_sid
-
The SID of the Activity that will be assigned to a Worker when a Task reservation times out without a response.
- url
-
The absolute URL of the Workspace 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.