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.
Task Channel friendlyName
and uniqueName
values do not support hyphens. Using hyphens may cause a parsing error.
Pagination is not supported under this resource. Please avoid usage of the page
query parameter.
The SID of the Account that created the Task Channel resource.
^AC[0-9a-fA-F]{32}$
Min length: 34
Max length: 34
The date and time in GMT when the resource was created specified in ISO 8601 format.
The date and time in GMT when the resource was last updated specified in ISO 8601 format.
The unique string that we created to identify the Task Channel resource.
^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.
^WS[0-9a-fA-F]{32}$
Min length: 34
Max length: 34
Whether the Task Channel will prioritize Workers that have been idle. When true
, Workers that have been idle the longest are prioritized.
The URLs of related resources.
POST https://taskrouter.twilio.com/v1/Workspaces/{WorkspaceSid}/TaskChannels
The SID of the Workspace that the new Task Channel belongs to.
^WS[0-9a-fA-F]{32}$
Min length: 34
Max length: 34
application/x-www-form-urlencoded
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
.
Whether the Task Channel should prioritize Workers that have been idle. If true
, Workers that have been idle the longest are prioritized.
1// Download the helper library from https://www.twilio.com/docs/node/install2const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";34// Find your Account SID and Auth Token at twilio.com/console5// and set the environment variables. See http://twil.io/secure6const accountSid = process.env.TWILIO_ACCOUNT_SID;7const authToken = process.env.TWILIO_AUTH_TOKEN;8const client = twilio(accountSid, authToken);910async function createTaskChannel() {11const taskChannel = await client.taskrouter.v112.workspaces("WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")13.taskChannels.create({14friendlyName: "FriendlyName",15uniqueName: "UniqueName",16});1718console.log(taskChannel.accountSid);19}2021createTaskChannel();
1{2"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",3"workspace_sid": "WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",4"sid": "TCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",5"friendly_name": "FriendlyName",6"unique_name": "UniqueName",7"date_created": "2016-04-14T17:35:54Z",8"date_updated": "2016-04-14T17:35:54Z",9"channel_optimized_routing": true,10"url": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/TaskChannels/TCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",11"links": {12"workspace": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"13}14}
GET https://taskrouter.twilio.com/v1/Workspaces/{WorkspaceSid}/TaskChannels/{Sid}
The SID of the Workspace with the Task Channel to fetch.
^WS[0-9a-fA-F]{32}$
Min length: 34
Max length: 34
The SID of the Task Channel resource to fetch.
1// Download the helper library from https://www.twilio.com/docs/node/install2const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";34// Find your Account SID and Auth Token at twilio.com/console5// and set the environment variables. See http://twil.io/secure6const accountSid = process.env.TWILIO_ACCOUNT_SID;7const authToken = process.env.TWILIO_AUTH_TOKEN;8const client = twilio(accountSid, authToken);910async function fetchTaskChannel() {11const taskChannel = await client.taskrouter.v112.workspaces("WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")13.taskChannels("Sid")14.fetch();1516console.log(taskChannel.accountSid);17}1819fetchTaskChannel();
1{2"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",3"date_created": "2016-04-14T17:35:54Z",4"date_updated": "2016-04-14T17:35:54Z",5"friendly_name": "Default",6"sid": "Sid",7"unique_name": "default",8"url": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/TaskChannels/TCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",9"workspace_sid": "WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",10"channel_optimized_routing": true,11"links": {12"workspace": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"13}14}
GET https://taskrouter.twilio.com/v1/Workspaces/{WorkspaceSid}/TaskChannels
The SID of the Workspace with the Task Channel to read.
^WS[0-9a-fA-F]{32}$
Min length: 34
Max length: 34
How many resources to return in each list page. The default is 50, and the maximum is 1000.
1
Maximum: 1000
The page token. This is provided by the API.
1// Download the helper library from https://www.twilio.com/docs/node/install2const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";34// Find your Account SID and Auth Token at twilio.com/console5// and set the environment variables. See http://twil.io/secure6const accountSid = process.env.TWILIO_ACCOUNT_SID;7const authToken = process.env.TWILIO_AUTH_TOKEN;8const client = twilio(accountSid, authToken);910async function listTaskChannel() {11const taskChannels = await client.taskrouter.v112.workspaces("WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")13.taskChannels.list({ limit: 20 });1415taskChannels.forEach((t) => console.log(t.accountSid));16}1718listTaskChannel();
1{2"channels": [3{4"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",5"date_created": "2016-04-14T17:35:54Z",6"date_updated": "2016-04-14T17:35:54Z",7"friendly_name": "Default",8"sid": "TCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",9"unique_name": "default",10"url": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/TaskChannels/TCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",11"workspace_sid": "WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",12"channel_optimized_routing": true,13"links": {14"workspace": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"15}16}17],18"meta": {19"first_page_url": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/TaskChannels?PageSize=50&Page=0",20"key": "channels",21"next_page_url": null,22"page": 0,23"page_size": 50,24"previous_page_url": null,25"url": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/TaskChannels?PageSize=50&Page=0"26}27}
POST https://taskrouter.twilio.com/v1/Workspaces/{WorkspaceSid}/TaskChannels/{Sid}
application/x-www-form-urlencoded
A descriptive string that you create to describe the Task Channel. It can be up to 64 characters long.
Whether the TaskChannel should prioritize Workers that have been idle. If true
, Workers that have been idle the longest are prioritized.
1// Download the helper library from https://www.twilio.com/docs/node/install2const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";34// Find your Account SID and Auth Token at twilio.com/console5// and set the environment variables. See http://twil.io/secure6const accountSid = process.env.TWILIO_ACCOUNT_SID;7const authToken = process.env.TWILIO_AUTH_TOKEN;8const client = twilio(accountSid, authToken);910async function updateTaskChannel() {11const taskChannel = await client.taskrouter.v112.workspaces("WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")13.taskChannels("Sid")14.update({ friendlyName: "FriendlyName" });1516console.log(taskChannel.accountSid);17}1819updateTaskChannel();
1{2"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",3"workspace_sid": "WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",4"sid": "Sid",5"friendly_name": "FriendlyName",6"unique_name": "default",7"date_created": "2016-04-14T17:35:54Z",8"date_updated": "2016-04-14T17:35:54Z",9"url": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/TaskChannels/TCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",10"channel_optimized_routing": true,11"links": {12"workspace": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"13}14}
DELETE https://taskrouter.twilio.com/v1/Workspaces/{WorkspaceSid}/TaskChannels/{Sid}
The SID of the Workspace with the Task Channel to delete.
^WS[0-9a-fA-F]{32}$
Min length: 34
Max length: 34
The SID of the Task Channel resource to delete.
1// Download the helper library from https://www.twilio.com/docs/node/install2const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";34// Find your Account SID and Auth Token at twilio.com/console5// and set the environment variables. See http://twil.io/secure6const accountSid = process.env.TWILIO_ACCOUNT_SID;7const authToken = process.env.TWILIO_AUTH_TOKEN;8const client = twilio(accountSid, authToken);910async function deleteTaskChannel() {11await client.taskrouter.v112.workspaces("WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")13.taskChannels("Sid")14.remove();15}1617deleteTaskChannel();