> ## 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.

# List phone call handles

> List each time a human agent handled a call: answer, leave and after-call work end times, and the talk, hold and after-call work seconds with the AHT target.

Returns one row per stint of an agent on a call, oldest answer first, with the same filters as [Phone handle time](https://docs.open.cx/api-reference/sla-analytics/phone-handle-time.md). An agent who leaves a call and comes back to it (a conference guest invited again, a queue ringing them again) has a row for each stint; the handle time reports add those up and count the agent once for that call.

Until a row is `finished`, some parts are still running:

* `talk_seconds` is `null` while the agent is on the call, and final once they leave.
* `after_call_work_seconds` and `handle_seconds` are `null` until the agent's after-call work ends.
* `hold_seconds` is never `null`: it is the agent's hold time so far.

Page with `limit` (up to 500, default 100) and pass `next_cursor` back as `cursor`.


## OpenAPI

````yaml get /sla/analytics/phone/handles
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/handles:
    get:
      summary: List phone call handles
      description: >-
        List each time a human agent handled a call, oldest answer first: when
        they answered and left, when their after-call work ended, and the talk,
        hold and after-call work seconds with the AHT target that applied.
      operationId: listPhoneCallHandles
      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
        - schema:
            default: 100
            type: integer
            minimum: 1
            maximum: 500
          in: query
          name: limit
          required: false
        - schema:
            type: string
            maxLength: 200
          in: query
          name: cursor
          required: false
          description: The `next_cursor` of the previous page.
      responses:
        '200':
          description: Default Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PhoneHandleListResponseDto'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorDto'
components:
  schemas:
    PhoneHandleListResponseDto:
      $schema: https://json-schema.org/draft/2020-12/schema
      $id: '#/components/schemas/PhoneHandleListResponseDto'
      type: object
      properties:
        data:
          type: array
          items:
            type: object
            properties:
              id:
                type: string
              phone_call_id:
                type: string
              session_id:
                type: string
              user_id:
                anyOf:
                  - type: integer
                    minimum: -9007199254740991
                    maximum: 9007199254740991
                  - type: 'null'
              agent_name:
                type:
                  - string
                  - 'null'
              team_id:
                description: The queue the agent answered from.
                type:
                  - string
                  - 'null'
              team_name:
                type:
                  - string
                  - 'null'
              direction:
                type: string
              answered_at:
                type: string
                format: date-time
              left_at:
                anyOf:
                  - type: string
                    format: date-time
                  - type: 'null'
                description: Null while the agent is still on the call.
              after_call_work_ended_at:
                anyOf:
                  - type: string
                    format: date-time
                  - type: 'null'
                description: End of wrap-up; null until the agent left the call.
              finished:
                type: boolean
                description: >-
                  The agent left and their after-call work ended. Only finished
                  handles count.
              talk_seconds:
                type:
                  - number
                  - 'null'
              hold_seconds:
                type: number
              after_call_work_seconds:
                type:
                  - number
                  - 'null'
              handle_seconds:
                description: talk + hold + after-call work, once finished.
                type:
                  - number
                  - 'null'
              aht_target_seconds:
                anyOf:
                  - type: integer
                    minimum: -9007199254740991
                    maximum: 9007199254740991
                  - type: 'null'
                description: The target when the agent answered; null for no target.
              sla_policy_id:
                type:
                  - string
                  - 'null'
              sla_policy_name:
                type:
                  - string
                  - 'null'
            required:
              - id
              - phone_call_id
              - session_id
              - user_id
              - agent_name
              - team_id
              - team_name
              - direction
              - answered_at
              - left_at
              - after_call_work_ended_at
              - finished
              - talk_seconds
              - hold_seconds
              - after_call_work_seconds
              - handle_seconds
              - aht_target_seconds
              - sla_policy_id
              - sla_policy_name
            additionalProperties: false
        next_cursor:
          description: Pass as `cursor` to fetch the next page; null on the last page.
          type:
            - string
            - 'null'
      required:
        - data
        - next_cursor
      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.