Skip to main content

Webhook receiver helpers

Marea signs every webhook with HMAC-SHA256 over "<unix-ts>.<rawBody>" using the endpoint’s raw signing secret (the 64-char hex string returned at create / rotate time). The signature is in the X-Marea-Signature request header:
Reject any webhook where |now - t| > 300 (5-minute replay window).

Node.js / TypeScript

Python

Multiple endpoints, one receiver

If you serve multiple endpoints from one HTTP server, dispatch on the X-Marea-Endpoint-Id header and look up the corresponding secret:

Source disambiguation (developer vs merchant)

The X-Marea-Source header tells you which kind of activity produced the delivery: Either way, the signature is computed with the same algorithm using the endpoint’s own signingSecret. You do not need to maintain a different verifier per source.

Idempotency

Every envelope includes an eventId (UUID v4) as a stable idempotency key across retries:
Marea retries failed deliveries up to 3 times (0s / +30s / +5min). The retry payload uses the same eventId.

Detecting in-flight secret rotation

Every delivery includes X-Marea-Signing-Version (an integer that bumps each time you rotate the endpoint’s secret). If you receive a delivery with a version number you’ve never seen, assume rotation happened — pull the new secret from your secret manager (or the dashboard reveal modal if you triggered the rotate yourself) before retrying signature verification.