Fetch task queue real time statistics

GET /v1/Workspaces/{WorkspaceSid}/TaskQueues/{TaskQueueSid}/RealTimeStatistics

Path parameters

  • WorkspaceSid string Required

    The SID of the Workspace with the TaskQueue to fetch.

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

  • TaskQueueSid string Required

    The SID of the TaskQueue for which to fetch statistics.

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

Query parameters

  • TaskChannel string

    The TaskChannel for which to fetch statistics. 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
    • account_sid string | null

      The SID of the Account that created the TaskQueue resource.

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

    • activity_statistics array | null

      The number of current Workers by Activity.

    • longest_task_waiting_age integer

      The age of the longest waiting Task.

      Default value is 0.

    • longest_task_waiting_sid string | null

      The SID of the longest waiting Task.

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

    • longest_relative_task_age_in_queue integer

      The relative age in the TaskQueue for the longest waiting Task. Calculation is based on the time when the Task entered the TaskQueue.

      Default value is 0.

    • longest_relative_task_sid_in_queue string | null

      The Task SID of the Task waiting in the TaskQueue the longest. Calculation is based on the time when the Task entered the TaskQueue.

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

    • task_queue_sid string | null

      The SID of the TaskQueue from which these statistics were calculated.

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

    • tasks_by_priority

      The number of Tasks by priority. For example: {"0": "10", "99": "5"} shows 10 Tasks at priority 0 and 5 at priority 99.

    • tasks_by_status

      The number of Tasks by their current status. For example: {"pending": "1", "reserved": "3", "assigned": "2", "completed": "5"}.

    • total_available_workers integer

      The total number of Workers in the TaskQueue with an available status. Workers with an available status may already have active interactions or may have none.

      Default value is 0.

    • total_eligible_workers integer

      The total number of Workers eligible for Tasks in the TaskQueue, independent of their Activity state.

      Default value is 0.

    • total_tasks integer

      The total number of Tasks.

      Default value is 0.

    • workspace_sid string | null

      The SID of the Workspace that contains the TaskQueue.

      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 TaskQueue statistics resource.

GET /v1/Workspaces/{WorkspaceSid}/TaskQueues/{TaskQueueSid}/RealTimeStatistics
curl \
 --request GET 'https://taskrouter.twilio.com/v1/Workspaces/{WorkspaceSid}/TaskQueues/{TaskQueueSid}/RealTimeStatistics' \
 --user "username:password"
Response examples (200)
{
  "url": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/TaskQueues/WQaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/RealTimeStatistics",
  "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
  "total_tasks": 100,
  "workspace_sid": "WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
  "task_queue_sid": "WQaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
  "tasks_by_status": {
    "pending": 0,
    "assigned": 0,
    "reserved": 0,
    "wrapping": 0
  },
  "tasks_by_priority": {},
  "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"
    }
  ],
  "total_eligible_workers": 100,
  "total_available_workers": 100,
  "longest_task_waiting_age": 100,
  "longest_task_waiting_sid": "WTaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
  "longest_relative_task_age_in_queue": 100,
  "longest_relative_task_sid_in_queue": "WTaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
}