Webhooks

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

Post webhooks from Better Uptime

  1. Go to Integrations → Exporting data → Configure webhooks

  2. Click Configure

  3. Choose a type of webhook (Incident / Monitor / On-call change)

  4. Enter your Webhook URL in the URL field

  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
Example request body
{
"event":"acknowledged", // started, acknowledged or resolved
"data":{
"id":"1",
"type":"incident",
"attributes":{
"name":"Tesla.com homepage",
"url":"https://tesla.com",
"http_method":"get",
"cause":"Error 500",
"started_at":"2020-10-21T10:51:28.151Z",
"acknowledged_at":"2020-02-25T17:38:45.768Z",
"resolved_at":null,
"response_content":null,
"response_url":null,
"screenshot_url":null
},
"relationships":{
"monitor":{
"data":{
"id":"4",
"type":"monitor"
}
}
}
}
}

Monitor webhooks

You'll get a POST request when a new monitor is created, updated, paused, unpaused, or deleted.

Example request body
Example request body
{
"event":"created", // created, updated, paused, unpaused or deleted
"data":{
"id":"1",
"type":"monitor",
"attributes":{
"url":"https://example.com",
"pronounceable_name":"Example.com homepage",
"monitor_type":"keyword",
"required_keyword":"example",
"verify_ssl":true,
"check_frequency":30,
"call":true,
"sms":true,
"email":true,
"team_wait":null,
"http_method":"get",
"request_timeout":15,
"recovery_period":0,
"request_body":"",
"paused_at":null,
"last_checked_at":"2020-09-04T14:08:21.000Z",
"created_at":"2020-02-18T14:38:34.117Z",
"updated_at":"2020-10-27T14:23:38.658Z",
"archived_at":null
}
}
}

On-call change webhooks

You'll get a POST request when an on-call contact changes.

Example request body
Example request body
{
"data": {
"message": "Martin Galovic (martin@betteruptime.com) is now on-call.",
"emails": ["martin@betteruptime.com"]
}
}

⛳️ 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 hello@betteruptime.com.