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

[Skip to content](#_top)

[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

<details>

<summary>API Token</summary>



The preferred authorization scheme for interacting with the Cloudflare API. <a href="https://developers.cloudflare.com/fundamentals/api/get-started/create-token/">Create a token</a>.

**Example:**<code>Authorization: Bearer Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY</code>

</details>

<details>

<summary>API Email + API Key</summary>



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

**Example:**<code>X-Auth-Email: user@example.com</code>

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

**Example:**<code>X-Auth-Key: 144c9defac04969c7bfad8efaa8ea194</code>

</details>

##### 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.

[Link to this property](<#(resource)%20rulesets%20%3E%20(method)%20delete%20%3E%20(params)%20default%20%3E%20(param)%20ruleset_id%20%3E%20(schema)>)

<details>

<summary>

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

</summary>

account\_id?: string

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

<a href="#(resource)%20rulesets%20%3E%20(method)%20delete%20%3E%20(params)%20default%20%3E%20(param)%20account_id">Link to this property</a>

zone\_id?: string

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

<a href="#(resource)%20rulesets%20%3E%20(method)%20delete%20%3E%20(params)%20default%20%3E%20(param)%20zone_id">Link to this property</a>

dry\_run?: boolean

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

<a href="#(resource)%20rulesets%20%3E%20(method)%20delete%20%3E%20(params)%20default%20%3E%20(param)%20dry_run">Link to this property</a>

</details>

[Link to this property](<#(resource)%20rulesets%20%3E%20(method)%20delete%20%3E%20(params)%20default>)

### Delete an account or zone ruleset

TypeScript

HTTPTypeScriptPythonGoTerraform

```
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