---
title: Delete Spend Policy
---

[Skip to content](#_top)

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

[Billing](https://developers.cloudflare.com/api/python/resources/billing)

[Spend Policies](https://developers.cloudflare.com/api/python/resources/billing/subresources/spend_policies)

Copy Markdown

Open in **Claude**Open in **ChatGPT**Open in **Cursor**

---

**Copy Markdown****View as Markdown**

# Delete Spend Policy

billing.spend\_policies.delete(strpolicy\_id, SpendPolicyDeleteParams\*\*kwargs) -> [SpendPolicyDeleteResponse](<https://developers.cloudflare.com/api/python/resources/billing#(resource)%20billing.spend_policies%20%3E%20(model)%20spend_policy_delete_response%20%3E%20(schema)>)

DELETE/accounts/{account\_id}/billing/spend-policies/{policy\_id}

Soft-deletes the spend policy. The policy is disabled and no longer appears in list, get or audit responses. The `If-Match` header must equal the policy’s current `version`.

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

##### ParametersExpand Collapse

account\_id: str

Represents a Cloudflare resource identifier tag.

maxLength32

[Link to this property](<#(resource)%20billing.spend_policies%20%3E%20(method)%20delete%20%3E%20(params)%20default%20%3E%20(param)%20account_id%20%3E%20(schema)>)

policy\_id: str

The unique identifier of the spend policy.

formatuuid

[Link to this property](<#(resource)%20billing.spend_policies%20%3E%20(method)%20delete%20%3E%20(params)%20default%20%3E%20(param)%20policy_id%20%3E%20(schema)>)

if\_match: str

[Link to this property](<#(resource)%20billing.spend_policies%20%3E%20(method)%20delete%20%3E%20(params)%20default%20%3E%20(param)%20If-Match%20%3E%20(schema)>)

##### ReturnsExpand Collapse

<details>

<summary>

class SpendPolicyDeleteResponse: …

</summary>

id: str

The unique identifier of the spend policy.

formatuuid

<a href="#(resource)%20billing.spend_policies%20%3E%20(model)%20spend_policy_delete_response%20%3E%20(schema)%20%3E%20(property)%20id">Link to this property</a>

</details>

[Link to this property](<#(resource)%20billing.spend_policies%20%3E%20(model)%20spend_policy_delete_response%20%3E%20(schema)>)

### Delete Spend Policy

Python

HTTPTypeScriptPythonGoTerraform

```
import os
from cloudflare import Cloudflare

client = Cloudflare(
    api_token=os.environ.get("CLOUDFLARE_API_TOKEN"),  # This is the default and can be omitted
)
spend_policy = client.billing.spend_policies.delete(
    policy_id="6f1c2b8e-3d4a-4f5b-9c6d-7e8f9a0b1c2d",
    account_id="023e105f4ecef8ad9ca31a8372d0c353",
    if_match="\"3\"",
)
print(spend_policy.id)
```

200 example

```
{
  "errors": [
    {
      "message": "message",
      "code": 0
    }
  ],
  "messages": [
    {
      "message": "message",
      "code": 0
    }
  ],
  "result": {
    "id": "6f1c2b8e-3d4a-4f5b-9c6d-7e8f9a0b1c2d"
  },
  "success": true
}
```

##### Returns Examples

200 example

```
{
  "errors": [
    {
      "message": "message",
      "code": 0
    }
  ],
  "messages": [
    {
      "message": "message",
      "code": 0
    }
  ],
  "result": {
    "id": "6f1c2b8e-3d4a-4f5b-9c6d-7e8f9a0b1c2d"
  },
  "success": true
}
```