Send your key
Put your API key in theX-API-Key header on every request.
Authorization: Bearer header instead:
Key format
Create a key
Public API keys are self-service: you create them yourself, on any plan. What a key can call depends on your plan, which Huntd sets up for you.1
Open Settings
In the Huntd Dashboard, go to Settings → API & webhooks.
2
Create the key
Any member of your organization can create a key. Creating a key does not affect any existing
key.
3
Copy it right away
The key is shown once. Store it somewhere safe before you close the dialog.
Rotate a key
An organization can hold several active keys at once. That means you can rotate a key with no downtime:- Create the new key.
- Deploy the new key to your services.
- Revoke the old key once nothing uses it.
401 INVALID_API_KEY on its next
request.
Authentication errors
All four causes return the same response body:
Security best practices
Store keys in environment variables
Store keys in environment variables
Never hardcode a key in source code. Read it at runtime from an environment variable or a
secrets manager.
Never commit keys to version control
Never commit keys to version control
If a key is pushed to a repository, even a private one, treat it as compromised. Revoke it
immediately.
Call from server-side code only
Call from server-side code only
Anyone using your app can read a key placed in browser or mobile code. Make every Public API
call from your backend.
Use one key per service
Use one key per service
Separate keys let you revoke one integration without breaking the others. They also make
unexpected usage easier to trace.