Skip to main content
Spend alerts monitor usage-based spend against configured thresholds and notify you by webhook when a threshold is crossed. Unlike wallet and feature-usage alerts, which track balance or raw usage, spend alerts track billed spend: the same invoicing-grade calculation used to generate invoices, including commitments and overage. Spend alerts have three independent scopes:
  • Subscription: total usage-based spend across the whole subscription
  • Subscription line item: spend on a single line item
  • Group: spend summed across every line item whose feature belongs to a given group
All three scopes share the same configuration shape, the same three-level alert model (infowarningcritical), and the same webhook delivery mechanism. Pick a scope based on how granular the budget you’re protecting actually is: a whole subscription, one metered charge, or a set of related meters. Benefits:
  • Budget enforcement: Catch spend overruns before the invoice is generated
  • Granular scope: Monitor an entire subscription, a single line item, or a feature group independently
  • Invoicing-grade accuracy: Thresholds compare against the same commitment- and overage-aware spend calculation used for billing
  • Real-time evaluation: Spend is recalculated and compared against thresholds as usage events arrive, not on a delay

Alert Scopes at a Glance

ScopeWhat is monitoredWebhook event
SubscriptionTotal usage-based spend across the subscriptionsubscription.spend.threshold_reached / .threshold_recovered
Subscription line itemSpend on one usage-priced line itemsubscription.line_item_spend.threshold_reached / .threshold_recovered
GroupSpend summed across every line item in a groupsubscription.group_spend.threshold_reached / .threshold_recovered

Alert Levels and Conditions

Every alert configuration supports up to three independent threshold levels:
LevelAPI statePurpose
InfoinfoEarly milestone: spend is approaching a limit
WarningwarningAction needed: spend is significantly high
Criticalin_alarmImmediate action required
(none breached)okHealthy, no thresholds breached
Spend alerts only support the above condition: an alert fires when spend rises above the threshold. The below condition (used by wallet balance alerts) is rejected for subscription, line item, and group scopes.
Because every threshold uses above, ordering runs from smallest to largest:
A Warning threshold requires a Critical threshold to also be set. You cannot configure Warning without Critical. Info can be set independently of the other two.

Configuration API

All three scopes are configured through the same alert_settings resource:
ActionMethodEndpoint
Create alert settingPOST/v1/alerts/setting
Get alert settingGET/v1/alerts/setting/:id
Query alert settingsPOST/v1/alerts/setting/search
Update alert settingPUT/v1/alerts/setting/:id
Delete alert settingDELETE/v1/alerts/setting/:id
Create request body:
FieldDescription
entity_typesubscription, subscription_line_item, or group
entity_idID of the monitored entity, matching entity_type: subscription ID, subscription line item ID, or group ID
parent_entity_typesubscription for line item and group alerts; omitted for subscription-level alerts
parent_entity_idThe subscription ID that owns a line item or group alert; omitted for subscription-level alerts
config.alert_enabledTurns evaluation on or off for this alert setting
config.critical / config.warning / config.infoThreshold objects: { "threshold": "<amount>", "condition": "above" }
PUT /v1/alerts/setting/:id replaces the stored config wholesale. It does not merge with the existing configuration. Send the complete set of thresholds you want on every update; a threshold left out of the request is cleared, not left unchanged.

Validation

RuleDetail
ConditionEvery threshold’s condition must be above
Warning requires CriticalA warning threshold cannot exist without a critical threshold
Info stands aloneinfo can be configured with or without warning/critical
Orderinginfo < warning < critical, when each is set
One setting per entityAt most one alert setting per (entity_type, entity_id, parent_entity_type, parent_entity_id); creating a duplicate is rejected
Line item scopeentity_id must be a line item that belongs to the subscription identified by parent_entity_id
Group scopeparent_entity_id is mandatory; a group alert always belongs to exactly one subscription

What’s Next