Threshold Alerts

Alerting your customers as they approach or exceed usage thresholds

📘

Threshold Alerts are triggered when a customer's consumption exceeds some threshold.

Threshold alerts can be used to notify customers as they approach a usage limit or to revoke service access when they've exceeded a given plan's allowed quota. You can set up different alerts with different messages for different conditions, and then attach them to your plans and customers.

  • Usage Alerts are based on a customer's usage along a given Dimension and Aggregation. Usage alerts fire a usage.exceeded when a customer's usage goes above a configured threshold.
  • Credit Balance Alerts are based on a customer's consumption of Credits during a given billing period. Credit balance alerts fire a credit.balance.below webhook when a customer's credit balance drops below a given threshold.

Setting up Alerts

Setting up threshold alerts requires defining an alert, attaching it to a plan, and subscribing to a webhook.

  1. Define an alert through the dashboard. You can create alerts for all the same usage metrics you might use when creating plans. Alerts can be configured with an alert severity and human-readable message to use when handling alert notifications (more below).
  2. Assign alerts to your plans. You can attach multiple alerts to the same plan, so long as those alerts match the dimension configured on the plan. Any customers who are subscribed to a given plan will become subscribed to any alerts attached to that plan.
  3. Subscribe to webhooks to be notified when a customer's consumption reaches the alert threshold. You can read more about usage.exceeded and credit.balance.below webhooks here.

🚧

Customer alerts are reset at the end of every billing cycle (Credit alerts are also reset when a customer purchases additional top-up grants.) Alerts will be triggered just once per customer per billing cycle before being reset.

An Example

Say Mailman offered an "Basic Messaging" plan that included 100K messages per month. They might set up two alerts:

  • A Medium-severity alert with a threshold of 80K messages
  • A High-severity alert with a threshold of 100K messages

Mailman might attach both of these alerts to the "Basic Messaging" plan.

When a customer, Drivr, sends their 80,000th message through Mailman, the first alert will be triggered. Mailman will receive a usage.exceeded webhook from Kable with Medium severity, and may handle that webhook by sending an email to the customer notifying them that they are approaching their plan quoate.

When Drivr sends their 100,000th message, the second alert will be triggered. Mailman may choose to handle this usage.exceeded webhook by cutting off the Drivr's access to the messaging API. Mailman may also choose to handle this alert by prompting a conversation with Drivr about upgrading their plan.