# How to Receive PingRoom Room Events with an Outgoing Webhook

> Configure one Pro Room webhook, verify PingRoom’s delivery-bound signature over the raw request, and make retries safe with an idempotency key.

- Published: 2026-11-14
- Author: PingRoom
- Category: How-to
- Topics: outgoing webhook notifications, PingRoom outgoing webhook, verify webhook HMAC signature, webhook idempotency
- Canonical: https://pingroom.io/blog/receive-pingroom-room-events-outgoing-webhook
- Cover image: https://pingroom.ams3.cdn.digitaloceanspaces.com/blog/receive-pingroom-room-events-outgoing-webhook/receive-pingroom-room-events-outgoing-webhook-cover.webp
- Cover description: Pingo and two PingRoom teammates arrange a secure cable path between a small signal room and a server cabinet.

To receive a Room’s Pings on your server, give that Room one public HTTPS endpoint in **Room settings → Connections → Outgoing Webhook**, select the events you need, send a test, and turn on **Deliver pings**. Your receiver should verify `X-PingRoom-Signature-V2` against the untouched request bytes before it parses JSON, then process `X-PingRoom-Delivery` idempotently.

Outgoing webhooks are a Pro feature and only the Room owner can configure one. They send Room events from PingRoom to a server you control; they are different from an [incoming webhook that sends a Ping into a Room](/blog/webhook-to-push-notification).

_On the cover: [Pingo the Pigeon™](/Pingo), PingRoom’s official mascot and fictional CMO, supervises a miniature cable run while two human teammates own the real configuration and security decisions. The scene is an illustration, not a product screen or delivery guarantee._

## Prepare the receiver before enabling delivery

Your endpoint must be a public HTTPS URL on port 443. PingRoom rejects embedded credentials, private or reserved addresses, and redirects. Use a dedicated receiver hostname where practical.

The receiver needs:

- the Room’s signing secret, stored as a server-side secret;
- access to the exact raw request bytes before a JSON body parser changes them;
- a clock close enough to reject timestamps more than 300 seconds in the past or future;
- a durable store with a unique constraint on the delivery ID;
- a fast path that records or queues an accepted event before returning `2xx`.

Do not place the signing secret in browser code, logs, analytics, or a shared document. Treat the event body as sensitive too: it can include the Room, message, sender, source, custom data, and response state.

## Verify the v2 signature over raw bytes

Each new delivery includes a lower-case hexadecimal HMAC-SHA256 signature. The v2 signed value is:

```text
v2\n{timestamp}\n{deliveryId}\n{rawBody}
```

This dependency-free Node example requires v2, checks freshness, and compares decoded digests in constant time:

```js
import { createHmac, timingSafeEqual } from "node:crypto";

export function verifyPingRoomV2({
  rawBody,
  headers,
  secret,
  now = Date.now(),
}) {
  const timestamp = headers.get("x-pingroom-timestamp") ?? "";
  const deliveryId = headers.get("x-pingroom-delivery") ?? "";
  const suppliedHex = headers.get("x-pingroom-signature-v2") ?? "";

  if (!/^[0-9]{1,12}$/.test(timestamp)) return { ok: false };
  if (Math.abs(now / 1000 - Number(timestamp)) > 300) return { ok: false };
  if (!/^[!-~]{1,255}$/.test(deliveryId)) return { ok: false };
  if (!/^[0-9a-f]{64}$/i.test(suppliedHex)) return { ok: false };

  const signed = Buffer.concat([
    Buffer.from(`v2\n${timestamp}\n${deliveryId}\n`, "utf8"),
    rawBody,
  ]);
  const expected = createHmac("sha256", secret).update(signed).digest();
  const supplied = Buffer.from(suppliedHex, "hex");

  return {
    ok:
      supplied.length === expected.length &&
      timingSafeEqual(supplied, expected),
    deliveryId,
  };
}
```

If a v2 header is present, never fall back to a valid legacy v1 signature after v2 fails. New receivers can simply require v2, as this example does. Parse the JSON only after verification succeeds.

![Pingo stands beside a blank clipboard while two PingRoom teammates inspect a plain junction box and arrange three delivery tokens in one tray.](https://pingroom.ams3.cdn.digitaloceanspaces.com/blog/receive-pingroom-room-events-outgoing-webhook/receive-pingroom-room-events-outgoing-webhook-1.webp)

Pingo’s clipboard is deliberately blank. Real secrets, payloads, and delivery IDs belong in controlled server-side systems, not an editorial prop.

## Make retries idempotent

A valid signature proves authenticity and integrity; it does not mean the event will arrive only once. PingRoom can retry a delivery after a timeout or transient response. Two attempts with the same authenticated `X-PingRoom-Delivery` value are one logical delivery.

Use the delivery ID as a unique key in durable storage:

1. Verify v2 and its timestamp.
2. Begin a transaction.
3. Insert the delivery ID into a table with a unique constraint.
4. If the insert conflicts, return the same successful acknowledgement without repeating the side effect.
5. Store or enqueue the event in that transaction.
6. Return `2xx`, then let a worker perform slower processing.

An in-memory `Set` is useful for a local fixture, but it is not production idempotency: it disappears on restart and is not shared across instances.

Our companion fixture exercised valid v2, altered-body, bad-signature, stale-past, future-timestamp, missing-v2, and repeated-delivery cases with locally generated HMACs and an in-memory stand-in. It did not call a live PingRoom Room, public endpoint, or downstream service.

## Configure the Room

Once the receiver is deployed:

1. Open the Room and go to **Settings → Connections → Outgoing Webhook**.
2. Enter the endpoint URL and select **Save**. Saving a changed endpoint pauses delivery.
3. Open **Events**. Keep **All events** only when every Room event belongs in this system; otherwise choose **Only selected** and select the smallest useful set.
4. Open **Signing secret** and copy it into your server-side secret store.
5. Select **Send test**. Confirm your receiver verified, recorded, and acknowledged the test.
6. Turn on **Deliver pings**.
7. Send one harmless real Ping and confirm one logical job is created, even if you replay the captured fixture locally.

The recent-delivery status is a configuration aid, not a substitute for receiver logs and queue monitoring. If you change the endpoint later, test it and explicitly turn delivery back on.

## Read failure and retry behavior correctly

PingRoom’s delivery worker can make up to three HTTP attempts for a target delivery on transient failure, with a 10-second request timeout and short waits between attempts. Repeated counted failures can disable the Room webhook. A notification event can also be retried before the delivery worker receives it, which is another reason to deduplicate by the authenticated delivery ID.

Return `2xx` only after your system has safely accepted the event. A quick `2xx` before any durable write can lose work; a slow response after a successful write can invite a retry. Queue-before-acknowledgement is the useful middle path.

For the complete event vocabulary, configuration API, legacy v1 compatibility, retry rules, and target-address checks, keep the [outgoing webhook reference](/documents/webhooks) beside your implementation. The [outgoing webhook feature overview](/features/outgoing-webhook) is the shorter product-level explanation. For framework-neutral security review, compare the receiver against the [OWASP Webhook Security Cheat Sheet](https://cheatsheetseries.owasp.org/cheatsheets/Webhook_Security_Cheat_Sheet.html) and [GitHub’s webhook operating practices](https://docs.github.com/en/webhooks/using-webhooks/best-practices-for-using-webhooks); PingRoom’s own signed inputs and retry rules remain authoritative for this endpoint.
