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

# Purchase Phone Number

> Buy a number from the inventory.



## OpenAPI

````yaml post /v1/agent/phone-numbers
openapi: 3.1.0
info:
  title: FishAudio OpenAPI
  version: '1'
servers:
  - description: Fish Audio API
    url: https://api.fish.audio
security: []
tags: []
paths:
  /v1/agent/phone-numbers:
    post:
      tags:
        - Phone Numbers
      summary: Purchase Phone Number
      description: >-
        Buy a number from the inventory. The number lands in your default

        workspace, and any `agent_id` you bind must live there too. Billing is
        the

        monthly price charged in daily slices: the first day is charged before

        anything is bought (402 costs you nothing), and the daily run advances
        it

        from there. 409 means the number is already on the platform; 502 means
        the

        provider refused the purchase — the number stays visible with status

        `error` and is safe to release.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PublicPhoneNumberPurchasePayload'
      responses:
        '201':
          description: Document created, URL follows
          headers: {}
          content:
            application/json:
              schema:
                properties:
                  phone_number_id:
                    title: Phone Number Id
                    type: string
                  workspace_id:
                    title: Workspace Id
                    type: string
                  phone_number:
                    description: E.164, e.g. +14155550123.
                    title: Phone Number
                    type: string
                  provider:
                    enum:
                      - livekit
                      - twilio
                    title: Provider
                    type: string
                  label:
                    default: ''
                    title: Label
                    type: string
                  agent_id:
                    anyOf:
                      - type: string
                      - type: 'null'
                    description: >-
                      Inbound calls route to this agent; unbound numbers ring
                      busy.
                    title: Agent Id
                  status:
                    enum:
                      - provisioning
                      - active
                      - error
                      - released
                    title: Status
                    type: string
                  status_detail:
                    default: ''
                    description: What failed when status is `error`; empty otherwise.
                    title: Status Detail
                    type: string
                  created_at:
                    format: date-time
                    title: Created At
                    type: string
                  updated_at:
                    format: date-time
                    title: Updated At
                    type: string
                required:
                  - phone_number_id
                  - workspace_id
                  - phone_number
                  - provider
                  - agent_id
                  - status
                  - created_at
                  - updated_at
                type: object
        '401':
          description: No permission -- see authorization schemes
          headers: {}
          content:
            application/json:
              schema:
                properties:
                  status:
                    title: Status
                    type: integer
                  message:
                    title: Message
                    type: string
                required:
                  - status
                  - message
                type: object
        '402':
          description: No payment -- see charging schemes
          headers: {}
          content:
            application/json:
              schema:
                properties:
                  status:
                    title: Status
                    type: integer
                  message:
                    title: Message
                    type: string
                required:
                  - status
                  - message
                type: object
        '403':
          description: Request forbidden -- authorization will not help
          headers: {}
          content:
            application/json:
              schema:
                properties:
                  status:
                    title: Status
                    type: integer
                  message:
                    title: Message
                    type: string
                required:
                  - status
                  - message
                type: object
        '404':
          description: Nothing matches the given URI
          headers: {}
          content:
            application/json:
              schema:
                properties:
                  status:
                    title: Status
                    type: integer
                  message:
                    title: Message
                    type: string
                required:
                  - status
                  - message
                type: object
        '409':
          description: Request conflict
          headers: {}
          content:
            application/json:
              schema:
                properties:
                  status:
                    title: Status
                    type: integer
                  message:
                    title: Message
                    type: string
                required:
                  - status
                  - message
                type: object
        '422':
          description: ''
          headers: {}
          content:
            application/json:
              schema:
                properties:
                  status:
                    title: Status
                    type: integer
                  message:
                    title: Message
                    type: string
                required:
                  - status
                  - message
                type: object
        '502':
          description: Invalid responses from another server/proxy
          headers: {}
          content:
            application/json:
              schema:
                properties:
                  status:
                    title: Status
                    type: integer
                  message:
                    title: Message
                    type: string
                required:
                  - status
                  - message
                type: object
        '503':
          description: The server cannot process the request due to a high load
          headers: {}
          content:
            application/json:
              schema:
                properties:
                  status:
                    title: Status
                    type: integer
                  message:
                    title: Message
                    type: string
                required:
                  - status
                  - message
                type: object
      security:
        - BearerAuth: []
components:
  schemas:
    PublicPhoneNumberPurchasePayload:
      additionalProperties: false
      properties:
        provider:
          const: twilio
          description: >-
            Inventory to buy from. Only the managed `twilio` inventory is
            purchasable (supports call transfer). The field discriminates so
            importing your own numbers can share this endpoint later.
          title: Provider
          type: string
        phone_number:
          description: >-
            E.164 number from `GET /v1/agent/available-phone-numbers`, e.g.
            +14155550123.
          title: Phone Number
          type: string
        label:
          default: ''
          maxLength: 120
          title: Label
          type: string
        agent_id:
          anyOf:
            - type: string
            - type: 'null'
          default: null
          description: Bind an agent to answer inbound calls right away.
          title: Agent Id
      required:
        - provider
        - phone_number
      title: PublicPhoneNumberPurchasePayload
      type: object
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer

````