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:
- Use a unique URL that includes an authentication token or other secret, so only Odown can post to it.
- Make sure your endpoint accepts a JSON
POSTand responds quickly with a 2xx status.
Webhook Events
When a monitor is confirmed down, the webhook URL gets a POST request with the event ALERT_FAILURE. run_location is the location of the check that failed.
{
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",
},
}Webhooks used by status page subscribers also receive incident and scheduled maintenance events.