The PhoneNumber Object
Attributes
Phone number that can be purchased.
Area code of the number.
City of the number. Returns
null for national numbers.Country of the number.
City and country of the number.
Rate center. US and Canada only.
Local access and transport area. US and Canada only.
Number type. Values:
fixed, mobile, or tollfree.Number subtype. Values:
fixed, mobile, tollfree, national, or local.One-time setup fee in USD.
Monthly rental fee in USD.
Whether the number can receive SMS.
Cost per SMS received in USD.
Whether the number can receive MMS.
Cost per MMS received in USD.
Whether the number can receive calls.
Cost per minute for calls in USD.
Verification requirement. Values:
city-address, country-address, terms-and-conditions, or null.Description of verification requirements.
URI to the phone number resource.
Example Object
Search Phone Numbers
Returns available phone numbers matching your criteria.Arguments
ISO 3166 alpha-2 country code of the country.
Number type filter. Values:
tollfree, local, mobile, national, or fixed.Pattern to match. For example,
415 returns numbers starting with 1415.Six-digit prefix filter. US and Canada only.
Expand search to local calling area of
npanxx.Region name (e.g.,
Frankfurt). For fixed type only.City name. For
local type only.Filter by capabilities. Values:
voice, sms, mms, voice,sms, or voice,sms,mms.LATA filter. US and Canada only.
Rate center filter. US and Canada only.
Results per page. Maximum 20, default 20.
Pagination offset. Default 0.
Example
Response
Buy a Phone Number
Purchase a phone number and add it to your account.Arguments
Application to assign. Defaults to
default_number_app.Enable CNAM lookup. Values:
enabled or disabled. US only.UUID of an
accepted compliance application to attach to the number at purchase. The application’s country and number type must match the number. If omitted, Plivo auto-selects your most recent applicable compliance application. See the Compliance API.Auth ID of a subaccount to assign the number to at purchase. Requires main-account credentials (see note below).
If the number requires verification documents, the number status will be
pending until documents are approved.Call this endpoint with main-account credentials. Phone numbers are billed and owned at the main-account level, so a request made with subaccount credentials returns
404 not found even when Search works with the same credentials. To buy a number for a subaccount, call this endpoint with main-account credentials and pass the subaccount parameter. To move an already-rented number to a subaccount, use the Update an Account Phone Number endpoint’s subaccount parameter.Example
Response
Related
- Account Phone Numbers - Manage your rented numbers
- Regulatory Compliance - Verification requirements
- Number Porting - Port numbers to Plivo