Task Channel Resource
Task Channels provide a mechanism to separate tasks of different types.
You can specify different concurrent capacity for tasks of each type. For example, one Worker might be able to handle 10 SMS Tasks at any given time, but only a single phone call Task. When MultiTasking is enabled, you can specify the task type by passing the Unique Name or SID of the Task Channel. For details on limitations around the Task Channel Unique Name, see the FAQ on the Multitasking page.
Warning
Task Channel friendlyName
and uniqueName
values do not support hyphens. Using hyphens may cause a parsing error.
Warning
Pagination is not supported under this resource. Please avoid usage of the page
query parameter.
Property nameTypePIIDescription
The SID of the Account that created the Task Channel resource.
Pattern: ^AC[0-9a-fA-F]{32}$
Min length: 34
Max length: 34
date_createdstring<date-time>
date_updatedstring<date-time>
The string that you assigned to describe the resource.
The unique string that we created to identify the Task Channel resource.
Pattern: ^TC[0-9a-fA-F]{32}$
Min length: 34
Max length: 34
An application-defined string that uniquely identifies the Task Channel, such as voice
or sms
.
The SID of the Workspace that contains the Task Channel.
Pattern: ^WS[0-9a-fA-F]{32}$
Min length: 34
Max length: 34
channel_optimized_routingboolean Whether the Task Channel will prioritize Workers that have been idle. When true
, Workers that have been idle the longest are prioritized.
The absolute URL of the Task Channel resource.
The URLs of related resources.
POST https://taskrouter.twilio.com/v1/Workspaces/{WorkspaceSid}/TaskChannels
Property nameTypeRequiredPIIDescription
WorkspaceSidSID<WS>required The SID of the Workspace that the new Task Channel belongs to.
Pattern: ^WS[0-9a-fA-F]{32}$
Min length: 34
Max length: 34
Property nameTypeRequiredPIIDescription
FriendlyNamestringrequired A descriptive string that you create to describe the Task Channel. It can be up to 64 characters long.
An application-defined string that uniquely identifies the Task Channel, such as voice
or sms
.
ChannelOptimizedRoutingbooleanOptional Whether the Task Channel should prioritize Workers that have been idle. If true
, Workers that have been idle the longest are prioritized.
_21// Download the helper library from https://www.twilio.com/docs/node/install
_21const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";
_21// Find your Account SID and Auth Token at twilio.com/console
_21// and set the environment variables. See http://twil.io/secure
_21const accountSid = process.env.TWILIO_ACCOUNT_SID;
_21const authToken = process.env.TWILIO_AUTH_TOKEN;
_21const client = twilio(accountSid, authToken);
_21async function createTaskChannel() {
_21 const taskChannel = await client.taskrouter.v1
_21 .workspaces("WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")
_21 .taskChannels.create({
_21 friendlyName: "FriendlyName",
_21 uniqueName: "UniqueName",
_21 console.log(taskChannel.accountSid);
_14 "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
_14 "workspace_sid": "WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
_14 "sid": "TCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
_14 "friendly_name": "FriendlyName",
_14 "unique_name": "UniqueName",
_14 "date_created": "2016-04-14T17:35:54Z",
_14 "date_updated": "2016-04-14T17:35:54Z",
_14 "channel_optimized_routing": true,
_14 "url": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/TaskChannels/TCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
_14 "workspace": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
GET https://taskrouter.twilio.com/v1/Workspaces/{WorkspaceSid}/TaskChannels/{Sid}
Property nameTypeRequiredPIIDescription
WorkspaceSidSID<WS>required The SID of the Workspace with the Task Channel to fetch.
Pattern: ^WS[0-9a-fA-F]{32}$
Min length: 34
Max length: 34
The SID of the Task Channel resource to fetch.
_19// Download the helper library from https://www.twilio.com/docs/node/install
_19const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";
_19// Find your Account SID and Auth Token at twilio.com/console
_19// and set the environment variables. See http://twil.io/secure
_19const accountSid = process.env.TWILIO_ACCOUNT_SID;
_19const authToken = process.env.TWILIO_AUTH_TOKEN;
_19const client = twilio(accountSid, authToken);
_19async function fetchTaskChannel() {
_19 const taskChannel = await client.taskrouter.v1
_19 .workspaces("WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")
_19 console.log(taskChannel.accountSid);
_14 "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
_14 "date_created": "2016-04-14T17:35:54Z",
_14 "date_updated": "2016-04-14T17:35:54Z",
_14 "friendly_name": "Default",
_14 "unique_name": "default",
_14 "url": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/TaskChannels/TCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
_14 "workspace_sid": "WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
_14 "channel_optimized_routing": true,
_14 "workspace": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
GET https://taskrouter.twilio.com/v1/Workspaces/{WorkspaceSid}/TaskChannels
Property nameTypeRequiredPIIDescription
WorkspaceSidSID<WS>required The SID of the Workspace with the Task Channel to read.
Pattern: ^WS[0-9a-fA-F]{32}$
Min length: 34
Max length: 34
Property nameTypeRequiredPIIDescription
How many resources to return in each list page. The default is 50, and the maximum is 1000.
Minimum: 1
Maximum: 1000
The page index. This value is simply for client state.
Minimum: 0
The page token. This is provided by the API.
_18// Download the helper library from https://www.twilio.com/docs/node/install
_18const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";
_18// Find your Account SID and Auth Token at twilio.com/console
_18// and set the environment variables. See http://twil.io/secure
_18const accountSid = process.env.TWILIO_ACCOUNT_SID;
_18const authToken = process.env.TWILIO_AUTH_TOKEN;
_18const client = twilio(accountSid, authToken);
_18async function listTaskChannel() {
_18 const taskChannels = await client.taskrouter.v1
_18 .workspaces("WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")
_18 .taskChannels.list({ limit: 20 });
_18 taskChannels.forEach((t) => console.log(t.accountSid));
_27 "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
_27 "date_created": "2016-04-14T17:35:54Z",
_27 "date_updated": "2016-04-14T17:35:54Z",
_27 "friendly_name": "Default",
_27 "sid": "TCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
_27 "unique_name": "default",
_27 "url": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/TaskChannels/TCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
_27 "workspace_sid": "WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
_27 "channel_optimized_routing": true,
_27 "workspace": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
_27 "first_page_url": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/TaskChannels?PageSize=50&Page=0",
_27 "next_page_url": null,
_27 "previous_page_url": null,
_27 "url": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/TaskChannels?PageSize=50&Page=0"
POST https://taskrouter.twilio.com/v1/Workspaces/{WorkspaceSid}/TaskChannels/{Sid}
Property nameTypeRequiredPIIDescription
WorkspaceSidSID<WS>required The SID of the Workspace with the Task Channel to update.
Pattern: ^WS[0-9a-fA-F]{32}$
Min length: 34
Max length: 34
The SID of the Task Channel resource to update.
Property nameTypeRequiredPIIDescription
FriendlyNamestringOptional A descriptive string that you create to describe the Task Channel. It can be up to 64 characters long.
ChannelOptimizedRoutingbooleanOptional Whether the TaskChannel should prioritize Workers that have been idle. If true
, Workers that have been idle the longest are prioritized.
_19// Download the helper library from https://www.twilio.com/docs/node/install
_19const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";
_19// Find your Account SID and Auth Token at twilio.com/console
_19// and set the environment variables. See http://twil.io/secure
_19const accountSid = process.env.TWILIO_ACCOUNT_SID;
_19const authToken = process.env.TWILIO_AUTH_TOKEN;
_19const client = twilio(accountSid, authToken);
_19async function updateTaskChannel() {
_19 const taskChannel = await client.taskrouter.v1
_19 .workspaces("WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")
_19 .update({ friendlyName: "FriendlyName" });
_19 console.log(taskChannel.accountSid);
_14 "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
_14 "workspace_sid": "WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
_14 "friendly_name": "FriendlyName",
_14 "unique_name": "default",
_14 "date_created": "2016-04-14T17:35:54Z",
_14 "date_updated": "2016-04-14T17:35:54Z",
_14 "url": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/TaskChannels/TCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
_14 "channel_optimized_routing": true,
_14 "workspace": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
DELETE https://taskrouter.twilio.com/v1/Workspaces/{WorkspaceSid}/TaskChannels/{Sid}
Property nameTypeRequiredPIIDescription
WorkspaceSidSID<WS>required The SID of the Workspace with the Task Channel to delete.
Pattern: ^WS[0-9a-fA-F]{32}$
Min length: 34
Max length: 34
The SID of the Task Channel resource to delete.
_17// Download the helper library from https://www.twilio.com/docs/node/install
_17const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";
_17// Find your Account SID and Auth Token at twilio.com/console
_17// and set the environment variables. See http://twil.io/secure
_17const accountSid = process.env.TWILIO_ACCOUNT_SID;
_17const authToken = process.env.TWILIO_AUTH_TOKEN;
_17const client = twilio(accountSid, authToken);
_17async function deleteTaskChannel() {
_17 await client.taskrouter.v1
_17 .workspaces("WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")