Skip to content

Custom Webhooks

Goal: DownBad alerts reach your own endpoint, or a service DownBad doesn’t format for yet, such as an automation tool or an internal API.

You need a paid DownBad plan and an http:// or https:// URL that accepts a POST from the internet.

  1. Add the channel. Go to Settings › Alerts, press Add webhook and paste your URL. A URL that isn’t a known service is set up as Custom. You can also choose Custom for a known service’s URL to receive raw JSON.
  2. Choose the body.
    • DownBad event JSON (default): the full event, described below.
    • Your own body: a template in JSON, form or plain text, filled in from the variables below.
  3. Add authentication, if your endpoint needs it. Choose Basic, Bearer token, or one named header. You can also add up to 20 custom headers.
  4. Set a signing secret, if you want to verify requests. Recommended for any endpoint you run yourself.
  5. Press Test now, then save and add the channel to the notification profiles that should use it.

Your endpoint receives a POST within seconds. On a test, the event says it’s a test (see below). Answer with any 2xx status to tell DownBad it arrived.

Every Custom request is a POST with these headers:

HeaderValue
Content-Typeapplication/json, or the type of your own body
User-AgentDownBad-Monitor/1.0
X-DownBad-EventWhat happened, such as incident_opened
X-DownBad-Event-IDThe event’s unique ID. Use it to ignore a retried duplicate.
X-DownBad-Severityinfo, warn or critical
X-DownBad-Signaturesha256=<hex>, only when a signing secret is set

DownBad waits up to 10 seconds for an answer.

The default body is the event itself. These fields are always present; more may be added over time, so ignore any you don’t know.

{
"eventId": "…",
"eventKey": "incident_opened",
"severity": "critical",
"monitor": { "id": "…", "name": "Shop", "kind": "url", "accountId": "…" },
"status": {
"current": "down",
"previous": "up",
"consecutiveFailures": 2,
"consecutiveSuccesses": 0
},
"timestamps": {
"firstDetectedAt": "2026-11-15T07:17:00.000Z",
"detectedAt": "2026-11-15T07:17:00.000Z"
},
"profile": { "id": "…", "name": "Default" },
"incidentId": "…",
"links": { "incidentUrl": "https://downbad.app/…" }
}

incidentId, links and metrics are present when they apply. Branch on eventKey and treat values you don’t recognize as informational, since new event types will be added.

Use {{variable}} placeholders. Each value is escaped for the format you chose, so a quote in a monitor’s name can’t break your JSON. In a JSON body, put each placeholder inside double quotes: {"text": "{{message}}"}.

VariableHolds
messageThe headline, such as “Shop is down”
statusDown, Still down or Back up
reasonWhy it was sent: the recorded failure, or that checks pass again
monitor.name / monitor.id / monitor.kindThe monitor
event.key / event.id / event.severityThe event
event.testtrue on a test, false on a real alert
incident.idThe incident, when there is one
detected_atWhen it was detected, ISO 8601 UTC
linkThe incident’s page in DownBad, else the monitor’s

On a test, every variable says it’s a test: message is “DownBad WebHook Channel Integrated”, status is Test and event.test is true.

With a signing secret set, DownBad signs the exact body it sends with HMAC-SHA256 and sends X-DownBad-Signature: sha256=<hex digest>. Compute the same digest over the raw request body, before any JSON parsing, and compare 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);
}
  • Retried: no answer, a timeout, HTTP 5xx, 408 or 429. Up to five retries with increasing delays. A 429 waits as long as your Retry-After header asks.
  • Not retried: any other 4xx, a redirect, or a URL that resolves to a private address.

A retry can deliver the same event twice if your endpoint processed it but answered too slowly. Deduplicate on X-DownBad-Event-ID.

“…answered HTTP 301/302 with a redirect…, which is not followed.” Your URL redirects, often from http to https or to add a trailing slash. Paste the final address.

The delivery fails with a timeout. Your endpoint took longer than 10 seconds. Answer with a 2xx straight away and do slow work afterward.

The delivery is refused because the address is private. DownBad won’t send to localhost, private network ranges or link-local addresses. Expose the endpoint publicly, or use a tunnel for testing.

“DownBad sets the … header itself. Remove it.” Content-Type, User-Agent, Host and a few others can’t be set as custom headers.

“The JSON body is not valid JSON once its variables are filled in.” A placeholder is outside double quotes. Write "{{message}}", not {{message}}.

Your signature check fails. You’re probably hashing the parsed and re-serialized JSON. Hash the raw body bytes exactly as received.

Alerts stopped and the bell says the webhook was switched off. Ten alerts in a row failed. Fix the cause above, then press Test now to switch the channel back on.