Beacon

Integrations

Outgoing Webhooks

When an incident is created or updated, Beacon sends HTTP POST requests to your configured webhook URLs with the full event payload. Use webhooks to integrate with Slack, PagerDuty, Discord, or any custom system that accepts HTTP callbacks.

Setting up webhooks

Navigate to your status page, open the Webhooks tab, and click Add Webhook. Enter the URL where Beacon should send event payloads.

Beacon generates a unique signing secret for each webhook and stores it encrypted. Use Reveal or Copy next to the endpoint in the Webhooks list to get it, and store it securely on your server -- you need it to verify webhook signatures.

To rotate a secret, delete the webhook and add it again; the new endpoint gets a fresh secret.

Events

Beacon sends webhooks for the following events:

Event Triggered when
incident.opened A new incident is created (manually or by auto-detection)
incident.updated An incident receives a new update, is resolved, or has its properties changed

Payload format

Every webhook request includes a JSON body with the full event context:

{
  "event": "incident.opened",
  "sent_at": "2026-04-04T14:32:00Z",
  "workspace": {
    "slug": "acme",
    "name": "Acme Inc"
  },
  "status_page": {
    "slug": "acme-cloud",
    "name": "Acme Cloud",
    "url": "https://usebeacon.pro/status/acme/acme-cloud"
  },
  "incident": {
    "id": "inc_01HX9Z...",
    "title": "API Health is down",
    "impact": "major",
    "state": "investigating",
    "resolved": false,
    "created_at": "2026-04-04T14:32:00Z",
    "updated_at": "2026-04-04T14:32:00Z",
    "updates": [
      {
        "id": "upd_01HX9Z...",
        "message": "Monitor detected failure: HTTP 503 returned",
        "created_at": "2026-04-04T14:32:00Z"
      }
    ]
  },
  "change": {
    "field": "state",
    "from": null,
    "to": "investigating"
  }
}

The change object describes what triggered the webhook. For incident.opened events, the from field is null. For updates, it shows the previous value.

Request details

Each webhook delivery is an HTTP POST with the following headers:

Header Value
Content-Type application/json
User-Agent Beacon-Webhook/1
X-Beacon-Event The event name, e.g. incident.opened
X-Beacon-Signature sha256={hex_signature}
X-Beacon-Timestamp Unix time (seconds) the request was signed

Signature verification

Every delivery carries two headers: X-Beacon-Timestamp (Unix seconds when the request was signed) and X-Beacon-Signature in the form sha256={hex}, where {hex} is the HMAC-SHA256 hex digest, keyed by the webhook's signing secret, of the timestamp, a literal dot, and the raw request body:

signature = "sha256=" + hex(hmac_sha256(secret, timestamp + "." + raw_body))

To verify: compute the signature over the exact bytes you received (before any JSON parsing), compare it to the header with a constant-time comparison, and reject requests whose timestamp is more than 5 minutes from your clock to block replays. Retries are re-signed with a fresh timestamp.

PHP

$body      = file_get_contents('php://input');
$secret    = getenv('BEACON_WEBHOOK_SECRET');
$timestamp = $_SERVER['HTTP_X_BEACON_TIMESTAMP'] ?? '';
$header    = $_SERVER['HTTP_X_BEACON_SIGNATURE'] ?? '';

$expected = 'sha256=' . hash_hmac('sha256', $timestamp . '.' . $body, $secret);

if (! ctype_digit($timestamp)
    || abs(time() - (int) $timestamp) > 300
    || ! hash_equals($expected, $header)) {
    http_response_code(403);
    exit('Invalid signature');
}

$event = json_decode($body, true);

Node.js

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

// rawBody: the unparsed request body (e.g. express.raw({ type: 'application/json' }))
function verifyBeaconWebhook(rawBody, headers, secret) {
  const timestamp = headers['x-beacon-timestamp'] ?? '';
  const signature = headers['x-beacon-signature'] ?? '';

  if (!/^\d+$/.test(timestamp)) return false;
  if (Math.abs(Date.now() / 1000 - Number(timestamp)) > 300) return false;

  const expected = Buffer.from('sha256=' + createHmac('sha256', secret)
    .update(`${timestamp}.`)
    .update(rawBody)
    .digest('hex'));
  const received = Buffer.from(signature);

  return received.length === expected.length && timingSafeEqual(received, expected);
}

Retry behavior

Beacon makes up to 4 delivery attempts per webhook event: the first, then retries 10 seconds, 1 minute and 5 minutes later.

Response Behavior
2xx Success. No retry.
4xx Client error. No retry. Fix the issue on your end.
5xx Server error. Retried (10s, 1 min, 5 min).
Timeout No response within 10 seconds. Retried (10s, 1 min, 5 min).

After 4 failed attempts, the delivery is abandoned.

Timeout

Each webhook delivery has a 10-second timeout. If your server does not respond within 10 seconds, the attempt is considered failed and will be retried (if retries remain).

Tip: Respond with a 200 immediately and process the payload asynchronously. This avoids timeout issues even for complex integrations.

Best practices

  • Respond quickly — Return a 2xx status as fast as possible. Queue the payload for async processing if your handler needs to do significant work.
  • Verify signatures — Always check the X-Beacon-Signature header using a constant-time comparison function.
  • Filter by event type — Use the X-Beacon-Event header or the event field in the body to route different events to different handlers.
  • Handle duplicates — In rare cases (e.g., network issues), you may receive the same event twice. Use the incident id and updated_at to deduplicate.

Example: Slack integration

Forward Beacon webhook events to a Slack channel using a simple proxy script. First, create a Slack Incoming Webhook URL in your Slack workspace settings.

Then set up a lightweight endpoint that receives Beacon webhooks and forwards them to Slack:

// Express.js example
import express from 'express';

const app = express();
app.use(express.json());

app.post('/webhooks/beacon', async (req, res) => {
  // Respond immediately
  res.sendStatus(200);

  const { event, incident, status_page } = req.body;
  const emoji = event === 'incident.opened' ? ':red_circle:' : ':large_blue_circle:';
  const text = `${emoji} *${incident.title}*\n`
    + `Impact: ${incident.impact} | State: ${incident.state}\n`
    + `Page: ${status_page.url}`;

  await fetch(process.env.SLACK_WEBHOOK_URL, {
    method: 'POST',
    headers: { 'Content-Type': 'application/json' },
    body: JSON.stringify({ text }),
  });
});