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

# List Phone Country Rules

> List DialNexa phone country rules, calling codes, number lengths, and dialing prefixes for destination validation.

Read only

List phone country rules to read the destination countries known to DialNexa, ordered by country name. Each rule includes `country_iso`, `country_name`, `calling_code`, an optional `max_length`, and the configured `prefixes`.

## When to list phone country rules

* Build a destination country selector.
* Normalize calling codes before submitting outbound numbers.
* Compare global country data with the network groups enabled for your workspace.

> [!NOTE]
>
> This operation returns the global country catalog. It does not mean every country or prefix is enabled for your workspace. Use [List Enabled Network Groups](https://dialnexa.com/docs/api-reference/v1/phone-numbers/list-enabled-network-groups.md) for workspace-specific availability.

## Verify the result

Match the destination's `country_iso` and `calling_code`. If `prefixes` is non-empty, use it as reference data only and still rely on the workspace-specific network group response before placing a call.

## Errors and recovery

* `401 Unauthorized` means the API key is missing or invalid.
* An empty array means no active country rules are currently available. Do not infer support from a stale local copy.

## Related endpoints

* [List Enabled Network Groups](https://dialnexa.com/docs/api-reference/v1/phone-numbers/list-enabled-network-groups.md): read workspace-specific destination availability.
* [List Phone Number Pricing](https://dialnexa.com/docs/api-reference/v1/phone-numbers/list-pricing.md): compare rental pricing by provider and country.
* [Create Call](https://dialnexa.com/docs/api-reference/v1/calls/create.md): start an outbound call after validating the destination.


## OpenAPI

````yaml GET /v1/phone-country-rules/countries
openapi: 3.0.0
info:
  title: DialNexa API
  description: Public `/v1` REST API for the DialNexa voice AI platform.
  version: 1.0.0
servers:
  - url: https://api.dialnexa.com
    description: DialNexa production API
security:
  - bearer: []
tags:
  - name: Agents
  - name: Batch Calls
  - name: Calls
  - name: Knowledge Base
  - name: Languages
  - name: LLMs
  - name: Phone Numbers
  - name: Organization Folders
  - name: Transcribers
  - name: Webhooks
  - name: Voices
  - name: Workflows
  - name: Workflow Leads
  - name: Authentication
  - name: Agent Builder
  - name: Agent Evaluations
paths:
  /v1/phone-country-rules/countries:
    get:
      tags:
        - Phone Numbers
      summary: List Phone Country Rules
      description: >-
        Returns the active global country catalog with calling codes, number
        lengths, and prefixes.
      operationId: listPhoneCountryRules
      responses:
        '200':
          description: Active phone country rules returned successfully.
          content:
            application/json:
              schema:
                type: object
                required:
                  - success
                  - error
                  - statusCode
                  - message
                  - data
                  - timestamp
                properties:
                  success:
                    type: boolean
                    enum:
                      - true
                  error:
                    type: boolean
                    enum:
                      - false
                  statusCode:
                    type: integer
                    example: 200
                  message:
                    type: string
                    example: Success
                  data:
                    type: array
                    items:
                      $ref: '#/components/schemas/PhoneCountryRule'
                  timestamp:
                    type: string
                    format: date-time
        '401':
          description: Unauthorized - missing or invalid API key.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security:
        - bearer: []
components:
  schemas:
    PhoneCountryRule:
      type: object
      properties:
        id:
          type: string
          example: c7r2n5x8q1w4zt
        country_iso:
          type: string
          minLength: 2
          maxLength: 2
          example: IN
        country_name:
          type: string
          example: India
        calling_code:
          type: string
          example: '91'
        max_length:
          type: integer
          nullable: true
          example: 10
        prefixes:
          type: array
          items:
            type: string
          example:
            - '98'
            - '99'
        is_deleted:
          type: boolean
          example: false
        created_at:
          type: string
          format: date-time
        updated_at:
          type: string
          format: date-time
      required:
        - id
        - country_iso
        - country_name
        - calling_code
        - prefixes
        - is_deleted
    ErrorResponse:
      type: object
      description: Error body on endpoints without response filtering.
      properties:
        statusCode:
          type: integer
          example: 404
        error:
          type: boolean
          enum:
            - true
        success:
          type: boolean
          enum:
            - false
        data:
          oneOf:
            - type: object
              properties:
                code:
                  type: string
                  description: Machine-readable refusal code.
            - type: array
              items: {}
          description: >-
            For a coded refusal, an object with code and the details listed for
            that code. Otherwise an empty array.
        message:
          type: string
        errors:
          type: array
          items:
            type: string
          description: Validation messages for a 400. Empty for other errors.
        validation_errors:
          type: array
          description: >-
            Present when uploaded rows fail number validation (batch and
            workflow lead uploads): one group per distinct error.
          items:
            type: object
            properties:
              error:
                type: string
              rows:
                type: array
                items:
                  type: integer
                description: Row numbers with this error.
              phone_numbers:
                type: array
                items:
                  type: string
        invalid_row_count:
          type: integer
          description: 'Present with validation_errors: how many rows failed.'
      required:
        - statusCode
        - error
        - success
        - data
        - message
        - errors
  securitySchemes:
    bearer:
      scheme: bearer
      type: http

````

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