> ## Documentation Index
> Fetch the complete documentation index at: https://docs.phanomcloud.online/llms.txt
> Use this file to discover all available pages before exploring further.

# Check Subdomain

> Checks if a subdomain name is available. Public endpoint — no authentication required.

## Path Parameters

<ParamField path="name" type="string" required>
  The subdomain name to check. Lowercase letters, numbers and hyphens only.
</ParamField>

## Validation Rules

| Rule           | Requirement                                                             |
| -------------- | ----------------------------------------------------------------------- |
| Length         | Between 3 and 32 characters                                             |
| Characters     | Lowercase letters, numbers and hyphens (`-`) only                       |
| Start/End      | Cannot start or end with a hyphen                                       |
| Reserved names | Cannot use reserved names like `api`, `www`, `admin`, `dashboard`, etc. |

<RequestExample>
  ```bash cURL theme={null}
  curl https://api.phanomcloud.online/apps/check/my-cool-app
  ```

  ```js JavaScript theme={null}
  const res = await fetch("https://api.phanomcloud.online/apps/check/my-cool-app");
  const { data } = await res.json();

  if (data.available) {
    console.log("Available at:", data.url);
  } else {
    console.log("Unavailable:", data.reason);
  }
  ```
</RequestExample>

<ResponseExample>
  ```json 200 — Available theme={null}
  {
    "success": true,
    "data": {
      "available": true,
      "name": "my-cool-app",
      "url": "https://my-cool-app.phanomcloud.online"
    }
  }
  ```

  ```json 200 — Taken theme={null}
  {
    "success": true,
    "data": {
      "available": false,
      "reason": "\"my-cool-app\" is already taken"
    }
  }
  ```

  ```json 200 — Reserved theme={null}
  {
    "success": true,
    "data": {
      "available": false,
      "reason": "\"admin\" is a reserved name"
    }
  }
  ```

  ```json 200 — Invalid format theme={null}
  {
    "success": true,
    "data": {
      "available": false,
      "reason": "Only lowercase letters, numbers and hyphens. Cannot start or end with hyphen."
    }
  }
  ```
</ResponseExample>
