Skip to content

Native webhooks

A webhook source gives you a secret URL. Your tool POSTs JSON to it. OnCallAlerting reads the payload, maps it to one or more alerts, and opens, updates or resolves incidents.

The URL is shown once, when you connect the source or rotate its secret. It has this shape:

https://oncallalerting.com/api/hooks/SOURCE_ID/SECRET
  • Send POST with a JSON body. No other headers or authentication are needed; the secret in the path is the credential.

  • Success is 202 with the incidents the request touched:

    {"accepted": true, "incident_ids": ["9a0c..."]}
  • A payload OnCallAlerting cannot read gets 400 with an error message, such as title is required (max 300 characters); description max 10000.

  • A wrong URL gets 404. Too many requests get 429.

  • Bodies are limited to 1 MB.

The examples below use YOUR_WEBHOOK_URL for your source's URL.

Every native payload ends up as a status and a severity. Values are not case-sensitive.

Status valuesBecome
resolved, resolve, ok, recovered, recovery, closedA recovery. It resolves the open incident with the same key.
open, triggered, trigger, firing, alert, alarm, created, regression, renotify, re-triggered, retriggered, warn, no data, or emptyAn alert. It opens an incident or adds an occurrence.
Anything elseRejected with 400, for example unsupported alert status "assigned"
Severity valuesBecome
critical, error, danger, emergency, alertcritical
warning, warnwarning
Anything else, or emptyinfo

Native webhooks cannot acknowledge an incident. Use a PagerDuty-compatible or Opsgenie-compatible source for that.

Every alert needs a title of up to 300 characters and a deduplication key of up to 500 characters. Descriptions are up to 10000 characters.

oncallalerting.com/workspace?tab=integrations
The Prometheus Alertmanager source setup dialog with the secret link and an Alertmanager receiver example The Prometheus Alertmanager source setup dialog with the secret link and an Alertmanager receiver example

Add OnCallAlerting as a webhook receiver and route alerts to it. Keep send_resolved: true so recoveries resolve incidents.

receivers:
- name: oncallalerting
webhook_configs:
- url: YOUR_WEBHOOK_URL
send_resolved: true
# Add receiver: oncallalerting to your Alertmanager route.

One webhook can carry 1-100 alerts. Each becomes its own alert in OnCallAlerting:

Incident fieldFrom
Titleannotations.summary, else labels.alertname
Descriptionannotations.description
Deduplication keyfingerprint, else labels.alertname and labels.instance
StatusThe alert's status, else the payload's status
Severitylabels.severity

To keep an existing PagerDuty or Opsgenie receiver instead, see the compatible sources.

Create a contact point of type webhook with the source URL and method POST, and attach it to a notification policy. Grafana's webhook payload has the same alerts array as Alertmanager, and maps the same way.

Create a webhook in the Datadog webhooks integration with the source URL, and a payload that uses Datadog's template variables:

{
"name": "OnCallAlerting",
"url": "YOUR_WEBHOOK_URL",
"payload": {
"title": "{{event_title}}",
"text": "{{event_msg}}",
"aggregation_key": "{{alert_id}}",
"alert_transition": "{{alert_transition}}",
"alert_type": "{{alert_type}}"
}
}
Incident fieldFrom
Titletitle, else alert_title
Descriptiontext, else body
Deduplication keyaggregation_key, else id
Statusalert_transition, else status. Recovered resolves; Triggered, Re-Triggered, Warn and No Data open.
Severityalert_type, else severity

Send CloudWatch alarm state changes through an EventBridge API destination whose endpoint is the source URL. OnCallAlerting reads either an EventBridge "CloudWatch Alarm State Change" event or a direct alarm JSON body.

Incident fieldFrom
TitleAlarmName, else detail.alarmName
DescriptionNewStateReason, else detail.state.reason
Deduplication keyAlarmArn, else detail.alarmName, else AlarmName
StatusNewStateValue, else detail.state.value. ALARM opens; OK resolves.
SeverityAlways critical

Add the source URL to Sentry's webhooks integration for issue alerts.

Incident fieldFrom
Titledata.issue.title, else data.event.title, else title
Descriptiondata.issue.culprit, else data.event.message
Deduplication keydata.issue.id, else data.event.event_id, else dedup_key
Statusaction, else status. created opens; resolved resolves.
Severitydata.issue.level, else data.event.level

Other Sentry actions, such as assigned or archived, are not a status OnCallAlerting accepts and get 400.

oncallalerting.com/workspace?tab=integrations
The generic JSON webhook setup dialog with the secret link and a curl example The generic JSON webhook setup dialog with the secret link and a curl example

Use the generic format for your own scripts and for every tool marked "Generic JSON webhook" on Add integration. Send one alert per request:

FieldRequiredNotes
titleYesUp to 300 characters
descriptionNoUp to 10000 characters
dedup_keyYesUp to 500 characters. Use the same key for the recovery.
severityNoSee the severity table. Defaults to info.
statusNoSee the status table. Defaults to an alert.

Other fields are ignored.

Terminal window
curl -X POST YOUR_WEBHOOK_URL \
-H 'content-type: application/json' \
-d '{"title":"API error rate is high","description":"Production API needs attention","dedup_key":"production-api-errors","severity":"critical","status":"open"}'

When the problem clears, send the same dedup_key with "status":"resolved".