Skip to main content

Browse Available DIDs

This request returns a pool of rentable phone numbers.

get /phonenumber/available_dids
get /dids/inventorydeprecated

Sample​

A sample GET request to get available DIDs matching the criteria in the request URL:

curl -X GET \
'https://api.carrierx.com/core/v2/phonenumber/available_dids?limit=1' \
-H 'Authorization: Bearer 5ebc03d6-8b2b-44ad-bf65-72d4f1491dda'

Response​

200 status code with a list of available DID objects:

{
"count": 1,
"has_more": true,
"items": [
{
"active_capabilities": 4,
"attributes": {},
"callback_url": null,
"campaign_sid": null,
"capabilities": 7,
"classification_sid": "17f4d954-d635-4cda-912b-c2a2fa3a6860",
"country_code": "USA",
"did_group_sid": null,
"did_sid": "07e3dee3-2f0d-4254-b635-21334ccde8b9",
"in_country_format": "(516) 206-5573",
"international_format": "+1 516-206-5573",
"lata": null,
"line_type": null,
"locality": "NEW YORK",
"lrn_sid": null,
"name": "(516) 206-5573",
"ocn": "251F",
"partner_sid": null,
"pending_port_in": null,
"phonenumber": "15162065573",
"porting_pin": null,
"price": "0.6",
"state": "NY",
"status": "available",
"string_key_1": null,
"string_key_2": null,
"transformations": [],
"trunk_group_sid": null,
"underlying_carrier_sid": "40a8c9cf-8b08-4c21-a3e3-952c65ee892d",
"wireless_handset_messaging_approval": null,
"wireless_iccid": null,
"wireless_product": null
}
],
"limit": 1,
"offset": 0,
"pagination": {
"next": "https://api.carrierx.com/core/v2/phonenumber/available_dids?limit=1&offset=1"
},
"total": null
}

This request is enabled for Pagination, Result Filtering, and Field Filtering.

Required Scopes​

To get information about rentable numbers the partner must have one of the following scopes enabled:

  • phonenumber.manage
  • phonenumber.read

Filtering by Location​

CarrierX allows you to filter the available phone numbers by their geographical location and area codes. Refer to the table below to see the parameters which you can use to do this.

ParameterDescriptionSyntaxExamples
latlngUse this option to search for the phone numbers located closer to the area described by geographical coordinates specified.phonenumber nearby latlng:<latitude,longitude>filter=phonenumber+nearby+latlng%3A40.801912%2C-73.9681657
npaUse this option to search for the phone numbers located closer to the area associated with the NANP area code specified. See tip below.phonenumber nearby npa:<npa>filter=phonenumber+nearby+npa%3A516
zipUse this option to search for the phone numbers located closer to the area associated with the ZIP code specified.phonenumber nearby zip:<zip>filter=phonenumber+nearby+zip%3A10025
tip

The filter phonenumber nearby npa is a geographical search and may return numbers outside the NPA specified but geographically nearby or in an overlay NPA. To search within a specific area code, use phonenumber like "1<npa>%". The percent symbol, %, is a wildcard, so 1<npa>% says anything that starts with 1<npa>. For example, to find numbers in the 415 area code use:

phonenumber like "1415%"

DID Sources​

CarrierX searches for available phone numbers in its own inventory. For some countries, CarrierX also searches at an external provider. The country_code and line_type parameters in the result filter decide where the system searches.

If the filter has no country_code eq parameter, the system searches only the CarrierX inventory.

If the filter has country_code eq with a country where CarrierX uses an external provider, the system searches the CarrierX inventory first. Then it adds phone numbers from the external provider. In this case:

  • Pagination is not supported. The offset must be 0. The number of records in the response depends on the external provider.
  • The phonenumber nearby filters are not allowed.
  • The external provider supports only these filter parameters and operators:
    • country_code eq, which must be followed by a 3-letter country code, for example country_code eq "GBR".
    • phonenumber like, for example phonenumber like "%555%".
    • capabilities, which must be followed by either bit or eq operator. Please note that external DIDs often have limited capabilities. In most cases, only SMS and voice are supported (capabilities bit 1, 2, and 4; and their combinations), so if you are using a capabilities filter with an external DID, you may need to make sure its number does not exceed 7, otherwise you may get very limited results.

The line_type parameter selects the type of phone numbers to search for. It does not filter the phone numbers in the response. The default value is local. Wireless DIDs cannot be browsed. A request with line_type eq "wireless" returns a 400 error. To get a wireless DID, rent it directly.

Query Arguments​

ParameterData TypeDescription
include_external
deprecated
boolean

This argument is ignored. The source of the phone numbers depends on the country_code and line_type filter parameters. Refer to DID Sources for details.