---
title: "How do I verify an overads webhook signature?"
description: "Compute an HMAC-SHA256 of the raw request body with your endpoint's whsec secret and compare the hex result with the X-Overads-Signature header."
canonical_url: https://overads.io/help/verify-webhook-signature
md_url: https://overads.io/help/verify-webhook-signature.md
updated: 2026-11-27
---

# How do I verify an overads webhook signature?

Included in Growth, the one overads plan. API keys, webhooks and the MCP server are part of the plan.

Every webhook overads sends carries an `X-Overads-Signature` header: the hex HMAC-SHA256 of the raw request body, keyed with your endpoint's signing secret. Compute the same value over the bytes you received, compare the two in constant time, and only then parse the JSON.

## Why verify

Your webhook URL is a public address. Anyone who learns it can send a request that looks like a published post or an approved post. The signature proves two things: the request was made by someone holding your endpoint's secret, and the body was not changed on the way. A receiver that skips the check will act on forged events.

## What arrives with each delivery

| Header | Value |
| --- | --- |
| `X-Overads-Signature` | Hex HMAC-SHA256 of the raw request body, keyed with the endpoint secret |
| `X-Overads-Event` | The event name, the same as `event` in the body |
| `X-Overads-Delivery` | The delivery id. A retry carries the same id, so use it to drop repeats |
| `Content-Type` | `application/json` |
| `User-Agent` | `overads-webhooks/1` |

The body is one JSON object, the same shape for every event.

```json
{
  "version": "1",
  "event": "post.published",
  "timestamp": "2026-12-04T03:30:04.212Z",
  "data": {
    "postId": "b6a0f6b2-1d0e-4d4a-8f2f-0c1f2a3b4c5d",
    "platform": "linkedin",
    "connectionId": "3f1c1a2e-6b2a-4a0e-9a5f-0d5a7d0f2b11",
    "permalink": "https://www.linkedin.com/feed/update/urn:li:share:7241…",
    "publishedAt": "2026-12-04T03:30:04.000Z"
  }
}
```

## The check, step by step

1. Read the raw bytes of the request body, before any JSON parsing.
2. Compute HMAC-SHA256 over those bytes with the `whsec_` secret as the key, and write the result as lowercase hex.
3. Read the `X-Overads-Signature` header, trim it and lowercase it.
4. Compare the two with a constant-time comparison. If they differ, or the header is missing, answer `401` and stop.
5. Parse the JSON and handle the event.
6. Answer with any 2xx status within 10 seconds.

## Node (Express)

Node (Express):

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

const app = express();

app.post("/overads", express.raw({ type: "application/json" }), (req, res) => {
  const expected = Buffer.from(
    createHmac("sha256", process.env.OVERADS_WEBHOOK_SECRET).update(req.body).digest("hex"),
    "hex",
  );
  const given = Buffer.from(String(req.get("X-Overads-Signature") ?? "").trim().toLowerCase(), "hex");
  if (given.length !== expected.length || given.length === 0 || !timingSafeEqual(given, expected)) {
    return res.status(401).end();
  }
  const envelope = JSON.parse(req.body.toString("utf8"));
  // envelope.event, envelope.data, req.get("X-Overads-Delivery")
  res.status(204).end();
});
```

## Python (Flask)

Python (Flask):

```python
import hashlib, hmac, os
from flask import Flask, request, abort

app = Flask(__name__)
SECRET = os.environ["OVERADS_WEBHOOK_SECRET"].encode()

@app.post("/overads")
def overads_webhook():
    raw = request.get_data()  # raw bytes, before any JSON parsing
    expected = hmac.new(SECRET, raw, hashlib.sha256).hexdigest()
    given = (request.headers.get("X-Overads-Signature") or "").strip().lower()
    if not given or not hmac.compare_digest(given, expected):
        abort(401)
    envelope = request.get_json(force=True)
    return "", 204
```

## Why a correct-looking check fails

| Symptom | Likely cause | Fix |
| --- | --- | --- |
| Every delivery fails the check | The body was parsed and written out again before hashing. Whitespace and key order change the digest. | Hash the raw bytes. In Express use `express.raw`; in Flask use `request.get_data()`. |
| It worked, then stopped | The secret was rotated. Deliveries signed with the old secret stop verifying as soon as a new one is minted. | Put the new secret in the receiver. |
| Fails on one endpoint only | Each endpoint has its own secret, and the receiver is using another endpoint's. | Use the secret shown when that endpoint was added. |
| Fails behind a proxy | A proxy or framework middleware changed the body, for example by re-encoding it. | Verify before any middleware touches the body. |
| The comparison throws | The header was empty or not hex, so the two values differ in length. | Check the length first and answer `401`. |

## Check a signature by hand

To see what the header should hold for a body you captured, compute the same value on the command line. Save the body exactly as it arrived, with no added line break.

bash:

```bash
openssl dgst -sha256 -hmac "$OVERADS_WEBHOOK_SECRET" < body.json
```

The hex value printed should equal the `X-Overads-Signature` header of that delivery.

## What your receiver should answer

| Case | Answer | What overads does next |
| --- | --- | --- |
| The signature matches | Any 2xx | Marks the delivery Delivered. |
| The signature is missing or wrong | `401` | Counts a failed attempt and retries. A forged request is simply refused. |
| A delivery id you have already handled | Any 2xx, without doing the work again | Marks it Delivered. |
| An event your code does not use | Any 2xx | Marks it Delivered. Untick the event on the endpoint to stop receiving it. |
| Your own system is down | A `5xx`, or no answer | Retries, and pauses the endpoint after 20 failures in a row. |

## Try it with a test ping

1. Open Settings > Webhooks.
2. Press Test on the endpoint. overads queues a signed `ping` event.
3. Press Deliveries. Delivered means your receiver verified the ping and answered 2xx. A `401` in the Status column means your check refused it.

`ping` is only ever sent by the Test button or the test route. It cannot be subscribed to, and its `data` holds the endpoint id and a message.

## Answer fast, work later

overads waits 10 seconds for a 2xx answer. Anything else, a timeout included, counts as a failed attempt and is retried: three attempts in all, the second 10 seconds after the first failure and the third 1 minute after the second. Verify, put the event on your own queue, answer `204`, and do the real work afterwards.

## Handle repeats

A retry carries the same `X-Overads-Delivery` id as the first attempt. If your receiver did the work but its answer was lost, the retry would do the work twice. Store each delivery id you have handled and skip one you have seen. A delivery sent again with Redeliver is a new delivery with a new id and the old payload.

## Rotate the secret safely

1. Have the place where the receiver reads its secret ready to change.
2. In Settings > Webhooks, press Rotate secret on the endpoint and confirm with Rotate.
3. Copy the new secret from the New signing secret dialog. This is the only time it is shown.
4. Update the receiver straight away, then press Test.

> Missing readings in a payload are null, never 0 or an empty string. `permalink` is null when the platform returned none.

## Common questions

### Which algorithm signs overads webhooks?

HMAC-SHA256 over the raw request body, keyed with the endpoint's signing secret and written as hex in the X-Overads-Signature header.

### Where do I find the signing secret?

It is shown once, when the endpoint is added in Settings > Webhooks or created over the API. If you did not keep it, press Rotate secret to mint a new one.

### How long do I have to answer a webhook?

10 seconds. Any 2xx status inside that time counts as delivered; anything else is a failed attempt.

### How do I stop handling the same event twice?

Keep the X-Overads-Delivery ids you have handled. A retry carries the same id as the first attempt.

### What happens if my receiver stays down?

After 20 failed attempts in a row the endpoint pauses itself and the workspace is told. Fix the receiver, then press Resume.

## Related

- [How do I set up an overads webhook?](https://overads.io/help/set-up-webhook)
- [What do overads API error codes mean?](https://overads.io/help/api-error-codes)
- [Does overads have an API and an MCP server?](https://overads.io/help/api-and-mcp)
- [Webhooks (developer docs)](https://overads.io/docs/webhooks)
- [Webhooks API (developer docs)](https://overads.io/docs/api/webhooks)

Updated 2026-11-27. Source: https://overads.io/help/verify-webhook-signature
