> ## Documentation Index
> Fetch the complete documentation index at: https://docs.open.cx/llms.txt
> Use this file to discover all available pages before exploring further.

# Get phone average handle time

> Get phone average handle time (AHT): talk, hold and after-call work for calls human agents handled, and how many handles took longer than their target.

`from` and `to` select handles by when the agent answered. `timezone` is an IANA name, default `UTC`. Filter with `team_id`, `policy_id`, `user_id`, or `direction` (`inbound`, `outbound`).

`aht_seconds` is `(talk_seconds + hold_seconds + after_call_work_seconds) / handles`. Only finished handles count: the agent has left the call and their after-call work has ended. A call two agents handled counts once for each. `over_target_rate` is `over_target / graded`, where `graded` handles had an AHT target when the agent answered. `target_seconds` is the target when every handle in the range had the same one, otherwise `null`. See [Average handle time](https://docs.open.cx/phone/answer-time-sla.md#average-handle-time).


## OpenAPI

````yaml get /sla/analytics/phone/handle-time
openapi: 3.1.0
info:
  title: OpenCX API
  description: >

    OpenCX is an AI-powered, all-in-one platform for customer support and
    outbound communications.


    Use this API to manage your OpenCX organization's AI agents, actions,
    conversations, contacts, and more.


    To get started, generate a new API key from the dashboard.


    ## Authentication

    All API endpoints require authentication using a Bearer token. You can
    generate an API key from your OpenCX dashboard.


    ## Rate Limiting

    API requests are rate limited to ensure fair usage. The current limits are:

    - 100 requests per minute for standard endpoints

    - 1000 requests per minute for streaming endpoints


    ## Error Handling

    The API uses standard HTTP status codes and returns detailed error messages
    in the response body.
  version: 1.0-beta
  license:
    name: MIT
    url: https://opensource.org/licenses/MIT
servers:
  - url: http://localhost:8080
    description: Development
  - url: https://api.open.cx
    description: Production
security:
  - bearerAuth: []
paths:
  /sla/analytics/phone/handle-time:
    get:
      summary: Get phone average handle time
      description: >-
        Get average handle time (AHT) for calls human agents handled: talk, hold
        and after-call work totals and averages, and how many handles took
        longer than their target. AHT starts when the agent answers, so IVR and
        queue time are left out. A call two agents handled counts once for each.
      operationId: getPhoneHandleTimeOverview
      parameters:
        - schema:
            default: UTC
            type: string
          in: query
          name: timezone
          required: false
          description: IANA timezone for day and hour buckets.
        - schema:
            type: string
            maxLength: 36
          in: query
          name: team_id
          required: false
        - schema:
            type: string
            format: uuid
            pattern: >-
              ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
          in: query
          name: policy_id
          required: false
        - schema: {}
          in: query
          name: from
          required: true
          description: Start of the range, on when agents answered.
        - schema: {}
          in: query
          name: to
          required: true
          description: End of the range, on when agents answered.
        - schema:
            type: integer
            exclusiveMinimum: 0
            maximum: 9007199254740991
          in: query
          name: user_id
          required: false
          description: Only this agent’s handles.
        - schema:
            type: string
            enum:
              - inbound
              - outbound
          in: query
          name: direction
          required: false
      responses:
        '200':
          description: Default Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PhoneHandleTimeOverviewResponseDto'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorDto'
components:
  schemas:
    PhoneHandleTimeOverviewResponseDto:
      $schema: https://json-schema.org/draft/2020-12/schema
      $id: '#/components/schemas/PhoneHandleTimeOverviewResponseDto'
      type: object
      properties:
        handles:
          type: integer
          minimum: -9007199254740991
          maximum: 9007199254740991
          description: >-
            Finished handles: an agent answered, left the call, and their
            after-call work ended. A call two agents handled counts once for
            each.
        talk_seconds:
          type: number
          description: 'Total talk time: on the call, holds excluded.'
        hold_seconds:
          type: number
          description: Total time the agents kept callers on hold.
        after_call_work_seconds:
          type: number
          description: 'Total after-call work: from leaving the call to the end of wrap-up.'
        avg_talk_seconds:
          type:
            - number
            - 'null'
        avg_hold_seconds:
          type:
            - number
            - 'null'
        avg_after_call_work_seconds:
          type:
            - number
            - 'null'
        aht_seconds:
          description: 'Average handle time: (talk + hold + after-call work) ÷ handles.'
          type:
            - number
            - 'null'
        aht_seconds_p90:
          type:
            - number
            - 'null'
        graded:
          type: integer
          minimum: -9007199254740991
          maximum: 9007199254740991
          description: Handles that had an AHT target when the agent answered.
        over_target:
          type: integer
          minimum: -9007199254740991
          maximum: 9007199254740991
          description: Graded handles that took longer than their target.
        over_target_rate:
          type: number
          description: over_target / graded, 0–1.
        target_seconds:
          anyOf:
            - type: integer
              minimum: -9007199254740991
              maximum: 9007199254740991
            - type: 'null'
          description: The AHT target when every handle in range had the same one.
      required:
        - handles
        - talk_seconds
        - hold_seconds
        - after_call_work_seconds
        - avg_talk_seconds
        - avg_hold_seconds
        - avg_after_call_work_seconds
        - aht_seconds
        - aht_seconds_p90
        - graded
        - over_target
        - over_target_rate
        - target_seconds
      additionalProperties: false
    ErrorDto:
      type: object
      properties:
        statusCode:
          type: integer
        message:
          type: string
        error:
          type: string
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.