Cloudflare Filters API
Cloudflare Filters is an API-only component of firewall rules for designing complex criteria that rely on boolean operators and other logic to examine incoming HTTP traffic and look for a match.
Deprecation notice
Cloudflare Firewall Rules has been deprecated. Cloudflare has moved existing firewall rules to WAF custom rules. For more information on this change, refer to the upgrade guide.
For example, a filter matching:
- An HTTP user agent, and
- The HTTP path, and
- The source IP address
Associate a filter with a firewall rule to define the scope of that rule.
Use IP lists within a filter to refer collectively to a group of IP addresses. Refer to the Lists API for more information.
Before getting started with the Cloudflare Filters API, familiarize yourself with rule expressions. For a complete reference, refer to Rules language.
The Firewall Rules API behaves differently from most Cloudflare APIs in two ways:
- API calls accept and return multiple items, and allow applying data changes to multiple items.
- Although API calls return the standard response, the error object follows the JSON API standard ↗, such that in an error condition, it is clear which item produced the error and why.
To get started, review What is a filter?, followed by the Cloudflare Filters JSON object and Endpoints.
Was this helpful?
- Resources
- API
- New to Cloudflare?
- Products
- Sponsorships
- Open Source
- Support
- Help Center
- System Status
- Compliance
- GDPR
- Company
- cloudflare.com
- Our team
- Careers
- © 2025 Cloudflare, Inc.
- Privacy Policy
- Terms of Use
- Report Security Issues
- Trademark