Alerts and status pages

Webhooks

A webhook is an address of yours that gets a POST request with a JSON body for every alert. Each message is signed, so your code can check that it is real.

On this page

Add a webhook

  1. On Integrations, under Webhooks, press Add webhook.
  2. Type a Name, and the Address of your receiver, such as https://example.com/hooks/monitoring.
  3. Press Add webhook.
  4. The window Copy the signing secret now shows the signing secret. It starts with whsec_. Copy it, keep it on your server, then press I saved the secret.
  5. Press Send a test message on the webhook. The result appears in the Delivery log.

The address must be one that anyone on the internet can reach:

  • It starts with https:// or http:// and has at most 2,048 characters.
  • Its port is 80, 443, or 1024 and higher.
  • It has no user name or password in it.
  • It is not in a private network: localhost, 192.168.1.10 and names such as intranet.corp are refused. This is checked again before every message.

Events

The header X-Monitor-Event and the field event in the body say what happened:

EventWhen it is sent
incident.openedAn incident of a monitor, a heartbeat or a server opened. With escalation, a later step sends it again to its own targets.
incident.acknowledgedSomeone said they are on the incident.
incident.reminderNobody acknowledged yet, and the escalation reminds its last step.
incident.resolvedThe incident ended.
certificate.expiringA monitor's HTTPS certificate ends soon.
domain.expiringA monitor's domain name ends soon.
vendor.incidentA vendor you follow reports an incident.
vendor.resolvedThe vendor says the incident is over.
error.new_issueA new error showed up on one of your sites.
error.regressionAn error you marked as resolved came back.
testYou pressed Send a test message.

Each webhook gets every event that goes to it. There is no filter: your code can ignore the events it does not need.

If your workspace uses escalation steps, a webhook gets incident messages only when a step names it. The other events always go to every webhook that is on.

The body

The body is JSON. Here is an incident that opened, spread over several lines so it is easy to read:

JSON
{
  "event": "incident.opened",
  "organization_id": "org_0192f0c1a2b37c4d8e5f6a7b8c9d0e00",
  "monitor": {
    "id": "mon_0192f0c1a2b37c4d8e5f6a7b8c9d0e1f",
    "name": "Shop",
    "type": "http",
    "url": "https://shop.example.com/"
  },
  "incident": {
    "id": "inc_0192f0c1a2b37c4d8e5f6a7b8c9d0f01",
    "started_at": "2026-11-24T10:00:00Z",
    "resolved_at": null,
    "cause": "status",
    "status_code": 503,
    "places": [
      { "city": "Frankfurt", "country": "DE", "main": true, "ok": false }
    ],
    "acknowledged_at": null
  }
}
  • The real body has no spaces or line breaks. Always check the signature on the bytes exactly as they arrived.
  • resolved_at, status_code, acknowledged_at and places are always there, with null or [] when they have no value. failed_check, acknowledged_by, acknowledged_by_key and round are left out when they have none.
  • Times are in RFC 3339 format and may have fractions of a second.
  • IDs start with a short prefix: org_, mon_, inc_, hbt_ (heartbeat), srv_ (server).
EventWhat the body holds besides event and organization_id
incident.*incident, and monitor, heartbeat or server. A server's incident also has alert: the metric, the limit, the minutes and the value. A reminder has incident.round: 1, 2, 3…
incident.acknowledgedincident.acknowledged_at and acknowledged_by: a person's name, or a key's name when acknowledged_by_key is true.
certificate.expiring, domain.expiringmonitor, and expiry with kind, domain, expires_at and days_left.
vendor.*vendor with slug, name and status_page, and vendor_incident with name, impact, status, link, started_at and resolved_at.
error.*error_site with id and name, and error_issue with id, type, message, culprit, page, browser, events and first_seen.
testNothing else.

Headers

HeaderValue
Content-Typeapplication/json
User-AgentUptimezy-Webhook/1.0
X-Monitor-EventThe event, such as incident.opened.
X-Monitor-DeliveryThe ID of this message, such as ntf_…. It is the same on every retry.
X-Monitor-TimestampWhen this try was signed, in seconds since 1970. A retry has a new one.
X-Monitor-Signaturev1= followed by the HMAC-SHA256 of the message, in lower-case hex.

Use X-Monitor-Delivery to notice a message you already handled: a retry has the same ID, but a new timestamp and a new signature.

Check the signature

The signature proves that the message comes from Uptimezy and was not changed. Check it like this:

  1. Read the raw body as bytes, before you parse the JSON.
  2. Join the value of X-Monitor-Timestamp, a dot, and the raw body: <timestamp>.<body>.
  3. Compute the HMAC-SHA256 of it. The key is the whole signing secret, whsec_ included.
  4. Write the result in lower-case hex and put v1= before it.
  5. Compare it with X-Monitor-Signature in constant time.
  6. Refuse a message whose timestamp is more than a few minutes old. Uptimezy sets no limit itself: the examples use 5 minutes.
Node.js
const http = require('node:http');
const crypto = require('node:crypto');

// The whole signing secret, whsec_ included.
const secret = process.env.WEBHOOK_SECRET;

function validSignature(timestamp, rawBody, signature) {
  const expected = 'v1=' + crypto
    .createHmac('sha256', secret)
    .update(timestamp + '.')
    .update(rawBody)
    .digest('hex');
  const a = Buffer.from(expected);
  const b = Buffer.from(signature);
  return a.length === b.length && crypto.timingSafeEqual(a, b);
}

http.createServer((req, res) => {
  const chunks = [];
  req.on('data', (chunk) => chunks.push(chunk));
  req.on('end', () => {
    const rawBody = Buffer.concat(chunks);
    const timestamp = req.headers['x-monitor-timestamp'] || '';
    const signature = req.headers['x-monitor-signature'] || '';
    const age = Math.abs(Date.now() / 1000 - Number(timestamp));
    if (!/^[0-9]+$/.test(timestamp) || age > 300 || !validSignature(timestamp, rawBody, signature)) {
      res.writeHead(401).end();
      return;
    }
    const message = JSON.parse(rawBody.toString('utf8'));
    // The same on every retry: use it to skip a message you already handled.
    const delivery = req.headers['x-monitor-delivery'];
    console.log(delivery, message.event);
    res.writeHead(204).end();
  });
}).listen(8080);
Python
import hashlib
import hmac
import json
import os
import time
from http.server import BaseHTTPRequestHandler, HTTPServer

# The whole signing secret, whsec_ included.
SECRET = os.environ["WEBHOOK_SECRET"].encode()


def valid_signature(timestamp: str, raw_body: bytes, signature: str) -> bool:
    mac = hmac.new(SECRET, timestamp.encode() + b"." + raw_body, hashlib.sha256)
    expected = "v1=" + mac.hexdigest()
    return hmac.compare_digest(expected.encode(), signature.encode())


class Handler(BaseHTTPRequestHandler):
    def do_POST(self):
        raw_body = self.rfile.read(int(self.headers.get("Content-Length", "0")))
        timestamp = self.headers.get("X-Monitor-Timestamp", "")
        signature = self.headers.get("X-Monitor-Signature", "")
        fresh = timestamp.isascii() and timestamp.isdigit() and abs(time.time() - int(timestamp)) <= 300
        if not fresh or not valid_signature(timestamp, raw_body, signature):
            self.send_response(401)
            self.end_headers()
            return
        message = json.loads(raw_body)
        # The same on every retry: use it to skip a message you already handled.
        delivery = self.headers.get("X-Monitor-Delivery")
        print(delivery, message["event"])
        self.send_response(204)
        self.end_headers()


HTTPServer(("", 8080), Handler).serve_forever()

Answers, retries and time limits

  • Answer with a status from 200 to 299 within 10 seconds. Only that counts as delivered.
  • Any other answer is tried again, also a redirect (redirects are never followed) and 429 (the Retry-After header is not read).
  • A message is tried 4 times in all: again after 1 minute, after 5 more minutes, and after 30 more minutes. Then it counts as Failed.
  • A webhook that was switched off or deleted, or an address that now leads into a private network, is not tried again.
  • Your answer's body is not read for anything: Uptimezy reads at most 64 KB of it and throws it away.

Every message counts toward the workspace's daily limit, the test too. See the delivery log and daily limits.

More guides

All guides