CtrlK
BlogDocsLog inGet started
Tessl Logo

webhook-handler-patterns

Best practices for webhook handlers. Use when implementing the handler sequence (verify first, parse second, handle idempotently), idempotency, error handling, retry logic, or framework-specific issues with Express, Next.js, or FastAPI.

89

1.12x
Quality

87%

Does it follow best practices?

Impact

89%

1.12x

Average score across 3 eval scenarios

SecuritybySnyk

Advisory

Suggest reviewing before use

SKILL.md
Quality
Evals
Security

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

  • references/handler-sequence.md - Verify first, parse second, handle idempotently third

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
2xxSuccessNo retry
4xxClient errorUsually no retry (except 429)
5xxServer errorRetry with backoff
429Rate 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

  • stripe-webhooks - Stripe payment webhook handling
  • shopify-webhooks - Shopify e-commerce webhook handling
  • github-webhooks - GitHub repository webhook handling
  • resend-webhooks - Resend email webhook handling
  • chargebee-webhooks - Chargebee billing webhook handling
  • clerk-webhooks - Clerk auth webhook handling
  • elevenlabs-webhooks - ElevenLabs webhook handling
  • openai-webhooks - OpenAI webhook handling
  • paddle-webhooks - Paddle billing webhook handling
  • hookdeck-event-gateway - Webhook infrastructure that replaces your queue — guaranteed delivery, automatic retries, replay, rate limiting, and observability for your webhook handlers
Repository
hookdeck/webhook-skills
Last updated
Created

Is this your skill?

If you maintain this skill, you can claim it as your own. Once claimed, you can manage eval scenarios, bundle related skills, attach documentation or rules, and ensure cross-agent compatibility.