Skip to content

Authentication

Every request carries an API key. Keys start with hd_, belong to one account, and must stay on your server.

In the dashboard, open API keys and create a key. The full key is shown once, when you create it. If you lose it, create a new one and revoke the old one.

Keys start with hd_. A key belongs to your account and works while the account’s subscription is active: every call checks emails and IP addresses, matches your custom lists and counts toward your analytics.

Send the key in the Authorization header as a bearer token:

Authorization: Bearer hd_your_key

If your HTTP client makes that awkward, the x-api-key header works the same way:

x-api-key: hd_your_key

When a request carries both, the bearer token is used.

Terminal window
curl "https://heimdal.codebrewerz.com/api/v1/check?email=test%40mailinator.com" \
-H "Authorization: Bearer $HEIMDAL_API_KEY"

The API is built for server-to-server calls. Cross-origin browser requests are refused: only the Heimdal dashboard’s own origin is allowed by CORS.

  • Store the key in an environment variable or a secret manager, not in source control.
  • Use a separate key for each service and environment, so you can revoke one without touching the others.
  • Each key has its own rate limit: 100 requests a second. See Rate limits.

Revoke a key in the dashboard under API keys.

To rotate a key without downtime:

  1. Create a new key.
  2. Deploy it to your service.
  3. Revoke the old key once nothing uses it.
Status Code Meaning
401 missing_api_key No key in Authorization or x-api-key.
401 invalid_api_key The key does not exist or was revoked.
402 subscription_required The key is valid, but the account has no active subscription.

If a renewal payment fails, the API keeps answering for 3 days so you can fix the payment method. After that it answers 402 until the subscription is active again.

The full list of errors is in Errors and limits.