{"command":{"effect":"write","timeoutSeconds":30,"inputSchema":{"type":"object","description":"Replaces the whole spend policy. Every field is required, as on create; there are no partial updates and `PATCH` is not supported. The `If-Match` header must equal the policy's current `version`. On success, `version` goes up by one and the new value is returned in `ETag`.","properties":{"path":{"type":"object","properties":{"account_id":{"$ref":"#/definitions/billing-spend-policies_identifier","description":"Identifies the Cloudflare account (account tag)."},"policy_id":{"$ref":"#/definitions/billing-spend-policies_policy_id","description":"Identifies the spend policy."}},"required":["account_id","policy_id"],"additionalProperties":false},"headers":{"type":"object","properties":{"If-Match":{"type":"string","pattern":"^\"?[1-9][0-9]*\"?$","examples":["\"3\""],"description":"The policy `version` the change is based on, as returned in `ETag`. Quoted (`\"3\"`) and bare (`3`) values are both accepted. Weak ETags (`W/\"3\"`) and `*` are not."}},"required":["If-Match"],"additionalProperties":false},"body":{"$ref":"#/definitions/billing-spend-policies_policy_input"}},"required":["path","headers","body"],"additionalProperties":false,"definitions":{"billing-spend-policies_identifier":{"description":"Represents a Cloudflare resource identifier tag.","type":"string","maxLength":32,"pattern":"^[0-9a-f]{32}$","examples":["023e105f4ecef8ad9ca31a8372d0c353"]},"billing-spend-policies_policy_id":{"description":"The unique identifier of the spend policy.","type":"string","format":"uuid","examples":["6f1c2b8e-3d4a-4f5b-9c6d-7e8f9a0b1c2d"]},"billing-spend-policies_policy_input":{"description":"A spend policy as sent on create and on full replacement. Unknown fields and trailing JSON are rejected. Only the first 1 MiB of the body is read.","type":"object","properties":{"action":{"$ref":"#/definitions/billing-spend-policies_policy_action"},"enabled":{"description":"Whether the policy is evaluated.","type":"boolean","examples":[true]},"name":{"description":"Display name of the policy. After surrounding whitespace is trimmed, it must be 1 to 200 bytes long. The value is stored as sent, untrimmed.","type":"string","minLength":1,"examples":["Workers cap"]},"notification_email":{"description":"Email address that receives notifications. Required when `action` is `notification`. When set, it must be a bare address (`user@example.com`); display-name forms such as `Name <user@example.com>` are rejected.","type":"string","format":"email","examples":["billing@example.com"]},"product_id":{"$ref":"#/definitions/billing-spend-policies_product_id"},"threshold_cents":{"description":"The spend threshold for the current billing period, in US cents. Must be greater than zero.","type":"integer","minimum":1,"examples":[100]}},"additionalProperties":false,"required":["name","product_id","enabled","threshold_cents","action"]},"billing-spend-policies_policy_action":{"description":"The action taken when the threshold is reached. `notification` sends an email to `notification_email`. `usage_block` blocks further usage of the product until the end of the billing period. Raising the threshold above the current balance, disabling the policy, or deleting it lifts the block early.","type":"string","enum":["notification","usage_block"],"examples":["notification"]},"billing-spend-policies_product_id":{"description":"The product the policy applies to: `workers` or `durable_objects`. Each product's balance and policies are separate. Both products support `notification` and `usage_block` policies on create and update.","type":"string","enum":["workers","durable_objects"],"examples":["workers"]}}},"name":"Update Spend Policy","id":"cloudflare.spend-policies-update","example":{"path":{"account_id":"023e105f4ecef8ad9ca31a8372d0c353","policy_id":"6f1c2b8e-3d4a-4f5b-9c6d-7e8f9a0b1c2d"},"headers":{"If-Match":"\"3\""},"body":{"name":"Workers cap","product_id":"workers","enabled":true,"threshold_cents":100,"action":"notification"}},"maxRequests":1,"summary":false}}