Alert Triggers

Alert Triggers can notify you via a webhook when errors exceed daily, monthly, or yearly thresholds. You
can create and configure Alert Triggers in the Console's Developer Center.

For example, you can set an Alert Trigger to fire a webhook when the first or 100th error occurs in a day. Additionally, you can configure Triggers on specific error codes for finer grained monitoring.

As soon as the error count exceeds the TriggerValue, the trigger will fire and Twilio will make an asynchronous HTTP request to the Alert Trigger’s webhook URL. This request will typically fire within a minute of exceeding the threshold.

When implementing Alert Trigger URL handlers take into account that it is possible
that they may receive the HTTP request more than once. Services that handle duplicate
requests and return the same response are called idempotent. We give
you an IdempotencyToken that is unique for each App Monitor Trigger webhook request.

You can keep track of the IdempotencyToken to properly handle requests to your
service and prevent them from performing the same operation twice. For
instance, if your App Monitor Trigger sends alerts to your on-call team to
notify them of an issue with your application, you’d want to be sure you didn’t
send multiple alerts.

You can follow the test-and-set pattern to implement idempotent services. In
short, you would test for the existence of the IdempotencyToken before
processing your application's logic. This allows your application to handle
already existing tokens and choose the next appropriate step.

Need some help?

We all do sometimes; code is hard. Get help now from our
support team, or lean on
the wisdom of the crowd browsing the
Twilio tag on Stack Overflow.