> Receive RestoreCord verification, firewall and snapshot events as signed JSON. Verify X-Signature-256 with HMAC-SHA256, route by event and handle no retries.

Source: https://restorecord.watch/webhook-events

# Receive signed RestoreCord webhook events in your own stack

Discord logs are for people. Custom webhook events are for software: signed JSON requests your services can trust, route and store. This guide covers the receiver end to end.

[Get Enterprise](https://restorecord.com/pricing)[Webhook docs](https://restorecord.com/docs/webhooks)

Short answer

Enable Custom Webhook in your server's Security tab (Enterprise), save your HTTPS endpoint and copy the one-time signing secret. Verify the X-Signature-256 header as HMAC-SHA256 of the raw body, route by X-Webhook-Event, and respond 2xx fast because failed deliveries are not retried.

## When to use events instead of logs

Choose events when something other than a moderator needs to react: writing every verification to your own database, opening a ticket when a member is denied, feeding a risk model, or building a dashboard next to your other business metrics. The Discord [log channel](https://restorecord.watch/verification-logs) keeps running alongside, so staff lose nothing.

## Configure delivery

1. 1Deploy an HTTPS route that accepts JSON POST requests.
2. 2In **Servers → Manage → Security**, switch on **Custom Webhook** and paste the URL. It can also be set through the API with `PATCH /api/v3/servers/{serverId}` and a `webhookUrl` field.
3. 3Copy the webhook secret into your secret manager immediately. It is shown only once; regenerate it if it is ever lost or exposed.

## What a request looks like

Each delivery carries the event name twice: once in a header for fast routing and once in the body.

Example deliveryhttp

```
POST /restorecord/events HTTP/1.1
Content-Type: application/json
X-Webhook-Event: member.denied
X-Signature-256: sha256=<hex digest>

{
  "event": "member.denied",
  "timestamp": "2026-10-19T18:30:00.000Z",
  "server": { "guildId": "123456789012345678", "name": "Example Server" },
  "data": { "userId": "345678901234567890", "username": "harbor_pine", "reason": "vpn" }
}
```

## Verify the signature first

RestoreCord signs the exact bytes it sends with HMAC-SHA256 and your secret. Compute the same digest over the **raw** request body and compare in constant time. Strip the `sha256=` prefix before comparing.

verify.tsts

```
import crypto from "crypto";

export function isFromRestoreCord(rawBody: Buffer, header: string, secret: string) {
    const expected = crypto.createHmac("sha256", secret).update(rawBody).digest("hex");
    const received = header.replace(/^sha256=/, "");
    const a = Buffer.from(expected, "hex");
    const b = Buffer.from(received, "hex");
    return a.length === b.length && crypto.timingSafeEqual(a, b);
}
```

Do not parse and re-stringify the JSON before checking. Changed whitespace or key order produces a different digest and every request will look forged.

## Event names to route

| Event               | Fires when                                                                                            |
| ------------------- | ----------------------------------------------------------------------------------------------------- |
| member.verified     | A member completes verification                                                                       |
| member.denied       | Verification is refused; reason can be firewall, blacklist, vpn, wireless, alt, guild or account\_age |
| member.deauthorized | A member removes the RestoreCord app in Discord                                                       |
| firewall.block      | The firewall denies a verification request                                                            |
| firewall.allow      | A rule or bypass explicitly lets a request through                                                    |
| firewall.password   | Someone submits a firewall password                                                                   |
| snapshot.create     | A server snapshot starts                                                                              |
| snapshot.restore    | A snapshot restore starts                                                                             |

Treat unknown fields as additive, and accept nullable values: sensitive fields such as IP address depend on server settings and plan.

## A minimal receiver

The shape is the same in any framework: read the raw body, check the signature, acknowledge, then hand the event to a queue. Here it is with Express, using a raw body parser so the bytes stay untouched.

server.tsts

```
import express from "express";
import { isFromRestoreCord } from "./verify";

const app = express();

app.post("/restorecord/events", express.raw({ type: "application/json" }), (req, res) => {
    const signature = req.header("X-Signature-256") ?? "";
    if (!isFromRestoreCord(req.body, signature, process.env.RESTORECORD_WEBHOOK_SECRET!)) {
        return res.sendStatus(401);
    }
    res.sendStatus(204); // acknowledge first
    queue.push({ type: req.header("X-Webhook-Event"), body: JSON.parse(req.body.toString("utf8")) });
});
```

## What teams build with it

| Event               | Typical automation                                                                |
| ------------------- | --------------------------------------------------------------------------------- |
| member.verified     | Add the member to a CRM or welcome sequence, or log the join in your own database |
| member.denied       | Open a moderation ticket when the reason is blacklist or alt                      |
| firewall.block      | Count blocks per minute and page on-call when the rate jumps                      |
| member.deauthorized | Flag subscribers who removed the app so support can follow up                     |
| snapshot.create     | Record backup activity in an audit trail next to your other infrastructure        |

Keep test traffic private. Pointing production events at a public request bin sends member data outside your systems, so use a staging endpoint you control.

## Design for best-effort delivery

* Requests are fire-and-forget; a failed or non-2xx delivery is not retried.
* RestoreCord waits a few seconds at most, so acknowledge first and process in a queue.
* Delivery never blocks the verification itself, so a slow receiver cannot lock members out.
* Make handlers idempotent so a duplicate never creates a duplicate ticket or row.
* Alert on your own receiver errors, since nothing upstream will tell you about a gap.

Need history rather than a stream? Pull trends from the analytics endpoints with a `READ_ANALYTICS` key, as described in the [analytics guide](https://restorecord.watch/reading-analytics). Back to [RestoreCord Monitor](https://restorecord.watch/).

## Build a receiver in four steps

1. 1  
### Stand up an HTTPS endpoint  
Deploy a route that accepts JSON POST requests and returns a 2xx response quickly.
2. 2  
### Save the URL and copy the secret  
Enable Custom Webhook in the Security tab, paste your endpoint and store the one-time signing secret.
3. 3  
### Verify every signature  
Compute HMAC-SHA256 over the raw body with your secret and compare it to the X-Signature-256 header.
4. 4  
### Route by event name  
Read X-Webhook-Event, hand each event to its handler and make handlers safe to run twice.
[API reference](https://restorecord.com/docs/api)

## Webhook event questions

### 

### 

### 

## Put RestoreCord activity where your tools live

Signed events, a clear schema and no polling. Point Enterprise webhooks at your endpoint and start routing.

[Upgrade to Enterprise](https://restorecord.com/pricing)[View pricing](https://restorecord.com/pricing)
