Skip to content
Ruleset Engine
Visit Ruleset Engine on GitHub
Set theme to dark (⇧+D)

Endpoints

For some operations, you can use specific endpoints provided by the Rulesets API for managing phase entry point rulesets. These endpoints include the phase name in the endpoint instead of the ruleset ID.

For example, instead of using the following endpoint:

PUT /zones/{zone-id}/rulesets/{ruleset-id}

You can use the following endpoint:

PUT /zones/{zone-id}/rulesets/phases/{phase-name}/entrypoint

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

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

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

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

The Cloudflare Rulesets API supports the operations outlined below. Visit the associated links for examples.

List and view rulesets

OperationMethodNotes
List existing rulesetsGET

Returns the list of existing rulesets at the account level or at the zone level.

View a specific rulesetGET

Returns the properties of the most recent version of a specific ruleset.

List all versions of a rulesetGET

Returns a list of all the versions of a ruleset.

View a specific version of a rulesetGET

Returns the configuration of a specific version of a ruleset, including its rules.

List rules in a Managed Ruleset with a specific tagGET

Returns a list of all the rules in a Managed Ruleset with a specific tag.

Create rulesets

OperationVerbNotes
Create rulesetPOST

Creates a new ruleset or a new phase entry point.

Update and deploy rulesets

OperationVerbNotes
Update or deploy a rulesetPUT

Updates the basic properties of a ruleset and the list of rules in the ruleset.
Allows you to configure the execution of Managed Rulesets.

Add rule to rulesetPOST

Adds a single rule to an existing ruleset.
Allows you to add a single rule without having to include all the existing ruleset rules in the request.

Update a rule in a rulesetPATCH

Updates the definition of a single rule within a ruleset.
Allows you to change the order of a rule in a ruleset.

Delete a rule in a rulesetDELETE

Deletes a single rule in a ruleset.

Delete rulesets

OperationVerbNotes
Delete rulesetDELETE

Deletes all the versions of a ruleset.

Delete ruleset versionDELETE

Deletes a specific version of a ruleset.