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

  1. Mint a replacement key

    Create a second key in Dashboard → API keys with identical scopes and ZDR setting.
  2. Deploy the new secret

    Roll out the new MACKEREL_API_KEY to your application or CI workers. Both keys remain active during rollout.
  3. Revoke the old key

    Click Revoke in the dashboard. Revocation takes effect immediately on the very next request.