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

# Buy Phone Number

> Buy a number onto the carrier account; bind it with
`POST /v1/phone-numbers`. Admin only. Irreversible on the carrier side:
the number stays on the account (and is billed) until released.



## OpenAPI

````yaml /openapi.json post /v1/phone-numbers/purchase
openapi: 3.1.0
info:
  title: TurnCall
  description: Production voice agent platform API
  version: 2.0.0
servers: []
security: []
paths:
  /v1/phone-numbers/purchase:
    post:
      tags:
        - phone-numbers
      summary: Buy Phone Number
      description: |-
        Buy a number onto the carrier account; bind it with
        `POST /v1/phone-numbers`. Admin only. Irreversible on the carrier side:
        the number stays on the account (and is billed) until released.
      operationId: buy_phone_number_v1_phone_numbers_purchase_post
      parameters:
        - name: authorization
          in: header
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: Authorization
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/BuyPhoneNumberRequest'
      responses:
        '201':
          description: Successful Response
          content:
            application/json:
              schema:
                type: object
                additionalProperties: true
                title: Response Buy Phone Number V1 Phone Numbers Purchase Post
          headers:
            X-TurnCall-Audit-Id:
              description: >-
                The id of the audit log entry for this request's primary
                resource. Every entry the request wrote (a publish also archives
                versions and re-points numbers) carries it as `request_id`: `GET
                /v1/audit-log?request_id=<this id>` returns them all.
              schema:
                type: string
                format: uuid
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    BuyPhoneNumberRequest:
      properties:
        twilio_account_sid:
          anyOf:
            - type: string
              pattern: ^AC[0-9a-fA-F]{32}$
            - type: 'null'
          title: Twilio Account Sid
        twilio_auth_token:
          anyOf:
            - type: string
              maxLength: 256
              minLength: 1
            - type: 'null'
          title: Twilio Auth Token
        carrier:
          type: string
          enum:
            - twilio
            - telnyx
          title: Carrier
          description: The carrier whose account the number is bought on.
          default: twilio
        e164_number:
          type: string
          pattern: ^\+[1-9]\d{1,14}$
          title: E164 Number
      type: object
      required:
        - e164_number
      title: BuyPhoneNumberRequest
      description: |-
        Buy a number a search returned. On Twilio, the account it is bought on
        is the pair given here, else the platform's TWILIO_* account; bind the
        number with the same pair.
    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
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError

````

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