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

# List Phone Numbers

> Retrieve all Phone Numbers



## OpenAPI

````yaml /api-reference/openapi.json get /v1/convai/phone-numbers
openapi: 3.1.0
info:
  title: Threetone API Documentation
  description: >-
    This is the documentation for the Threetone API. You can use this API to use
    our service programmatically with API keys sent in the x-api-key header. You
    can create and manage API keys in the dashboard at
    https://threetone.in/app/developers/api-keys.
  version: '1.0'
servers:
  - url: https://api.threetone.in
    description: Production
security: []
paths:
  /v1/convai/phone-numbers:
    get:
      tags:
        - Agents Platform
      summary: List Phone Numbers
      description: Retrieve all Phone Numbers
      operationId: list_phone_numbers_route
      parameters:
        - name: provider
          in: query
          required: false
          schema:
            anyOf:
              - $ref: '#/components/schemas/TelephonyProvider'
              - type: 'null'
            description: Filter by telephony provider
            title: Provider
          description: Filter by telephony provider
        - name: agent_id
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            description: Filter by assigned agent ID
            title: Agent Id
          description: Filter by assigned agent ID
        - name: branch_id
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            description: Filter by assigned branch ID
            title: Branch Id
          description: Filter by assigned branch ID
        - name: x-api-key
          in: header
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            description: >-
              Your API key for programmatic access. Send it in the x-api-key
              header; you can create and manage keys from the Developers page.
            title: X-Api-Key
          description: >-
            Your API key for programmatic access. Send it in the x-api-key
            header; you can create and manage keys from the Developers page.
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                type: array
                items:
                  oneOf:
                    - $ref: '#/components/schemas/GetPhoneNumberTwilioResponseModel'
                    - $ref: '#/components/schemas/GetPhoneNumberExotelResponseModel'
                    - $ref: '#/components/schemas/GetPhoneNumberSIPTrunkResponseModel'
                  discriminator:
                    propertyName: provider
                    mapping:
                      exotel:
                        $ref: '#/components/schemas/GetPhoneNumberExotelResponseModel'
                      sip_trunk:
                        $ref: >-
                          #/components/schemas/GetPhoneNumberSIPTrunkResponseModel
                      twilio:
                        $ref: '#/components/schemas/GetPhoneNumberTwilioResponseModel'
                title: Response List Phone Numbers Route
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    TelephonyProvider:
      type: string
      enum:
        - twilio
        - sip_trunk
        - exotel
      title: TelephonyProvider
    GetPhoneNumberTwilioResponseModel:
      properties:
        phone_number:
          type: string
          title: Phone Number
          description: Phone number
        label:
          type: string
          title: Label
          description: Label for the phone number
        phone_number_id:
          type: string
          title: Phone Number Id
          description: The ID of the phone number
        assigned_agent:
          anyOf:
            - $ref: '#/components/schemas/PhoneNumberAgentInfo'
            - type: 'null'
          description: The agent that is assigned to the phone number
        provider:
          type: string
          const: twilio
          title: Provider
          description: Phone provider
          default: twilio
      type: object
      required:
        - phone_number
        - label
        - phone_number_id
      title: GetPhoneNumberTwilioResponseModel
      example:
        label: Customer Support
        phone_number: '+1234567890'
        phone_number_id: phone_123
        provider: twilio
    GetPhoneNumberExotelResponseModel:
      properties:
        phone_number:
          type: string
          title: Phone Number
          description: Phone number
        label:
          type: string
          title: Label
          description: Label for the phone number
        phone_number_id:
          type: string
          title: Phone Number Id
          description: The ID of the phone number
        assigned_agent:
          anyOf:
            - $ref: '#/components/schemas/PhoneNumberAgentInfo'
            - type: 'null'
          description: The agent that is assigned to the phone number
        provider:
          type: string
          const: exotel
          title: Provider
          description: Phone provider
          default: exotel
      type: object
      required:
        - phone_number
        - label
        - phone_number_id
      title: GetPhoneNumberExotelResponseModel
      example:
        label: Exotel Outbound
        phone_number: '+919999999999'
        phone_number_id: phnum_X3Pbu5gP6NNKBscdCdwB
        provider: exotel
    GetPhoneNumberSIPTrunkResponseModel:
      properties:
        phone_number:
          type: string
          title: Phone Number
          description: Phone number
        label:
          type: string
          title: Label
          description: Label for the phone number
        phone_number_id:
          type: string
          title: Phone Number Id
          description: The ID of the phone number
        assigned_agent:
          anyOf:
            - $ref: '#/components/schemas/PhoneNumberAgentInfo'
            - type: 'null'
          description: The agent that is assigned to the phone number
        provider:
          type: string
          const: sip_trunk
          title: Provider
          description: Phone provider
          default: sip_trunk
        source_type:
          type: string
          const: sip_trunk
          title: Source Type
          description: Phone number source type
          default: sip_trunk
        outbound_trunk:
          anyOf:
            - $ref: >-
                #/components/schemas/GetPhoneNumberOutboundSIPTrunkConfigResponseModel
            - type: 'null'
          description: Configuration of the Outbound SIP trunk - if configured.
        inbound_trunk:
          anyOf:
            - $ref: >-
                #/components/schemas/GetPhoneNumberInboundSIPTrunkConfigResponseModel
            - type: 'null'
          description: Configuration of the Inbound SIP trunk - if configured.
        livekit_stack:
          $ref: '#/components/schemas/LivekitStackType'
          description: Type of Livekit stack used for this number.
        store_sip_messages:
          type: boolean
          title: Store Sip Messages
          description: Whether to store SIP messages for this phone number.
          default: true
      type: object
      required:
        - phone_number
        - label
        - phone_number_id
        - livekit_stack
      title: GetPhoneNumberSIPTrunkResponseModel
      description: >-
        SIP-trunk-backed phone number row. Inbound/outbound capability is
        implied by

        `inbound_trunk` / `outbound_trunk` (and related flags), not by separate
        booleans.
      example:
        label: Sales Team
        livekit_stack: standard
        phone_number: '+1987654321'
        phone_number_id: phone_456
        source_type: sip_trunk
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    PhoneNumberAgentInfo:
      properties:
        agent_id:
          type: string
          title: Agent Id
          description: The ID of the agent
        agent_name:
          type: string
          title: Agent Name
          description: The name of the agent
        environment:
          anyOf:
            - type: string
            - type: 'null'
          title: Environment
          description: >-
            Environment to use for resolving environment variables on calls to
            this number.
        branch_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Branch Id
          description: Agent branch to use for calls to this number.
      type: object
      required:
        - agent_id
        - agent_name
      title: PhoneNumberAgentInfo
      example:
        agent_id: F3Pbu5gP6NNKBscdCdwB
        agent_name: My Agent
    GetPhoneNumberOutboundSIPTrunkConfigResponseModel:
      properties:
        address:
          type: string
          title: Address
          description: Hostname or IP the SIP INVITE is sent to
        transport:
          $ref: '#/components/schemas/SIPTrunkTransportEnum'
          description: Protocol to use for SIP transport
        media_encryption:
          $ref: '#/components/schemas/SIPMediaEncryptionEnum'
          description: Whether or not to encrypt media (data layer).
        headers:
          additionalProperties:
            type: string
          type: object
          title: Headers
          description: SIP headers for INVITE request
        attributes_to_headers:
          additionalProperties:
            type: string
          type: object
          title: Attributes To Headers
          description: >-
            Map of dynamic variable name to header name for
            attributes_to_headers
        has_auth_credentials:
          type: boolean
          title: Has Auth Credentials
          description: Whether authentication credentials are configured
        username:
          anyOf:
            - type: string
            - type: 'null'
          title: Username
          description: SIP trunk username (if available)
        has_outbound_trunk:
          type: boolean
          title: Has Outbound Trunk
          description: Whether a LiveKit SIP outbound trunk is configured
          default: false
        enabled_codecs:
          items:
            $ref: '#/components/schemas/MediaCodec'
          type: array
          title: Enabled Codecs
          description: >-
            Media codecs that are offered in the SDP for outbound calls. If
            empty, all supported codecs are offered.
      type: object
      required:
        - address
        - transport
        - media_encryption
        - has_auth_credentials
      title: GetPhoneNumberOutboundSIPTrunkConfigResponseModel
      description: SIP Trunk configuration details for a phone number
    GetPhoneNumberInboundSIPTrunkConfigResponseModel:
      properties:
        allowed_addresses:
          items:
            type: string
          type: array
          title: Allowed Addresses
          description: >-
            List of IP addresses that are allowed to use the trunk. Each item in
            the list can be an individual IP address or a Classless Inter-Domain
            Routing notation representing a CIDR block.
        allowed_numbers:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Allowed Numbers
          description: List of phone numbers that are allowed to use the trunk.
        media_encryption:
          $ref: '#/components/schemas/SIPMediaEncryptionEnum'
        has_auth_credentials:
          type: boolean
          title: Has Auth Credentials
          description: Whether authentication credentials are configured
        username:
          anyOf:
            - type: string
            - type: 'null'
          title: Username
          description: SIP trunk username (if available)
        remote_domains:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Remote Domains
          description: Domains of remote SIP servers used to validate TLS certificates.
        attributes_to_headers:
          additionalProperties:
            type: string
          type: object
          title: Attributes To Headers
          description: >-
            Map of dynamic variable name to header name for
            attributes_to_headers
      type: object
      required:
        - allowed_addresses
        - allowed_numbers
        - media_encryption
        - has_auth_credentials
      title: GetPhoneNumberInboundSIPTrunkConfigResponseModel
    LivekitStackType:
      type: string
      enum:
        - standard
        - static
      title: LivekitStackType
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
    SIPTrunkTransportEnum:
      type: string
      enum:
        - auto
        - udp
        - tcp
        - tls
      title: SIPTrunkTransportEnum
    SIPMediaEncryptionEnum:
      type: string
      enum:
        - disabled
        - allowed
        - required
      title: SIPMediaEncryptionEnum
    MediaCodec:
      type: string
      enum:
        - G722/8000
        - PCMU/8000
        - PCMA/8000
      title: MediaCodec

````