API Key Format
Keys follow this format:- Prefix:
xq_ - Body: 64 hexadecimal characters
- Storage: SHA-256 hashed in database (raw key never stored)
Using Your API Key
Pass the key in thex-api-key header:
Auth Methods by Endpoint
Most endpoints support dual authentication: either an API key or a session cookie from the dashboard.| Endpoint | API Key | Session Cookie |
|---|---|---|
GET /account | Yes | No |
PATCH /account | No | Yes |
POST /api-keys | No | Yes |
GET /api-keys | No | Yes |
DELETE /api-keys/:id | No | Yes |
* /monitors/* | Yes | Yes |
GET /events/* | Yes | No |
* /webhooks/* | Yes | Yes |
GET /webhooks/:id/deliveries | Yes | No |
API key management endpoints (
/api-keys) require session authentication to prevent key self-management loops.Key Management
Create a Key
Generate keys from the API Keys page in your dashboard or via the API (session auth only):fullKey) is returned once in the creation response. Store it securely.
Revoke a Key
Error Response
Invalid or missing API key returns:401 Unauthorized
Security Best Practices
Store keys in environment variables
Store keys in environment variables
Never hardcode API keys in your source code. Use environment variables to keep keys separate from your codebase:Access the key in your application:
.env
Never commit keys to version control
Never commit keys to version control
Add If a key is accidentally committed, revoke it immediately from your dashboard and generate a new one. Consider the exposed key compromised even if you force-push to remove it from history.
.env to your .gitignore to prevent accidental commits:.gitignore
Rotate keys regularly
Rotate keys regularly
Rotate API keys periodically to limit the impact of a potential leak:
- Create a new key from the dashboard
- Update the key in all your environments
- Verify all services work with the new key
- Revoke the old key
Use separate keys for development & production
Use separate keys for development & production
Create distinct API keys for each environment. This limits blast radius if a development key is compromised and makes it easier to track usage per environment:Name your keys descriptively (e.g., “Production - Backend”, “Staging”, “Local Dev”) so you can identify them in the dashboard.
.env.local
.env.production