Fetch workflow statistics

GET /v1/Workspaces/{WorkspaceSid}/Workflows/{WorkflowSid}/Statistics

Path parameters

  • WorkspaceSid string Required

    The SID of the Workspace with the Workflow to fetch.

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

  • WorkflowSid string Required

    Returns the list of Tasks that are being controlled by the Workflow with the specified SID value.

    Minimum length is 34, maximum length is 34. Format should match the following pattern: ^WW[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.

  • TaskChannel string

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

  • SplitByWaitTime string

    A comma separated list of values that describes the thresholds, in seconds, to calculate statistics on. For each threshold specified, the number of Tasks canceled and reservations accepted above and below the specified thresholds in seconds are computed. For example, 5,30 would show splits of Tasks that were canceled or accepted before and after 5 seconds and before and after 30 seconds. This can be used to show short abandoned Tasks or Tasks that failed to meet an SLA.

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 Workflow resource.

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

    • cumulative

      An object that contains the cumulative statistics for the Workflow.

    • realtime

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

    • workflow_sid string | null

      Returns the list of Tasks that are being controlled by the Workflow with the specified SID value.

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

    • workspace_sid string | null

      The SID of the Workspace that contains the Workflow.

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

GET /v1/Workspaces/{WorkspaceSid}/Workflows/{WorkflowSid}/Statistics
curl \
 --request GET 'https://taskrouter.twilio.com/v1/Workspaces/{WorkspaceSid}/Workflows/{WorkflowSid}/Statistics' \
 --user "username:password"
Response examples (200)
{
  "url": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Workflows/WWaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Statistics",
  "realtime": {
    "total_tasks": 1,
    "tasks_by_status": {
      "pending": 0,
      "assigned": 1,
      "reserved": 0,
      "wrapping": 0
    },
    "longest_task_waiting_age": 0,
    "longest_task_waiting_sid": "WTaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
  },
  "cumulative": {
    "end_time": "2008-01-02T00:00:00Z",
    "start_time": "2008-01-02T00:00:00Z",
    "tasks_moved": 0,
    "tasks_entered": 0,
    "tasks_canceled": 0,
    "reservations_accepted": 0,
    "reservations_rejected": 0,
    "reservations_timed_out": 0,
    "avg_task_acceptance_time": 0,
    "tasks_timed_out_in_workflow": 0
  },
  "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
  "workflow_sid": "WWaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
  "workspace_sid": "WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
}