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

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.


TaskChannel Properties

taskchannel-properties page anchor
(warning)

Warning

Task Channel friendlyName and uniqueName values do not support hyphens. Using hyphens may cause a parsing error.

(warning)

Warning

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

Resource properties
account_sidtype: SID<AC>Not PII

date_createdtype: string<DATE TIME>Not PII

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


date_updatedtype: string<DATE TIME>Not PII

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


friendly_nametype: stringNot PII

The string that you assigned to describe the resource.


sidtype: SID<TC>Not PII

The unique string that we created to identify the Task Channel resource.


unique_nametype: stringNot PII

An application-defined string that uniquely identifies the Task Channel, such as voice or sms.


workspace_sidtype: SID<WS>Not PII

The SID of the Workspace that contains the Task Channel.


channel_optimized_routingtype: booleanNot PII

Whether the Task Channel will prioritize Workers that have been idle. When true, Workers that have been idle the longest are prioritized.


urltype: string<URI>Not PII

The absolute URL of the Task Channel resource.


linkstype: object<URI MAP>Not PII

The URLs of related resources.


Create a TaskChannel resource

create-a-taskchannel-resource page anchor
POST https://taskrouter.twilio.com/v1/Workspaces/{WorkspaceSid}/TaskChannels

Parameters

create-parameters page anchor
URI parameters
WorkspaceSidtype: SID<WS>Not PII
Path Parameter

The SID of the Workspace that the new Task Channel belongs to.


Request body parameters
FriendlyNametype: stringNot PII
Required

A descriptive string that you create to describe the Task Channel. It can be up to 64 characters long.


UniqueNametype: stringNot PII
Required

An application-defined string that uniquely identifies the Task Channel, such as voice or sms.


ChannelOptimizedRoutingtype: booleanNot PII

Whether the Task Channel should prioritize Workers that have been idle. If true, Workers that have been idle the longest are prioritized.

Node.js
Python
C#
Java
Go
PHP
Ruby
twilio-cli
curl

_14
// Download the helper library from https://www.twilio.com/docs/node/install
_14
// Find your Account SID and Auth Token at twilio.com/console
_14
// and set the environment variables. See http://twil.io/secure
_14
const accountSid = process.env.TWILIO_ACCOUNT_SID;
_14
const authToken = process.env.TWILIO_AUTH_TOKEN;
_14
const client = require('twilio')(accountSid, authToken);
_14
_14
client.taskrouter.v1.workspaces('WSXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX')
_14
.taskChannels
_14
.create({
_14
friendlyName: 'friendly_name',
_14
uniqueName: 'unique_name'
_14
})
_14
.then(task_channel => console.log(task_channel.sid));

Output

_14
{
_14
"account_sid": "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_14
"workspace_sid": "WSXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_14
"sid": "TCXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_14
"friendly_name": "Outbound Voice",
_14
"unique_name": "ovoice",
_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/WSXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/TaskChannels/TCXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_14
"links": {
_14
"workspace": "https://taskrouter.twilio.com/v1/Workspaces/WSXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
_14
}
_14
}


Fetch a TaskChannel resource

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

URI parameters
WorkspaceSidtype: SID<WS>Not PII
Path Parameter

The SID of the Workspace with the Task Channel to fetch.


Sidtype: stringNot PII
Path Parameter

The SID of the Task Channel resource to fetch.

Node.js
Python
C#
Java
Go
PHP
Ruby
twilio-cli
curl

_11
// Download the helper library from https://www.twilio.com/docs/node/install
_11
// Find your Account SID and Auth Token at twilio.com/console
_11
// and set the environment variables. See http://twil.io/secure
_11
const accountSid = process.env.TWILIO_ACCOUNT_SID;
_11
const authToken = process.env.TWILIO_AUTH_TOKEN;
_11
const client = require('twilio')(accountSid, authToken);
_11
_11
client.taskrouter.v1.workspaces('WSXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX')
_11
.taskChannels('TCXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX')
_11
.fetch()
_11
.then(task_channel => console.log(task_channel.friendlyName));

Output

_14
{
_14
"account_sid": "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_14
"date_created": "2016-04-14T17:35:54Z",
_14
"date_updated": "2016-04-14T17:35:54Z",
_14
"friendly_name": "Default",
_14
"sid": "TCXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_14
"unique_name": "default",
_14
"url": "https://taskrouter.twilio.com/v1/Workspaces/WSXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/TaskChannels/TCXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_14
"workspace_sid": "WSXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_14
"channel_optimized_routing": true,
_14
"links": {
_14
"workspace": "https://taskrouter.twilio.com/v1/Workspaces/WSXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
_14
}
_14
}


Read multiple TaskChannel resources

read-multiple-taskchannel-resources page anchor
GET https://taskrouter.twilio.com/v1/Workspaces/{WorkspaceSid}/TaskChannels

URI parameters
WorkspaceSidtype: SID<WS>Not PII
Path Parameter

The SID of the Workspace with the Task Channel to read.


PageSizetype: integerNot PII
Query Parameter

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


Pagetype: integerNot PII
Query Parameter

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


PageTokentype: stringNot PII
Query Parameter

The page token. This is provided by the API.

List multiple TaskChannels

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

_11
// Download the helper library from https://www.twilio.com/docs/node/install
_11
// Find your Account SID and Auth Token at twilio.com/console
_11
// and set the environment variables. See http://twil.io/secure
_11
const accountSid = process.env.TWILIO_ACCOUNT_SID;
_11
const authToken = process.env.TWILIO_AUTH_TOKEN;
_11
const client = require('twilio')(accountSid, authToken);
_11
_11
client.taskrouter.v1.workspaces('WSXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX')
_11
.taskChannels
_11
.list({limit: 20})
_11
.then(taskChannels => taskChannels.forEach(t => console.log(t.sid)));

Output

_27
{
_27
"channels": [
_27
{
_27
"account_sid": "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_27
"date_created": "2016-04-14T17:35:54Z",
_27
"date_updated": "2016-04-14T17:35:54Z",
_27
"friendly_name": "Default",
_27
"sid": "TCXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_27
"unique_name": "default",
_27
"url": "https://taskrouter.twilio.com/v1/Workspaces/WSXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/TaskChannels/TCXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_27
"workspace_sid": "WSXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_27
"channel_optimized_routing": true,
_27
"links": {
_27
"workspace": "https://taskrouter.twilio.com/v1/Workspaces/WSXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
_27
}
_27
}
_27
],
_27
"meta": {
_27
"first_page_url": "https://taskrouter.twilio.com/v1/Workspaces/WSXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/TaskChannels?PageSize=50&Page=0",
_27
"key": "channels",
_27
"next_page_url": "https://taskrouter.twilio.com/v1/Workspaces/WSXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/TaskChannels?PageSize=50&Page=1",
_27
"page": 0,
_27
"page_size": 50,
_27
"previous_page_url": "https://taskrouter.twilio.com/v1/Workspaces/WSXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/TaskChannels?PageSize=50&Page=0",
_27
"url": "https://taskrouter.twilio.com/v1/Workspaces/WSXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/TaskChannels?PageSize=50&Page=0"
_27
}
_27
}


Update a TaskChannel resource

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

URI parameters
WorkspaceSidtype: SID<WS>Not PII
Path Parameter

The SID of the Workspace with the Task Channel to update.


Sidtype: stringNot PII
Path Parameter

The SID of the Task Channel resource to update.


Request body parameters
FriendlyNametype: stringNot PII

A descriptive string that you create to describe the Task Channel. It can be up to 64 characters long.


ChannelOptimizedRoutingtype: booleanNot PII

Whether the TaskChannel should prioritize Workers that have been idle. If true, Workers that have been idle the longest are prioritized.

Node.js
Python
C#
Java
Go
PHP
Ruby
twilio-cli
curl

_11
// Download the helper library from https://www.twilio.com/docs/node/install
_11
// Find your Account SID and Auth Token at twilio.com/console
_11
// and set the environment variables. See http://twil.io/secure
_11
const accountSid = process.env.TWILIO_ACCOUNT_SID;
_11
const authToken = process.env.TWILIO_AUTH_TOKEN;
_11
const client = require('twilio')(accountSid, authToken);
_11
_11
client.taskrouter.v1.workspaces('WSXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX')
_11
.taskChannels('TCXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX')
_11
.update({friendlyName: 'friendly_name'})
_11
.then(task_channel => console.log(task_channel.friendlyName));

Output

_14
{
_14
"account_sid": "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_14
"workspace_sid": "WSXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_14
"sid": "TCXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_14
"friendly_name": "Default",
_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/WSXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/TaskChannels/TCXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_14
"channel_optimized_routing": true,
_14
"links": {
_14
"workspace": "https://taskrouter.twilio.com/v1/Workspaces/WSXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
_14
}
_14
}


Delete a TaskChannel resource

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

URI parameters
WorkspaceSidtype: SID<WS>Not PII
Path Parameter

The SID of the Workspace with the Task Channel to delete.


Sidtype: stringNot PII
Path Parameter

The SID of the Task Channel resource to delete.

Node.js
Python
C#
Java
Go
PHP
Ruby
twilio-cli
curl

_10
// Download the helper library from https://www.twilio.com/docs/node/install
_10
// Find your Account SID and Auth Token at twilio.com/console
_10
// and set the environment variables. See http://twil.io/secure
_10
const accountSid = process.env.TWILIO_ACCOUNT_SID;
_10
const authToken = process.env.TWILIO_AUTH_TOKEN;
_10
const client = require('twilio')(accountSid, authToken);
_10
_10
client.taskrouter.v1.workspaces('WSXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX')
_10
.taskChannels('TCXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX')
_10
.remove();


Rate this page: