Menu

Expand
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?

Worker Statistics Resource

TaskRouter provides real-time, cumulative, and historical statistics for Workers. There are various APIs for retrieving the data that is meaningful to your business.

These resources may not be accessible if your Workspace exceeds 100 workers. Please contact support for additional assistance.

Names in REST API format
realtime
object Not PII

An object that contains the real-time statistics for the Worker.

cumulative
object Not PII

An object that contains the cumulative statistics for the Worker.

account_sid
sid<AC> Not PII

The SID of the Account that created the Worker resource.

workspace_sid
sid<WS> Not PII

The SID of the Workspace that contains the Worker.

url
url Not PII

The absolute URL of the Worker statistics resource.

Minutes cannot be used in combination with StartDate and EndDate parameters. If no parameters are passed, 15 minutes will be the default.

Fetch All Worker Statistics

GET /v1/Workspaces/{WorkspaceSid}/Workers/Statistics
Names in REST API format
workspace_sid
Path
get sid<WS> Not PII

The SID of the Workspace with the Worker to fetch.

minutes
Optional
get integer Not PII

Only calculate statistics since this many minutes in the past. The default 15 minutes. This is helpful for displaying statistics for the last 15 minutes, 240 minutes (4 hours), and 480 minutes (8 hours) to see trends.

start_date
Optional
get date_time<iso8601> Not PII

Only calculate statistics from this date and time and later, specified in ISO 8601 format.

end_date
Optional
get date_time<iso8601> Not PII

Only calculate statistics from this date and time and earlier, specified in GMT as an ISO 8601 date-time.

task_queue_sid
Optional
get sid<WQ> Not PII

The SID of the TaskQueue for which to fetch Worker statistics.

task_queue_name
Optional
get string Not PII

The friendly_name of the TaskQueue for which to fetch Worker statistics.

friendly_name
Optional
get string Not PII

Only include Workers with friendly_name values that match this parameter.

task_channel
Optional
get string Not PII

Only calculate statistics on this TaskChannel. Can be the TaskChannel's SID or its unique_name, such as voice, sms, or default.

        
        
        
        

        Fetch Real-Time Worker Statistics

        GET /v1/Workspaces/{WorkspaceSid}/Workers/RealTimeStatistics
        
        Names in REST API format
        workspace_sid
        Path
        get sid<WS> Not PII

        The SID of the Workspace with the resource to fetch.

        task_channel
        Optional
        get string Not PII

        Only calculate real-time statistics on this TaskChannel. Can be the TaskChannel's SID or its unique_name, such as voice, sms, or default.

              
              
              
              

              Real-time statistics relating to a list of Workers include the following:

              Field Description
              TotalWorkers The total number of Workers
              ActivityStatistics The current Worker status count breakdown by Activity

              Fetch Cumulative Worker Statistics

              GET /v1/Workspaces/{WorkspaceSid}/Workers/CumulativeStatistics
              
              Names in REST API format
              workspace_sid
              Path
              get sid<WS> Not PII

              The SID of the Workspace with the resource to fetch.

              end_date
              Optional
              get date_time<iso8601> Not PII

              Only calculate statistics from this date and time and earlier, specified in ISO 8601 format.

              minutes
              Optional
              get integer Not PII

              Only calculate statistics since this many minutes in the past. The default 15 minutes. This is helpful for displaying statistics for the last 15 minutes, 240 minutes (4 hours), and 480 minutes (8 hours) to see trends.

              start_date
              Optional
              get date_time<iso8601> Not PII

              Only calculate statistics from this date and time and later, specified in ISO 8601 format.

              task_channel
              Optional
              get string Not PII

              Only calculate cumulative statistics on this TaskChannel. Can be the TaskChannel's SID or its unique_name, such as voice, sms, or default.

                    
                    
                    
                    

                    Cumulative statistics relating to a list of Workers include the following over the interval:

                    Field Description
                    ReservationsCreated The total number of Reservations that were created
                    ReservationsAccepted The total number of Reservations that were accepted
                    ReservationsRejected The total number of Reservations that were rejected
                    ReservationsTimedOut The total number of Reservations that were timed out
                    ReservationsCanceled The total number of Reservations that were canceled
                    ReservationsRescinded The total number of Reservations that were rescinded
                    ActivityDurations The minimum, average, maximum and total time (in seconds) Workers spent in each Activity

                    Fetch A Specific Worker's Statistics

                    GET /v1/Workspaces/{WorkspaceSid}/Workers/{WorkerSid}/Statistics
                    
                    Names in REST API format
                    workspace_sid
                    Path
                    get sid<WS> Not PII

                    The SID of the Workspace with the WorkerChannel to fetch.

                    worker_sid
                    Path
                    get sid<WK> Not PII

                    The SID of the Worker with the WorkerChannel to fetch.

                    minutes
                    Optional
                    get integer Not PII

                    Only calculate statistics since this many minutes in the past. The default 15 minutes. This is helpful for displaying statistics for the last 15 minutes, 240 minutes (4 hours), and 480 minutes (8 hours) to see trends.

                    start_date
                    Optional
                    get date_time<iso8601> Not PII

                    Only calculate statistics from this date and time and later, specified in ISO 8601 format.

                    end_date
                    Optional
                    get date_time<iso8601> Not PII

                    Only include usage that occurred on or before this date, specified in GMT as an ISO 8601 date-time.

                    task_channel
                    Optional
                    get string Not PII

                    Only calculate statistics on this TaskChannel. Can be the TaskChannel's SID or its unique_name, such as voice, sms, or default.

                          
                          
                          
                          
                          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.