Skip to content

Get AHT

Description

The interface GET_AHT (Average Handle Time) is a REST API querying the aggregated metric of the AHT. This API provides the data in terms of voice and message. It queries aggregate conversation data to retrieve the tHandle metric, used to calculate Average Handle Time.

Business Application

A critical efficiency metric. Lower AHT often indicates efficiency, while High AHT might suggest complex issues or training gaps. Used for Capacity Planning and staffing.

Endpoint

POST https://api.mypurecloud.de/api/v2/analytics/conversations/aggregates/query

Request

Headers

  • Authorization: Bearer Token
  • Content-Type: application/json

Body Parameters

Name Type Mandatory Description
interval DateTime Yes Time range for this query (e.g., 2025-11-10T00:00.../2025-11-17T...). Dynamic Calculation: Calculate based on current date (e.g., Last 7 Days).
metrics Array Yes Requested Metrics (e.g., ["tHandle"])
filter Object Optional Filter to get per user as opposed to all users. Use userId retrieved from Get All Users.

Sample Request

{
 "interval": "2025-11-10T00:00:00.000Z/2025-11-17T23:59:59.999Z",
 "metrics": ["tHandle"]
}

CURL Example

curl -X POST 'https://api.mypurecloud.de/api/v2/analytics/conversations/aggregates/query' \
  -H 'Authorization: Bearer *******************' \
  -H 'Content-Type: application/json' \
  --data-raw $'{"interval":"2025-11-10T00:00:00.000Z/2025-11-17T23:59:59.999Z","metrics":["tHandle"]}'

Response

Body Parameters

Name Type Description
results Array Contains grouping and data for the query
metrics Array Contains the specific metric stats (sum, count) used to calculate AHT

Sample Response

{
    "results": [
        {
            "group": {
                "mediaType": "message"
            },
            "data": [
                {
                    "interval": "2025-11-10T00:00:00.000Z/2025-11-17T23:59:59.999Z",
                    "metrics": [
                        {
                            "metric": "tHandle",
                            "stats": {
                                "max": 4825184,
                                "min": 7489,
                                "count": 1113,
                                "sum": 963943429
                            }
                        }
                    ]
                }
            ]
        },
        {
            "group": {
                "mediaType": "voice"
            },
            "data": [
                {
                    "interval": "2025-11-10T00:00:00.000Z/2025-11-17T23:59:59.999Z",
                    "metrics": [
                        {
                            "metric": "tHandle",
                            "stats": {
                                "max": 3449214,
                                "min": 856,
                                "count": 1618,
                                "sum": 430537628
                            }
                        }
                    ]
                }
            ]
        }
    ]
}