Introducing the Better Auth Chargebee plugin: Use it to handle subscriptions, billing, and auth seamlessly.Try now
ChargebeechargebeeAPI

Alerts

An alert defines a threshold rule for a metered feature within a subscription. When the usage of a metered feature crosses the configured threshold, Chargebee triggers a webhook notification, enabling you to take action such as notifying the customer, upgrading the plan, or blocking further usage.

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 storage usage exceeds an absolute limit.
  • Triggering an automated upgrade workflow when usage crosses a defined threshold.

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.

Sample AlertJSON

API Index URL

https://[site].chargebee.com/api/v2/alerts

Alerts attributes

id
required, string, max chars=40

Uniquely identifies the alert configuration.

type
required, enumerated string

The type of alert. Determines the condition that triggers the alert.

Enum Values
usage_exceeded

The alert fires when usage of the metered feature exceeds the configured threshold.

name
required, string, max chars=50

A human-readable name for the alert, shown in the Chargebee UI and webhook payloads. Maximum 50 characters.

description
optional, string, max chars=65k

An optional description providing additional context about the alert. Maximum 65,000 characters.

metered_feature_id
required, string, max chars=50

The identifier of the metered feature that this alert monitors.

subscription_id
optional, string, max chars=50

The identifier of the subscription this alert is scoped to. Present only for subscription-scoped alerts; null for global alerts.

status
optional, enumerated string, default=enabled

Whether the alert is currently active. A disabled alert is not evaluated against usage data.

Enum Values
enabled

The alert is active and will trigger when the threshold is breached.

disabled

The alert is inactive and will not trigger, regardless of usage.

meta
optional, string, max chars=65k

An optional string field for storing custom metadata with the alert (for example, JSON serialized by your integration). Maximum 65,000 characters.

created_at
required, timestamp(UTC) in seconds

Timestamp (UTC, in seconds) indicating when the alert was created.

updated_at
required, timestamp(UTC) in seconds

Timestamp (UTC, in seconds) indicating when the alert was last updated.