Level up your Twilio API skills in TwilioQuest, an educational game for Mac, Windows, and Linux. Download Now

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 PHP format
realtime
object Not PII

cumulative
object Not PII

accountSid
sid<AC> Not PII

workspaceSid
sid<WS> Not PII

url
url Not PII

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 PHP format
minutes
Optional
get integer Not PII

Filter cumulative statistics by up to 'x' minutes in the past. This is helpful for statistics for the last 15 minutes, 240 minutes (4 hours), and 480 minutes (8 hours) to see trends. Defaults to 15 minutes.

startDate
Optional
get date_time<iso8601> Not PII

Filter cumulative statistics by a start date. This is helpful for defining a range of statistics to capture. Input is a string of the format: yyyy-MM-dd'T'HH:mm:ss'Z'.

endDate
Optional
get date_time<iso8601> Not PII

Filter cumulative statistics by a end date. This is helpful for defining a range of statistics to capture. Input is a string of the format: yyyy-MM-dd'T'HH:mm:ss'Z'.

taskQueueSid
Optional
get sid<WQ> Not PII

Filter the real-time and cumulative statistics based on Workers tied to a particular queue

taskQueueName
Optional
get string Not PII

Filter the real-time and cumulative statistics based on Workers tied to a particular queue

taskChannel
Optional
get string Not PII

Filter cumulative statistics by TaskChannel. Takes in a Unique Name ("voice", "sms", "default", etc.) or a TaskChannelSid.

        
        
        
        

        Fetch Real-Time Worker Statistics

        GET /v1/Workspaces/{WorkspaceSid}/Workers/RealTimeStatistics
        
        Names in PHP format
        taskChannel
        Optional
        get string Not PII

        Filter cumulative statistics by TaskChannel. Takes in a Unique Name ("voice", "sms", "default", etc.) or a TaskChannelSid.

              
              
              
              

              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 PHP format
              endDate
              Optional
              get date_time<iso8601> Not PII

              Filter cumulative statistics by a end date. This is helpful for defining a range of statistics to capture. Input is a string of the format: yyyy-MM-dd'T'HH:mm:ss'Z'.

              minutes
              Optional
              get integer Not PII

              Filter cumulative statistics by up to 'x' minutes in the past. This is helpful for statistics for the last 15 minutes, 240 minutes (4 hours), and 480 minutes (8 hours) to see trends. Defaults to 15 minutes.

              startDate
              Optional
              get date_time<iso8601> Not PII

              Filter cumulative statistics by a start date. This is helpful for defining a range of statistics to capture. Input is a string of the format: yyyy-MM-dd'T'HH:mm:ss'Z'.

              taskChannel
              Optional
              get string Not PII

              Filter cumulative statistics by TaskChannel. Takes in a Unique Name ("voice", "sms", "default", etc.) or a TaskChannelSid.

                    
                    
                    
                    

                    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 PHP format
                    minutes
                    Optional
                    get integer Not PII

                    Filter cumulative statistics by up to 'x' minutes in the past. This is helpful for statistics for the last 15 minutes, 240 minutes (4 hours), and 480 minutes (8 hours) to see trends. Defaults to 15 minutes.

                    startDate
                    Optional
                    get date_time<iso8601> Not PII

                    Filter cumulative statistics by a start date. This is helpful for defining a range of statistics to capture. Input is a string of the format: yyyy-MM-dd'T'HH:mm:ss'Z'.

                    endDate
                    Optional
                    get date_time<iso8601> Not PII

                    Filter cumulative statistics by a end date. This is helpful for defining a range of statistics to capture. Input is a string of the format: yyyy-MM-dd'T'HH:mm:ss'Z'.

                    taskChannel
                    Optional
                    get string Not PII

                    Filter cumulative statistics by TaskChannel. Takes in a Unique Name ("voice", "sms", "default", etc.) or a TaskChannelSid.

                          
                          
                          
                          
                          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.