Manage rules via the APIs
Last updated Apr 24, 2026 Cloudflare offers APIs that work together to achieve the same effect as the UI-based Firewall rules feature under Security > WAF.
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.
These APIs are the following:
- Firewall Rules API: Manage firewall rules and their actions, based on criteria separately defined through filters.
- Filters API: Manage the filters that enable rule matching.
- Lists API: Manage named lists of items (such as IP addresses) that you can use in the rules of different Cloudflare products.
Was this helpful?
YesNo
On this page
{"@context":"https://schema.org","@type":"WebPage","@id":"https://developers.cloudflare.com/firewall/api/#page","headline":"Manage rules via the APIs","description":"Manage firewall rules programmatically via APIs.","url":"https://developers.cloudflare.com/firewall/api/","inLanguage":"en","image":"https://developers.cloudflare.com/firewall/api/og.png?v=d8efa61cdf5c94d9","dateModified":"2026-04-24","publisher":{"@type":"Organization","name":"Cloudflare","description":"One platform for your apps, agents, and workforce. Build, secure, and scale without managing infrastructure","url":"https://www.cloudflare.com/","sameAs":["https://github.com/cloudflare","https://www.linkedin.com/company/cloudflare","https://x.com/cloudflare"],"logo":{"@type":"ImageObject","url":"https://developers.cloudflare.com/logo.svg"},"address":{"@type":"PostalAddress","streetAddress":"101 Townsend St","addressLocality":"San Francisco","addressRegion":"CA","postalCode":"94107","addressCountry":"US"},"contactPoint":[{"@type":"ContactPoint","contactType":"Customer Support","url":"https://support.cloudflare.com/","availableLanguage":["English"]},{"@type":"ContactPoint","contactType":"Sales","url":"https://www.cloudflare.com/contact/","availableLanguage":["English"]}]},"isPartOf":{"@type":"WebSite","@id":"https://developers.cloudflare.com/#website","name":"Cloudflare Docs","url":"https://developers.cloudflare.com/"}}
description: Recommended API call sequence for firewall rules. title: Call sequence image: https://developers.cloudflare.com/firewall/api/call-sequence/og.png?v=e8eb9ef18f528a3a
Documentation Index
Fetch the complete documentation index at: https://developers.cloudflare.com/firewall/llms.txt
Use this file to discover all available pages before exploring further.
Docs