RaaqebDocsالعربية
RaaqebDocsالعربية

Webhook

The JSON a webhook channel posts, how Raaqeb signs it with Standard Webhooks, and how to verify the signature on your receiver.

A webhook channel posts each notification as JSON to a URL you choose, signed with the Standard Webhooks scheme. Use it to feed your own service, an automation tool or anything that takes an HTTP POST. The body is machine values only and is never translated, so the channel has no channel language.

What you need first

An http or https URL that accepts a POST and answers 2xx. It can be on the public internet or on your own network. Raaqeb generates the signing secret when you save the channel; copy it from the channel's page to your receiver.

Fields

FieldMeaningRequiredDefault
NameWhat the admin area calls the channel, at most 80 characters.YesNone
Apply to new monitors by defaultEvery new monitor starts with this channel selected.NoOn
URLWhere Raaqeb posts. http or https, at most 2048 characters. A secret: stored encrypted and never shown after saving, since a URL often carries a token.YesNone
Signing secretGenerated by Raaqeb, whsec_ followed by the base64 of 32 random bytes. Shown on the channel's page once saved.GeneratedNone
A new signing secret on saveReplaces the signing secret when you save. After saving, the receiver stops verifying with the old secret.NoOff

The request

Each attempt is one POST:

http
POST /hooks/raaqeb HTTP/1.1
content-type: application/json
user-agent: Raaqeb
webhook-id: 0199a3c4-1b2e-7f40-8a6d-3c5e9b2d7a11
webhook-timestamp: 1790362142
webhook-signature: v1,ZQq6cK+z7eUi6D9zZWTUyqr1MZ/7a41TG2GEWUF7CAs=

{"data":{"incidentUrl":"https://status.example.com/admin/incidents/new?monitor=0199a3c2-5f1e-7c3a-9b1d-2f6e8a4c1b7d","monitor":{"adminUrl":"https://status.example.com/admin/monitors/0199a3c2-5f1e-7c3a-9b1d-2f6e8a4c1b7d","checkType":"http","id":"0199a3c2-5f1e-7c3a-9b1d-2f6e8a4c1b7d","name":"Main website","target":"https://example.com"},"reason":"timeout"},"timestamp":"2026-09-25T18:49:00.000Z","type":"monitor.down"}
HeaderValue
webhook-idThe notification's id, a UUID. The same on every retry of one notification, so a receiver can drop a duplicate.
webhook-timestampWhen this attempt was made, in Unix seconds. Each retry has its own.
webhook-signaturev1, then the base64 HMAC-SHA256 signature.

Any 2xx answer is a success, and Raaqeb does not read its body. Redirects are not followed: a 3xx answer is a failed attempt, so a signed body never lands at another address.

The payload

The body follows the Standard Webhooks envelope: type, timestamp (when the event happened, ISO 8601 in UTC) and data. Every monitor event's data has a monitor object:

FieldMeaning
idThe monitor's id.
nameThe monitor's name.
checkTypehttp, tcp, dns, postgres, mysql, redis, docker or heartbeat.
targetThe URL, host:port or name the check reaches; null for a heartbeat monitor.
adminUrlThe monitor's page in the admin area. Absent when the install stores no public address.

The types and what they add to data:

typeAdded to data
monitor.downreason; incidentUrl, the admin page that opens an incident for this monitor, absent without a public address.
monitor.reminderreason, the one the outage opened with; downForMs, how long the monitor has been down.
monitor.recovereddowntimeMs, how long the outage lasted.
monitor.degraded_startedreason.
monitor.degraded_endedNothing.
monitor.certificate_expiringcertificate: daysLeft, whole days left rounded down, and notAfter, the expiry instant.
channel.testchannel: the channel's id and name. No monitor.

reason is a reason code such as timeout, dns_failed, connection_refused, unexpected_status, assertion_failed, slow or heartbeat_late. A recovered notification:

json
{
  "data": {
    "downtimeMs": 754000,
    "monitor": {
      "adminUrl": "https://status.example.com/admin/monitors/0199a3c2-5f1e-7c3a-9b1d-2f6e8a4c1b7d",
      "checkType": "http",
      "id": "0199a3c2-5f1e-7c3a-9b1d-2f6e8a4c1b7d",
      "name": "Main website",
      "target": "https://example.com"
    }
  },
  "timestamp": "2026-09-25T19:01:34.000Z",
  "type": "monitor.recovered"
}

The payload is a public contract: types and fields are added, never changed. The full schema, with every reason code, is in the API reference.

The signature

Raaqeb signs each attempt as Standard Webhooks describes:

  1. Take the signing secret, drop the whsec_ prefix, and base64-decode the rest. Those 32 bytes are the HMAC key.
  2. Build the signed content: the webhook-id, a full stop, the webhook-timestamp, a full stop, then the body exactly as received: id.timestamp.body.
  3. Compute HMAC-SHA256 of the signed content with the key, and base64-encode it.
  4. Send it as webhook-signature: v1,<signature>.

To verify, compute the same signature from the raw body bytes, before any JSON parsing, and compare it in constant time. Reject a request whose webhook-timestamp is too far from your clock; Standard Webhooks suggests five minutes. A Standard Webhooks library takes the secret as Raaqeb shows it, whsec_ prefix included. Without one:

ts
const toBytes = (base64: string) =>
  Uint8Array.from(atob(base64), (char) => char.charCodeAt(0));

/** Whether a request carries a valid Raaqeb signature. `body` is the raw request body. */
export async function verify(
  secret: string,
  headers: Headers,
  body: string,
  toleranceSeconds = 300
): Promise<boolean> {
  const id = headers.get("webhook-id");
  const timestamp = headers.get("webhook-timestamp");
  const signatures = headers.get("webhook-signature");
  if (!(id && timestamp && signatures)) {
    return false;
  }
  if (!(Math.abs(Date.now() / 1000 - Number(timestamp)) <= toleranceSeconds)) {
    return false;
  }
  const key = await crypto.subtle.importKey(
    "raw",
    toBytes(secret.slice("whsec_".length)),
    { hash: "SHA-256", name: "HMAC" },
    false,
    ["verify"]
  );
  const signed = new TextEncoder().encode(`${id}.${timestamp}.${body}`);
  // The header may list several signatures separated by spaces; Raaqeb sends one.
  for (const entry of signatures.split(" ")) {
    const [version, signature] = entry.split(",");
    if (
      version === "v1" &&
      signature &&
      (await crypto.subtle.verify("HMAC", key, toBytes(signature), signed))
    ) {
      return true;
    }
  }
  return false;
}

It runs on Bun, Deno, Node.js 20 and later, and Cloudflare Workers. crypto.subtle.verify compares in constant time. To test your receiver, the request at the top of this page is signed with the secret whsec_AQgPFh0kKzI5QEdOVVxjanF4f4aNlJuiqbC3vsXM09o=; it verifies once you set aside the timestamp check.

To rotate the secret, turn on A new signing secret on save, save, and give the new secret to your receiver. The old secret stops working at once, so update the receiver straight after saving.

Failures and limits

One attempt gives up after 10 seconds. A failed attempt is retried 30 seconds, 2 minutes and 10 minutes later, with the same webhook-id. See the queue and retries.

Reason codeTextTypical cause
unexpected_statusUnexpected status codeThe receiver answered outside 2xx, or redirected. Observed shows the status, Error text the start of the answer's body.
timeoutTimed outNo answer within 10 seconds.
dns_failedDNS lookup failedThe URL's host does not resolve.
connection_refusedConnection refusedNothing listens at the URL's host and port.
connection_failedConnection failedThe connection was reset or the host was unreachable.
certificate_expiredCertificate expiredThe receiver's certificate has expired.
certificate_invalidCertificate invalidThe certificate is self-signed, for another name, or cannot be verified.
unknownUnknown errorAnything else. Error text says what happened.

The URL is removed from every recorded error text. There are no custom request headers; the signature is how a receiver knows a POST came from your install.

On this page