v10

latestSwagger 2.02026-07-13203270.7 KB
Find and purchase available phone numbers

Search for available phone numbers to purchase.

post/availablePhoneNumbers/countries/{countryCode}/:search

Path parameters

countryCodestring required

The ISO 3166-2 country code, e.g. US.

Query parameters

api-versionstring required

Version of API to invoke

Request body

phoneNumberType'geographic' | 'tollFree' | 'mobile' required

The type of phone numbers to search for, e.g. geographic, tollFree, mobile.

assignmentType'person' | 'application' required

The assignment type of the phone numbers to search for. A phone number can be assigned to a person, or to an application.

areaCodestring

The area code of the desired phone number, e.g. 425.

quantityinteger

The quantity of desired phone numbers. The default value is 1.

Response

The service has accepted the request and will start processing later. It will return 'Accepted' immediately and include an 'Operation-Location' and 'Location' headers. Client side should further query the operation status using the URL specified in 'Operation-Location' header. When operation completes successfully query final result using URL specified in 'Location' header.

searchIdstring required

The search id.

phoneNumbersstring[] required

The phone numbers that are available. Can be fewer than the desired search quantity.

phoneNumberType'geographic' | 'tollFree' | 'mobile' required

The phone number's type, e.g. geographic, tollFree, mobile.

assignmentType'person' | 'application' required

Phone number's assignment type.

searchExpiresBystring date-time required

The date that this search result expires and phone numbers are no longer on hold. A search result expires in less than 15min, e.g. 2020-11-19T16:31:49.048Z.

isAgreementToNotResellRequiredboolean

Indicates if do not resell agreement is required. If true, the phone numbers cannot be acquired unless the customer provides explicit agreement to not resell them.

errorCodeinteger

The error code of the search.

error'NoError' | 'UnknownErrorCode' | 'OutOfStock' | 'AuthorizationDenied' | 'MissingAddress' | 'InvalidAddress' | 'InvalidOfferModel' | 'NotEnoughLicenses' | 'NoWallet' | 'NotEnoughCredit' | 'NumbersPartiallyAcquired' | 'AllNumbersNotAcquired' | 'ReservationExpired' | 'PurchaseFailed' | 'BillingUnavailable' | 'ProvisioningFailed' | 'UnknownSearchError'

Mapping Error Messages to Codes