An alert defines a threshold rule for usage or spend. When the configured threshold is crossed, Chargebee triggers a webhook notification so that you can take action such as notifying the customer, upgrading the plan, or pausing further consumption.
Common examples of alerts include:
- Notifying a customer when they have consumed 90% of their monthly API call quota.
- Alerting your operations team when a customer's spend exceeds a monthly limit.
The alert resource represents configuration only. To check the current runtime state of an alert for a subscription (whether it is within_limit or in_alarm), use the Alert Status endpoints.
See also
- Alert Statuses — runtime state of alerts per subscription.
- Usage Events — usage ingestion for
usage_exceededalerts.
Sample AlertJSON
API Index URL
Alerts attributes
The type of alert. Determines what the alert measures, which input it requires, and how the threshold is interpreted.
The alert fires when usage of the metered feature (identified by metered_feature_id) reaches or exceeds the configured threshold. Supports both percentage and absolute threshold modes.
The alert fires when the total usage-based spend accumulated from metered addons reaches or exceeds the configured threshold. Only spend from usage beyond the included entitlement is counted. See usage charges for how overage spend is computed. The threshold mode is always absolute.
Identifier of the metered feature that this alert monitors. Present only for usage_exceeded alerts.
The ISO currency code in which the metered-addon overage spend is measured. Present only for spend_exceeded alerts.
The identifier of the subscription this alert is scoped to. Present only for subscription-scoped alerts; null for global alerts.