Delete Spend Policy
billing.spend_policies.delete(strpolicy_id, SpendPolicyDeleteParams**kwargs) -> SpendPolicyDeleteResponse
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:
API Email + API Key
The previous authorization scheme for interacting with the Cloudflare API, used in conjunction with a Global API key.
Example:
The previous authorization scheme for interacting with the Cloudflare API. When possible, use API tokens instead of Global API keys.
Example:
Parameters
Delete Spend Policy
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){
"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
}