The PhoneNumber Object
Attributes
Verification requirement. Values:
city-address, country-address, terms-and-conditions, or null.Example Object
Search Phone Numbers
Returns available phone numbers matching your criteria.Arguments
ISO 3166 alpha-2 country code of the country.
Example
Response
Buy a Phone Number
Purchase a phone number and add it to your account.Arguments
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 the application was filed for a subaccount, buy the number for that subaccount (pass subaccount). See the Compliance API.If you omit it, Plivo auto-selects the most recent accepted application that matches the number’s country and type:- With
subaccount: one filed for that subaccount first, then one of your main account’s. - Without
subaccount: one of your main account’s.
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. A number linked to a compliance application filed for a subaccount stays on that subaccount; see the subaccount parameter there.Example
Response
Compliance Errors
Renting a number that requires compliance, such as an India number, needs a compliance application inaccepted status. Requests that don’t meet this condition return 400 bad request:
See India Number KYC for how to resolve each application status.
Related
- Account Phone Numbers - Manage your rented numbers
- Regulatory Compliance - Verification requirements
- Number Porting - Port numbers to Plivo