Firewall Rules API
Last updated Apr 24, 2026 Use the Firewall Rules API to programmatically manage your rules.
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.
When working with the Firewall Rules API, refer to these topics for additional context:
To get started with the API, review the Firewall Rules API JSON object and Endpoints.
For more information on the Rules language used to write rule expressions, refer to Rules language in the Ruleset Engine documentation.
Differences from other Cloudflare APIs
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.
Was this helpful?
YesNo
On this page
{"@context":"https://schema.org","@type":"TechArticle","@id":"https://developers.cloudflare.com/firewall/api/cf-firewall-rules/#page","headline":"Firewall Rules API","description":"Manage firewall rules via the Firewall Rules API.","url":"https://developers.cloudflare.com/firewall/api/cf-firewall-rules/","inLanguage":"en","image":"https://developers.cloudflare.com/firewall/api/cf-firewall-rules/og.png?v=fb9fd46014f48aa3","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: Delete filters or rules with DELETE API requests. title: DELETE examples image: https://developers.cloudflare.com/firewall/api/cf-firewall-rules/delete/og.png?v=7424e24a196e746f
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