GET
https://jmpy.me/api/v1
/
domains
/
check-subdomain
/
{subdomain}
Check Subdomain Available
curl --request GET \
  --url https://jmpy.me/api/v1/domains/check-subdomain/{subdomain} \
  --header 'Authorization: Bearer <token>'
{
  "available": true,
  "message": "<string>"
}
Check if a jmpy.me subdomain (e.g., acme) is available.

Path Parameters

subdomain
string
required
The subdomain to check. Alphanumeric and dashes only.

Response

available
boolean
Whether the subdomain is available.
message
string
Status message.

Request Examples

curl -X GET "https://jmpy.me/api/v1/domains/check-subdomain/acme" \
  -H "Authorization: Bearer YOUR_API_KEY"

Response Examples

{
  "success": true,
  "data": {
    "subdomain": "acme",
    "available": true,
    "message": "Subdomain is available"
  }
}

Use Cases

Check subdomain availability instantly as the user types.
// Example: Debounced function for a registration form
async function checkSubdomainAvailability(subdomain) {
  if (subdomain.length < 3) return;

  try {
    const response = await fetch(
      `https://jmpy.me/api/v1/domains/check-subdomain/${subdomain}`,
      { headers: { 'Authorization': 'Bearer YOUR_API_KEY' } }
    );
    const result = await response.json();
    
    if (result.data.available) {
      console.log('Subdomain is available!');
    } else {
      console.warn('Subdomain is already taken');
    }
  } catch (error) {
    console.error('Check failed', error);
  }
}