GET
https://jmpy.me/api/v1
/
short-urls
/
check-alias
Check Alias Availability
curl --request GET \
  --url https://jmpy.me/api/v1/short-urls/check-alias \
  --header 'Authorization: Bearer <token>'
{
  "available": true,
  "alias": "<string>",
  "url_type": "<string>",
  "subdomain": "<string>",
  "branded_domain": "<string>",
  "full_url": "<string>",
  "message": "<string>"
}
Check if a custom alias is available for use within a specific domain context. This endpoint helps you verify alias availability before creating a short URL, preventing conflicts.
Custom Alias Scoping: Aliases are unique per domain context:
  • Standard URLs (jmpy.me): Alias must be unique among all standard URLs
  • Subdomain URLs (subdomain.jmpy.me): Alias must be unique within that specific subdomain
  • Branded URLs (yourdomain.com): Alias must be unique within that specific branded domain
This means jmpy.me/promo and acme.jmpy.me/promo can coexist as separate short URLs.

Query Parameters

alias
string
required
The custom alias to check for availability.Requirements:
  • 3-50 characters
  • Alphanumeric with underscores (_) or dashes (-) only
  • Case-sensitive
  • Must match the regex ^[a-zA-Z0-9_-]+$
Example: my-custom-alias
url_type
string
default:"standard"
The type of URL context to check within.
ValueDescription
standardCheck on jmpy.me (default)
subdomainCheck on a specific subdomain
brandedCheck on a branded domain
subdomain
string
The subdomain to check within (required when url_type=subdomain).Example: acme (checks acme.jmpy.me)
branded_domain
string
The branded domain to check within (required when url_type=branded).Example: go.mycompany.com

Response

available
boolean
Whether the alias is available for use.
alias
string
The alias that was checked.
url_type
string
The URL type context that was checked.
subdomain
string
The subdomain context (if applicable).
branded_domain
string
The branded domain context (if applicable).
full_url
string
The full URL that would be created if this alias is used.
message
string
Human-readable status message.

Request Examples

curl -X GET "https://jmpy.me/api/v1/short-urls/check-alias?alias=my-custom-alias" \
  -H "Authorization: Bearer YOUR_API_KEY"

Response Examples

{
  "success": true,
  "data": {
    "available": true,
    "alias": "my-custom-alias",
    "url_type": "standard",
    "subdomain": null,
    "branded_domain": null,
    "full_url": "https://jmpy.me/my-custom-alias",
    "message": "Alias 'my-custom-alias' is available"
  }
}

Use Cases

Check if an alias is available before creating a short URL to provide better user experience:
async function createShortUrl(url, alias) {
  // First check if alias is available
  const checkResponse = await fetch(
    `https://jmpy.me/api/v1/short-urls/check-alias?alias=${alias}`,
    { headers: { 'Authorization': 'Bearer YOUR_API_KEY' } }
  );
  const checkResult = await checkResponse.json();
  
  if (!checkResult.data.available) {
    throw new Error(`Alias "${alias}" is not available`);
  }
  
  // Create the short URL
  const createResponse = await fetch('https://jmpy.me/api/v1/short-urls', {
    method: 'POST',
    headers: {
      'Authorization': 'Bearer YOUR_API_KEY',
      'Content-Type': 'application/json'
    },
    body: JSON.stringify({ url, custom_alias: alias })
  });
  
  return createResponse.json();
}
An alias might be available on one domain but not another:
async function findAvailableDomain(alias, domains) {
  for (const domain of domains) {
    const params = new URLSearchParams({ alias });
    
    if (domain.type === 'subdomain') {
      params.set('url_type', 'subdomain');
      params.set('subdomain', domain.name);
    } else if (domain.type === 'branded') {
      params.set('url_type', 'branded');
      params.set('branded_domain', domain.name);
    }
    
    const response = await fetch(
      `https://jmpy.me/api/v1/short-urls/check-alias?${params}`,
      { headers: { 'Authorization': 'Bearer YOUR_API_KEY' } }
    );
    const result = await response.json();
    
    if (result.data.available) {
      return { domain, url: result.data.full_url };
    }
  }
  
  return null; // Not available on any domain
}