Cloudflare Docs
Firewall
Visit Firewall on GitHub
Set theme to dark (⇧+D)

Endpoints

To invoke a Cloudflare Firewall Rules API operation, append the endpoint to the Cloudflare API base URL:

https://api.cloudflare.com/client/v4/

For authentication instructions, refer to Getting Started: Requests in the Cloudflare API documentation.

For help with endpoints and pagination, refer to Getting Started: Endpoints.

The Cloudflare Firewall Rules API supports the operations outlined below. Visit the pages in this section for examples.

OperationMethod & EndpointNotes
Create Firewall RulesPOST zones/{''}/firewall/rulesHandled as a single transaction. If there is an error, the entire operation fails.
List Firewall RulesGET zones/{''}/firewall/rulesLists all current Firewall Rules. Results return paginated with 25 items per page by default. Use optional parameters to narrow results.{' '}
Get a Firewall RuleGET zones/{''}/firewall/rules/{''}Retrieve a single Firewall Rule by ID.
Update Firewall RulesPUT zones/{''}/firewall/rulesHandled as a single transaction. All rules must exist for operation to succeed. If there is an error, the entire operation fails.
Update a Firewall RulePUT zones/{''}/firewall/rules/{''}Update a single Firewall Rule by ID.
Delete Firewall RulesDELETE zones/{''}/firewall/rules

Delete existing Firewall Rules. Must specify list of Firewall Rule IDs.

Empty requests result in no deletion. Returns HTTP status code 200 if a specified rule does not exist.

Delete a Firewall RuleDELETE zones/{''}/firewall/rules/{''}

Delete a Firewall Rule by ID.