Skip to main content
Buys a number from the carrier for this project: the one named by e164, or one Roark picks to match autoPick (trying the next match if the carrier has just sold one). Free inside the plan allowance; past it, the first month of rent is charged now and monthly after that.
Calls POST /v1/phone-number

Options

string
The number to buy, in E.164 format, from a search result. Give this or autoPick.
object
What the number Roark picks should look like. Roark buys the first matching number the carrier will sell, preferring the area code and falling back to a nearby one.
string
ISO 3166-1 alpha-2 country of the number: US or CA. One of US, CA
string
LOCAL for a number in an area code, TOLL_FREE for one from the shared US and Canada toll-free pool. One of LOCAL, TOLL_FREE
string
Three-digit area code, or a toll-free prefix such as 800. When it has no numbers, nearby ones are returned instead, flagged bestEffort.
string
Digits or letters the number must contain (1 to 7, * matches any digit).
string
The country of the number given by e164 (default: US). An auto-picked number uses autoPick.country. One of US, CA
string
A label for the number.
string
The agent to assign the number to.
switch
Whether you expect this number to be free (from the allowance). The purchase is refused with 409 if that has changed since you checked.
integer
The monthly rent you expect for a paid number, in micros (from the allowance). The purchase is refused with 409 if that has changed since you checked.

Example

Every command also takes the global options and sets one of the exit codes.