---
title: "Create a phone number"
method: POST
path: "/phone_numbers"
---

# Create a phone number

`POST /phone_numbers`

## Request

- Base URL: `https://api.vogent.ai/api`
- URL: `https://api.vogent.ai/api/phone_numbers`
- Auth: HTTP bearer

Creates a phone number of various types (purchase, SIP import, or Vogent SIP).

## Request body

- CreatePhoneNumberInput
  - `type` 'purchase' | 'sip_import' | 'vogent_sip', required: The type of phone number creation operation.
  - `purchase` CreatePhoneNumberPurchaseInput
    - `number` string, required: The number as returned by the phone number search endpoint.
  - `sipImport` CreatePhoneNumberSIPImportInput
    - `phoneNumber` string, required: The phone number in E.164 format.
    - `terminationUri` string, required: The termination URI for the SIP trunk.
    - `username` string, required: The username for SIP authentication.
    - `password` string, required: The password for SIP authentication.
  - `vogentSip` CreatePhoneNumberVogentSIPInput
    - `sipPrefix` string, required: The SIP prefix/username.
    - `username` string, required: The username for SIP authentication (minimum 5 characters).
    - `password` string, required: The password for SIP authentication (minimum 5 characters).

## Response `200`

Successful operation

- PhoneNumber
  - `id` string, required
  - `number` string, required: The number in e.164 format, or the SIP username, if the type is SIP_USERNAME.
  - `type` 'PSTN' | 'SIP_USERNAME', required
  - `agentId` string, nullable, required: The ID of the linked agent, if the phone number is linked to one.

## Other responses

- `400`: Invalid input
- `422`: Validation exception

---

[API](https://skmtc.dev/vogent/apis/vogent-openapi-3-0.md) - [All operations](https://skmtc.dev/vogent/apis/vogent-openapi-3-0/llms.txt) - [OpenAPI document](https://skmtc.dev/vogent/apis/vogent-openapi-3-0/revisions/a5966cc364ef?raw)
