Webhook HMAC signatures (2026):timestamps, replay protection, raw bodies

webhook7 min readMay 02, 2026

Author: DevStudio.it

TL;DR

  • webhook hmac signature verification 2026
  • For backends receiving webhooks from payments, CI, and partners.

Who this is for

  • For backends receiving webhooks from payments, CI, and partners.

Keyword (SEO)

webhook hmac signature verification 2026

Algorithm

  • Read raw body before JSON parse-otherwise signatures never match.
  • HMAC-SHA256(secret, payload) or vendor scheme.
  • Constant-time compare (crypto.timingSafeEqual).

Replay

  • Vendor timestamp header + e.g. 5 minute window.
  • Store event_id with TTL to drop duplicates.

Common mistakes

  • Read raw body before JSON parse-otherwise signatures never match.
  • HMAC-SHA256(secret, payload) or vendor scheme.

FAQ

401 vs 400 on bad signature?

Often 400/401 without details-avoid leaking validation hints.

Want help shipping this?

Related posts

API rate limiting & throttling patterns (2026) for SaaS and lead forms
7 min read
API integrations, how they work and popular solutions in 2026
11 min read
Stripe Customer Portal, subscriptions, webhooks and Next.js in 2026
5 min read

About the author

We build fast websites, web/mobile apps, AI chatbots and hosting setups — with a focus on SEO and conversion.

Recommended links

From theory to production — Branchly, our hosting stack and shipped work.

Like how we think? Let's build something together.

Start project configuration