Purchase phone number
Purchase a local or toll-free phone number and assign it to an account.
Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
The account for which the phone number should be created.
"acct_01j9a43avnfqzbjfch6pygv1td"
Body
Parameters for purchasing a new phone number. The system will automatically infer the type in certain cases:
- If only area_code is provided, type is inferred from the area code
- If only latitude/longitude are provided, type is inferred as 'local'
- Otherwise, type must be explicitly specified
If phone_number is provided, all other search parameters are ignored.
The desired area code for this phone number. If provided without type, the type will be inferred.
^\d{3}$"801"
Latitude to search for nearby phone numbers. Must be used with longitude. If provided without type, type will be inferred as 'local'.
-90 <= x <= 9040.7128
Longitude to search for nearby phone numbers. Must be used with latitude. If provided without type, type will be inferred as 'local'.
-180 <= x <= 180-74.006
A human-readable name for the phone number. If not provided, defaults to the formatted phone number.
"Support Line"
The exact phone number to purchase in E.164 format. When provided, all other search parameters are ignored.
^\+[1-9]\d{6,14}$"+18015551234"
Whether the phone number is local or toll-free. Can be omitted if area_code or latitude/longitude are provided.
local, toll_free "local"
Response
Purchased phone number
A phone number that can be used to send and receive messages and calls
Campaign attachment details for domestic local numbers, or null for other types of numbers and local numbers without a campaign
Deprecated. The unique identifier of the campaign this phone number is attached to, if any
Unique identifier for the phone number
A human-readable name for the phone number
The phone number in E.164 format
^\+[1-9]\d{6,14}$"+18015551234"
Whether the phone number is local, toll-free, or short code
local, short_code, toll_free