# Webhook alerts and signatures

Send StatusCheck downtime alerts to your own systems as signed JSON webhooks. See each event's payload and verify the webhook signature.

A webhook is a message that StatusCheck sends to a web address you choose, the moment something happens: a monitor goes down, it recovers, or someone posts a status update. Software at that address reads the message and acts on it, for example by opening a ticket, updating an internal dashboard, or passing the alert to a tool StatusCheck has no integration for.

You need webhooks only if you have somewhere for the messages to go: an app your developers run, or an automation tool that gives you a web address to receive data. To get alerts in a chat app or by email, use a ready-made integration instead, such as [Slack](/docs/alerts/slack/), [Microsoft Teams](/docs/alerts/microsoft-teams/) or [email alerts](/docs/alerts/email/). They need no code.

Webhooks are available on every plan. A workspace can have many endpoints (the web addresses that receive webhooks), each with its own events and signing secret. The rest of this page is for the developer who builds the receiving end.

**Before you start**

- You need the **Owner**, **Admin** or **Editor** role in the StatusCheck workspace.
- Your endpoint must be reachable from the internet over `https://`. StatusCheck refuses addresses such as `localhost` or private IP addresses.
- The endpoint should answer within 10 seconds with a `2xx` status (any success code, such as `200` or `204`). Do slow work after you respond.

## Add a webhook endpoint

1. In StatusCheck, open **Integrations** in the sidebar and choose **Webhooks**.

2. Select **Add endpoint**.

3. Enter the **Endpoint URL**, for example `https://ops.acme.io/hooks/statuscheck`.

4. Under **Events**, keep the events this endpoint should receive. All three are selected by default, and at least one is required.

5. Select **Add endpoint**.

6. Select **Copy secret** and store the signing secret where your receiver can read it, for example in an environment variable. The secret is a shared password that lets your receiver check each request really came from StatusCheck.

   ![The Webhooks page after adding an endpoint: a Copy your signing secret banner with the secret and a Copy secret button, and the Endpoints table with the URL, 3 / 3 events, the masked secret and a Connected status.](https://www.statuscheck.io/_astro/integration-webhook.CiHqkyPd.png)

:::caution[The secret is shown once]
The signing secret appears only right after you add the endpoint. If you lose it, delete the endpoint and add it again to get a new one.
:::

Before you rely on the endpoint, [send a test event](#send-a-test-event) and select the endpoint on each monitor's **Notifications** tab, under **Channels**. Until you do, it receives status updates only.

The **Endpoints** table lists each endpoint with its URL, the number of events it receives, the last four characters of its secret (shown as `whsec_…` plus those characters), its last event and its status.

## Events an endpoint can receive

| Event | `X-StatusCheck-Event` | When it is sent |
| --- | --- | --- |
| **Monitor down** | `monitor.down` | A failure has been confirmed from a second location and an incident has opened, and again for each reminder if the monitor's **Resend while down** is set. |
| **Monitor recovered** | `monitor.up` | The monitor's recovery has been confirmed, or someone resolved the incident. |
| **Status updates** | `incident.updated` | Someone posts an update to a status page, including the update that resolves it. |

Down and recovery events go only to endpoints selected on a monitor's **Notifications** tab, under **Channels**. Status updates go to every endpoint that receives **Status updates**, whatever monitors it is attached to.

You can't edit an endpoint's events after you add it. To change them, delete the endpoint and add it again with the events you want. Then update the secret in your receiver and select the new endpoint again on each monitor's **Notifications** tab.

## Request format

Each event is an HTTP `POST` request with a JSON body. JSON is a plain-text format for structured data that every programming language can read.

| Header | Value |
| --- | --- |
| `Content-Type` | `application/json` |
| `User-Agent` | `StatusCheck-Webhooks/1.0` |
| `X-StatusCheck-Event` | `monitor.down`, `monitor.up`, `incident.updated`, or `test` |
| `X-StatusCheck-Delivery` | A numeric delivery ID, the same on every retry of a delivery (`test` for test events). Use it to ignore duplicates. |
| `X-StatusCheck-Signature` | `t=<unix seconds>,v1=<hex HMAC-SHA256>`. See [Verify the signature](#verify-the-signature). |

### Example: `monitor.down`

```json
{
  "id": 48213,
  "event": "monitor.down",
  "created_at": "2026-11-29T10:15:04.512+00:00",
  "data": {
    "event_type": "opened",
    "sequence": 0,
    "test": false,
    "workspace": "Acme",
    "monitor": {
      "id": "mon_7Rk2PqXa9LmT4vWc",
      "name": "Public API",
      "type": "http",
      "target": "https://api.acme.io/health"
    },
    "incident": {
      "id": "inc_Hb3nQ8sYd1KzF6Ue",
      "title": "Public API is down",
      "summary": null,
      "url": "https://app.statuscheck.io/incidents/inc_Hb3nQ8sYd1KzF6Ue",
      "state": "ongoing",
      "severity": "major",
      "startedAt": "2026-11-29T10:14:31.000+00:00",
      "resolvedAt": null,
      "durationSeconds": null,
      "region": "Frankfurt, Germany",
      "statusCode": 503,
      "reason": "ERR_UNEXPECTED_STATUS"
    },
    "update": null
  }
}
```

- `data.event_type` is `opened` for the first alert and `reminder` for each reminder. Both arrive as `monitor.down`.
- `data.sequence` is `0` for the first alert and goes up by one with each reminder.
- `data.monitor.target` is `null` unless **Show URL in notifications** is on for the monitor.
- Top-level keys use snake_case; keys inside `monitor` and `incident` use camelCase.
- Times are ISO 8601 in UTC.

### `monitor.up` and `incident.updated`

A `monitor.up` body has the same shape with `event_type` set to `resolved`, `state` set to `resolved`, and `resolvedAt` and `durationSeconds` filled in.

An `incident.updated` body has `event_type` set to `updated` and an `update` object with the stage and text that was posted:

```json
"update": {
  "stage": "identified",
  "body": "We have found the cause and are rolling out a fix."
}
```

`stage` is one of `investigating`, `identified`, `update`, `monitoring` or `resolved`. For a status update, `incident` describes the status update itself and `monitor` is `null`.

Reopening a resolved monitor incident also sends `incident.updated`. In that case `monitor` and `incident` describe the monitor's incident, `update.stage` is `null` and `update.body` is empty.

## Send a test event

On the Webhooks page in StatusCheck, in the **Endpoints** table, open the **•••** menu on the endpoint and select **Send test event**. StatusCheck sends a request with `X-StatusCheck-Event: test` and a sample body: `event` is `test`, `data.test` is `true`, and the monitor is "Example monitor" with the ID `mon_test`. StatusCheck signs the request like any other, so use it to check your verification code.

## Verify the signature

Verify every request before you act on it, so nobody can forge an alert by posting to your URL. The signature is an HMAC: a code computed from the request body and your signing secret. Only someone who knows the secret can produce a matching code.

The `X-StatusCheck-Signature` header looks like `t=1795974237,v1=ded3c87e…`. To verify it:

1. Split the header on commas and read `t` (a Unix timestamp in seconds) and `v1` (a hex string).
2. Reject the request if `t` is more than 5 minutes from your current time. This stops someone replaying an old request.
3. Compute the HMAC-SHA256 of the string `<t>.<raw body>` with your signing secret as the key, as lowercase hex.
4. Compare it to `v1` with a constant-time comparison.

Use the raw request body exactly as received. Parsing the JSON and serializing it again changes the bytes, and the signature will not match.

**Node.js**

```js
import crypto from 'node:crypto';
import express from 'express';

const SECRET = process.env.STATUSCHECK_WEBHOOK_SECRET;
const TOLERANCE_SECONDS = 5 * 60;

function verifySignature(header, rawBody) {
  if (!header) return false;
  const parts = Object.fromEntries(
    header.split(',').map((part) => {
      const i = part.indexOf('=');
      return [part.slice(0, i), part.slice(i + 1)];
    })
  );
  const { t, v1 } = parts;
  if (!/^\d+$/.test(t ?? '') || !v1) return false;
  if (Math.abs(Date.now() / 1000 - Number(t)) > TOLERANCE_SECONDS) return false;

  const expected = crypto.createHmac('sha256', SECRET).update(`${t}.${rawBody}`).digest('hex');
  const a = Buffer.from(expected);
  const b = Buffer.from(v1);
  return a.length === b.length && crypto.timingSafeEqual(a, b);
}

const app = express();

// express.raw keeps the body as bytes, so the signature is checked against what was sent.
app.post('/hooks/statuscheck', express.raw({ type: 'application/json' }), (req, res) => {
  const rawBody = req.body.toString('utf8');
  if (!verifySignature(req.get('X-StatusCheck-Signature'), rawBody)) {
    return res.status(401).send('Invalid signature');
  }

  const event = JSON.parse(rawBody);
  console.log(event.event, event.data.incident.title);
  res.sendStatus(204);
});

app.listen(3000);
```

**Python**

```python
import hashlib
import hmac
import os
import time

from flask import Flask, abort, request

SECRET = os.environ["STATUSCHECK_WEBHOOK_SECRET"]
TOLERANCE_SECONDS = 5 * 60

def verify_signature(header, raw_body: bytes) -> bool:
    if not header:
        return False
    parts = dict(part.split("=", 1) for part in header.split(",") if "=" in part)
    t, v1 = parts.get("t", ""), parts.get("v1", "")
    if not t.isdigit() or not v1:
        return False
    if abs(time.time() - int(t)) > TOLERANCE_SECONDS:
        return False
    expected = hmac.new(
        SECRET.encode(), f"{t}.".encode() + raw_body, hashlib.sha256
    ).hexdigest()
    return hmac.compare_digest(expected, v1)

app = Flask(__name__)

@app.post("/hooks/statuscheck")
def statuscheck():
    raw_body = request.get_data()
    if not verify_signature(request.headers.get("X-StatusCheck-Signature"), raw_body):
        abort(401)

    event = request.get_json()
    print(event["event"], event["data"]["incident"]["title"])
    return "", 204
```

Use the secret as text, exactly as copied. Do not hex-decode it.

## Retries

- Any `2xx` response counts as delivered.
- StatusCheck treats `401`, `403`, `404` and `410` as permanent and does not retry, because the endpoint is gone or refuses the request.
- StatusCheck retries any other status, a network error, or no response within 10 seconds, up to 3 more times. The wait between attempts starts at 10 seconds and grows each time (exponential backoff), up to 2 minutes.

Every attempt is a separate request with a fresh timestamp and signature, but the same `X-StatusCheck-Delivery` ID. Make your receiver idempotent, so that handling the same delivery twice has no extra effect: remember the IDs it has processed and skip repeats.

## Check recent deliveries

On the Webhooks page in StatusCheck, the **Recent deliveries** card shows the last 25 requests across all endpoints: **Time**, **Event**, **Endpoint**, **Attempt**, **Status** (the HTTP status your endpoint returned, or the error) and **Latency**. An endpoint whose last delivery failed shows **Failing** in the **Endpoints** table.

## Delete an endpoint

On the Webhooks page in StatusCheck, open the **•••** menu on the endpoint and select **Delete endpoint**. The endpoint stops receiving events immediately. You can't undo this. To receive events there again, add the endpoint again, which creates a new secret.

## Troubleshooting

**Signatures never match.** You are probably signing a re-serialized body. Read the raw bytes before any JSON middleware runs, and use the secret exactly as copied, as text.

**Every request is rejected as too old.** Your server's clock is off. Turn on automatic time sync (NTP) on the server. The check allows 5 minutes either way.

**Deliveries show a timeout.** Your endpoint took longer than 10 seconds. Respond with `2xx` first and process the event in the background.

**StatusCheck refuses the URL.** It must start with `https://` and must not point at `localhost` or a private IP address.

## Related

- [How alerts work](/docs/alerts/) explains when events fire and how monitors are routed.
- [Post a status update](/docs/status-pages/status-updates/) explains the updates behind `incident.updated`.
- [Respond to an incident](/docs/incidents/) covers what happens on the incident linked in each payload.
