List Available Exchanges

Returns a list of all Central Office (exchange) codes containing purchasable phone numbers. All request parameters are optional.

Endpoint

GET /available/exchanges

Query Parameters

  • limit
    integer

    Limits the number of exchange codes to retrieve. A maximum of 200 items can be retrieved with 10 being the default value if not specified.

  • offset
    integer

    Offsets the list of exchange codes to retrieve by your specified value.

  • max_setup_cost
    float

    Restricts the results to exchanges that include at least one telephone number with a setup fee below or equal to the specified max_setup_cost. For more details around pricing, please see Flowroute Pricing Details.

  • areacode
    integer

    Restricts the results to the specified area code.

Response Fields

On success, the HTTP status code in the response header is 200 OK and the response body contains an array of exchange objects in JSON format. On error, the header status code is an error code and the response body contains an array of error objects.

  • data
    array

    An array of exchange objects that satisfy your query individually composed of:

    • id
      integer

      Unique identifier of the exchange.

    • links
      object

      Links object pointing to the related array of phone numbers that start with the returned exchange code regardless of the area code unless the results are filtered by area code. For example, https://api.flowroute.com/v2/numbers/available?starts_with=1201267.

    • type
      string

      This will always be exchange.

  • links
    object

    Links object pointing to your search and a link to the next page if any. For example, https://api.flowroute.com/v2/numbers/available/exchanges?limit=2&offset=0.

Example Request

GET /v2/numbers/available/exchanges?limit=2 HTTP/1.1
Content-Type: application/vnd.api+json
Accept: application/vnd.api+json

                        

Example Request

curl https://api.flowroute.com/v2/numbers/available/exchanges?limit=2 -u accessKey:secretKey

                        

Example Responses

200 OK

{
  "data": [
    {
      "id": "201267",
      "links": {
        "related": "https://api.flowroute.com/v2/numbers/available?starts_with=1201267"
      },
      "type": "exchange"
    },
    {
      "id": "201616",
      "links": {
        "related": "https://api.flowroute.com/v2/numbers/available?starts_with=1201616"
      },
      "type": "exchange"
    }
  ],
  "links": {
    "next": "https://api.flowroute.com/v2/numbers/available/exchanges?limit=2&offset=2",
    "self": "https://api.flowroute.com/v2/numbers/available/exchanges?limit=2&offset=0"
  }
}

            

422 UNPROCESSABLE ENTITY

{
  "errors": [
    {
      "detail": "Invalid area code",
      "id": "90e94676-0c3b-4fb5-aeee-3704408f09ba",
      "status": 422
    }
  ]
}