Webhooks

Webhooks are automated messages sent from apps when something happens. They have a message—or payload—and are sent to a unique URL. Webhooks are almost always faster than polling, and require less work on your end. They're much like SMS notifications.

How to setup webhooks

Webhook allows you to send Statusping events (like Uptime failed, Uptime recovered, Detected Performance change, etc.) to external applications.

You can enter your webhook endpoint at the Team level. When an outage arises, the Webhook URL receives a POST request with the type of event in its payload.

Webhook Events

  1. Downtime detected
  2. Recovery detected
  3. Invalid Certificate detected
  4. Valid Certificate detected
  5. SSL Certificate Expiring Soon
  6. Response time reached max-threshold level

Downtime detected

When an outage arises, the Webhook URL receives a POST request with the uptime-check-failed type of event in its payload.

{
    "eventType": "uptime-check-failed",
    "monitor": {
        "monitorId": 1,
        "name": "Sesha ",
        "url": "https://sesha.in",
        "status": "Down",
        "timesChecked": 2,
        "checks": {
            "primary": {
                "type": "uptime",
                "status": "Down",
                "failureReason": "Client error: `GET https:\/\/sesha.in\/hello` resulted in a `404 Not Found` response:\n<!DOCTYPE html>\n<html lang=\"en\">\n    <head>\n        <meta charset=\"utf-8\">\n        <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\">\n\n        <title>Not Found<\/title>\n\n        <!-- Fonts -->\n        <link rel=\"preconnect\" href=\"htt (truncated...)\n",
                "statusCode": "404",
                "content": "We'll let you know as soon as your website is up again.",
                "checkedAt": "2021-12-06 10:58:38",
                "location": "Bangalore",
                "ip": "139.59.75.39",
                "startDateTime": "2021-12-06 10:58:38",
                "timezone": "America/New_York"
            },
            "secondary": {
                "type": "uptime",
                "status": "Down",
                "failureReason": "Client error: `GET https:\/\/sesha.in\/hello` resulted in a `404 Not Found` response:\n<!DOCTYPE html>\n<html lang=\"en\">\n    <head>\n        <meta charset=\"utf-8\">\n        <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\">\n\n        <title>Not Found<\/title>\n\n        <!-- Fonts -->\n        <link rel=\"preconnect\" href=\"htt (truncated...)\n",
                "statusCode": "404",
                "content": "We'll let you know as soon as your website is up again.",
                "checkedAt": "2021-12-06 11:00:46",
                "location": "Bangalore",
                "ip": "139.59.75.39",
                "startDateTime": "2021-12-06 11:00:46",
                "timezone": "America/New_York"
            }
        }
    }
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36

Recovery detected

When an outage ends, a uptime-check-recovered event is sent to the webhook url.

{
   "eventType": "uptime-check-recovered",
   "monitor": {
       "monitorId": 15,
       "name": "Personal Site",
       "url": "https://sesha.in",
       "status": "Up",
       "checks": {
           "primary": {
               "type": "uptime",
               "status": "Up",
               "duration": "13h 55m",
               "content": "20:57 on 05/12/2021 ➡️ 10:52",
               "checkedAt": "2021-12-06 10:52:47",
               "location": "Bangalore",
               "ip": "139.59.75.39",
               "startDateTime": "2021-12-05 20:57:09",
               "endDateTime": "2021-12-06 10:52:47",
               "timezone": "America/New_York"
           }
       }
   }
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23

Invalid Certificate detected

When we detect issues with your certificate, we'll send you webhook event for the certificate-check-failed type with this data.

{
    "eventType": "certificate-check-failed",
    "monitor": {
        "monitorId": 15,
        "name": "Sesha",
        "url": "https://sesha.in",
        "sslStatus": "Invalid",
        "status": "Down",
        "timesChecked": null,
        "checks": {
            "primary": {
                "type": "certificate",
                "sslStatus": "Invalid",
                "failureReason": "your SSL certificate is expired",
                "content": "We'll let you know as soon as we detect valid SSL certificate.",
                "checkedAt": "2021-12-06 10:28:47",
                "location": "Bangalore",
                "ip": "139.59.75.39",
                "startDateTime": "2021-12-06 10:28:47",
                "timezone": "Asia/Kolkata"
            }
        }
    }
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24

Valid Certificate detected

When we detect that the issues with a certificate have been fixed, we'll send you a webhook event of type certificate-check-recovered

{
    "eventType": "certificate-check-succeeded",
    "monitor": {
        "monitorId": 15,
        "name": "Sesha",
        "url": "https://sesha.in",
        "sslStatus": "Valid",
        "status": "Up",
        "timesChecked": null,
        "checks": {
            "primary": {
                "type": "certificate",
                "sslStatus": "Valid",
                "content": "Expires: 2022-12-06 10:28:47",
                "checkedAt": "2021-12-06 10:28:47",
                "location": "Bangalore",
                "ip": "139.59.75.39",
                "startDateTime": "2021-12-05 20:57:09",
                "endDateTime": "2021-12-06 10:52:47",
                "timezone": "Asia/Kolkata"
            }
        }
    }
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24

SSL Certificate Expiring Soon

We'll send you a webhook events of type based on SSL certificate setting on Statusping console. By default, we'll send you remainder events on before 15 days, 3 days and, 1 day.

{
    "eventType": "certificate-expire-soon",
    "monitor": {
        "monitorId": 3,
        "name": "Sesha",
        "url": "https://sesha.in",
        "sslStatus": "Healthy",
        "status": "Up",
        "checks": {
            "primary": {
                "type": "certificate-remainder",
                "sslStatus": "Healthy",
                "issuer": "R3",
                "expires": "1 month from now",
                "checkedAt": "2021-12-06 12:25:27",
                "content": "This is a friendly reminder from StatusPing to let you know that the SSL certificate served by https://sesha.in will expire in 43 days.",
                "remainingDays": 43,
                "location": "Bangalore",
                "ip": "139.59.75.39",
                "timezone": "Asia/Kolkata"
            }
        }
    }
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24

Response time reached max-threshold level

Once it's reached maximum threshold load time on the performance setting screen, we'll send you a webhook event of type performance-reached-max-threshold

{
    "eventType": "performance-reached-max-threshold",
    "monitor": {
        "monitorId": 1,
        "name": "Sesha",
        "url": "https://sesha.in",
        "status": "Down",
        "checks": {
            "primary": {
                "type": "performance",
                "content": "In the last few hours, we detected a high (1624ms) response time for Sesha - hello",
                "avgResponse": "1624ms",
                "definedMaxLoadTime": "1000ms",
                "checkedAt": "2021-12-06 10:52:10",
                "location": "Bangalore",
                "ip": "139.59.75.39",
                "timezone": "Asia/Kolkata"
            }
        }
    }
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21

If you noticed any issues, please reach out at info@statusping.app

Last Updated: 12/9/2021, 11:29:02 AM
Contributors: sesha