Delete rulesets
You can use the API to delete all the versions of a ruleset or delete a specific version of a ruleset.
Deletes all the versions of an existing ruleset at the account or zone level.
Use one of the following API endpoints:
| Operation | Method + Endpoint | 
|---|---|
| Delete an account ruleset | DELETE /accounts/{account_id}/rulesets/{ruleset_id} | 
| Delete a zone ruleset | DELETE /zones/{zone_id}/rulesets/{ruleset_id} | 
If the delete operation succeeds, the API method call returns a 204 No Content HTTP status code.
The following example request deletes an existing ruleset with ID $RULESET_ID.
Required API token permissions
 
At least one of the following token permissions 
is required:
Mass URL Redirects WriteMagic Firewall WriteL4 DDoS Managed Ruleset WriteTransform Rules WriteSelect Configuration WriteAccount WAF WriteAccount Rulesets WriteLogs Write
curl https://api.cloudflare.com/client/v4/accounts/$ACCOUNT_ID/rulesets/$RULESET_ID \  --request DELETE \  --header "Authorization: Bearer $CLOUDFLARE_API_TOKEN"Deletes a specific version of a ruleset.
Use one of the following API endpoints:
| Operation | Method + Endpoint | 
|---|---|
| Delete an account ruleset version | DELETE /accounts/{account_id}/rulesets/{ruleset_id}/versions/{version_number} | 
| Delete a zone ruleset version | 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.
The following example request deletes a version of an existing ruleset.
Required API token permissions
 
At least one of the following token permissions 
is required:
Mass URL Redirects WriteMagic Firewall WriteL4 DDoS Managed Ruleset WriteTransform Rules WriteSelect Configuration WriteAccount WAF WriteAccount Rulesets WriteLogs Write
curl https://api.cloudflare.com/client/v4/accounts/$ACCOUNT_ID/rulesets/$RULESET_ID/versions/$RULESET_VERSION \  --request DELETE \  --header "Authorization: Bearer $CLOUDFLARE_API_TOKEN"Was this helpful?
- Resources
 - API
 - New to Cloudflare?
 - Products
 - Sponsorships
 - Open Source
 
- Support
 - Help Center
 - System Status
 - Compliance
 - GDPR
 
- Company
 - cloudflare.com
 - Our team
 - Careers
 
- 2025 Cloudflare, Inc.
 - Privacy Policy
 - Terms of Use
 - Report Security Issues
 - Trademark