API keys
Every request to/v1/* endpoints must include an API key as a Bearer token in the Authorization header:
Key format
Keys are a minimum of 49 characters and match the pattern:
Security
- Keys are hashed with SHA-256 before storage — the full key is never stored on our servers.
- Keys are shown only once at creation time. Store them securely (e.g. environment variable, secret manager).
- Keys can have an expiration date. Expired keys return
401 expired_api_key. - You can revoke a key at any time from the dashboard.
Scopes
Each API key is granted specific scopes that control what it can access:
If a key lacks a required scope, the API returns:
Domain-scoped keys
API keys can optionally be scoped to a specific domain. A domain-scoped key can only send emails from that domain and only access that domain’s data. This is useful when you have multiple sending domains and want to limit each integration to its own domain.Test mode
Keys prefixed withgrl_test_ enable test mode:
Test mode keys are ideal for development and CI/CD pipelines. They use the same API endpoints and response formats as production keys.
Example request
Best practices
Use environment variables
Use environment variables
Never hardcode API keys in source code. Store them in environment variables or a secret manager.
Use minimum scopes
Use minimum scopes
Create keys with only the scopes they need. A service that only sends emails should have
email:send — not domain:manage.Rotate keys regularly
Rotate keys regularly
Set expiration dates and rotate keys periodically. Revoke any keys that may have been exposed.
Use separate keys per environment
Use separate keys per environment
Use
grl_test_ keys for development/staging and grl_live_ keys for production. Never share keys across environments.