TaskRouter provides real-time, cumulative, and historical statistics for Workers. Historical statistics allow you to analyze data from the past 30 days. 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.
account_sid
type: SID<AC>The SID of the Account that created the Worker resource.
^AC[0-9a-fA-F]{32}$
34
34
workspace_sid
type: SID<WS>The SID of the Workspace that contains the Worker.
^WS[0-9a-fA-F]{32}$
34
34
Minutes cannot be used in combination with StartDate and EndDate parameters. If no parameters are passed, 15 minutes will be the default.
_10GET /v1/Workspaces/{WorkspaceSid}/Workers/Statistics
WorkspaceSid
type: SID<WS>The SID of the Workspace with the Worker to fetch.
^WS[0-9a-fA-F]{32}$
34
34
Minutes
type: integerOnly 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.
StartDate
type: string<date-time>Only calculate statistics from this date and time and later, specified in ISO 8601 format.
EndDate
type: string<date-time>Only calculate statistics from this date and time and earlier, specified in GMT as an ISO 8601 date-time.
TaskQueueSid
type: SID<WQ>The SID of the TaskQueue for which to fetch Worker statistics.
^WQ[0-9a-fA-F]{32}$
34
34
TaskQueueName
type: stringThe friendly_name
of the TaskQueue for which to fetch Worker statistics.
FriendlyName
type: stringOnly include Workers with friendly_name
values that match this parameter.
TaskChannel
type: stringOnly calculate statistics on this TaskChannel. Can be the TaskChannel's SID or its unique_name
, such as voice
, sms
, or default
.
We recommended leveraging caching when utilizing this endpoint from your backend application to ensure this endpoint can support your scaling needs.
In scenarios where this endpoint would be used from a client application, we recommend implementing a sync layer, e.g., via Twilio Sync, to help synchronize this endpoint's state across all clients, and to ensure this endpoint can scale with your user growth.
_10GET /v1/Workspaces/{WorkspaceSid}/Workers/RealTimeStatistics
WorkspaceSid
type: SID<WS>The SID of the Workspace with the resource to fetch.
^WS[0-9a-fA-F]{32}$
34
34
TaskChannel
type: stringOnly 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:
Property | Description |
---|---|
TotalWorkers | The total number of Workers |
ActivityStatistics | The current Worker status count breakdown by Activity |
Cumulative statistics allow you to analyze Worker data from the past 30 days.
_10GET /v1/Workspaces/{WorkspaceSid}/Workers/CumulativeStatistics
WorkspaceSid
type: SID<WS>The SID of the Workspace with the resource to fetch.
^WS[0-9a-fA-F]{32}$
34
34
EndDate
type: string<date-time>Only calculate statistics from this date and time and earlier, specified in ISO 8601 format.
Minutes
type: integerOnly 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.
StartDate
type: string<date-time>Only calculate statistics from this date and time and later, specified in ISO 8601 format.
TaskChannel
type: stringOnly 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:
Property | 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 |
_10GET /v1/Workspaces/{WorkspaceSid}/Workers/{WorkerSid}/Statistics
WorkspaceSid
type: SID<WS>The SID of the Workspace with the WorkerChannel to fetch.
^WS[0-9a-fA-F]{32}$
34
34
WorkerSid
type: SID<WK>The SID of the Worker with the WorkerChannel to fetch.
^WK[0-9a-fA-F]{32}$
34
34
Minutes
type: integerOnly 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.
StartDate
type: string<date-time>Only calculate statistics from this date and time and later, specified in ISO 8601 format.
EndDate
type: string<date-time>Only include usage that occurred on or before this date, specified in GMT as an ISO 8601 date-time.
TaskChannel
type: stringOnly calculate statistics on this TaskChannel. Can be the TaskChannel's SID or its unique_name
, such as voice
, sms
, or default
.