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

# List all phone numbers

> Returns a list of all active phone numbers associated with the given external connection.



## OpenAPI

````yaml https://telnyx-openapi-ng.s3.us-east-1.amazonaws.com/real-time-communications/external-connects.yml get /external_connections/{id}/phone_numbers
openapi: 3.1.0
info:
  title: Telnyx External Connects API
  version: 2.0.0
  description: API for External connects.
  contact:
    email: support@telnyx.com
servers:
  - url: https://api.telnyx.com/v2
security:
  - bearerAuth: []
paths:
  /external_connections/{id}/phone_numbers:
    get:
      tags:
        - External Connections
      summary: List all phone numbers
      description: >-
        Returns a list of all active phone numbers associated with the given
        external connection.
      operationId: ListExternalConnectionPhoneNumbers
      parameters:
        - $ref: '#/components/parameters/external-voice-integrations_id'
        - $ref: '#/components/parameters/FilterPhoneNumbersConsolidated'
        - $ref: '#/components/parameters/external-voice-integrations_PageConsolidated'
      responses:
        '200':
          $ref: '#/components/responses/ListExternalConnectionPhoneNumbersResponse'
        '401':
          description: Unauthorized
        '404':
          description: Not found
        '422':
          description: Bad request
      x-codeSamples:
        - lang: JavaScript
          source: >-
            import Telnyx from 'telnyx';


            const client = new Telnyx({
              apiKey: process.env['TELNYX_API_KEY'], // This is the default and can be omitted
            });


            // Automatically fetches more pages as needed.

            for await (const externalConnectionPhoneNumber of
            client.externalConnections.phoneNumbers.list(
              '1293384261075731499',
            )) {
              console.log(externalConnectionPhoneNumber.civic_address_id);
            }
        - lang: Python
          source: |-
            import os
            from telnyx import Telnyx

            client = Telnyx(
                api_key=os.environ.get("TELNYX_API_KEY"),  # This is the default and can be omitted
            )
            page = client.external_connections.phone_numbers.list(
                id="1293384261075731499",
            )
            page = page.data[0]
            print(page.civic_address_id)
        - lang: Go
          source: "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/team-telnyx/telnyx-go\"\n\t\"github.com/team-telnyx/telnyx-go/option\"\n)\n\nfunc main() {\n\tclient := telnyx.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\tpage, err := client.ExternalConnections.PhoneNumbers.List(\n\t\tcontext.TODO(),\n\t\t\"1293384261075731499\",\n\t\ttelnyx.ExternalConnectionPhoneNumberListParams{},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\\n\", page)\n}\n"
        - lang: Java
          source: >-
            package com.telnyx.sdk.example;


            import com.telnyx.sdk.client.TelnyxClient;

            import com.telnyx.sdk.client.okhttp.TelnyxOkHttpClient;

            import
            com.telnyx.sdk.models.externalconnections.phonenumbers.PhoneNumberListPage;

            import
            com.telnyx.sdk.models.externalconnections.phonenumbers.PhoneNumberListParams;


            public final class Main {
                private Main() {}

                public static void main(String[] args) {
                    TelnyxClient client = TelnyxOkHttpClient.fromEnv();

                    PhoneNumberListPage page = client.externalConnections().phoneNumbers().list("1293384261075731499");
                }
            }
        - lang: Ruby
          source: >-
            require "telnyx"


            telnyx = Telnyx::Client.new(api_key: "My API Key")


            page =
            telnyx.external_connections.phone_numbers.list("1293384261075731499")


            puts(page)
        - lang: CLI
          source: |-
            telnyx external-connections:phone-numbers list \
              --api-key 'My API Key' \
              --id 1293384261075731499
components:
  parameters:
    external-voice-integrations_id:
      name: id
      description: Identifies the resource.
      in: path
      required: true
      schema:
        type: string
        example: '1293384261075731499'
        x-format: int64
    FilterPhoneNumbersConsolidated:
      name: filter
      in: query
      style: deepObject
      explode: true
      required: false
      description: >-
        Filter parameter for phone numbers (deepObject style). Supports
        filtering by phone_number, civic_address_id, and location_id with
        eq/contains operations.
      schema:
        type: object
        properties:
          phone_number:
            type: object
            properties:
              eq:
                type: string
                example: '+19705555098'
                description: The phone number to filter by (exact match)
              contains:
                type: string
                example: '+1970'
                description: The phone number to filter by (partial match)
          civic_address_id:
            type: object
            properties:
              eq:
                type: string
                example: '19990261512338516954'
                description: The civic address ID to filter by
          location_id:
            type: object
            properties:
              eq:
                type: string
                example: '19995665508264022121'
                description: The location ID to filter by
    external-voice-integrations_PageConsolidated:
      name: page
      in: query
      style: deepObject
      explode: true
      description: >-
        Consolidated page parameter (deepObject style). Originally: page[size],
        page[number]
      schema:
        type: object
        properties:
          size:
            type: integer
            minimum: 1
            maximum: 250
            default: 250
            description: The size of the page
          number:
            type: integer
            minimum: 1
            default: 1
            description: The page number to load
  responses:
    ListExternalConnectionPhoneNumbersResponse:
      description: Successful response
      content:
        application/json:
          schema:
            type: object
            title: List External Connection Phone Numbers Response
            properties:
              data:
                type: array
                items:
                  $ref: '#/components/schemas/ExternalConnectionPhoneNumber'
              meta:
                $ref: >-
                  #/components/schemas/external-voice-integrations_PaginationMeta
  schemas:
    ExternalConnectionPhoneNumber:
      type: object
      title: Phone number details with relation to an external connection
      properties:
        ticket_id:
          $ref: '#/components/schemas/UUID'
        telephone_number:
          type: string
          description: Phone number in E164 format.
        number_id:
          type: string
          description: Phone number ID from the Telnyx API.
        civic_address_id:
          type: string
          format: uuid
          description: Identifies the civic address assigned to the phone number.
        location_id:
          type: string
          format: uuid
          description: Identifies the location assigned to the phone number.
        displayed_country_code:
          type: string
          description: >-
            The iso country code that will be displayed to the user when they
            receive a call from this phone number.
        acquired_capabilities:
          type: array
          items:
            type: string
            enum:
              - FirstPartyAppAssignment
              - InboundCalling
              - Office365
              - OutboundCalling
              - UserAssignment
            description: >-
              The capabilities that are available for this phone number on
              Microsoft Teams.
    external-voice-integrations_PaginationMeta:
      title: Pagination Meta
      type: object
      properties:
        total_pages:
          type: integer
          example: 3
        total_results:
          type: integer
          example: 55
        page_number:
          type: integer
          example: 2
        page_size:
          type: integer
          example: 25
    UUID:
      title: UUID
      type: string
      format: uuid
      description: Uniquely identifies the resource.
      example: 542c3bca-d247-42bc-8fe7-e01d16ecd761
  securitySchemes:
    bearerAuth:
      scheme: bearer
      type: http

````