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

Delete rulesets

You can use the API to delete all the versions of a ruleset or delete a specific version of a ruleset.

Delete ruleset

To delete all the versions of an existing ruleset at the account or zone level, use one of the following API endpoints:

Account-level endpoint
DELETE /accounts/{account-id}/rulesets/{ruleset-id}
Zone-level endpoint
DELETE /zones/{zone-id}/rulesets/{ruleset-id}

If the delete operation succeeds, the API method call returns a 204 No Content HTTP status code.

Example

The following example request deletes an existing ruleset.

curl -X DELETE \
-H "X-Auth-Email: user@cloudflare.com" \
-H "X-Auth-Key: REDACTED" \
"https://api.cloudflare.com/client/v4/accounts/{account-id}/rulesets/{ruleset-id}"

Delete ruleset version

To delete a specific version of a ruleset, use one of the following API endpoints:

Account-level endpoint
DELETE /accounts/{account-id}/rulesets/{ruleset-id}/versions/{version-number}
Zone-level endpoint
DELETE /zones/{zone-id}/rulesets/{ruleset-id}/versions/{version-number}

If the delete operation succeeds, the method call returns a 204 No Content HTTP status code.

Later updates to the ruleset will not reuse the version number of a deleted ruleset version.

Example

The following example request deletes a version of an existing ruleset.

curl -X DELETE \
-H "X-Auth-Email: user@cloudflare.com" \
-H "X-Auth-Key: REDACTED" \
"https://api.cloudflare.com/client/v4/accounts/{account-id}/rulesets/{ruleset-id}/versions/{version-number}"