For each webhook request:
- Read the RAW body exactly as sent by the server (watch out for middlewares that parse/modify it).
- Compute
HMAC_SHA256(secret, rawBody).
- Convert to lowercase hex and compose
sha256=<hex>.
- Compare in constant time with the value in the
X-Integration-Signature header.
Reject the request if the time skew of the Date header (if sent) exceeds 5 minutes.
Node.js (Express)
Python (FastAPI / Starlette)
Retries and idempotency
If your endpoint responds with >=500 or does not respond in time, MarIA will retry the delivery.
Common errors
Reading an already-parsed req.body loses the RAW bytes. Use middleware to preserve the buffer before any JSON parser.