# API Webhook Signature Verification

> Verify webhook signatures with HMAC-SHA256 over the raw body, constant-time compare, timestamp replay windows, and idempotent handling. Use when implementing or reviewing webhook receivers or providers.

- Skill: `deangrant/api-webhook-signature-verification` (Agent Skill, multi-file: 4 files)
- Install (CLI): `npx skillmds@latest add deangrant/api-webhook-signature-verification`
- Raw SKILL.md: https://api.skillmd.com/api/skills/deangrant/api-webhook-signature-verification/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Integrations & APIs
- Author: deangrant (https://skillmd.com/u/deangrant)
- Updated: 2026-09-17
- Page: https://skillmd.com/skills/deangrant/api-webhook-signature-verification

---


# Webhook Signature Verification

Use this skill when **signing or verifying** webhook payloads.

---

## 1. Provider

Sign the **raw body** bytes (not re-serialized JSON) with HMAC-SHA256 (or
documented scheme). Include timestamp in the signed content. Rotate secrets.

---

## 2. Receiver

- Read raw body before JSON parse.
- Compute expected HMAC; **constant-time** compare.
- Reject if timestamp outside skew window (replay).
- Dedupe on event id (idempotent processing).

---

## 3. Quick checklist

- [ ] Raw body signed/verified.
- [ ] Constant-time compare.
- [ ] Timestamp window enforced.
- [ ] Secrets not logged; rotation supported.
- [ ] Idempotent event handling.

See [reference.md](reference.md) and [examples.md](examples.md).

