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.
WorkerChannel properties
Resource Properties in REST API format | |
---|---|
account_sid
|
The SID of the Account that created the Worker resource. |
assigned_tasks
|
The total number of Tasks assigned to Worker for the TaskChannel type. |
available
|
Whether the Worker should receive Tasks of the TaskChannel type. |
available_capacity_percentage
|
The current percentage of capacity the TaskChannel has available. Can be a number between |
configured_capacity
|
The current configured capacity for the WorkerChannel. TaskRouter will not create any reservations after the assigned Tasks for the Worker reaches the value. |
date_created
|
The date and time in GMT when the resource was created specified in RFC 2822 format. |
date_updated
|
The date and time in GMT when the resource was last updated specified in RFC 2822 format. |
sid
|
The unique string that we created to identify the WorkerChannel resource. |
task_channel_sid
|
The SID of the TaskChannel. |
task_channel_unique_name
|
The unique name of the TaskChannel, such as |
worker_sid
|
The SID of the Worker that contains the WorkerChannel. |
workspace_sid
|
The SID of the Workspace that contains the WorkerChannel. |
url
|
The absolute URL of the WorkerChannel resource. |
Fetch a WorkerChannel resource
https://taskrouter.twilio.com/v1/Workspaces/{WorkspaceSid}/Workers/{WorkerSid}/Channels/{Sid}
Returns a single Worker Channel resource identified by either WorkerChannelUniqueName
or WorkerChannelSid
Parameters
Parameters in REST API format | |
---|---|
workspace_sid
Path
|
The SID of the Workspace with the WorkerChannel to fetch. |
worker_sid
Path
|
The SID of the Worker with the WorkerChannel to fetch. |
sid
Path
|
The SID of the WorkerChannel to fetch. |
Example 1
Read multiple WorkerChannel resources
https://taskrouter.twilio.com/v1/Workspaces/{WorkspaceSid}/Workers/{WorkerSid}/Channels
Parameters
Parameters in REST API format | |
---|---|
workspace_sid
Path
|
The SID of the Workspace with the WorkerChannels to read. |
worker_sid
Path
|
The SID of the Worker with the WorkerChannels to read. |
Example 1
Update a WorkerChannel resource
https://taskrouter.twilio.com/v1/Workspaces/{WorkspaceSid}/Workers/{WorkerSid}/Channels/{Sid}
Parameters
Parameters in REST API format | |
---|---|
workspace_sid
Path
|
The SID of the Workspace with the WorkerChannel to update. |
worker_sid
Path
|
The SID of the Worker with the WorkerChannel to update. |
sid
Path
|
The SID of the WorkerChannel to update. |
capacity
Optional
|
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. |
available
Optional
|
Whether the WorkerChannel is available. Set to |
Example 1
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 by visiting Twilio's Stack Overflow Collective or browsing the Twilio tag on Stack Overflow.