Skip to content

Manage Alerting Through the API

Goal: set up where your alerts go from a script, CI job or AI agent, then check, before anything breaks, exactly who would hear about a monitor going down and when.

This page builds on Use the DownBad API: the same base address, key and limits apply. Changes need a Read and write key made by an Owner or Editor, on a paid plan. Reading, explaining and the dry run work with any key, a Read key on the Free plan included.

Three words used below:

  • A channel is somewhere alerts go: an email channel (one or more addresses), a webhook (Slack, Discord, Teams, your own endpoint and so on), or the built-in in-app channel.
  • An alert profile says, for each kind of monitor, which events alert, how severe they are, and which channels hear about them.
  • An escalation step is a later alert to more channels, sent only if the incident is still open after a delay you choose.

No answer ever contains a webhook’s URL, token, headers, signing secret or provider values, and no email address in full. The one exception is an agent destination’s signing secret, which DownBad makes: the create (or change) that makes it returns it once as signingSecret, and so does POST /channels/{id}/signing-secret, which replaces it. A webhook is shown by its host (hooks.slack.com), an address with its name hidden (a***@example.com). Test results and refusals are scrubbed the same way. To see or copy a full webhook URL, open the channel in DownBad.

An email channel:

Terminal window
curl -s -X POST https://downbad.app/api/public/v1/channels \
-H "Authorization: Bearer $DOWNBAD_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"type": "email",
"name": "On-call inbox",
"recipients": ["[email protected]"]
}'

Expected result: 201 with the channel. Each address that is not the verified sign-in address of someone on your account is sent a message titled Confirm this address for DownBad alerts, listed (hidden) in confirmationSentTo.

Check where it stands with GET /api/public/v1/channels/{id}: each entry in recipients has addedVia (app or public_api) and confirmed. Send the message again with:

Terminal window
curl -s -X POST https://downbad.app/api/public/v1/channels/{id}/verification \
-H "Authorization: Bearer $DOWNBAD_API_KEY"

A webhook channel takes the same settings as the app’s form. Webhooks need a plan that includes them.

Terminal window
curl -s -X POST https://downbad.app/api/public/v1/channels \
-H "Authorization: Bearer $DOWNBAD_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"type": "webhook",
"name": "Ops Slack",
"config": { "url": "https://hooks.slack.com/services/…", "provider": "slack" }
}'

Expected result: 201, with hint hooks.slack.com and verification verified. If the URL answers with a redirect, which DownBad never follows, redirect says so with the host it pointed to.

Terminal window
curl -s -X POST https://downbad.app/api/public/v1/channels/{id}/test \
-H "Authorization: Bearer $DOWNBAD_API_KEY"

This sends a real test message now, even when the channel is switched off. An email channel sends one to each address on it, skipping any address added through the API that isn’t confirmed yet. A webhook gets one test request, except PagerDuty, which gets a test alert and then a second request that resolves it. Each call sends again.

Expected result: 200 with delivered and a detail saying what happened, with each address hidden. An email channel that isn’t verified yet sends nothing and says why.

Change a channel with PATCH /api/public/v1/channels/{id}, sending only the fields to change: name, enabled, throttleCooldownSeconds, quietHours (null removes them), recipients (email only, replaces the list) or config (webhook only, replaces the whole config). A new address is confirmed as on create. Delete one with DELETE /api/public/v1/channels/{id}.

Create an alert profile and its escalation

Section titled “Create an alert profile and its escalation”

Alert profiles need a plan that includes them. Start from a recipe, which routes to your channels the way the app’s recipes do:

Terminal window
curl -s -X POST https://downbad.app/api/public/v1/profiles \
-H "Authorization: Bearer $DOWNBAD_API_KEY" \
-H "Content-Type: application/json" \
-d '{ "name": "Shop alerts", "recipe": "uptime-critical" }'

The recipes are uptime-critical, status-change, quiet-hours-digest and dev-sandbox. Or send monitorSettings whole: the same rules the profile editor saves, which GET /api/public/v1/profiles/{id} returns. Every channel id you name must be one of your channels.

Then add escalation to one alert, here URL monitors going down: Slack at once, and the on-call inbox if the incident is still open after 15 minutes:

Terminal window
curl -s -X PUT https://downbad.app/api/public/v1/profiles/{id}/escalation \
-H "Authorization: Bearer $DOWNBAD_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"kind": "url",
"event": "first_failure",
"steps": [
{ "id": "now", "delaySeconds": 0, "channelIds": ["{slack-id}"], "minSeverity": "info" },
{ "id": "later", "delaySeconds": 900, "channelIds": ["{inbox-id}"], "minSeverity": "critical" }
]
}'

Expected result: 200 with the profile. A step with delaySeconds 0 is part of the first alert and replaces the rule’s own channels. A step only runs when the event’s severity reaches its minSeverity. An empty steps list removes the escalation. To point monitors at the profile, change their notificationProfileId as shown in Change monitors.

Terminal window
curl -s -X PUT https://downbad.app/api/public/v1/quiet-hours \
-H "Authorization: Bearer $DOWNBAD_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"enabled": true,
"mode": "digest",
"recurring": [{ "dayOfWeek": 6, "startTime": "22:00", "endTime": "08:00" }],
"oneOff": [],
"affectedSeverities": ["info", "warn"]
}'

Expected result: 200 with the settings and timeZone, the zone the times are read in (the account owner’s). digest holds alerts and sends one summary when the window ends; suppress drops them. Quiet hours need a plan that includes them.

Terminal window
curl -s https://downbad.app/api/public/v1/monitors/{id}/alerting \
-H "Authorization: Bearer $DOWNBAD_API_KEY"

Expected result: for each event that alerts, the channels told at once, each escalation step with its delay and whether it applies, whether quiet hours cover it, and an explanation in plain words. holds says what stops every alert right now (paused, muted, in maintenance), each channel carries a state (deliverable, unconfirmed, undeliverable, disabled or deleted) and its unconfirmedRecipients, the addresses it skips until they are confirmed, and problems lists everything found that stops or weakens the alerts, with its fix. It’s built from the same rules DownBad uses to send.

Ask what would happen if the monitor went down at a given moment, for example Saturday night inside your quiet hours:

Terminal window
curl -s -X POST https://downbad.app/api/public/v1/monitors/{id}/alerting/simulate \
-H "Authorization: Bearer $DOWNBAD_API_KEY" \
-H "Content-Type: application/json" \
-d '{ "event": "first_failure", "at": "2026-12-05T23:30:00.000Z" }'

Expected result: 200 with steps in time order, each with at, offsetSeconds and a kind:

kindMeaning
eventThe event itself
sendThe channel is sent the alert (skippedRecipients: unconfirmed)
quiet_hoursHeld by quiet hours until holdEndsAt (mode: digest/suppress)
mutedThe monitor is muted
not_deliveredThe channel can’t carry it (channelState says why)
escalationAn escalation step comes due, if the incident is still open
escalation_skippedA step this event’s severity doesn’t reach
maintenance_deferralA step put off by a maintenance window, until until
not_alertedNothing alerts at all (paused, no rule, or a maintenance window)

A quiet_hours step’s holdEndsAt is when the hold ends, in UTC, read in the zone your quiet hours are set in, so a window that crosses midnight, or one that starts as another ends, is followed to its end. In digest mode it’s the first moment no window of your account’s quiet hours or the channel’s own is open, whatever severities they cover: the summary waits for all of them and goes out shortly after. In suppress mode it’s the first moment neither holds this alert, and alerts are sent again from then. It’s null only when the windows, your account’s and the channel’s together, cover every hour of the week, so the hold never ends.

Nothing is sent, queued or recorded, and sent is always false. A repeat of the same alert inside a channel’s cooldown would be held back; the dry run mentions the cooldown but can’t know what was sent before. The event keys are the ones the explanation lists, such as first_failure and recovery.

Each create, change, test, confirmation resend and delete is recorded in Account › API activity with the person and key that made it. See Read the API activity log. The dry run and the explanation are reads and are not recorded.

A refusal names its rule in details.rule, with a link in details.helpUrl. The ones you’re most likely to meet here are the plan does not include this feature (webhooks, quiet hours or alert profiles), a plan limit was reached (email addresses), and an email address gets no alerts.