Skip to main content
POST
Takes one of your account’s free numbers (no agent answers it) and assigns it to an agent in a single step. Two requests made at the same moment can never both receive the same number: each gets a different one, and a request that finds none left gets a 409. Send a reference of your own, such as the id of the user the number is for. Asking again with the same reference returns the same number, so a retry after a timeout or a double click never uses a second number. If that reference already holds a number answered by a different agent than the agent_id you send, the answer is 409, never a silent reply with the old agent. It is the number’s allocation key until you release it. Numbers that have never been used come first, then the one idle the longest. The assignment is the one Assign Phone Number makes: the number answers with the agent’s latest deployed version.
An account API key is required, and an account reader key is refused (403), because this changes who answers a live number.

Body Parameters

string
required
The agent that will answer the number. It must be on your account and deployed.
string
required
Your own key for this allocation, 1 to 64 characters from letters, digits and . _ : -. The same reference always returns the same number.
integer
default:"0"
Only allocate a number that has never been used, or was last used at least this many days ago (0 to 3650). Use it to keep a number you just released away from new callers for a while.

Response

string
The allocated number in E.164.
string
The agent that answers it.
string
Always active.
string
The reference you sent.
string
When it was allocated (ISO 8601, UTC).