Webhooks
Webhooks allow you to POST custom payloads to any endpoint of your infrastructure or that of a third-party provider. In a nutshell, you should do the following:
- Make a unique URL by using authentication tokens or other secrets.
- In the editor, debug and validate the webhook by submitting test messages.
Webhook Events
If there is an interruption, the webhook URL gets a POST request with the payload ALERT_FAILURE
.
It also contains the list of the double checks in pings
. The ping having the key original
set to true
is the region that detected the outage.
{
event: "ALERT_FAILURE",
check:
{
id: "f4250d4e-6b5d-46b2-8d6a-24146ea2ecdc",
date: "2021-04-02T08:40:27+00:00",
url: "https://example.com",
method: "GET",
name: "Check name",
},
alert:
{
uptime: 500,
responseTime: 243,
run_location: "frankfurt",
status_code: 500,
created_at: "2021-04-02T08:40:27+00:00",
},
}
When an outage is solved, a ALERT_RECOVERY
event is forwarded to the webhook URL.
{
event: "ALERT_RECOVERY",
check:
{
id: "849af478-f482-47d7-9cf8-4e2a47c75887",
date: "2021-04-02T08:42:01+00:00",
url: "https://example.com",
method: "GET",
name: "Check name",
},
alert:
{
uptime: 100,
responseTime: 331,
run_location: "frankfurt",
status_code: 200,
created_at: "2021-04-02T08:42:01+00:00",
},
}
As your SSL certificate expiry date approaches, you will also get an SSL notification, as seen below.
{
event: "ALERT_EXPIRED_SSL",
check:
{
id: "a9c6d4ab-2b36-4ff6-a3ad-0190aab3e766",
date: "2021-04-02T08:53:35+00:00",
url: "https://example.com",
method: "GET",
name: "Check name",
},
alert:
{
uptime: 100,
responseTime: 131,
run_location: "frankfurt",
status_code: 200,
created_at: "2021-04-02T08:53:35+00:00",
ssl_days_remaining: 244,
ssl_expired_date: "Dec 02, 2021 11:00 AM",
ssl_check_domain: "example.com",
},
}
Until any outage occurs, you can test these events using the test buttons next to the webhook URL field.