Skip to main content
POST
Create a phone number

Authorizations

Authorization
string
header
required

Your organization API key (it starts with anek_org_). The same key works on the Voice API and the Support API. See Authentication.

Path Parameters

projectId
string
required

Project id

Body

application/json

Send exactly one of provider and sip_trunk_id. Fields not listed here are ignored.

e164
string
required

The number in E.164 form as 7 to 15 digits, with no +: 14155550123. It must not be registered in any project yet. It cannot be changed later.

Pattern: ^\d{7,15}$
provider
enum<string> | null

The carrier the number comes from. Leave it out (or null) for a number on an inbound SIP trunk.

Available options:
twilio,
didww,
null
sip_trunk_id
string | null

An inbound SIP trunk of this project the number belongs to. Leave it out (or null) for a carrier number.

Minimum string length: 1
voice_inbound
boolean
default:false

The number takes inbound calls.

voice_outbound
boolean
default:false

Agents may place outbound calls from the number. Required for outbound_trunk_ids.

outbound_trunk_ids
string[]

Active outbound SIP trunks of this project for calls from this number, primary first, then up to four fallbacks. Needs voice_outbound: true.

Maximum array length: 5
Minimum string length: 1
max_calls_per_second
integer

The most inbound calls per second the number accepts. Default 1. Values above 5 are set by Clarity support (403 otherwise).

Required range: 1 <= x <= 100
abuse_protection_exempt
boolean

Leave the number out of the project's inbound abuse protection. Default false.

Response

The number was created. outbound_agents and outbound_agents_inherited are always empty here; read the number to see which agents present it.

phone_number
object
required

A phone number of the project. Its inbound calls come from a carrier (provider) or from one of your inbound SIP trunks (sip_trunk_id), never both; with neither, the number is unassigned.

max_calls_per_second_self_serve_max
integer

Returned when you read a number: the highest max_calls_per_second you can set yourself. Higher limits are set by Clarity support.