Skip to main content
When an alert with a webhook destination fires, ManaLens sends a signed POST request with a JSON body to your HTTPS URL.

Payload

Both conditions use the type alert.threshold_reached. Read data[].condition to tell them apart. The condition, threshold and filters in a delivery are the ones the window fired under. If someone edits the alert after that, a retry of the same delivery still sends the old values. A test send has "type": "alert.test", a new id, data[0].test = true, and the alert’s current condition, threshold and trigger_filters. It has no count or window.

Headers

Verify the signature

The signing secret (whsec_...) is shown once, when you create the alert or when you change the alert to a new webhook URL. A new URL always gets a new secret. To verify a request:
  1. Read the raw request body. Do not parse and re-serialize it first.
  2. Refuse a timestamp more than five minutes from your clock.
  3. Compute the HMAC-SHA256 of {timestamp}.{raw body} with the secret.
  4. Compare it with X-Webhook-Signature in constant time.
The timestamp is inside the signed string, so an attacker cannot replay an old body with a new timestamp.
Node.js

Delivery rules

  • Respond with a 2xx status. Any other result, including a 3xx redirect, is a failed delivery.
  • A request times out after 5 seconds. The response body is ignored.
  • Failed deliveries retry with backoff, up to five attempts. Delivery is at least once.