Webhook-skills webhook-handler-patterns

install
source · Clone the upstream repo
git clone https://github.com/hookdeck/webhook-skills
Claude Code · Install into ~/.claude/skills/
T=$(mktemp -d) && git clone --depth=1 https://github.com/hookdeck/webhook-skills "$T" && mkdir -p ~/.claude/skills && cp -r "$T/skills/webhook-handler-patterns" ~/.claude/skills/hookdeck-webhook-skills-webhook-handler-patterns && rm -rf "$T"
manifest: skills/webhook-handler-patterns/SKILL.md
source content

Webhook Handler Patterns

When to Use This Skill

  • Following the correct webhook handler order (verify → parse → handle idempotently)
  • Implementing idempotent webhook handlers
  • Handling errors and configuring retry behavior
  • Understanding framework-specific gotchas (raw body, middleware order)
  • Building production-ready webhook infrastructure

Resources

Handler Sequence

Best Practices

Framework Guides

Quick Reference

Handler Sequence

  1. Verify signature first — Use raw body; reject invalid requests with 4xx.
  2. Parse payload second — After verification, parse or construct the event.
  3. Handle idempotently third — Check event ID, then process; return 2xx for duplicates.

See references/handler-sequence.md for details and links to provider verification and idempotency patterns.

Response Codes

CodeMeaningProvider Behavior
2xx
SuccessNo retry
4xx
Client errorUsually no retry (except 429)
5xx
Server errorRetry with backoff
429
Rate limitedRetry after delay

Idempotency Checklist

  1. Extract unique event ID from payload
  2. Check if event was already processed
  3. Process event within transaction
  4. Store event ID after successful processing
  5. Return success for duplicate events

Related Skills