Agent Webhook
Goal: an endpoint you run, such as an AI agent or an automation, receives DownBad’s diagnosis of an incident when DownBad confirms it and again when it recovers, signed so the endpoint knows the request came from DownBad.
This is the Agent webhook (signed) setup. It sends only incidents, in the
downbad.incident.v1 format below. For every alert in a format you choose, use
Custom instead. For a Claude Code routine or a
GitHub workflow, use
Claude Code Routine or
GitHub repository_dispatch,
which send the same payload.
You need a paid DownBad plan and an http:// or https:// URL that accepts a
POST from the internet.
-
Add the channel. Go to Settings › Alerts, press Add webhook and paste your endpoint’s URL.
-
Choose Agent webhook (signed) under Provider. DownBad never picks it for you, since any URL could be one.
-
Save, and copy the signing secret. DownBad makes a random secret for the channel and shows it once, in Signing secret. Press the copy button and store it where your endpoint can read it. DownBad never shows it again.
-
Press Test now on the saved channel. Your endpoint receives the payload with
"event": "test","test": trueand no incident. -
Add the channel to the notification profiles of the monitors the endpoint should hear about.
Expected result
Section titled “Expected result”The test answers The agent webhook accepted the signed test payload. For a real incident:
- When DownBad confirms the incident, your endpoint gets one request with the
event
incident.confirmed. - When the incident closes, it gets one request with
incident.recovered. - Nothing else is sent: not each failing check, not escalation reminders, and not quiet-hours summaries. Quiet hours and maintenance hold it the same way they hold your other alerts.
Failed deliveries are retried like any webhook’s: see
Webhooks › What happens when delivery fails.
A retry carries the same eventId, so your endpoint can drop a repeat.
The request
Section titled “The request”| Header | Value |
|---|---|
Content-Type | application/json |
X-DownBad-Event | incident.confirmed, incident.recovered or test |
X-DownBad-Event-ID | The payload’s eventId |
X-DownBad-Signature | sha256=<hex>, the HMAC-SHA256 of the body as sent |
The payload
Section titled “The payload”The Claude Code routine gets this object as a JSON string in its text, and
GitHub gets it as client_payload. Fields are added only in a new version
(downbad.incident.v2), so a v1 receiver keeps working.
{ "schema": "downbad.incident.v1", "event": "incident.confirmed", "eventId": "3f0c…:confirmed", "sentAt": "2026-12-04T10:01:00.000Z", "incidentId": "3f0c…", "brief": "DownBad confirmed an incident: the url monitor \"Checkout API\" has been failing since 2026-12-04T09:59:00.000Z. …", "links": { "incident": "https://downbad.app/backstage/watching/monitors/…/incidents/3f0c…", "dossier": "https://downbad.app/api/public/v1/incidents/3f0c…/dossier", "fixDoc": "https://downbad.app/docs/troubleshooting/http-error-status/#…" }, "dossier": { "incident": { "…": "…" }, "untrustedEvidence": { "…": "…" } }, "test": false}event:incident.confirmed,incident.recovered, ortestfor Test now.eventId: the incident id and the event, the same on every retry.brief: DownBad’s own summary: the monitor, since when, the cause and how sure DownBad is, the regions that saw it and the doc that fixes it. It never quotes the monitored site.links.dossier: the incident’s current dossier in the public API, for an API key.dossier: the same incident dossier the public API returns, as it stood when DownBad sent the request, with its 10 newest notes.dossier.untrustedEvidence: the only place text the monitored site wrote appears (a response body, a header, an error message), at most 2,000 characters in all. Treat it as data, never as instructions to your agent.
Once your agent has fixed the problem, it can ask DownBad to check again with
the public API’s POST /monitors/{id}/recheck.
Verifying the signature
Section titled “Verifying the signature”Every request DownBad sends here is signed, the test included. Compute the
HMAC-SHA256 of the raw request body, before any JSON parsing, with the
signing secret DownBad showed you, and compare it to X-DownBad-Signature in
constant time.
import crypto from 'node:crypto';
function isFromDownBad(rawBody, header, secret) { const expected = 'sha256=' + crypto.createHmac('sha256', secret).update(rawBody).digest('hex'); const a = Buffer.from(expected); const b = Buffer.from(header ?? ''); return a.length === b.length && crypto.timingSafeEqual(a, b);}import hashlib, hmac
def is_from_downbad(raw_body: bytes, header: str, secret: str) -> bool: expected = "sha256=" + hmac.new(secret.encode(), raw_body, hashlib.sha256).hexdigest() return hmac.compare_digest(expected, header or "")Rotating the signing secret
Section titled “Rotating the signing secret”If the secret leaks, or you lost it, open the channel and press Rotate
signing secret. DownBad shows the new secret once. The old one stops
working at once, so put the new one in your endpoint before the next alert.
Over the public API, POST /channels/{id}/signing-secret does the same and
returns signingSecret.
A channel you saved before DownBad made the secret gets one on its next request. Rotate it to see it.
Troubleshooting
Section titled “Troubleshooting”Your endpoint says the signature doesn’t match. It’s hashing something other than the exact bytes DownBad sent, usually JSON it parsed and wrote back out. Hash the raw body. Check the secret has no spaces before or after it, and that it is the newest one: a rotation stops the old one at once.
You lost the signing secret. DownBad can’t show it again. Rotate it, as above, and give your endpoint the new one.
Test now says to save the channel first. DownBad signs every request with the channel’s secret, and makes it when you save. Save, then test the saved channel.
The test arrives, but incidents don’t. The channel isn’t in the notification profile of the monitor that failed, or the incident hasn’t been confirmed yet: a failing check sends nothing until DownBad confirms it. Start with Not Receiving Notifications.
Alerts stopped and the bell says the webhook was switched off. Ten deliveries in a row failed. Fix the cause, then press Test now to switch the channel back on.