Skip to contentSkip to navigationSkip to topbar
Rate this page:
On this page

Workspace Resource


A Workspace is a container for your Tasks, Workers, TaskQueues, Workflows, and Activities. Each of these items exists within a single Workspace and is not shared across Workspaces. For example, if you were using TaskRouter to distribute tasks for two separate organizations in your business, you might create a Workspace for each organization.

(information)

Info

Please note that a Flex project can only have a single Workspace.

A single Workspace can hold a variety of task types, priorities, and workers with a variety of capabilities. A contact center might collect waiting phone calls, pending cases, and incoming chat requests into a single Workspace. Some of the phone calls in the Workspace might require an agent who speaks English, while others require an agent who speaks Spanish. Some of the tasks might originate from high-value customers, giving them a higher priority, while other tasks can wait longer before resolution.

(warning)

Warning

While we still support the creation of a single-tasking Workspace (legacy mode) we advise you to only create multi-tasking Workspaces.

We also encourage you to start the migration of all your existing single-tasking Workspaces to multi-tasking. Please be advised that once a Workspace has been migrated to multi-tasking it can longer be converted back to single-tasking.


Workspace Properties

workspace-properties page anchor
(warning)

Warning

Pagination is not supported under this resource. Please avoid usage of the page query parameter.

Property nameTypePIIDescription
account_sidSID<AC>
Not PII

The SID of the Account that created the Workspace resource.

Pattern: ^AC[0-9a-fA-F]{32}$Min length: 34Max length: 34

date_updatedstring<date-time>

The date and time in GMT when the resource was last updated specified in ISO 8601(link takes you to an external page) format.


default_activity_namestring

The name of the default activity.


default_activity_sidSID<WA>

The SID of the Activity that will be used when new Workers are created in the Workspace.

Pattern: ^WA[0-9a-fA-F]{32}$Min length: 34Max length: 34

event_callback_urlstring<uri>

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_filterstring

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_namestring
PII MTL: 30 days

The string that you assigned to describe the Workspace resource. For example Customer Support or 2014 Election Campaign.


multi_task_enabledboolean

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.


sidSID<WS>

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

Pattern: ^WS[0-9a-fA-F]{32}$Min length: 34Max length: 34

timeout_activity_namestring

The name of the timeout activity.


timeout_activity_sidSID<WA>

The SID of the Activity that will be assigned to a Worker when a Task reservation times out without a response.

Pattern: ^WA[0-9a-fA-F]{32}$Min length: 34Max length: 34

prioritize_queue_orderenum<string>

The type of TaskQueue to prioritize when Workers are receiving Tasks from both types of TaskQueues. Can be: LIFO or FIFO and the default is FIFO. For more information, see Queue Ordering.

Possible values:
FIFOLIFO

urlstring<uri>

The absolute URL of the Workspace resource.


linksobject<uri-map>

The URLs of related resources.


Create a Workspace resource

create-a-workspace-resource page anchor
POST https://taskrouter.twilio.com/v1/Workspaces

Request body parameters

request-body-parameters page anchor
Property nameTypeRequiredPIIDescription
FriendlyNamestringrequired

A descriptive string that you create to describe the Workspace resource. It can be up to 64 characters long. For example: Customer Support or 2014 Election Campaign.


EventCallbackUrlstring<uri>Optional

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.


EventsFilterstringOptional

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.


MultiTaskEnabledbooleanOptional

Whether to enable multi-tasking. Can be: true to enable multi-tasking, or false to disable it. However, all workspaces should be created as multi-tasking. The default is true. 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.


TemplatestringOptional

An available template name. Can be: NONE or FIFO and the default is NONE. Pre-configures the Workspace with the Workflow and Activities specified in the template. NONE will create a Workspace with only a set of default activities. FIFO will 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.


PrioritizeQueueOrderenum<string>Optional

The type of TaskQueue to prioritize when Workers are receiving Tasks from both types of TaskQueues. Can be: LIFO or FIFO and the default is FIFO. For more information, see Queue Ordering.

Possible values:
FIFOLIFO

Create a Workspace

create-a-workspace page anchor
Node.js
Python
C#
Java
Go
PHP
Ruby
twilio-cli
curl

_20
// Download the helper library from https://www.twilio.com/docs/node/install
_20
const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";
_20
_20
// Find your Account SID and Auth Token at twilio.com/console
_20
// and set the environment variables. See http://twil.io/secure
_20
const accountSid = process.env.TWILIO_ACCOUNT_SID;
_20
const authToken = process.env.TWILIO_AUTH_TOKEN;
_20
const client = twilio(accountSid, authToken);
_20
_20
async function createWorkspace() {
_20
const workspace = await client.taskrouter.v1.workspaces.create({
_20
eventCallbackUrl: "https://workspace-example.free.beeceptor.com",
_20
friendlyName: "NewWorkspace",
_20
template: "FIFO",
_20
});
_20
_20
console.log(workspace.accountSid);
_20
}
_20
_20
createWorkspace();

Output

_29
{
_29
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
_29
"date_created": "2016-08-01T22:10:40Z",
_29
"date_updated": "2016-08-01T22:10:40Z",
_29
"default_activity_name": "Offline",
_29
"default_activity_sid": "WAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
_29
"event_callback_url": "https://workspace-example.free.beeceptor.com",
_29
"events_filter": null,
_29
"friendly_name": "NewWorkspace",
_29
"links": {
_29
"activities": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Activities",
_29
"statistics": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Statistics",
_29
"real_time_statistics": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/RealTimeStatistics",
_29
"cumulative_statistics": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/CumulativeStatistics",
_29
"task_queues": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/TaskQueues",
_29
"tasks": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Tasks",
_29
"workers": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Workers",
_29
"workflows": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Workflows",
_29
"task_channels": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/TaskChannels",
_29
"events": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Events"
_29
},
_29
"multi_task_enabled": false,
_29
"prioritize_queue_order": "FIFO",
_29
"sid": "WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
_29
"timeout_activity_name": "Offline",
_29
"timeout_activity_sid": "WAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
_29
"default_operating_unit_sid": "OUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
_29
"url": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
_29
}


Fetch a Workspace resource

fetch-a-workspace-resource page anchor
GET https://taskrouter.twilio.com/v1/Workspaces/{Sid}

Property nameTypeRequiredPIIDescription
SidSID<WS>required

The SID of the Workspace resource to fetch.

Pattern: ^WS[0-9a-fA-F]{32}$Min length: 34Max length: 34
Node.js
Python
C#
Java
Go
PHP
Ruby
twilio-cli
curl

_18
// Download the helper library from https://www.twilio.com/docs/node/install
_18
const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";
_18
_18
// Find your Account SID and Auth Token at twilio.com/console
_18
// and set the environment variables. See http://twil.io/secure
_18
const accountSid = process.env.TWILIO_ACCOUNT_SID;
_18
const authToken = process.env.TWILIO_AUTH_TOKEN;
_18
const client = twilio(accountSid, authToken);
_18
_18
async function fetchWorkspace() {
_18
const workspace = await client.taskrouter.v1
_18
.workspaces("WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")
_18
.fetch();
_18
_18
console.log(workspace.accountSid);
_18
}
_18
_18
fetchWorkspace();

Output

_29
{
_29
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
_29
"date_created": "2016-08-01T22:10:40Z",
_29
"date_updated": "2016-08-01T22:10:40Z",
_29
"default_activity_name": "Offline",
_29
"default_activity_sid": "WAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
_29
"event_callback_url": "",
_29
"events_filter": null,
_29
"friendly_name": "new",
_29
"links": {
_29
"activities": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Activities",
_29
"statistics": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Statistics",
_29
"real_time_statistics": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/RealTimeStatistics",
_29
"cumulative_statistics": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/CumulativeStatistics",
_29
"task_queues": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/TaskQueues",
_29
"tasks": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Tasks",
_29
"workers": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Workers",
_29
"workflows": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Workflows",
_29
"task_channels": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/TaskChannels",
_29
"events": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Events"
_29
},
_29
"multi_task_enabled": false,
_29
"prioritize_queue_order": "FIFO",
_29
"sid": "WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
_29
"timeout_activity_name": "Offline",
_29
"timeout_activity_sid": "WAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
_29
"default_operating_unit_sid": "OUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
_29
"url": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
_29
}


GET https://taskrouter.twilio.com/v1/Workspaces

By default, this will return the first 50 Workspaces. Supply a PageSize parameter to fetch more than 50 Workspaces. See pagination information for more information.

Property nameTypeRequiredPIIDescription
FriendlyNamestringOptional

The friendly_name of the Workspace resources to read. For example Customer Support or 2014 Election Campaign.


PageSizeintegerOptional

How many resources to return in each list page. The default is 50, and the maximum is 1000.

Minimum: 1Maximum: 1000

PageintegerOptional

The page index. This value is simply for client state.

Minimum: 0

PageTokenstringOptional

The page token. This is provided by the API.

List multiple Workspaces

list-multiple-workspaces page anchor
Node.js
Python
C#
Java
Go
PHP
Ruby
twilio-cli
curl

_16
// Download the helper library from https://www.twilio.com/docs/node/install
_16
const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";
_16
_16
// Find your Account SID and Auth Token at twilio.com/console
_16
// and set the environment variables. See http://twil.io/secure
_16
const accountSid = process.env.TWILIO_ACCOUNT_SID;
_16
const authToken = process.env.TWILIO_AUTH_TOKEN;
_16
const client = twilio(accountSid, authToken);
_16
_16
async function listWorkspace() {
_16
const workspaces = await client.taskrouter.v1.workspaces.list({ limit: 20 });
_16
_16
workspaces.forEach((w) => console.log(w.accountSid));
_16
}
_16
_16
listWorkspace();

Output

_42
{
_42
"meta": {
_42
"first_page_url": "https://taskrouter.twilio.com/v1/Workspaces?FriendlyName=friendly_name&PageSize=50&Page=0",
_42
"key": "workspaces",
_42
"next_page_url": null,
_42
"page": 0,
_42
"page_size": 50,
_42
"previous_page_url": null,
_42
"url": "https://taskrouter.twilio.com/v1/Workspaces?FriendlyName=friendly_name&PageSize=50&Page=0"
_42
},
_42
"workspaces": [
_42
{
_42
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
_42
"date_created": "2016-08-01T22:10:40Z",
_42
"date_updated": "2016-08-01T22:10:40Z",
_42
"default_activity_name": "Offline",
_42
"default_activity_sid": "WAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
_42
"event_callback_url": "",
_42
"events_filter": null,
_42
"friendly_name": "new",
_42
"links": {
_42
"activities": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Activities",
_42
"statistics": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Statistics",
_42
"real_time_statistics": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/RealTimeStatistics",
_42
"cumulative_statistics": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/CumulativeStatistics",
_42
"task_queues": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/TaskQueues",
_42
"tasks": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Tasks",
_42
"workers": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Workers",
_42
"workflows": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Workflows",
_42
"task_channels": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/TaskChannels",
_42
"events": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Events"
_42
},
_42
"multi_task_enabled": false,
_42
"prioritize_queue_order": "FIFO",
_42
"sid": "WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
_42
"timeout_activity_name": "Offline",
_42
"timeout_activity_sid": "WAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
_42
"default_operating_unit_sid": "OUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
_42
"url": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
_42
}
_42
]
_42
}


Update a Workspace resource

update-a-workspace-resource page anchor
POST https://taskrouter.twilio.com/v1/Workspaces/{Sid}

Property nameTypeRequiredPIIDescription
SidSID<WS>required

The SID of the Workspace resource to update.

Pattern: ^WS[0-9a-fA-F]{32}$Min length: 34Max length: 34
Property nameTypeRequiredPIIDescription
DefaultActivitySidSID<WA>Optional

The SID of the Activity that will be used when new Workers are created in the Workspace.

Pattern: ^WA[0-9a-fA-F]{32}$Min length: 34Max length: 34

EventCallbackUrlstring<uri>Optional

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.


EventsFilterstringOptional

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.


FriendlyNamestringOptional

A descriptive string that you create to describe the Workspace resource. For example: Sales Call Center or Customer Support Team.


MultiTaskEnabledbooleanOptional

Whether to enable multi-tasking. Can be: true to enable multi-tasking, or false to 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.


TimeoutActivitySidSID<WA>Optional

The SID of the Activity that will be assigned to a Worker when a Task reservation times out without a response.

Pattern: ^WA[0-9a-fA-F]{32}$Min length: 34Max length: 34

PrioritizeQueueOrderenum<string>Optional

The type of TaskQueue to prioritize when Workers are receiving Tasks from both types of TaskQueues. Can be: LIFO or FIFO. For more information, see Queue Ordering.

Possible values:
FIFOLIFO
Node.js
Python
C#
Java
Go
PHP
Ruby
twilio-cli
curl

_21
// Download the helper library from https://www.twilio.com/docs/node/install
_21
const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";
_21
_21
// Find your Account SID and Auth Token at twilio.com/console
_21
// and set the environment variables. See http://twil.io/secure
_21
const accountSid = process.env.TWILIO_ACCOUNT_SID;
_21
const authToken = process.env.TWILIO_AUTH_TOKEN;
_21
const client = twilio(accountSid, authToken);
_21
_21
async function updateWorkspace() {
_21
const workspace = await client.taskrouter.v1
_21
.workspaces("WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")
_21
.update({
_21
eventCallbackUrl: "https://new-workspace-callback.free.beeceptor.com",
_21
friendlyName: "NewWorkspaceName",
_21
});
_21
_21
console.log(workspace.accountSid);
_21
}
_21
_21
updateWorkspace();

Output

_29
{
_29
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
_29
"date_created": "2016-08-01T22:10:40Z",
_29
"date_updated": "2016-08-01T22:10:40Z",
_29
"default_activity_name": "Offline",
_29
"default_activity_sid": "WAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
_29
"event_callback_url": "https://new-workspace-callback.free.beeceptor.com",
_29
"events_filter": null,
_29
"friendly_name": "NewWorkspaceName",
_29
"links": {
_29
"activities": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Activities",
_29
"statistics": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Statistics",
_29
"real_time_statistics": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/RealTimeStatistics",
_29
"cumulative_statistics": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/CumulativeStatistics",
_29
"task_queues": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/TaskQueues",
_29
"tasks": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Tasks",
_29
"workers": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Workers",
_29
"workflows": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Workflows",
_29
"task_channels": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/TaskChannels",
_29
"events": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Events"
_29
},
_29
"multi_task_enabled": false,
_29
"prioritize_queue_order": "FIFO",
_29
"sid": "WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
_29
"timeout_activity_name": "Offline",
_29
"timeout_activity_sid": "WAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
_29
"default_operating_unit_sid": "OUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
_29
"url": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
_29
}


Delete a Workspace resource

delete-a-workspace-resource page anchor
DELETE https://taskrouter.twilio.com/v1/Workspaces/{Sid}

Property nameTypeRequiredPIIDescription
SidSID<WS>required

The SID of the Workspace resource to delete.

Pattern: ^WS[0-9a-fA-F]{32}$Min length: 34Max length: 34
Node.js
Python
C#
Java
Go
PHP
Ruby
twilio-cli
curl

_16
// Download the helper library from https://www.twilio.com/docs/node/install
_16
const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";
_16
_16
// Find your Account SID and Auth Token at twilio.com/console
_16
// and set the environment variables. See http://twil.io/secure
_16
const accountSid = process.env.TWILIO_ACCOUNT_SID;
_16
const authToken = process.env.TWILIO_AUTH_TOKEN;
_16
const client = twilio(accountSid, authToken);
_16
_16
async function deleteWorkspace() {
_16
await client.taskrouter.v1
_16
.workspaces("WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")
_16
.remove();
_16
}
_16
_16
deleteWorkspace();


Workspace Instance Subresources

workspace-instance-subresources page anchor

Every Workspace supports the following subresources.

/v1/Workspaces/{WorkspaceSid}/Workers

Represents the resources that can process Tasks from this Workflow, such as agents in a call center or people working a help desk. See the Worker Resource for more information.

/v1/Workspaces/{WorkspaceSid}/Activities

A worker's availability to handle a task is controlled by its Activity. Activities describe what a worker is currently doing and provide a meaningful label for real-time worker statistics. See the Activity Resource for more information.

/v1/Workspaces/{WorkspaceSid}/TaskQueues

TaskQueues hold tasks that are waiting to be assigned to Workers. Each TaskQueue specifies the capabilities workers must have to receive tasks from the queue. See [TaskQueues][taskqueues] for more information.

/v1/Workspaces/{WorkspaceSid}/Workflows

Workflows control how Tasks will be prioritized and routed to queues. Workflows can also escalate a Task's priority, move a Task to another queue after a timeout, or remove a Task from the Workspace entirely if it has not been assigned within some timeout. All Tasks enter the Workspace through a Workflow and will be managed by a Workflow until they are either assigned to a Worker or removed from the Workspace. See the Workflow Resource for more information.

/v1/Workspaces/{WorkspaceSid}/Tasks

Represents the Tasks waiting in this Workspace. See the Task Resource for more information.

/v1/Workspaces/{WorkspaceSid}/Statistics

Statistics are captured for each of TaskRouter's subresources. You can use these Statistics to build reporting dashboards and displays for your team. See Workspace Statistics for more information.

/v1/Workspaces/{WorkspaceSid}/Events

Events describe changes to your Workspace. Use these Events to build historical reports for your TaskRouter environment. See the Event Resource for more information.


Rate this page: