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

# Select Phone Number

> Select and provision a phone number from your plan's phone number allowance. Phone numbers consume a slot from your plan's included allowance. If you've reached your plan limit, you'll need to upgrade your plan or release an existing number.



## OpenAPI

````yaml /docs/openapi.json post /api/v1/agent/select-phone-number
openapi: 3.1.0
info:
  title: Voice AI Developer API
  description: >-
    Generate realistic speech and clone voices. AI voice agents with retrieval
    augmented generation (RAG) and model context protocol (MCP) included.
  version: 1.5.0
  contact: {}
servers:
  - url: https://dev.voice.ai
    description: HTTP API endpoints
security:
  - BearerAuth: []
tags:
  - name: Text To Speech
    description: Text-to-speech endpoints for voice cloning and speech generation.
  - name: Pronunciation Dictionaries
    description: Manage versioned pronunciation dictionaries for TTS and voice agents.
  - name: Agent Management
    description: Create, update, deploy, and manage voice agents.
  - name: Models
    description: Discover supported LLM and TTS model options.
  - name: Agent Connection
    description: Connect to agents and manage active calls.
  - name: Agent Analytics
    description: >-
      Analytics and reporting for agent performance, call history, and
      statistics.
  - name: Agent Knowledge Base
    description: >-
      Manage knowledge bases for retrieval augmented generation (RAG) with your
      agents.
  - name: Phone Number Management
    description: >-
      Search, select, and manage phone numbers from your plan allocation.
      Release numbers to free up slots.
  - name: Managed Tools
    description: >-
      Connect Google Calendar, Sheets, and Gmail to agents and inspect
      connection state.
paths:
  /api/v1/agent/select-phone-number:
    post:
      tags:
        - Phone Number Management
      summary: Select Phone Number
      description: >-
        Select and provision a phone number from your plan's phone number
        allowance. Phone numbers consume a slot from your plan's included
        allowance. If you've reached your plan limit, you'll need to upgrade
        your plan or release an existing number.
      operationId: select_phone_number_api_v1_agent_select_phone_number_post
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PurchasePhoneNumberRequest'
        required: true
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PurchasePhoneNumberResponse'
        '401':
          description: Unauthorized - Invalid or missing API key
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '402':
          description: >-
            Payment Required - Phone number limit reached. Upgrade your plan or
            release an existing number.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '403':
          description: Forbidden - Insufficient permissions
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '404':
          description: Phone number not found or not available
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
components:
  schemas:
    PurchasePhoneNumberRequest:
      properties:
        phone_number:
          type: string
          title: Phone Number
          description: >-
            Exact phone number to select from search results (e.g.,
            '+15551234567')
        provider:
          type: string
          title: Provider
          description: 'Provider: ''twilio'' or ''telnyx'''
          default: twilio
          enum:
            - twilio
            - telnyx
      type: object
      required:
        - phone_number
      title: PurchasePhoneNumberRequest
    PurchasePhoneNumberResponse:
      properties:
        phone_number:
          type: string
          title: Phone Number
        status:
          type: string
          title: Status
      type: object
      required:
        - phone_number
        - status
      title: PurchasePhoneNumberResponse
    ErrorResponse:
      properties:
        error:
          type: string
          title: Error
          description: Error message
        detail:
          type: string
          title: Detail
          description: Detailed error information
          nullable: true
        code:
          type: string
          title: Code
          description: Error code
          nullable: true
      type: object
      required:
        - error
      title: ErrorResponse
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    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
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: >-
        Bearer token authentication. Use your API key as the bearer token.
        Format: Authorization: Bearer <your-api-key>

````