PhoneNumbersClient (stable:2025-04-01)

2025/03/31 • 20 new methods

PhoneNumbers_ListAreaCodes (new)
Description Gets the list of available area codes.
Reference Link ¶

⚼ Request

GET:  /availablePhoneNumbers/countries/{countryCode}/areaCodes
{
countryCode: string ,
phoneNumberType: string ,
skip: integer ,
maxPageSize: integer ,
assignmentType: string ,
locality: string ,
administrativeDivision: string ,
api-version: string ,
accept-language: string ,
}

⚐ Response (200)

{
areaCodes:
[
{
areaCode: string ,
}
,
]
,
nextLink: string ,
}

⚐ Response (default)

{
error:
{
code: string ,
message: string ,
target: string ,
details:
[
{
code: string ,
message: string ,
target: string ,
details:
[
string ,
]
,
innererror: string ,
}
,
]
,
innererror:
{
code: string ,
message: string ,
target: string ,
details:
[
string ,
]
,
innererror: string ,
}
,
}
,
}
PhoneNumbers_ListAvailableCountries (new)
Description Gets the list of supported countries.
Reference Link ¶

⚼ Request

GET:  /availablePhoneNumbers/countries
{
skip: integer ,
maxPageSize: integer ,
api-version: string ,
accept-language: string ,
}

⚐ Response (200)

{
countries:
[
{
localizedName: string ,
countryCode: string ,
}
,
]
,
nextLink: string ,
}

⚐ Response (default)

{
error:
{
code: string ,
message: string ,
target: string ,
details:
[
{
code: string ,
message: string ,
target: string ,
details:
[
string ,
]
,
innererror: string ,
}
,
]
,
innererror:
{
code: string ,
message: string ,
target: string ,
details:
[
string ,
]
,
innererror: string ,
}
,
}
,
}
PhoneNumbers_BrowseAvailableNumbers (new)
Description Browses for available phone numbers to purchase. The response will be a randomized list of phone numbers available to purchase matching the browsing criteria. This operation is not paginated. Since the results are randomized, repeating the same request will not guarantee the same results.
Reference Link ¶

⚼ Request

POST:  /availablePhoneNumbers/countries/{countryCode}/:browse
{
api-version: string ,
countryCode: string ,
phoneNumbersBrowseRequest:
{
phoneNumberType: enum ,
capabilities:
{
calling: enum ,
sms: enum ,
}
,
assignmentType: enum ,
phoneNumberPrefixes:
[
string ,
]
,
}
,
}

⚐ Response (200)

{
phoneNumbers:
[
{
id: string ,
countryCode: string ,
phoneNumber: string ,
capabilities:
{
calling: enum ,
sms: enum ,
}
,
phoneNumberType: enum ,
assignmentType: enum ,
cost: object ,
status: enum ,
isAgreementToNotResellRequired: boolean ,
error:
{
code: string ,
message: string ,
}
,
}
,
]
,
}

⚐ Response (default)

{
error:
{
code: string ,
message: string ,
target: string ,
details:
[
{
code: string ,
message: string ,
target: string ,
details:
[
string ,
]
,
innererror: string ,
}
,
]
,
innererror:
{
code: string ,
message: string ,
target: string ,
details:
[
string ,
]
,
innererror: string ,
}
,
}
,
}
PhoneNumbers_ListAvailableLocalities (new)
Description Gets the list of cities or towns with available phone numbers.
Reference Link ¶

⚼ Request

GET:  /availablePhoneNumbers/countries/{countryCode}/localities
{
countryCode: string ,
skip: integer ,
maxPageSize: integer ,
administrativeDivision: string ,
api-version: string ,
accept-language: string ,
}

⚐ Response (200)

{
phoneNumberLocalities:
[
{
localizedName: string ,
administrativeDivision:
{
localizedName: string ,
abbreviatedName: string ,
}
,
}
,
]
,
nextLink: string ,
}

⚐ Response (default)

{
error:
{
code: string ,
message: string ,
target: string ,
details:
[
{
code: string ,
message: string ,
target: string ,
details:
[
string ,
]
,
innererror: string ,
}
,
]
,
innererror:
{
code: string ,
message: string ,
target: string ,
details:
[
string ,
]
,
innererror: string ,
}
,
}
,
}
PhoneNumbers_ListOfferings (new)
Description List available offerings of capabilities with rates for the given country.
Reference Link ¶

⚼ Request

GET:  /availablePhoneNumbers/countries/{countryCode}/offerings
{
countryCode: string ,
skip: integer ,
maxPageSize: integer ,
phoneNumberType: string ,
assignmentType: string ,
api-version: string ,
accept-language: string ,
}

⚐ Response (200)

{
phoneNumberOfferings:
[
{
phoneNumberType: enum ,
assignmentType: enum ,
availableCapabilities:
{
calling: enum ,
sms: enum ,
}
,
cost:
{
amount: number ,
currencyCode: string ,
billingFrequency: enum ,
}
,
}
,
]
,
nextLink: string ,
}

⚐ Response (default)

{
error:
{
code: string ,
message: string ,
target: string ,
details:
[
{
code: string ,
message: string ,
target: string ,
details:
[
string ,
]
,
innererror: string ,
}
,
]
,
innererror:
{
code: string ,
message: string ,
target: string ,
details:
[
string ,
]
,
innererror: string ,
}
,
}
,
}
PhoneNumbers_ListReservations (new)
Description Retrieves a paginated list of all phone number reservations. Note that the reservations will not be populated with the phone numbers associated with them.
Reference Link ¶

⚼ Request

GET:  /availablePhoneNumbers/reservations
{
api-version: string ,
maxPageSize: integer ,
}

⚐ Response (200)

{
reservations:
[
{
id: string ,
expiresAt: string ,
phoneNumbers: object ,
status: enum ,
}
,
]
,
nextLink: string ,
}

⚐ Response (default)

{
error:
{
code: string ,
message: string ,
target: string ,
details:
[
{
code: string ,
message: string ,
target: string ,
details:
[
string ,
]
,
innererror: string ,
}
,
]
,
innererror:
{
code: string ,
message: string ,
target: string ,
details:
[
string ,
]
,
innererror: string ,
}
,
}
,
}
PhoneNumbers_CreateOrUpdateReservation (new)
Description Adds and removes phone numbers from the reservation with the given ID. The response will be the updated state of the reservation. Phone numbers can be reserved by including them in the payload. If a number is already in the reservation, it will be ignored. To remove a phone number, set it explicitly to null in the request payload. This operation is idempotent. If a reservation with the same ID already exists, it will be updated, otherwise a new one is created. Only reservations with 'active' status can be updated. Updating a reservation will extend the expiration time of the reservation to 15 minutes after the last change, up to a maximum of 2 hours from creation time. Partial success is possible, in which case the response will have a 207 status code.
Reference Link ¶

⚼ Request

PATCH:  /availablePhoneNumbers/reservations/{reservationId}
{
api-version: string ,
reservationId: string ,
reservation:
{
id: string ,
expiresAt: string ,
phoneNumbers: object ,
status: enum ,
}
,
}

⚐ Response (201)

{
id: string ,
expiresAt: string ,
phoneNumbers: object ,
status: enum ,
}

⚐ Response (200)

{
id: string ,
expiresAt: string ,
phoneNumbers: object ,
status: enum ,
}

⚐ Response (207)

{
id: string ,
expiresAt: string ,
phoneNumbers: object ,
status: enum ,
}

⚐ Response (default)

{
error:
{
code: string ,
message: string ,
target: string ,
details:
[
{
code: string ,
message: string ,
target: string ,
details:
[
string ,
]
,
innererror: string ,
}
,
]
,
innererror:
{
code: string ,
message: string ,
target: string ,
details:
[
string ,
]
,
innererror: string ,
}
,
}
,
}
PhoneNumbers_GetReservation (new)
Description Retrieves the reservation with the given ID, including all of the phone numbers associated with it.
Reference Link ¶

⚼ Request

GET:  /availablePhoneNumbers/reservations/{reservationId}
{
api-version: string ,
reservationId: string ,
}

⚐ Response (200)

{
id: string ,
expiresAt: string ,
phoneNumbers: object ,
status: enum ,
}

⚐ Response (default)

{
error:
{
code: string ,
message: string ,
target: string ,
details:
[
{
code: string ,
message: string ,
target: string ,
details:
[
string ,
]
,
innererror: string ,
}
,
]
,
innererror:
{
code: string ,
message: string ,
target: string ,
details:
[
string ,
]
,
innererror: string ,
}
,
}
,
}
PhoneNumbers_DeleteReservation (new)
Description Deletes the reservation with the given ID. Any phone number in the reservation will be released and made available for others to purchase. Only reservations with 'active' status can be deleted.
Reference Link ¶

⚼ Request

DELETE:  /availablePhoneNumbers/reservations/{reservationId}
{
api-version: string ,
reservationId: string ,
}

⚐ Response (204)

{}

⚐ Response (default)

{
error:
{
code: string ,
message: string ,
target: string ,
details:
[
{
code: string ,
message: string ,
target: string ,
details:
[
string ,
]
,
innererror: string ,
}
,
]
,
innererror:
{
code: string ,
message: string ,
target: string ,
details:
[
string ,
]
,
innererror: string ,
}
,
}
,
}
PhoneNumbers_PurchaseReservation (new)
Description Starts a long running operation to purchase all of the phone numbers in the reservation. Purchase can only be started for active reservations that at least one phone number. If any of the phone numbers in the reservation is from a country where reselling is not permitted, do not resell agreement is required. The response will include an 'Operation-Location' header that can be used to query the status of the operation.
Reference Link ¶

⚼ Request

POST:  /availablePhoneNumbers/reservations/{reservationId}/:purchase
{
api-version: string ,
reservationId: string ,
reservationPurchaseRequest:
{
agreeToNotResell: boolean ,
}
,
}

⚐ Response (202)

{
operation-location: string ,
operation-id: string ,
reservation-purchase-id: string ,
}

⚐ Response (default)

{
error:
{
code: string ,
message: string ,
target: string ,
details:
[
{
code: string ,
message: string ,
target: string ,
details:
[
string ,
]
,
innererror: string ,
}
,
]
,
innererror:
{
code: string ,
message: string ,
target: string ,
details:
[
string ,
]
,
innererror: string ,
}
,
}
,
}
PhoneNumbers_SearchAvailablePhoneNumbers (new)
Description Search for available phone numbers to purchase.
Reference Link ¶

⚼ Request

POST:  /availablePhoneNumbers/countries/{countryCode}/:search
{
countryCode: string ,
api-version: string ,
body:
{
phoneNumberType: enum ,
assignmentType: enum ,
capabilities:
{
calling: enum ,
sms: enum ,
}
,
areaCode: string ,
quantity: integer ,
}
,
}

⚐ Response (202)

{
$headers:
{
location: string ,
operation-location: string ,
operation-id: string ,
search-id: string ,
}
,
$schema:
{
searchId: string ,
phoneNumbers:
[
string ,
]
,
phoneNumberType: enum ,
assignmentType: enum ,
capabilities:
{
calling: enum ,
sms: enum ,
}
,
cost:
{
amount: number ,
currencyCode: string ,
billingFrequency: enum ,
}
,
searchExpiresBy: string ,
isAgreementToNotResellRequired: boolean ,
errorCode: integer ,
error: enum ,
}
,
}

⚐ Response (default)

{
error:
{
code: string ,
message: string ,
target: string ,
details:
[
{
code: string ,
message: string ,
target: string ,
details:
[
string ,
]
,
innererror: string ,
}
,
]
,
innererror:
{
code: string ,
message: string ,
target: string ,
details:
[
string ,
]
,
innererror: string ,
}
,
}
,
}
PhoneNumbers_GetSearchResult (new)
Description Gets a phone number search result by search id.
Reference Link ¶

⚼ Request

GET:  /availablePhoneNumbers/searchResults/{searchId}
{
searchId: string ,
api-version: string ,
}

⚐ Response (200)

{
searchId: string ,
phoneNumbers:
[
string ,
]
,
phoneNumberType: enum ,
assignmentType: enum ,
capabilities:
{
calling: enum ,
sms: enum ,
}
,
cost:
{
amount: number ,
currencyCode: string ,
billingFrequency: enum ,
}
,
searchExpiresBy: string ,
isAgreementToNotResellRequired: boolean ,
errorCode: integer ,
error: enum ,
}

⚐ Response (default)

{
error:
{
code: string ,
message: string ,
target: string ,
details:
[
{
code: string ,
message: string ,
target: string ,
details:
[
string ,
]
,
innererror: string ,
}
,
]
,
innererror:
{
code: string ,
message: string ,
target: string ,
details:
[
string ,
]
,
innererror: string ,
}
,
}
,
}
PhoneNumbers_PurchasePhoneNumbers (new)
Description Purchases phone numbers.
Reference Link ¶

⚼ Request

POST:  /availablePhoneNumbers/:purchase
{
api-version: string ,
body:
{
searchId: string ,
agreeToNotResell: boolean ,
}
,
}

⚐ Response (202)

{
operation-location: string ,
operation-id: string ,
purchase-id: string ,
}

⚐ Response (default)

{
error:
{
code: string ,
message: string ,
target: string ,
details:
[
{
code: string ,
message: string ,
target: string ,
details:
[
string ,
]
,
innererror: string ,
}
,
]
,
innererror:
{
code: string ,
message: string ,
target: string ,
details:
[
string ,
]
,
innererror: string ,
}
,
}
,
}
PhoneNumbers_GetOperation (new)
Description Gets an operation by its id.
Reference Link ¶

⚼ Request

GET:  /phoneNumbers/operations/{operationId}
{
operationId: string ,
api-version: string ,
}

⚐ Response (200)

{
$headers:
{
location: string ,
}
,
$schema:
{
operationType: enum ,
status: enum ,
resourceLocation: string ,
createdDateTime: string ,
error:
{
code: string ,
message: string ,
target: string ,
details:
[
{
code: string ,
message: string ,
target: string ,
details:
[
string ,
]
,
innererror: string ,
}
,
]
,
innererror:
{
code: string ,
message: string ,
target: string ,
details:
[
string ,
]
,
innererror: string ,
}
,
}
,
id: string ,
lastActionDateTime: string ,
}
,
}

⚐ Response (default)

{
error:
{
code: string ,
message: string ,
target: string ,
details:
[
{
code: string ,
message: string ,
target: string ,
details:
[
string ,
]
,
innererror: string ,
}
,
]
,
innererror:
{
code: string ,
message: string ,
target: string ,
details:
[
string ,
]
,
innererror: string ,
}
,
}
,
}
PhoneNumbers_CancelOperation (new)
Description Cancels an operation by its id.
Reference Link ¶

⚼ Request

DELETE:  /phoneNumbers/operations/{operationId}
{
operationId: string ,
api-version: string ,
}

⚐ Response (204)

{}

⚐ Response (default)

{
error:
{
code: string ,
message: string ,
target: string ,
details:
[
{
code: string ,
message: string ,
target: string ,
details:
[
string ,
]
,
innererror: string ,
}
,
]
,
innererror:
{
code: string ,
message: string ,
target: string ,
details:
[
string ,
]
,
innererror: string ,
}
,
}
,
}
PhoneNumbers_UpdateCapabilities (new)
Description Updates the capabilities of a phone number.
Reference Link ¶

⚼ Request

PATCH:  /phoneNumbers/{phoneNumber}/capabilities
{
phoneNumber: string ,
api-version: string ,
body:
{
calling: enum ,
sms: enum ,
}
,
}

⚐ Response (202)

{
$headers:
{
location: string ,
operation-location: string ,
operation-id: string ,
capabilities-id: string ,
}
,
$schema:
{
id: string ,
phoneNumber: string ,
countryCode: string ,
phoneNumberType: enum ,
capabilities:
{
calling: enum ,
sms: enum ,
}
,
assignmentType: enum ,
purchaseDate: string ,
cost:
{
amount: number ,
currencyCode: string ,
billingFrequency: enum ,
}
,
}
,
}

⚐ Response (default)

{
error:
{
code: string ,
message: string ,
target: string ,
details:
[
{
code: string ,
message: string ,
target: string ,
details:
[
string ,
]
,
innererror: string ,
}
,
]
,
innererror:
{
code: string ,
message: string ,
target: string ,
details:
[
string ,
]
,
innererror: string ,
}
,
}
,
}
PhoneNumbers_GetByNumber (new)
Description Gets the details of the given purchased phone number.
Reference Link ¶

⚼ Request

GET:  /phoneNumbers/{phoneNumber}
{
phoneNumber: string ,
api-version: string ,
}

⚐ Response (200)

{
id: string ,
phoneNumber: string ,
countryCode: string ,
phoneNumberType: enum ,
capabilities:
{
calling: enum ,
sms: enum ,
}
,
assignmentType: enum ,
purchaseDate: string ,
cost:
{
amount: number ,
currencyCode: string ,
billingFrequency: enum ,
}
,
}

⚐ Response (default)

{
error:
{
code: string ,
message: string ,
target: string ,
details:
[
{
code: string ,
message: string ,
target: string ,
details:
[
string ,
]
,
innererror: string ,
}
,
]
,
innererror:
{
code: string ,
message: string ,
target: string ,
details:
[
string ,
]
,
innererror: string ,
}
,
}
,
}
PhoneNumbers_ReleasePhoneNumber (new)
Description Releases a purchased phone number.
Reference Link ¶

⚼ Request

DELETE:  /phoneNumbers/{phoneNumber}
{
phoneNumber: string ,
api-version: string ,
}

⚐ Response (202)

{
operation-location: string ,
operation-id: string ,
release-id: string ,
}

⚐ Response (default)

{
error:
{
code: string ,
message: string ,
target: string ,
details:
[
{
code: string ,
message: string ,
target: string ,
details:
[
string ,
]
,
innererror: string ,
}
,
]
,
innererror:
{
code: string ,
message: string ,
target: string ,
details:
[
string ,
]
,
innererror: string ,
}
,
}
,
}
PhoneNumbers_ListPhoneNumbers (new)
Description Gets the list of all purchased phone numbers.
Reference Link ¶

⚼ Request

GET:  /phoneNumbers
{
skip: integer ,
top: integer ,
api-version: string ,
}

⚐ Response (200)

{
phoneNumbers:
[
{
id: string ,
phoneNumber: string ,
countryCode: string ,
phoneNumberType: enum ,
capabilities:
{
calling: enum ,
sms: enum ,
}
,
assignmentType: enum ,
purchaseDate: string ,
cost:
{
amount: number ,
currencyCode: string ,
billingFrequency: enum ,
}
,
}
,
]
,
nextLink: string ,
}

⚐ Response (default)

{
error:
{
code: string ,
message: string ,
target: string ,
details:
[
{
code: string ,
message: string ,
target: string ,
details:
[
string ,
]
,
innererror: string ,
}
,
]
,
innererror:
{
code: string ,
message: string ,
target: string ,
details:
[
string ,
]
,
innererror: string ,
}
,
}
,
}
PhoneNumbers_OperatorInformationSearch (new)
Description Searches for number format and operator information for a given list of phone numbers.
Reference Link ¶

⚼ Request

POST:  /operatorInformation/:search
{
api-version: string ,
body:
{
phoneNumbers:
[
string ,
]
,
options:
{
includeAdditionalOperatorDetails: boolean ,
}
,
}
,
}

⚐ Response (200)

{
values:
[
{
phoneNumber: string ,
nationalFormat: string ,
internationalFormat: string ,
isoCountryCode: string ,
numberType: enum ,
operatorDetails:
{
name: string ,
mobileNetworkCode: string ,
mobileCountryCode: string ,
}
,
}
,
]
,
}

⚐ Response (default)

{
error:
{
code: string ,
message: string ,
target: string ,
details:
[
{
code: string ,
message: string ,
target: string ,
details:
[
string ,
]
,
innererror: string ,
}
,
]
,
innererror:
{
code: string ,
message: string ,
target: string ,
details:
[
string ,
]
,
innererror: string ,
}
,
}
,
}