Skip to main content

Verify signatures

Every webhook delivery includes two headers you must verify:
  • X-Prudra-Signature — HMAC-SHA256 of the raw request body
  • X-Prudra-Timestamp — Unix timestamp of delivery
Signature verification confirms the webhook was sent by Prudra and the body was not tampered with. Timestamp verification prevents replay attacks.

Verification with the SDK

Manual verification

If you’re not using the SDK:

Signature format

The X-Prudra-Signature header value is:
The signed payload is:
Where <timestamp> is the value of X-Prudra-Timestamp and <raw-body> is the raw bytes of the request body.

Critical: use raw body

express.json() parses and discards the raw bytes. You must use express.raw() on the webhook route before express.json():
If express.json() has already parsed the body, req.body is a JavaScript object, not a Buffer — signature verification will fail.