Threshold Alerts

Alerting your customers as they approach or exceed usage thresholds

📘

Threshold Alerts are triggered when a customer's consumption exceeds some threshold for a given usage metric.

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.

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 monthly usage exceeds the alert threshold. You can read more about usage.exceeded webhooks here.

🚧

Customer alerts are reset at the end of every billing cycle. Alerts will be triggered at most once per customer per billing cycle.

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.