Rate this page:

Thanks for rating this page!

We are always striving to improve our documentation quality, and your feedback is valuable to us. How could this documentation serve you better?

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.


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}.


An example that lists all in a workspace


        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 of retrieving a single WorkerChannel


              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 for updating capacity for 'voice' channel.


                    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 )
                    Rate this page:

                    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.