Skip to content
Start here

Delete Spend Policy

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
API Token

The preferred authorization scheme for interacting with the Cloudflare API. Create a 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
Path ParametersExpand Collapse
account_id: string

Represents a Cloudflare resource identifier tag.

maxLength32
policy_id: string

The unique identifier of the spend policy.

formatuuid
Header ParametersExpand Collapse
"If-Match": string
ReturnsExpand Collapse
errors: array of object { message, code }

Always empty on success.

message: string

Describes the error or notice.

code: optional number

Identifies the error or notice type.

messages: array of object { message, code }

Contains informational notices about the response.

message: string

Describes the error or notice.

code: optional number

Identifies the error or notice type.

result: object { id }
id: string

The unique identifier of the spend policy.

formatuuid
success: true

Indicates whether the API call was successful.

Delete Spend Policy

curl https://api.cloudflare.com/client/v4/accounts/$ACCOUNT_ID/billing/spend-policies/$POLICY_ID \
    -X DELETE \
    -H "Authorization: Bearer $CLOUDFLARE_API_TOKEN"
{
  "errors": [
    {
      "message": "message",
      "code": 0
    }
  ],
  "messages": [
    {
      "message": "message",
      "code": 0
    }
  ],
  "result": {
    "id": "6f1c2b8e-3d4a-4f5b-9c6d-7e8f9a0b1c2d"
  },
  "success": true
}
Returns Examples
{
  "errors": [
    {
      "message": "message",
      "code": 0
    }
  ],
  "messages": [
    {
      "message": "message",
      "code": 0
    }
  ],
  "result": {
    "id": "6f1c2b8e-3d4a-4f5b-9c6d-7e8f9a0b1c2d"
  },
  "success": true
}