Use an account-level public key as your default payload logging configuration. This key captures supported matches from Managed Rules and Custom Rules for every zone in the account.
Add a zone-level key only when a zone needs a different key. Cloudflare treats the zone-level key as an override for that zone.
Choose a scope based on the rules you want to cover:
| Scope | Rule coverage | Use case |
|---|---|---|
| Account default | Managed Rules and Custom Rules in every zone without an override | Use one key across the account |
| Zone override | Managed Rules and Custom Rules in one zone | Use a different key for one zone |
| Managed ruleset (legacy) | Only the rules in one managed ruleset | Maintain an existing ruleset-level configuration |
If you need payload logging for Custom Rules, configure an account default or zone override. Managed ruleset keys apply only to Managed Rules and are a legacy configuration.
When multiple keys apply, Cloudflare selects the zone override first, the account default second, and the managed ruleset key third.
Adding an account default or zone override does not delete managed ruleset keys. A managed ruleset key becomes effective again if no account or zone key applies.
To migrate, reuse the existing key pair at the account or zone level. After verifying the new configuration with the existing private key, delete the managed ruleset key.
You can configure account and zone keys in either the dashboard or API:
- Configure in the dashboard to generate a key pair in your browser or enter an existing public key.
- Configure via API to manage keys programmatically.
To migrate or maintain an existing managed ruleset key, refer to Legacy Managed Rules payload logging.