Fetch worker statistics

GET /v1/Workspaces/{WorkspaceSid}/Workers/Statistics

Path parameters

  • WorkspaceSid string Required

    The SID of the Workspace with the Worker to fetch.

    Minimum length is 34, maximum length is 34. Format should match the following pattern: ^WS[0-9a-fA-F]{32}$.

Query parameters

  • Minutes integer

    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.

  • StartDate string(date-time)

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

  • EndDate string(date-time)

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

  • TaskQueueSid string

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

    Minimum length is 34, maximum length is 34. Format should match the following pattern: ^WQ[0-9a-fA-F]{32}$.

  • TaskQueueName string

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

  • FriendlyName string

    Only include Workers with friendly_name values that match this parameter.

  • TaskChannel string

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

Responses

  • 200 application/json

    OK

    Hide headers attributes Show headers attributes
    • X-Rate-Limit-Limit string
    • X-Rate-Limit-Remaining string
    • X-Rate-Limit-Config string
    • Access-Control-Allow-Origin string

      Specify the origin(s) allowed to access the resource

    • Access-Control-Allow-Methods string

      Specify the HTTP methods allowed when accessing the resource

    • Access-Control-Allow-Headers string

      Specify the headers allowed when accessing the resource

    • Access-Control-Allow-Credentials boolean

      Indicates whether the browser should include credentials

    • Access-Control-Expose-Headers string

      Headers exposed to the client

    Hide response attributes Show response attributes object
    • realtime

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

    • cumulative

      An object that contains the cumulative statistics for the Worker.

    • account_sid string | null

      The SID of the Account that created the Worker resource.

      Minimum length is 34, maximum length is 34. Format should match the following pattern: ^AC[0-9a-fA-F]{32}$.

    • workspace_sid string | null

      The SID of the Workspace that contains the Worker.

      Minimum length is 34, maximum length is 34. Format should match the following pattern: ^WS[0-9a-fA-F]{32}$.

    • url string(uri) | null

      The absolute URL of the Worker statistics resource.

GET /v1/Workspaces/{WorkspaceSid}/Workers/Statistics
curl \
 --request GET 'https://taskrouter.twilio.com/v1/Workspaces/{WorkspaceSid}/Workers/Statistics' \
 --user "username:password"
Response examples (200)
{
  "url": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Workers/Statistics",
  "realtime": {
    "total_workers": 15,
    "activity_statistics": [
      {
        "sid": "WAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
        "workers": 0,
        "friendly_name": "Idle"
      },
      {
        "sid": "WAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
        "workers": 9,
        "friendly_name": "Busy"
      },
      {
        "sid": "WAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
        "workers": 6,
        "friendly_name": "Offline"
      },
      {
        "sid": "WAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
        "workers": 0,
        "friendly_name": "Reserved"
      }
    ]
  },
  "cumulative": {
    "end_time": "2008-01-02T00:00:00Z",
    "start_time": "2008-01-02T00:00:00Z",
    "activity_durations": [
      {
        "avg": 1080,
        "max": 0,
        "min": 900,
        "sid": "WAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
        "total": 5400,
        "friendly_name": "Offline"
      },
      {
        "avg": 1012,
        "max": 0,
        "min": 900,
        "sid": "WAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
        "total": 8100,
        "friendly_name": "Busy"
      },
      {
        "avg": 0,
        "max": 0,
        "min": 0,
        "sid": "WAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
        "total": 0,
        "friendly_name": "Idle"
      },
      {
        "avg": 0,
        "max": 0,
        "min": 0,
        "sid": "WAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
        "total": 0,
        "friendly_name": "Reserved"
      }
    ],
    "reservations_created": 0,
    "reservations_accepted": 0,
    "reservations_canceled": 0,
    "reservations_rejected": 0,
    "reservations_rescinded": 0,
    "reservations_timed_out": 0
  },
  "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
  "workspace_sid": "WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
}