Worker Channel Resource
Worker Channels show the Worker 's capacity for handling multiple concurrent Tasks . Workers receive Task reservation requests in parallel for each task type until the configured Task Channel capacity is reached. In addition, Worker Channels can also be marked as unavailable, which is useful for temporarily removing the capacity for a given Worker Channel and then restoring to the previous capacity when marking available again.
Resource properties The total number of Tasks assigned to Worker for the TaskChannel type.
Whether the Worker should receive Tasks of the TaskChannel type.
available_capacity_percentage
type: integer Not PIIThe current percentage of capacity the TaskChannel has available. Can be a number between 0
and 100
. A value of 0
indicates that TaskChannel has no capacity available and a value of 100
means the Worker is available to receive any Tasks of this TaskChannel type.
configured_capacity
type: integer Not PIIThe current configured capacity for the WorkerChannel. TaskRouter will not create any reservations after the assigned Tasks for the Worker reaches the value.
date_created
type: string<DATE TIME> Not PIIdate_updated
type: string<DATE TIME> Not PIIThe unique string that we created to identify the WorkerChannel resource.
task_channel_sid
type: SID<TC> Not PIIThe SID of the TaskChannel.
task_channel_unique_name
type: string Not PIIThe unique name of the TaskChannel, such as voice
or sms
.
The SID of the Worker that contains the WorkerChannel.
The SID of the Workspace that contains the WorkerChannel.
The absolute URL of the WorkerChannel resource.
GET https://taskrouter.twilio.com/v1/Workspaces/{WorkspaceSid}/Workers/{WorkerSid}/Channels/{Sid}
Returns a single Worker Channel resource identified by either WorkerChannelUniqueName
or WorkerChannelSid
URI parameters Path Parameter
The SID of the Workspace with the WorkerChannel to fetch.
Path Parameter
The SID of the Worker with the WorkerChannel to fetch.
Path Parameter
The SID of the WorkerChannel to fetch.
_12 // Download the helper library from https://www.twilio.com/docs/node/install
_12 // Find your Account SID and Auth Token at twilio.com/console
_12 // and set the environment variables. See http://twil.io/secure
_12 const accountSid = process.env.TWILIO_ACCOUNT_SID;
_12 const authToken = process.env.TWILIO_AUTH_TOKEN;
_12 const client = require('twilio')(accountSid, authToken);
_12 client.taskrouter.v1.workspaces('WSXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX')
_12 .workers('WKXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX')
_12 .workerChannels('WCXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX')
_12 .then(worker_channel => console.log(worker_channel.taskChannelUniqueName));
_15 "account_sid": "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_15 "available_capacity_percentage": 100,
_15 "configured_capacity": 1,
_15 "date_created": "2016-04-14T17:35:54Z",
_15 "date_updated": "2016-04-14T17:35:54Z",
_15 "sid": "WCXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_15 "task_channel_sid": "TCXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_15 "task_channel_unique_name": "default",
_15 "url": "https://taskrouter.twilio.com/v1/Workspaces/WSXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Workers/WKXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Channels/WCXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_15 "worker_sid": "WKXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_15 "workspace_sid": "WSXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
GET https://taskrouter.twilio.com/v1/Workspaces/{WorkspaceSid}/Workers/{WorkerSid}/Channels
URI parameters Path Parameter
The SID of the Workspace with the WorkerChannels to read.
Path Parameter
The SID of the Worker with the WorkerChannels to read.
Query Parameter
How many resources to return in each list page. The default is 50, and the maximum is 1000.
Query Parameter
The page index. This value is simply for client state.
Query Parameter
The page token. This is provided by the API.
_12 // Download the helper library from https://www.twilio.com/docs/node/install
_12 // Find your Account SID and Auth Token at twilio.com/console
_12 // and set the environment variables. See http://twil.io/secure
_12 const accountSid = process.env.TWILIO_ACCOUNT_SID;
_12 const authToken = process.env.TWILIO_AUTH_TOKEN;
_12 const client = require('twilio')(accountSid, authToken);
_12 client.taskrouter.v1.workspaces('WSXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX')
_12 .workers('WKXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX')
_12 .then(workerChannels => workerChannels.forEach(w => console.log(w.sid)));
_28 "first_page_url": "https://taskrouter.twilio.com/v1/Workspaces/WSXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Workers/WKXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Channels?PageSize=50&Page=0",
_28 "next_page_url": "https://taskrouter.twilio.com/v1/Workspaces/WSXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Workers/WKXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Channels?PageSize=50&Page=1",
_28 "previous_page_url": "https://taskrouter.twilio.com/v1/Workspaces/WSXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Workers/WKXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Channels?PageSize=50&Page=0",
_28 "url": "https://taskrouter.twilio.com/v1/Workspaces/WSXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Workers/WKXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Channels?PageSize=50&Page=0"
_28 "account_sid": "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_28 "available_capacity_percentage": 100,
_28 "configured_capacity": 1,
_28 "date_created": "2016-04-14T17:35:54Z",
_28 "date_updated": "2016-04-14T17:35:54Z",
_28 "sid": "WCXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_28 "task_channel_sid": "TCXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_28 "task_channel_unique_name": "default",
_28 "url": "https://taskrouter.twilio.com/v1/Workspaces/WSXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Workers/WKXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Channels/WCXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_28 "worker_sid": "WKXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_28 "workspace_sid": "WSXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
POST https://taskrouter.twilio.com/v1/Workspaces/{WorkspaceSid}/Workers/{WorkerSid}/Channels/{Sid}
URI parameters Path Parameter
The SID of the Workspace with the WorkerChannel to update.
Path Parameter
The SID of the Worker with the WorkerChannel to update.
Path Parameter
The SID of the WorkerChannel to update.
Request body parameters The total number of Tasks that the Worker should handle for the TaskChannel type. TaskRouter creates reservations for Tasks of this TaskChannel type up to the specified capacity. If the capacity is 0, no new reservations will be created.
Whether the WorkerChannel is available. Set to false
to prevent the Worker from receiving any new Tasks of this TaskChannel type.
_12 // Download the helper library from https://www.twilio.com/docs/node/install
_12 // Find your Account SID and Auth Token at twilio.com/console
_12 // and set the environment variables. See http://twil.io/secure
_12 const accountSid = process.env.TWILIO_ACCOUNT_SID;
_12 const authToken = process.env.TWILIO_AUTH_TOKEN;
_12 const client = require('twilio')(accountSid, authToken);
_12 client.taskrouter.v1.workspaces('WSXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX')
_12 .workers('WKXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX')
_12 .workerChannels('WCXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX')
_12 .update({capacity: 1})
_12 .then(worker_channel => console.log(worker_channel.taskChannelUniqueName));
_15 "account_sid": "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_15 "available_capacity_percentage": 100,
_15 "configured_capacity": 3,
_15 "date_created": "2016-04-14T17:35:54Z",
_15 "date_updated": "2016-04-14T17:35:54Z",
_15 "sid": "WCXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_15 "task_channel_sid": "TCXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_15 "task_channel_unique_name": "default",
_15 "url": "https://taskrouter.twilio.com/v1/Workspaces/WSXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Workers/WKXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Channels/WCXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_15 "worker_sid": "WKXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_15 "workspace_sid": "WSXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"