Skip to content

Generic Webhook

The generic webhook endpoint accepts any JSON payload and maps it to a Navi.sh incident using a canonical field vocabulary. Use this when your monitoring tool supports custom webhooks but doesn't appear in the native integrations list.

POST/v1/events/webhook/{token}

Quick start

Your integration URL — including the token — is available in the Navi.sh dashboard → Integrations → Webhook.

Fire an alert

bash
curl -X POST "https://api.navi.sh/v1/events/webhook/<token>" \
  -H "Content-Type: application/json" \
  -d '{
    "title": "High CPU Usage",
    "description": "CPU usage exceeded 90% for 5 minutes",
    "severity": "critical",
    "dedup_key": "cpu-alert-prod-1",
    "status": "firing",
    "hostname": "web-01.prod",
    "starts_at": "2024-01-15T10:30:00Z",
    "labels": {
      "env": "production",
      "service": "api"
    }
  }'

Resolve an alert

Send the same dedup_key with "status": "resolved" to automatically close the incident:

bash
curl -X POST "https://api.navi.sh/v1/events/webhook/<token>" \
  -H "Content-Type: application/json" \
  -d '{
    "status": "resolved",
    "dedup_key": "cpu-alert-prod-1"
  }'

Field aliasing

If you can't rename fields in your tool's webhook template, these aliases are supported:

CanonicalAlias
titlesubject
descriptionmessage
severitypriority

All fields are optional. Navi.sh applies aliasing and sensible defaults when fields are absent. Any unrecognized JSON keys are captured in the incident's custom bag.

POST /v1/events/webhook/{token}

Accepts any JSON payload and maps it to a navi.sh incident using the canonical field vocabulary. Unknown fields are captured in a custom bag and forwarded to the incident details.

Set "status": "resolved" (together with a dedup_key) to auto-resolve a previously fired incident.

The token is generated in your navi.sh workspace under Integrations.

Payload schema

FieldTypeDescription
annotationsobject<string, string>Additional annotations attached to the alert.
dedup_keystringDeduplication key. Alerts with the same key are correlated into one incident. Required when resolving. (example: disk-web-01)
descriptionstringAlert description. Also accepted as message. (example: Disk /dev/sda1 at 92% on host web-01)
ends_atstringRFC3339 timestamp of when the alert ended. (example: 2024-01-15T11:00:00Z)
hostnamestringSource host that generated the alert. (example: web-01.us-east-1)
labelsobject<string, string>Arbitrary key-value metadata labels.
linkstringReference link to the alert in the source system. (example: https://monitoring.example.com/alerts/42)
messagestringAlias for description. (example: Disk /dev/sda1 at 92%)
prioritystring (critical, error, warning, info)Alias for severity. (example: critical)
regionstringGeographic or logical region. (example: us-east-1)
severitystring (critical, error, warning, info)Severity level. Also accepted as priority. (example: critical)
starts_atstringRFC3339 timestamp of when the alert started firing. (example: 2024-01-15T10:30:00Z)
statusstring (firing, resolved)Set to "resolved" (with dedup_key) to auto-resolve an open incident. (example: firing)
subjectstringAlias for title. (example: High disk usage)
titlestringAlert title. Also accepted as subject. (example: Disk usage > 90%)
typestringAlert type. Defaults to "webhook". (example: alert)
valuesobject<string, string>Metric values associated with the alert.

Examples

Firing

json
{
  "dedup_key": "cpu-alert-prod-1",
  "description": "CPU usage exceeded 90% for 5 minutes",
  "hostname": "web-01.prod",
  "labels": {
    "env": "production",
    "service": "api"
  },
  "severity": "critical",
  "starts_at": "2024-01-15T10:30:00Z",
  "status": "firing",
  "title": "High CPU Usage"
}

Resolved

json
{
  "dedup_key": "cpu-alert-prod-1",
  "status": "resolved"
}

Response codes

  • 202 — Accepted — processing is asynchronous
  • 401 — Invalid service token
  • 500 — Unexpected server error

Built by the Navi.sh team.