# Get Availability

Check the availability of phone numbers based on the provided request details.

# OpenAPI definition

```json
{
  "openapi": "3.0.1",
  "info": {
    "title": "Phone Number Request API",
    "version": "v1"
  },
  "servers": [
    {
      "url": "https://api.cm.com"
    }
  ],
  "paths": {
    "/voice-phonenumberrequestapi/v1/{accountGuid}/numberrequests/availability": {
      "get": {
        "tags": [
          "Number Requests"
        ],
        "summary": "Get Availability",
        "description": "Check the availability of phone numbers based on the provided request details.",
        "parameters": [
          {
            "name": "accountGuid",
            "in": "path",
            "description": "Unique identifier of the Logical Account or Voice Account.",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "example": "00000000-0000-0000-0000-000000000000"
          },
          {
            "name": "Quantity",
            "in": "query",
            "description": "The quantity of numbers to check availability for.",
            "schema": {
              "type": "integer",
              "format": "int32",
              "example": 25
            },
            "example": 25
          },
          {
            "name": "RangeSize",
            "in": "query",
            "description": "The size of the range to check availability for. **Only required if a range of numbers is requested.\r\nRequires number ranges to be supported. See the order restrictions endpoint for the allowed ranges**",
            "schema": {
              "type": "integer",
              "format": "int32",
              "example": 10
            },
            "example": 10
          },
          {
            "name": "CountryCode",
            "in": "query",
            "description": "The country code in ISO 3166-1 alpha-2 format.",
            "schema": {
              "type": "string",
              "example": "NL"
            },
            "example": "NL"
          },
          {
            "name": "NumberType",
            "in": "query",
            "description": "The type of the number, either Local, National, or TollFree.",
            "schema": {
              "$ref": "#/components/schemas/ApiNumberType"
            },
            "example": "Local"
          },
          {
            "name": "AreaCode",
            "in": "query",
            "description": "The area code to check availability for. Required when city is not provided.\r\nIf the city is also provided, this will be used in combination with city.",
            "schema": {
              "type": "string",
              "example": "76"
            },
            "example": "76"
          },
          {
            "name": "City",
            "in": "query",
            "description": "City to check availability for. Required when area code is not provided.\r\nIf the area code is also provided, this will be used in combination with area code.",
            "schema": {
              "type": "string",
              "example": "Amsterdam"
            },
            "example": "Amsterdam"
          },
          {
            "name": "Region",
            "in": "query",
            "description": "The region the city is located in (only required for Nanpa).",
            "schema": {
              "type": "string",
              "example": "Alabama"
            },
            "example": "Alabama"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiAvailableNumbers"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized"
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "ApiAvailableNumbers": {
        "title": "Available Numbers",
        "type": "object",
        "properties": {
          "quantity": {
            "type": "integer",
            "description": "The amount of number blocks.",
            "format": "int32",
            "example": 25
          },
          "rangeSize": {
            "type": "integer",
            "description": "The size of the number blocks.",
            "format": "int32",
            "example": 10
          },
          "countryCode": {
            "type": "string",
            "description": "The country code in ISO 3166-1 alpha-2 format.",
            "nullable": true,
            "example": "NL"
          },
          "numberType": {
            "type": "string",
            "description": "The phone number type (Local, National, TollFree).",
            "nullable": true,
            "example": "Local"
          },
          "areaCode": {
            "type": "string",
            "description": "The area code.",
            "nullable": true,
            "example": "76"
          },
          "city": {
            "type": "string",
            "description": "The city or town.",
            "nullable": true,
            "example": "Amsterdam"
          },
          "region": {
            "type": "string",
            "description": "The region or state, only for NANPA.",
            "nullable": true,
            "example": "Alabama"
          },
          "hasAvailableNumbers": {
            "type": "boolean",
            "description": "If true, the phone numbers to request are available",
            "example": true
          },
          "immediatelyAvailable": {
            "type": "boolean",
            "description": "If true, the numbers are available for immediate provisioning, otherwise there may be a delay",
            "example": false
          }
        },
        "additionalProperties": false,
        "description": "Result of checking for number availability"
      },
      "ApiNumberType": {
        "title": "Number Type",
        "enum": [
          "Local",
          "National",
          "TollFree"
        ],
        "type": "string",
        "description": "Phone number type"
      }
    },
    "securitySchemes": {
      "X-CM-PRODUCTTOKEN": {
        "type": "apiKey",
        "description": "Your producttoken",
        "name": "X-CM-PRODUCTTOKEN",
        "in": "header"
      }
    }
  },
  "security": [
    {
      "X-CM-PRODUCTTOKEN": []
    }
  ],
  "x-readme": {
    "explorer-enabled": true,
    "proxy-enabled": true
  },
  "_id": {
    "buffer": {
      "0": 102,
      "1": 244,
      "2": 3,
      "3": 143,
      "4": 59,
      "5": 172,
      "6": 25,
      "7": 0,
      "8": 32,
      "9": 139,
      "10": 61,
      "11": 227
    }
  }
}
```