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

# User phone states

> Read current phone occupancy across teams to distinguish idle agents, ringing offers, active calls and wrap-up in staffing monitors.

Send `user_ids` as a comma-separated list of up to 100 positive user IDs. The response contains only members of the API key's workspace, ordered by user ID. Unknown IDs and users outside that workspace are omitted. The request requires `agent-availability:read` and does not change availability or assignments.

| State | Meaning |
| - | - |
| `on_call` | Handling an active customer call, consultation or conference, including an accepted conference invitation that is connecting. |
| `ringing` | Receiving a current ring offer or transfer invitation, or placing a call that is connecting. |
| `wrap_up` | The agent's wrap-up period is still active. |
| `idle` | None of these phone activities currently occupies the agent. |

When states overlap, `on_call` takes precedence over `ringing`, then `wrap_up`. State applies across all teams: someone handling one team's call must not be counted as free in another team.

**Idle does not mean eligible for a new call.** Also check the agent's online status, **Available for calls**, availability on the relevant team, and calling connection. An active session alone does not prove that a phone call is still connected.

Refresh the data while showing a live monitor. If a request fails, a user is omitted, or the last sample becomes stale, show **Unknown** instead of counting the agent as available. Existing availability flags describe configured status and must not substitute for current phone occupancy.


## OpenAPI

````yaml get /availability-statuses/users/phone-states
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:
  /availability-statuses/users/phone-states:
    get:
      summary: Get live phone occupancy for users
      description: >-
        Read phone occupancy across all teams for up to 100 organization
        members. States include idle, ringing, on_call and wrap_up. Unknown or
        foreign user IDs are omitted. Idle describes occupancy, not full routing
        eligibility. This read does not change availability.
      operationId: getUsersPhoneStates
      parameters:
        - schema:
            type: string
          in: query
          name: user_ids
          required: true
          description: Comma-separated organization user IDs, max 100 (e.g. "12,34,56")
      responses:
        '200':
          description: Default Response
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/AgentPhoneStateDto'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorDto'
components:
  schemas:
    AgentPhoneStateDto:
      $schema: https://json-schema.org/draft/2020-12/schema
      $id: '#/components/schemas/AgentPhoneStateDto'
      type: object
      properties:
        user_id:
          type: integer
          minimum: -9007199254740991
          maximum: 9007199254740991
        state:
          type: string
          enum:
            - idle
            - ringing
            - on_call
            - wrap_up
          description: >-
            Current phone occupancy across all teams. Idle does not guarantee
            eligibility: online status, call availability, team membership and
            connection readiness also apply.
      required:
        - user_id
        - state
      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.