---
title: "POST /subscriptions/{subscriptionId}/providers/Microsoft.AzureActiveDirectory/checkNameAvailability"
method: POST
path: "/subscriptions/{subscriptionId}/providers/Microsoft.AzureActiveDirectory/checkNameAvailability"
tags: ["B2CTenants", "CIAMTenants"]
---

# POST /subscriptions/{subscriptionId}/providers/Microsoft.AzureActiveDirectory/checkNameAvailability

`POST /subscriptions/{subscriptionId}/providers/Microsoft.AzureActiveDirectory/checkNameAvailability`

Checks the availability and validity of a domain name for the tenant.

## Path parameters

- `subscriptionId` string, required

## Query parameters

- `api-version` string, required

## Request body

- CheckNameAvailabilityRequestBody — The information required to check the availability of the sub domain name for the tenant.
  - `name` string, required — The sub domain name to check for availability.
  - `countryCode` string, required — Country code of Azure tenant (e.g. 'US'). Refer to [aka.ms/B2CDataResidency](https://aka.ms/B2CDataResidency) to see valid country codes and corresponding data residency locations. If you do not see a country code in an valid data residency location, choose one from the list.

## Response `200`

The result of checking for the name availability.

- NameAvailabilityResponse — Response of the CheckNameAvailability operation.
  - `message` string — Description of the reason if name is not available.
  - `nameAvailable` boolean — True if the name is available and can be used to create a new tenant. Otherwise false.
  - `reason` 'AlreadyExists' | 'Invalid' — Describes the reason for the 'nameAvailable' value.

## Other responses

- `default` — Error response describing why the operation failed.

---

[API](https://skmtc.net/azure/apis/cpim-microsoft-azureactivedirectory-externalidentities.md) · [All operations](https://skmtc.net/azure/apis/cpim-microsoft-azureactivedirectory-externalidentities/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/azure/cpim-microsoft-azureactivedirectory-externalidentities/versions/0ea03104124e/schema)
