---
title: Delete an account or zone ruleset
---

[Skip to content](#%5Ftop) 

[API Reference](https://developers.cloudflare.com/api/typescript)

[Rulesets](https://developers.cloudflare.com/api/typescript/resources/rulesets)

Copy Markdown

Open in **Claude**

Open in **ChatGPT**

Open in **Cursor**

---

**Copy Markdown**

**View as Markdown**

# Delete an account or zone ruleset

client.rulesets.delete(stringrulesetID, RulesetDeleteParams { account\_id, zone\_id, dry\_run } params?, RequestOptionsoptions?): void

DELETE/{accounts\_or\_zones}/{account\_or\_zone\_id}/rulesets/{ruleset\_id}

Deletes all versions of an existing account or zone ruleset.

##### Security

API Token

The preferred authorization scheme for interacting with the Cloudflare API. [Create a token](https://developers.cloudflare.com/fundamentals/api/get-started/create-token/).

**Example:**`Authorization: Bearer Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY`

API Email + API Key

The previous authorization scheme for interacting with the Cloudflare API, used in conjunction with a Global API key.

**Example:**`X-Auth-Email: user@example.com`

The previous authorization scheme for interacting with the Cloudflare API. When possible, use API tokens instead of Global API keys.

**Example:**`X-Auth-Key: 144c9defac04969c7bfad8efaa8ea194`

##### Accepted Permissions (at least one required)

`Mass URL Redirects Write` `Magic Firewall Write` `L4 DDoS Managed Ruleset Write` `Transform Rules Write` `Select Configuration Write` `Account WAF Write` `Account Rulesets Write` `Logs Write`

##### ParametersExpand Collapse 

rulesetID: string

The unique ID of the ruleset.

params: RulesetDeleteParams { account\_id, zone\_id, dry\_run } 

account\_id?: string

Path param: The Account ID to use for this endpoint. Mutually exclusive with the Zone ID.

zone\_id?: string

Path param: The Zone ID to use for this endpoint. Mutually exclusive with the Account ID.

dry\_run?: boolean

Query param: Validates the request without persisting changes when set to `true`. Responses that normally return 200 return `result: null`; endpoints that normally return 204 continue to return 204.

### Delete an account or zone ruleset

TypeScript

HTTPHTTP

TypeScriptTypeScript

PythonPython

GoGo

TerraformTerraform

```
import Cloudflare from 'cloudflare';

const client = new Cloudflare({
  apiToken: process.env['CLOUDFLARE_API_TOKEN'], // This is the default and can be omitted
});

await client.rulesets.delete('2f2feab2026849078ba485f918791bdc', { account_id: 'account_id' });
```

##### Returns Examples