Webhooks
Make a request to your application when a new incident happens or an on-call contact changes.

Post webhooks from Better Uptime

  1. 1.
    Go to Integrations → Exporting data → Configure webhooks
  2. 2.
    Click Configure
  3. 3.
    Choose a type of webhook (Incident / Monitor / On-call change)
  4. 4.
    Enter your Webhook URL in the URL field
  5. 5.
    You're done!
Webhooks screen

Incident webhooks

You'll get a POST request when a new incident is created, gets acknowledged, or resolved.
You can fetch monitor details which is refered in "relationships.monitor" field using the Monitor API.
Example request body
1
{
2
"event":"acknowledged", // started, acknowledged or resolved
3
"data":{
4
"id":"1",
5
"type":"incident",
6
"attributes":{
7
"name":"Tesla.com homepage",
8
"url":"https://tesla.com",
9
"http_method":"get",
10
"cause":"Error 500",
11
"started_at":"2020-10-21T10:51:28.151Z",
12
"acknowledged_at":"2020-02-25T17:38:45.768Z",
13
"resolved_at":null,
14
"response_content":null,
15
"response_url":null,
16
"screenshot_url":null
17
},
18
"relationships":{
19
"monitor":{
20
"data":{
21
"id":"4",
22
"type":"monitor"
23
}
24
}
25
}
26
}
27
}
Copied!

Monitor webhooks

You'll get a POST request when a new monitor is created, updated, paused, unpaused, or deleted.
Example request body
1
{
2
"event":"created", // created, updated, paused, unpaused or deleted
3
"data":{
4
"id":"1",
5
"type":"monitor",
6
"attributes":{
7
"url":"https://example.com",
8
"pronounceable_name":"Example.com homepage",
9
"monitor_type":"keyword",
10
"required_keyword":"example",
11
"verify_ssl":true,
12
"check_frequency":30,
13
"call":true,
14
"sms":true,
15
"email":true,
16
"team_wait":null,
17
"http_method":"get",
18
"request_timeout":15,
19
"recovery_period":0,
20
"request_body":"",
21
"paused_at":null,
22
"last_checked_at":"2020-09-04T14:08:21.000Z",
23
"created_at":"2020-02-18T14:38:34.117Z",
24
"updated_at":"2020-10-27T14:23:38.658Z",
25
"archived_at":null
26
}
27
}
28
}
Copied!

On-call change webhooks

You'll get a POST request when an on-call contact changes.
Example request body
1
{
2
"data": {
3
"message": "Martin Galovic ([email protected]) is now on-call.",
4
"emails": ["[email protected]"]
5
}
6
}
Copied!

⛳️ Testing webhooks

We recommend using RequestBin for testing out webhooks.

1. Copy the generated URL from RequestBin

2. Paste the URL in the Webhook URL input

3. Click Send a test webhook

4. Inspect the request body and figure out what works best for you

Got any questions?

Please, send us an email to [email protected].
Last modified 1yr ago