Skip to main content
POST
JavaScript

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json

Input for buying a phone number

e164
string
required

The number to buy, in E.164 format, from a search result

Pattern: ^\+[1-9]\d{1,14}$
Example:

"+14155550123"

name
string

A label for the number

Required string length: 1 - 80
agentId
string<uuid>

The agent to assign the number to

expectFree
boolean

Whether you expect this number to be free (from the allowance). The purchase is refused with 409 if that has changed since you checked.

expectMonthlyRentMicros
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.

Required range: x >= 0
Example:

2000000

Response

The purchased phone number

data
object
required

A phone number the project owns