API Reference
Authentication
Bearer API keys, prefixes, SHA-512 storage, and zero-downtime rotation.
Bearer header
Authorization: Bearer mk_live_...
Key format & storage
Keys are 48 characters (mk_live_ or mk_test_ plus 40 alphanumeric characters). The raw secret is shown once at creation. Mackerel stores only the SHA-512 hash, prefix, and last 4 characters.
Zero-downtime rotation
Mint a replacement key
Create a second key in Dashboard → API keys with identical scopes and ZDR setting.Deploy the new secret
Roll out the newMACKEREL_API_KEYto your application or CI workers. Both keys remain active during rollout.Revoke the old key
Click Revoke in the dashboard. Revocation takes effect immediately on the very next request.