Skip to main content

Webhook

CompanyEstimated TimeVendor DocsOpen Source
PagerTree LLC10 minutesv3.rb

What is the Webhook Integration?​

Webhooks are user defined HTTP callbacks. They are usually triggered by some event, and when that event occurs, the source site makes an HTTP request to the URI configured for the webhook.

If your tool is not listed on our integrations page, the webhook integration is a great choice to use as an integration point since most tools support sending webhooks for alerts and alarms.

info

This documentation is meant for webhooks that are incoming into PagerTree. If you are looking for incoming webhooks with a custom format, please see custom webhooks. If you are looking for outgoing webhooks, please refer to the outgoing webhook documentation.

How It Works​

Webhooks are versatile user-defined callbacks that many applications support.

  • When the payload event_type is create (event_type === "create"), an alert is created in PagerTree automatically.
  • When the payload event_type is update (event_type === "update"), the alert matching the given Id is updated in PagerTree automatically. Only the fields included in the payload are changed; anything left out is untouched.
  • When the payload event_type is acknowledge (event_type === "acknowledge"), an alert is acknowledged in PagerTree automatically.
  • When the payload event_type is resolved (event_type === "resolve"), the alert is resolved in PagerTree automatically.

Integration Walkthrough​

In this integration tutorial we will show you how to send a Webhook into PagerTree. The estimated time for this integration is 10 minutes. We assume that you already have a PagerTree account setup.

In PagerTree​

  1. Create the integration by clicking the Webhook logo.
  2. Copy the Endpoint URL.

In Other Application - Configure the Webhook​

The calling application must send a POST request with a Content-Type: application/json. The body of the request should have the following values.

FieldTypeValid Values
event_typestringcreate|update|acknowledge|resolve
Idstringa unique id
Titlestring(non-empty)
Descriptionstring(non-empty)
Tagsstring array(optional)
Metamap(optional)
info

For update, Id must match the Id of an existing alert (it cannot be used to change an alert's Id), and every other field is optional - only the fields you include are changed on the alert.

Example Request # 1​

POST /integration/int_ODCWagoG9 HTTP/1.1
Host: api.pagertree.com
Content-Type: application/json

{
"event_type": "create",
"Id": "example-id-123",
"Title": "Example Incident Title",
"Description": "Example Incident Description"
}
curl -X POST https://api.pagertree.com/integration/int_ODCWagoG9 \
-H "Content-Type: application/json" \
-d '{
"event_type": "create",
"Id": "example-id-123",
"Title": "Example Incident Title",
"Description": "Example Incident Description"
}'

Example Request #2​

POST /integration/int_ODCWagoG9 HTTP/1.1
Host: api.pagertree.com
Content-Type: application/json

{
"event_type": "create",
"Id": "example-id-123",
"Title": "Example Incident Title",
"Description": "Example Incident Description",
"Tags": [
"a",
"b",
"c"
],
"Meta": {
"incident": true,
"incident_severity": "SEV-1",
"incident_message": "Please join conference bridge 1-800-123-4567"
}
}
curl -X POST https://api.pagertree.com/integration/int_ODCWagoG9 \
-H "Content-Type: application/json" \
-d '{
"event_type": "create",
"Id": "example-id-123",
"Title": "Example Incident Title",
"Description": "Example Incident Description",
"Tags": [
"a",
"b",
"c"
],
"Meta": {
"incident": true,
"incident_severity": "SEV-1",
"incident_message": "Please join conference bridge 1-800-123-4567"
}
}'

Example Request #3 (Update)​

POST /integration/int_ODCWagoG9 HTTP/1.1
Host: api.pagertree.com
Content-Type: application/json

{
"event_type": "update",
"Id": "example-id-123",
"Urgency": "critical"
}
curl -X POST https://api.pagertree.com/integration/int_ODCWagoG9 \
-H "Content-Type: application/json" \
-d '{
"event_type": "update",
"Id": "example-id-123",
"Urgency": "critical"
}'

This updates only the Urgency field on the alert with Id example-id-123. The Title, Description, Tags, and Meta fields are left unchanged since they were not included in the payload.

You have successfully completed the Webhook Integration.

Integration Options​

OptionDescriptionDefault
TokenThe token can be used to authenticate request. Must be passed in by requesting clients in the pagertree-token HTTP header.
Capture Additional DataShould PagerTree capture and display other data sent?False
Wrapper KeyThe key in the JSON payload that wraps all PagerTree fields. For example, if the payload is { "acme_payload": { "Id": "123" } }, the wrapper key is acme_payload.