Skip to content

Integration

VitalRix and webhooks

Send alerts and incident events to your own code: trigger runbooks, open tickets in internal tools, or post to systems VitalRix does not integrate with directly.

2 min read8 sectionsUpdated

On this page

What it does

As an alert channel, a webhook integration POSTs a JSON body to your endpoint for each notification, signed with HMAC-SHA256 in the x-platform-signature header using your secret. The organisation-level Webhooks feature also delivers monitor, incident and alert events (and publishing events for website content) to endpoints you register.

Set it up

  1. Create an endpoint. A public HTTPS URL that accepts POST requests and responds quickly with 2xx.
  2. Add it in VitalRix. As an integration (URL and a signing secret of at least 16 characters), or under Webhooks for event subscriptions.
  3. Verify signatures. Compute the HMAC of the timestamp, a dot and the raw body, compare in constant time, and reject old timestamps.
  4. Handle repeats. Delivery is at least once; store event ids and ignore duplicates.

Credentials are stored encrypted and secret fields are never shown again after saving. Use the test button before relying on it: chat tools and webhooks receive a sample message, while paging, SMS and ticketing integrations check the credentials without paging anyone or creating anything.

Verifying a delivery

verify.tstypescript
import { createHmac, timingSafeEqual } from 'node:crypto';

// header: x-platform-signature: t=<unix seconds>,v1=<hex>
export function verify(rawBody: string, header: string, secret: string): boolean {
  const parts = Object.fromEntries(header.split(',').map((p) => p.split('=') as [string, string]));
  const age = Math.abs(Date.now() / 1000 - Number(parts.t));
  if (!parts.t || !parts.v1 || age > 300) return false;
  const expected = createHmac('sha256', secret).update(`${parts.t}.${rawBody}`).digest('hex');
  return timingSafeEqual(Buffer.from(expected), Buffer.from(parts.v1));
}

Tips

  • Verify against the raw body, before JSON parsing changes it.
  • Respond fast and do the work asynchronously.
  • Rotate the secret if it leaks; endpoints show it only once.

Frequently asked questions

What events are available?

Monitor down and recovered, incident created and resolved, alert triggered and resolved, plus publish events for website pages and articles.

Are deliveries retried?

Delivery is at least once, so the same event can arrive more than once. Make handlers idempotent.

Check it now, free

  • VitalRix and Zoho Cliq: Send VitalRix alerts to Zoho Cliq: website down, API errors, SLO burn and recoveries, routed per alert rule and severity to the right channel.
  • VitalRix and Discord: Send VitalRix alerts to Discord: website down, API errors, SLO burn and recoveries, routed per alert rule and severity to the right channel.
  • VitalRix and Slack: Send VitalRix alerts to Slack: website down, API errors, SLO burn and recoveries, routed per alert rule and severity to the right channel.
  • VitalRix and Microsoft Teams: Send VitalRix alerts to Microsoft Teams: website down, API errors, SLO burn and recoveries, routed per alert rule and severity to the right channel.
  • Get website down alerts in Slack: Send website down alerts to Slack the right way: channel layout, what goes where, keeping noise down and backing Slack up with on-call paging.
  • All features: Every VitalRix product in one place: uptime monitoring, APM, logs, real user monitoring, alerts, on-call, SLOs, dashboards, notebooks and more.

Connect webhooks in a few minutes

Create a free account, add a monitor and connect your tools. No credit card needed.