Register by 10/16 for $250 off the on-site price.

REST API: WorkerChannel

Workers Channels shows 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.

Actions


List All Worker Channels

Resource URI

GET /v1/Workspaces/{WorkspaceSid}/Workers/{WorkerSid}/Channels

Returns the list of Task Channels in the workspace identified by {WorkspaceSid}.

Example

An example that lists all in a workspace

Loading Code Samples...
Language
Response Format:
  • json
SDK Version:
  • 7.x
SDK Version:
  • 5.x
Format:
  • JSON
# Get twilio-ruby from twilio.com/docs/ruby/install
require 'twilio-ruby'

# Get your Account SID and Auth Token from twilio.com/console
account_sid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
auth_token = 'your_auth_token'
workspace_sid = 'WSXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
worker_sid = 'WSXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'

client = Twilio::REST::Client.new(account_sid, auth_token)

client.taskrouter.v1.workspaces(workspace_sid).workers(worker_sid)
  .worker_channels.list.each do |worker_channel|
  puts worker_channel.task_channel_unique_name
end
import com.twilio.Twilio;
import com.twilio.base.ResourceSet;
import com.twilio.rest.taskrouter.v1.workspace.worker.WorkerChannel;

public class ListWorkerChannel {
	private static final String ACCOUNT_SID = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
	private static final String AUTH_TOKEN = "your_auth_token";
	private static final String WORKSPACE_SID = "WSXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
	private static final String WORKER_SID = "WKXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";

	public static void main(String[] args) {
		Twilio.init(ACCOUNT_SID, AUTH_TOKEN);

		ResourceSet<WorkerChannel> channels = WorkerChannel.reader(WORKSPACE_SID, WORKER_SID).read();

		for (WorkerChannel wc : channels) {
			System.out.println(wc.getTaskChannelUniqueName());
		}
	}

}
$ curl https://taskrouter.twilio.com/v1/Workspaces/WSXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Workers/WKXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Channels \
    -u '{account_sid}:{auth_token}'
{
  "channels": [
    {
      "sid": "WCa47a2285f13790f7bdb184eb488c8ab2",
      "account_sid": "AC1c41896f44563b7c8194235ee6d267b1",
      "workspace_sid": "WS74facd34612674c795b19d40690aeec2",
      "worker_sid": "WKb43a6313926a885fbe60b0f8c97b3c35",
      "task_channel_sid": "TC72e66c2c822002ff3cad36c608979ee9",
      "task_channel_unique_name": "default",
      "configured_capacity": 1,
      "available": true,
      "assigned_tasks": 0,
      "available_capacity_percentage": 100,
      "date_created": "2016-09-16T21:44:15Z",
      "date_updated": "2016-09-16T21:44:15Z",
      "url": "https://taskrouter.twilio.com/v1/Workspaces/WS74facd34612674c795b19d40690aeec2/Workers/WKb43a6313926a885fbe60b0f8c97b3c35/Channels/WCa47a2285f13790f7bdb184eb488c8ab2"
    },
    {
      "sid": "WC1ceb8ea62504a8799d6d3f67e51d0173",
      "account_sid": "AC1c41896f44563b7c8194235ee6d267b1",
      "workspace_sid": "WS74facd34612674c795b19d40690aeec2",
      "worker_sid": "WKb43a6313926a885fbe60b0f8c97b3c35",
      "task_channel_sid": "TC33089dd1198dfcdf986c1c44d1173840",
      "task_channel_unique_name": "voice",
      "configured_capacity": 1,
      "available": true,
      "assigned_tasks": 0,
      "available_capacity_percentage": 100,
      "date_created": "2016-09-16T21:44:15Z",
      "date_updated": "2016-09-16T21:44:15Z",
      "url": "https://taskrouter.twilio.com/v1/Workspaces/WS74facd34612674c795b19d40690aeec2/Workers/WKb43a6313926a885fbe60b0f8c97b3c35/Channels/WC1ceb8ea62504a8799d6d3f67e51d0173"
    },
    {
      "sid": "WC558c8217a63aec7c422b2965b7057641",
      "account_sid": "AC1c41896f44563b7c8194235ee6d267b1",
      "workspace_sid": "WS74facd34612674c795b19d40690aeec2",
      "worker_sid": "WKb43a6313926a885fbe60b0f8c97b3c35",
      "task_channel_sid": "TC8e4591f7176c8c85993002344f691296",
      "task_channel_unique_name": "video",
      "configured_capacity": 1,
      "available": true,
      "assigned_tasks": 0,
      "available_capacity_percentage": 100,
      "date_created": "2016-09-16T21:44:15Z",
      "date_updated": "2016-09-16T21:44:15Z",
      "url": "https://taskrouter.twilio.com/v1/Workspaces/WS74facd34612674c795b19d40690aeec2/Workers/WKb43a6313926a885fbe60b0f8c97b3c35/Channels/WC558c8217a63aec7c422b2965b7057641"
    },
    {
      "sid": "WC678142a6487001c38287b6f52c74524b",
      "account_sid": "AC1c41896f44563b7c8194235ee6d267b1",
      "workspace_sid": "WS74facd34612674c795b19d40690aeec2",
      "worker_sid": "WKb43a6313926a885fbe60b0f8c97b3c35",
      "task_channel_sid": "TC06f04ec398062896c18f00af02a85922",
      "task_channel_unique_name": "sms",
      "configured_capacity": 1,
      "available": true,
      "assigned_tasks": 0,
      "available_capacity_percentage": 100,
      "date_created": "2016-09-16T21:44:15Z",
      "date_updated": "2016-09-16T21:44:15Z",
      "url": "https://taskrouter.twilio.com/v1/Workspaces/WS74facd34612674c795b19d40690aeec2/Workers/WKb43a6313926a885fbe60b0f8c97b3c35/Channels/WC678142a6487001c38287b6f52c74524b"
    },
    {
      "sid": "WC5c81b3457297d1b6e4462018df373447",
      "account_sid": "AC1c41896f44563b7c8194235ee6d267b1",
      "workspace_sid": "WS74facd34612674c795b19d40690aeec2",
      "worker_sid": "WKb43a6313926a885fbe60b0f8c97b3c35",
      "task_channel_sid": "TC0729bb17003b3c1a347239e93cc458b1",
      "task_channel_unique_name": "chat",
      "configured_capacity": 1,
      "available": true,
      "assigned_tasks": 0,
      "available_capacity_percentage": 100,
      "date_created": "2017-01-12T01:32:31Z",
      "date_updated": "2017-01-12T01:32:31Z",
      "url": "https://taskrouter.twilio.com/v1/Workspaces/WS74facd34612674c795b19d40690aeec2/Workers/WKb43a6313926a885fbe60b0f8c97b3c35/Channels/WC5c81b3457297d1b6e4462018df373447"
    },
    {
      "sid": "WCb477b50c22966cc1ee914c02c2dbb44d",
      "account_sid": "AC1c41896f44563b7c8194235ee6d267b1",
      "workspace_sid": "WS74facd34612674c795b19d40690aeec2",
      "worker_sid": "WKb43a6313926a885fbe60b0f8c97b3c35",
      "task_channel_sid": "TC8c3b3ae361440b4e4f4557a5cfc32f72",
      "task_channel_unique_name": "custom1",
      "configured_capacity": 1,
      "available": true,
      "assigned_tasks": 0,
      "available_capacity_percentage": 100,
      "date_created": "2017-02-27T21:28:02Z",
      "date_updated": "2017-02-27T21:28:02Z",
      "url": "https://taskrouter.twilio.com/v1/Workspaces/WS74facd34612674c795b19d40690aeec2/Workers/WKb43a6313926a885fbe60b0f8c97b3c35/Channels/WCb477b50c22966cc1ee914c02c2dbb44d"
    },
    {
      "sid": "WC6c638b70174f64955b1c107c57cc49a4",
      "account_sid": "AC1c41896f44563b7c8194235ee6d267b1",
      "workspace_sid": "WS74facd34612674c795b19d40690aeec2",
      "worker_sid": "WKb43a6313926a885fbe60b0f8c97b3c35",
      "task_channel_sid": "TC42bdf6d766d036b87087e45b5ddb62a8",
      "task_channel_unique_name": "custom2",
      "configured_capacity": 1,
      "available": true,
      "assigned_tasks": 0,
      "available_capacity_percentage": 100,
      "date_created": "2017-02-27T21:28:02Z",
      "date_updated": "2017-02-27T21:28:02Z",
      "url": "https://taskrouter.twilio.com/v1/Workspaces/WS74facd34612674c795b19d40690aeec2/Workers/WKb43a6313926a885fbe60b0f8c97b3c35/Channels/WC6c638b70174f64955b1c107c57cc49a4"
    },
    {
      "sid": "WCbb18850107c35d54527b63dad22e531c",
      "account_sid": "AC1c41896f44563b7c8194235ee6d267b1",
      "workspace_sid": "WS74facd34612674c795b19d40690aeec2",
      "worker_sid": "WKb43a6313926a885fbe60b0f8c97b3c35",
      "task_channel_sid": "TCa718ea222669f2bfac6e0836c89e4ead",
      "task_channel_unique_name": "custom3",
      "configured_capacity": 1,
      "available": true,
      "assigned_tasks": 0,
      "available_capacity_percentage": 100,
      "date_created": "2017-02-27T21:28:02Z",
      "date_updated": "2017-02-27T21:28:02Z",
      "url": "https://taskrouter.twilio.com/v1/Workspaces/WS74facd34612674c795b19d40690aeec2/Workers/WKb43a6313926a885fbe60b0f8c97b3c35/Channels/WCbb18850107c35d54527b63dad22e531c"
    },
    {
      "sid": "WC63a3107591e3979a9e1b51e4d9519f99",
      "account_sid": "AC1c41896f44563b7c8194235ee6d267b1",
      "workspace_sid": "WS74facd34612674c795b19d40690aeec2",
      "worker_sid": "WKb43a6313926a885fbe60b0f8c97b3c35",
      "task_channel_sid": "TC9b39f59f71c1e974134c5eff8972537a",
      "task_channel_unique_name": "custom4",
      "configured_capacity": 1,
      "available": true,
      "assigned_tasks": 0,
      "available_capacity_percentage": 100,
      "date_created": "2017-02-27T21:28:02Z",
      "date_updated": "2017-02-27T21:28:02Z",
      "url": "https://taskrouter.twilio.com/v1/Workspaces/WS74facd34612674c795b19d40690aeec2/Workers/WKb43a6313926a885fbe60b0f8c97b3c35/Channels/WC63a3107591e3979a9e1b51e4d9519f99"
    },
    {
      "sid": "WC7fe11b2f71c64b9451366eb0929cd5bf",
      "account_sid": "AC1c41896f44563b7c8194235ee6d267b1",
      "workspace_sid": "WS74facd34612674c795b19d40690aeec2",
      "worker_sid": "WKb43a6313926a885fbe60b0f8c97b3c35",
      "task_channel_sid": "TCfc2136ff7a54e182ec78c9f8e1cd937c",
      "task_channel_unique_name": "custom5",
      "configured_capacity": 1,
      "available": true,
      "assigned_tasks": 0,
      "available_capacity_percentage": 100,
      "date_created": "2017-02-27T21:28:02Z",
      "date_updated": "2017-02-27T21:28:02Z",
      "url": "https://taskrouter.twilio.com/v1/Workspaces/WS74facd34612674c795b19d40690aeec2/Workers/WKb43a6313926a885fbe60b0f8c97b3c35/Channels/WC7fe11b2f71c64b9451366eb0929cd5bf"
    }
  ],
  "meta": {
    "page": 0,
    "page_size": 50,
    "first_page_url": "https://taskrouter.twilio.com/v1/Workspaces/WS74facd34612674c795b19d40690aeec2/Workers/WKb43a6313926a885fbe60b0f8c97b3c35/Channels?PageSize=50&Page=0",
    "previous_page_url": null,
    "url": "https://taskrouter.twilio.com/v1/Workspaces/WS74facd34612674c795b19d40690aeec2/Workers/WKb43a6313926a885fbe60b0f8c97b3c35/Channels?PageSize=50&Page=0",
    "next_page_url": null,
    "key": "channels"
  }
}
List All Worker Channels

Retrieve a WorkerChannel

Resource URI

GET /v1/Workspaces/{WorkspaceSid}/Workers/{WorkerSid}/Channels/{WorkerChannelUniqueName}
GET /v1/Workspaces/{WorkspaceSid}/Workers/{WorkerSid}/Channels/{WorkerChannelSid}

Returns a single WorkerChannel resource identified by either {WorkerChannelUniqueName} or {WorkerChannelSid}

Example

Example of retrieving a single WorkerChannel

Loading Code Samples...
Language
Response Format:
  • json
SDK Version:
  • 7.x
SDK Version:
  • 5.x
Format:
  • JSON
# Get twilio-ruby from twilio.com/docs/ruby/install
require 'twilio-ruby'

# Get your Account SID and Auth Token from twilio.com/console
account_sid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
auth_token = 'your_auth_token'
workspace_sid = 'WSXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
worker_sid = 'WSXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'

client = Twilio::REST::Client.new(account_sid, auth_token)

worker_channel = client.taskrouter.v1.workspaces(workspace_sid)
  .workers(worker_sid).worker_channels('voice').fetch

puts worker_channel.task_channel_unique_name
import com.twilio.Twilio;
import com.twilio.rest.taskrouter.v1.workspace.worker.WorkerChannel;

public class GetWorkerChannel {

	private static final String ACCOUNT_SID = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
	private static final String AUTH_TOKEN = "your_auth_token";
	private static final String WORKSPACE_SID = "WSXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
	private static final String WORKER_SID = "WKXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";

	public static void main(String[] args) {
		Twilio.init(ACCOUNT_SID, AUTH_TOKEN);

		WorkerChannel wc = WorkerChannel.fetcher(WORKSPACE_SID, WORKER_SID, "voice").fetch();

		System.out.println(wc.getTaskChannelUniqueName());
	}

}
$ curl https://taskrouter.twilio.com/v1/Workspaces/WSXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Workers/WKXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Channels/voice \
    -u '{account_sid}:{auth_token}'
{
  "sid": "WC3ff2dfb30125f534f80778a491a8d7d6",
  "account_sid": "ACxxxxxxxxxxxxxxxxxxxxxxxxxx",
  "workspace_sid": "WSbe0184a8fb478195e8bd199c4eed712c",
  "worker_sid": "WK5de00310a22b8289ff50a2ac424e8b07",
  "task_channel_sid": "TC3c1f1befe23ebd7cbc7ba6a2450d6018",
  "task_channel_unique_name": "voice",
  "configured_capacity": 2,
  "available": true,
  "assigned_tasks": 0,
  "available_capacity_percentage": 100,
  "date_created": "2016-08-22T22:41:41Z",
  "date_updated": "2016-08-22T22:41:41Z",
  "url": "https://taskrouter.twilio.com/v1/Workspaces/WSbe0184a8fb478195e8bd199c4eed712c/Workers/WK5de00310a22b8289ff50a2ac424e8b07/Channels/WC3ff2dfb30125f534f80778a491a8d7d6"
}
Get WorkerChannel instance

Resource Properties

Field Description
Sid The unique ID for this WorkerChannel.
AccountSid The unique ID of the Account that owns this WorkerChannel.
WorkspaceSid The unique ID of the Workspace that this WorkerChannel belongs to.
WorkerSid The unique ID of the Worker that this WorkerChannel belongs to.
TaskChannelSid The unique ID of the TaskChannel.
TaskChannelUniqueName The unique name of TaskChannel, such as 'voice', 'sms', etc.
ConfiguredCapacity The current configured capacity for the WorkerChannel. TaskRouter will not create any reservations once assigned Tasks for the worker reaches the value configured here.
Available Boolean value indicating whether the worker should receive Tasks of this TaskChannel type. Set this to False to stop worker from receiving Tasks of this TaskChannel type.
AssignedTasks The total number of tasks assigned to Worker for this TaskChannel type.
AvailableCapacityPercentage The current available capacity between 0 to 100 for this TaskChannel. If the value returned is 100, that means Worker is available to receive any Tasks of this TaskChannel type.
DateCreated The date this Activity was created.
DateUpdated The date this Activity was updated.

Update a WorkerChannel

Resource URI

POST /v1/Workspaces/{WorkspaceSid}/Workers/{WorkerSid}/Channels/{WorkerChannelUniqueName}
POST /v1/Workspaces/{WorkspaceSid}/Workers/{WorkerSid}/Channels/{WorkerChannelSid}

Updates a WorkerChannel instance identified by either {WorkerChannelUniqueName} or {WorkerChannelSid}

Example

Example for updating capacity for 'voice' channel.

Loading Code Samples...
Language
Response Format:
  • json
SDK Version:
  • 7.x
SDK Version:
  • 5.x
Format:
  • JSON
# Get twilio-ruby from twilio.com/docs/ruby/install
require 'twilio-ruby'

# Get your Account SID and Auth Token from twilio.com/console
account_sid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
auth_token = 'your_auth_token'
workspace_sid = 'WSXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
worker_sid = 'WSXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'

client = Twilio::REST::Client.new(account_sid, auth_token)

worker_channel = client.taskrouter.v1.workspaces(workspace_sid)
  .workers(worker_sid).worker_channels('voice').update(capacity: 1)

puts worker_channel.sid

puts worker_channel.configured_capacity
import com.twilio.Twilio;
import com.twilio.rest.taskrouter.v1.workspace.worker.WorkerChannel;

public class UpdateWorkerChannel {

	private static final String ACCOUNT_SID = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
	private static final String AUTH_TOKEN = "your_auth_token";
	private static final String WORKSPACE_SID = "WSXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
	private static final String WORKER_SID = "WKXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";

	public static void main(String[] args) {
		Twilio.init(ACCOUNT_SID, AUTH_TOKEN);

		WorkerChannel wc = WorkerChannel.updater(WORKSPACE_SID, WORKER_SID, "voice").setCapacity(1).update();

		System.out.println(wc.getSid() + "\t" + wc.getConfiguredCapacity());
	}

}
$ curl -X POST https://taskrouter.twilio.com/v1/Workspaces/WSXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Workers/WKXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Channels/voice \
		-d 'Capacity=2&Available=true' \
    -u '{account_sid}:{auth_token}'
{
  "sid": "WC3ff2dfb30125f534f80778a491a8d7d6",
  "account_sid": "ACxxxxxxxxxxxxxxxxxxxxxxxxxx",
  "workspace_sid": "WSbe0184a8fb478195e8bd199c4eed712c",
  "worker_sid": "WK5de00310a22b8289ff50a2ac424e8b07",
  "task_channel_sid": "TC3c1f1befe23ebd7cbc7ba6a2450d6018",
  "task_channel_unique_name": "voice",
  "configured_capacity": 2,
  "available": true,
  "assigned_tasks": 0,
  "available_capacity_percentage": 100,
  "date_created": "2016-08-22T22:41:41Z",
  "date_updated": "2016-08-22T22:41:41Z",
  "url": "https://taskrouter.twilio.com/v1/Workspaces/WSbe0184a8fb478195e8bd199c4eed712c/Workers/WK5de00310a22b8289ff50a2ac424e8b07/Channels/WC3ff2dfb30125f534f80778a491a8d7d6"
}
Update WorkerChannel instance

POST Parameters

You may use the following parameters when modifying a WorkerChannel resource.

Field Description
Capacity The total number of Tasks worker should handle for this TaskChannel type. TaskRouter will only create reservations for Tasks of this TaskChannel type up to the capacity configured. If the capacity is 0, no new reservations will be created (🏢 not PII )
Available Toggle the availability of the WorkerChannel. Set this to 'False' to make worker unavailable to receive any new Tasks of this TaskChannel type. (🏢 not PII )

Need some help?

We all do sometimes; code is hard. Get help now from our support team, or lean on the wisdom of the crowd browsing the Twilio tag on Stack Overflow.

Loading Code Samples...
Response Format:
  • json
SDK Version:
  • 7.x
SDK Version:
  • 5.x
Format:
  • JSON
# Get twilio-ruby from twilio.com/docs/ruby/install
require 'twilio-ruby'

# Get your Account SID and Auth Token from twilio.com/console
account_sid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
auth_token = 'your_auth_token'
workspace_sid = 'WSXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
worker_sid = 'WSXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'

client = Twilio::REST::Client.new(account_sid, auth_token)

client.taskrouter.v1.workspaces(workspace_sid).workers(worker_sid)
  .worker_channels.list.each do |worker_channel|
  puts worker_channel.task_channel_unique_name
end
import com.twilio.Twilio;
import com.twilio.base.ResourceSet;
import com.twilio.rest.taskrouter.v1.workspace.worker.WorkerChannel;

public class ListWorkerChannel {
	private static final String ACCOUNT_SID = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
	private static final String AUTH_TOKEN = "your_auth_token";
	private static final String WORKSPACE_SID = "WSXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
	private static final String WORKER_SID = "WKXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";

	public static void main(String[] args) {
		Twilio.init(ACCOUNT_SID, AUTH_TOKEN);

		ResourceSet<WorkerChannel> channels = WorkerChannel.reader(WORKSPACE_SID, WORKER_SID).read();

		for (WorkerChannel wc : channels) {
			System.out.println(wc.getTaskChannelUniqueName());
		}
	}

}
$ curl https://taskrouter.twilio.com/v1/Workspaces/WSXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Workers/WKXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Channels \
    -u '{account_sid}:{auth_token}'
{
  "channels": [
    {
      "sid": "WCa47a2285f13790f7bdb184eb488c8ab2",
      "account_sid": "AC1c41896f44563b7c8194235ee6d267b1",
      "workspace_sid": "WS74facd34612674c795b19d40690aeec2",
      "worker_sid": "WKb43a6313926a885fbe60b0f8c97b3c35",
      "task_channel_sid": "TC72e66c2c822002ff3cad36c608979ee9",
      "task_channel_unique_name": "default",
      "configured_capacity": 1,
      "available": true,
      "assigned_tasks": 0,
      "available_capacity_percentage": 100,
      "date_created": "2016-09-16T21:44:15Z",
      "date_updated": "2016-09-16T21:44:15Z",
      "url": "https://taskrouter.twilio.com/v1/Workspaces/WS74facd34612674c795b19d40690aeec2/Workers/WKb43a6313926a885fbe60b0f8c97b3c35/Channels/WCa47a2285f13790f7bdb184eb488c8ab2"
    },
    {
      "sid": "WC1ceb8ea62504a8799d6d3f67e51d0173",
      "account_sid": "AC1c41896f44563b7c8194235ee6d267b1",
      "workspace_sid": "WS74facd34612674c795b19d40690aeec2",
      "worker_sid": "WKb43a6313926a885fbe60b0f8c97b3c35",
      "task_channel_sid": "TC33089dd1198dfcdf986c1c44d1173840",
      "task_channel_unique_name": "voice",
      "configured_capacity": 1,
      "available": true,
      "assigned_tasks": 0,
      "available_capacity_percentage": 100,
      "date_created": "2016-09-16T21:44:15Z",
      "date_updated": "2016-09-16T21:44:15Z",
      "url": "https://taskrouter.twilio.com/v1/Workspaces/WS74facd34612674c795b19d40690aeec2/Workers/WKb43a6313926a885fbe60b0f8c97b3c35/Channels/WC1ceb8ea62504a8799d6d3f67e51d0173"
    },
    {
      "sid": "WC558c8217a63aec7c422b2965b7057641",
      "account_sid": "AC1c41896f44563b7c8194235ee6d267b1",
      "workspace_sid": "WS74facd34612674c795b19d40690aeec2",
      "worker_sid": "WKb43a6313926a885fbe60b0f8c97b3c35",
      "task_channel_sid": "TC8e4591f7176c8c85993002344f691296",
      "task_channel_unique_name": "video",
      "configured_capacity": 1,
      "available": true,
      "assigned_tasks": 0,
      "available_capacity_percentage": 100,
      "date_created": "2016-09-16T21:44:15Z",
      "date_updated": "2016-09-16T21:44:15Z",
      "url": "https://taskrouter.twilio.com/v1/Workspaces/WS74facd34612674c795b19d40690aeec2/Workers/WKb43a6313926a885fbe60b0f8c97b3c35/Channels/WC558c8217a63aec7c422b2965b7057641"
    },
    {
      "sid": "WC678142a6487001c38287b6f52c74524b",
      "account_sid": "AC1c41896f44563b7c8194235ee6d267b1",
      "workspace_sid": "WS74facd34612674c795b19d40690aeec2",
      "worker_sid": "WKb43a6313926a885fbe60b0f8c97b3c35",
      "task_channel_sid": "TC06f04ec398062896c18f00af02a85922",
      "task_channel_unique_name": "sms",
      "configured_capacity": 1,
      "available": true,
      "assigned_tasks": 0,
      "available_capacity_percentage": 100,
      "date_created": "2016-09-16T21:44:15Z",
      "date_updated": "2016-09-16T21:44:15Z",
      "url": "https://taskrouter.twilio.com/v1/Workspaces/WS74facd34612674c795b19d40690aeec2/Workers/WKb43a6313926a885fbe60b0f8c97b3c35/Channels/WC678142a6487001c38287b6f52c74524b"
    },
    {
      "sid": "WC5c81b3457297d1b6e4462018df373447",
      "account_sid": "AC1c41896f44563b7c8194235ee6d267b1",
      "workspace_sid": "WS74facd34612674c795b19d40690aeec2",
      "worker_sid": "WKb43a6313926a885fbe60b0f8c97b3c35",
      "task_channel_sid": "TC0729bb17003b3c1a347239e93cc458b1",
      "task_channel_unique_name": "chat",
      "configured_capacity": 1,
      "available": true,
      "assigned_tasks": 0,
      "available_capacity_percentage": 100,
      "date_created": "2017-01-12T01:32:31Z",
      "date_updated": "2017-01-12T01:32:31Z",
      "url": "https://taskrouter.twilio.com/v1/Workspaces/WS74facd34612674c795b19d40690aeec2/Workers/WKb43a6313926a885fbe60b0f8c97b3c35/Channels/WC5c81b3457297d1b6e4462018df373447"
    },
    {
      "sid": "WCb477b50c22966cc1ee914c02c2dbb44d",
      "account_sid": "AC1c41896f44563b7c8194235ee6d267b1",
      "workspace_sid": "WS74facd34612674c795b19d40690aeec2",
      "worker_sid": "WKb43a6313926a885fbe60b0f8c97b3c35",
      "task_channel_sid": "TC8c3b3ae361440b4e4f4557a5cfc32f72",
      "task_channel_unique_name": "custom1",
      "configured_capacity": 1,
      "available": true,
      "assigned_tasks": 0,
      "available_capacity_percentage": 100,
      "date_created": "2017-02-27T21:28:02Z",
      "date_updated": "2017-02-27T21:28:02Z",
      "url": "https://taskrouter.twilio.com/v1/Workspaces/WS74facd34612674c795b19d40690aeec2/Workers/WKb43a6313926a885fbe60b0f8c97b3c35/Channels/WCb477b50c22966cc1ee914c02c2dbb44d"
    },
    {
      "sid": "WC6c638b70174f64955b1c107c57cc49a4",
      "account_sid": "AC1c41896f44563b7c8194235ee6d267b1",
      "workspace_sid": "WS74facd34612674c795b19d40690aeec2",
      "worker_sid": "WKb43a6313926a885fbe60b0f8c97b3c35",
      "task_channel_sid": "TC42bdf6d766d036b87087e45b5ddb62a8",
      "task_channel_unique_name": "custom2",
      "configured_capacity": 1,
      "available": true,
      "assigned_tasks": 0,
      "available_capacity_percentage": 100,
      "date_created": "2017-02-27T21:28:02Z",
      "date_updated": "2017-02-27T21:28:02Z",
      "url": "https://taskrouter.twilio.com/v1/Workspaces/WS74facd34612674c795b19d40690aeec2/Workers/WKb43a6313926a885fbe60b0f8c97b3c35/Channels/WC6c638b70174f64955b1c107c57cc49a4"
    },
    {
      "sid": "WCbb18850107c35d54527b63dad22e531c",
      "account_sid": "AC1c41896f44563b7c8194235ee6d267b1",
      "workspace_sid": "WS74facd34612674c795b19d40690aeec2",
      "worker_sid": "WKb43a6313926a885fbe60b0f8c97b3c35",
      "task_channel_sid": "TCa718ea222669f2bfac6e0836c89e4ead",
      "task_channel_unique_name": "custom3",
      "configured_capacity": 1,
      "available": true,
      "assigned_tasks": 0,
      "available_capacity_percentage": 100,
      "date_created": "2017-02-27T21:28:02Z",
      "date_updated": "2017-02-27T21:28:02Z",
      "url": "https://taskrouter.twilio.com/v1/Workspaces/WS74facd34612674c795b19d40690aeec2/Workers/WKb43a6313926a885fbe60b0f8c97b3c35/Channels/WCbb18850107c35d54527b63dad22e531c"
    },
    {
      "sid": "WC63a3107591e3979a9e1b51e4d9519f99",
      "account_sid": "AC1c41896f44563b7c8194235ee6d267b1",
      "workspace_sid": "WS74facd34612674c795b19d40690aeec2",
      "worker_sid": "WKb43a6313926a885fbe60b0f8c97b3c35",
      "task_channel_sid": "TC9b39f59f71c1e974134c5eff8972537a",
      "task_channel_unique_name": "custom4",
      "configured_capacity": 1,
      "available": true,
      "assigned_tasks": 0,
      "available_capacity_percentage": 100,
      "date_created": "2017-02-27T21:28:02Z",
      "date_updated": "2017-02-27T21:28:02Z",
      "url": "https://taskrouter.twilio.com/v1/Workspaces/WS74facd34612674c795b19d40690aeec2/Workers/WKb43a6313926a885fbe60b0f8c97b3c35/Channels/WC63a3107591e3979a9e1b51e4d9519f99"
    },
    {
      "sid": "WC7fe11b2f71c64b9451366eb0929cd5bf",
      "account_sid": "AC1c41896f44563b7c8194235ee6d267b1",
      "workspace_sid": "WS74facd34612674c795b19d40690aeec2",
      "worker_sid": "WKb43a6313926a885fbe60b0f8c97b3c35",
      "task_channel_sid": "TCfc2136ff7a54e182ec78c9f8e1cd937c",
      "task_channel_unique_name": "custom5",
      "configured_capacity": 1,
      "available": true,
      "assigned_tasks": 0,
      "available_capacity_percentage": 100,
      "date_created": "2017-02-27T21:28:02Z",
      "date_updated": "2017-02-27T21:28:02Z",
      "url": "https://taskrouter.twilio.com/v1/Workspaces/WS74facd34612674c795b19d40690aeec2/Workers/WKb43a6313926a885fbe60b0f8c97b3c35/Channels/WC7fe11b2f71c64b9451366eb0929cd5bf"
    }
  ],
  "meta": {
    "page": 0,
    "page_size": 50,
    "first_page_url": "https://taskrouter.twilio.com/v1/Workspaces/WS74facd34612674c795b19d40690aeec2/Workers/WKb43a6313926a885fbe60b0f8c97b3c35/Channels?PageSize=50&Page=0",
    "previous_page_url": null,
    "url": "https://taskrouter.twilio.com/v1/Workspaces/WS74facd34612674c795b19d40690aeec2/Workers/WKb43a6313926a885fbe60b0f8c97b3c35/Channels?PageSize=50&Page=0",
    "next_page_url": null,
    "key": "channels"
  }
}
Response Format:
  • json
SDK Version:
  • 7.x
SDK Version:
  • 5.x
Format:
  • JSON
# Get twilio-ruby from twilio.com/docs/ruby/install
require 'twilio-ruby'

# Get your Account SID and Auth Token from twilio.com/console
account_sid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
auth_token = 'your_auth_token'
workspace_sid = 'WSXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
worker_sid = 'WSXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'

client = Twilio::REST::Client.new(account_sid, auth_token)

worker_channel = client.taskrouter.v1.workspaces(workspace_sid)
  .workers(worker_sid).worker_channels('voice').fetch

puts worker_channel.task_channel_unique_name
import com.twilio.Twilio;
import com.twilio.rest.taskrouter.v1.workspace.worker.WorkerChannel;

public class GetWorkerChannel {

	private static final String ACCOUNT_SID = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
	private static final String AUTH_TOKEN = "your_auth_token";
	private static final String WORKSPACE_SID = "WSXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
	private static final String WORKER_SID = "WKXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";

	public static void main(String[] args) {
		Twilio.init(ACCOUNT_SID, AUTH_TOKEN);

		WorkerChannel wc = WorkerChannel.fetcher(WORKSPACE_SID, WORKER_SID, "voice").fetch();

		System.out.println(wc.getTaskChannelUniqueName());
	}

}
$ curl https://taskrouter.twilio.com/v1/Workspaces/WSXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Workers/WKXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Channels/voice \
    -u '{account_sid}:{auth_token}'
{
  "sid": "WC3ff2dfb30125f534f80778a491a8d7d6",
  "account_sid": "ACxxxxxxxxxxxxxxxxxxxxxxxxxx",
  "workspace_sid": "WSbe0184a8fb478195e8bd199c4eed712c",
  "worker_sid": "WK5de00310a22b8289ff50a2ac424e8b07",
  "task_channel_sid": "TC3c1f1befe23ebd7cbc7ba6a2450d6018",
  "task_channel_unique_name": "voice",
  "configured_capacity": 2,
  "available": true,
  "assigned_tasks": 0,
  "available_capacity_percentage": 100,
  "date_created": "2016-08-22T22:41:41Z",
  "date_updated": "2016-08-22T22:41:41Z",
  "url": "https://taskrouter.twilio.com/v1/Workspaces/WSbe0184a8fb478195e8bd199c4eed712c/Workers/WK5de00310a22b8289ff50a2ac424e8b07/Channels/WC3ff2dfb30125f534f80778a491a8d7d6"
}
Response Format:
  • json
SDK Version:
  • 7.x
SDK Version:
  • 5.x
Format:
  • JSON
# Get twilio-ruby from twilio.com/docs/ruby/install
require 'twilio-ruby'

# Get your Account SID and Auth Token from twilio.com/console
account_sid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
auth_token = 'your_auth_token'
workspace_sid = 'WSXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
worker_sid = 'WSXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'

client = Twilio::REST::Client.new(account_sid, auth_token)

worker_channel = client.taskrouter.v1.workspaces(workspace_sid)
  .workers(worker_sid).worker_channels('voice').update(capacity: 1)

puts worker_channel.sid

puts worker_channel.configured_capacity
import com.twilio.Twilio;
import com.twilio.rest.taskrouter.v1.workspace.worker.WorkerChannel;

public class UpdateWorkerChannel {

	private static final String ACCOUNT_SID = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
	private static final String AUTH_TOKEN = "your_auth_token";
	private static final String WORKSPACE_SID = "WSXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
	private static final String WORKER_SID = "WKXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";

	public static void main(String[] args) {
		Twilio.init(ACCOUNT_SID, AUTH_TOKEN);

		WorkerChannel wc = WorkerChannel.updater(WORKSPACE_SID, WORKER_SID, "voice").setCapacity(1).update();

		System.out.println(wc.getSid() + "\t" + wc.getConfiguredCapacity());
	}

}
$ curl -X POST https://taskrouter.twilio.com/v1/Workspaces/WSXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Workers/WKXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Channels/voice \
		-d 'Capacity=2&Available=true' \
    -u '{account_sid}:{auth_token}'
{
  "sid": "WC3ff2dfb30125f534f80778a491a8d7d6",
  "account_sid": "ACxxxxxxxxxxxxxxxxxxxxxxxxxx",
  "workspace_sid": "WSbe0184a8fb478195e8bd199c4eed712c",
  "worker_sid": "WK5de00310a22b8289ff50a2ac424e8b07",
  "task_channel_sid": "TC3c1f1befe23ebd7cbc7ba6a2450d6018",
  "task_channel_unique_name": "voice",
  "configured_capacity": 2,
  "available": true,
  "assigned_tasks": 0,
  "available_capacity_percentage": 100,
  "date_created": "2016-08-22T22:41:41Z",
  "date_updated": "2016-08-22T22:41:41Z",
  "url": "https://taskrouter.twilio.com/v1/Workspaces/WSbe0184a8fb478195e8bd199c4eed712c/Workers/WK5de00310a22b8289ff50a2ac424e8b07/Channels/WC3ff2dfb30125f534f80778a491a8d7d6"
}