Skip to content
Start here

List Spend Policy Audit Entries

GET/accounts/{account_id}/billing/spend-policies/{policy_id}/audit

Returns the policy’s evaluation history, newest first. At most one threshold-crossing entry (limit_reached) is recorded per policy version and billing period, so a policy update can record a new entry without any change in balance. Disabled policies still return their history; deleted policies return 404. There is no pagination: use limit to set how many entries come back. Defaults to period=current_billing_cycle, resolved from the product’s canonical aggregates, not calendar months. Crossings match their recorded billing-period bounds, even if recorded late. Set period=all for history across cycles. Filtering happens before LIMIT. No current cycle returns an empty array; unavailable or disabled cycle resolution returns 503 with code 1013, never an empty success.

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
Query ParametersExpand Collapse
limit: optional number

Maximum number of audit entries to return. Defaults to 50. Values above 100 are capped at 100 rather than rejected.

minimum1
period: optional "current_billing_cycle" or "all"

Select current subscription billing-cycle history or history across all cycles.

One of the following:
"current_billing_cycle"
"all"
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: array of object { action, balance_cents, billing_period_end, 7 more }

Audit entries, newest first. An empty array when there are none.

action: "notification" or "usage_block"

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.

One of the following:
"notification"
"usage_block"
balance_cents: number

The account’s balance for the product at evaluation time, in US cents.

formatint64
billing_period_end: string

Exclusive end of the billing period that was evaluated.

formatdate-time
billing_period_start: string

Inclusive start of the billing period that was evaluated.

formatdate-time
created_at: string

When the entry was recorded.

formatdate-time
policy_version: number

The policy version that was evaluated.

formatint64
reason: string

A human-readable explanation of the trigger.

source: "kafka" or "policy_revision"

What caused the evaluation. kafka means a balance update. policy_revision means a change to the policy.

One of the following:
"kafka"
"policy_revision"
threshold_cents: number

The policy threshold at evaluation time, in US cents.

formatint64
trigger: string

The trigger recorded at evaluation time. New evaluations record limit_reached when the balance reaches or exceeds the configured threshold. Earlier entries retain their recorded trigger.

success: true

Indicates whether the API call was successful.

List Spend Policy Audit Entries

curl https://api.cloudflare.com/client/v4/accounts/$ACCOUNT_ID/billing/spend-policies/$POLICY_ID/audit \
    -H "Authorization: Bearer $CLOUDFLARE_API_TOKEN"
{
  "errors": [
    {
      "message": "message",
      "code": 0
    }
  ],
  "messages": [
    {
      "message": "message",
      "code": 0
    }
  ],
  "result": [
    {
      "action": "notification",
      "balance_cents": 104,
      "billing_period_end": "2026-11-01T00:00:00Z",
      "billing_period_start": "2026-10-01T00:00:00Z",
      "created_at": "2026-10-14T12:34:56Z",
      "policy_version": 2,
      "reason": "balance reached or exceeded the configured threshold",
      "source": "kafka",
      "threshold_cents": 100,
      "trigger": "limit_reached"
    }
  ],
  "success": true
}
Returns Examples
{
  "errors": [
    {
      "message": "message",
      "code": 0
    }
  ],
  "messages": [
    {
      "message": "message",
      "code": 0
    }
  ],
  "result": [
    {
      "action": "notification",
      "balance_cents": 104,
      "billing_period_end": "2026-11-01T00:00:00Z",
      "billing_period_start": "2026-10-01T00:00:00Z",
      "created_at": "2026-10-14T12:34:56Z",
      "policy_version": 2,
      "reason": "balance reached or exceeded the configured threshold",
      "source": "kafka",
      "threshold_cents": 100,
      "trigger": "limit_reached"
    }
  ],
  "success": true
}