webhook-integration-patterns

Designs webhook providers and consumers with signature verification, retries, and idempotent processing.

Updated May 16, 2026
One-click install
npx skills add https://github.com/organvm-i-theoria/_agent-ontology --skill webhook-integration-patterns-organvm-i-theoria
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: webhook-integration-patterns
Source: https://github.com/organvm-i-theoria/_agent-ontology/tree/main/.agents/skills/webhook-integration-patterns
Command: npx skills add https://github.com/organvm-i-theoria/_agent-ontology --skill webhook-integration-patterns-organvm-i-theoria

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? Building webhook integrations that survive real-world conditions—duplicate deliveries, replay attacks, endpoint failures, and out-of-order events—requires careful design that most teams get wrong on the first attempt. ## Core Features & Use Cases - Provider Design: Event schema patterns, HMAC-SHA256 signature generation, retry schedules with exponential backoff, and dead letter queues for failed deliveries. - Consumer Design: Signature verification with timestamp validation, idempotent processing via event ID deduplication, and queue-based async handling that responds within 5 seconds. - Security & Operations: Secret rotation with grace periods, IP allowlisting for Stripe/GitHub/Twilio, rate limiting, and testing workflows using ngrok, Stripe CLI, and webhook.site. - Use Case: When integrating Stripe payment events into your application, use this Skill to implement a verified endpoint that deduplicates events, queues processing, and handles subscription lifecycle webhooks correctly. ## Quick Start Ask the agent to design a secure webhook consumer endpoint for Stripe payment events with signature verification and idempotent processing.

Frequently Asked Questions about webhook-integration-patterns

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I verify webhook signatures in Python?▼

Verify webhook signatures using HMAC-SHA256: compute the expected hash over the timestamp plus raw payload with your secret, then compare using hmac.compare_digest for constant-time comparison. Always validate the timestamp is within 5 minutes to prevent replay attacks.

How to handle duplicate webhook events idempotently?▼

Handle duplicate webhooks by tracking each event's unique ID in Redis or a database before processing. Acquire a short-lived lock, check if the event was already processed, and store the result with a multi-day TTL so retries return success without reprocessing.

What retry strategy should webhook providers use?▼

Webhook providers should retry with exponential backoff across at least 5 attempts, such as 10 seconds, 1 minute, 5 minutes, 30 minutes, 1 hour, and up to 24 hours. After exhausting retries, move the event to a dead letter queue for manual review and replay.

How do I test webhooks locally during development?▼

Test webhooks locally using ngrok, localtunnel, or Cloudflare Tunnel to expose your localhost server with a public URL. Provider CLIs like stripe listen can forward events directly, and webhook.site lets you inspect raw incoming payloads.

Why does my webhook endpoint keep timing out?▼

Webhook timeouts happen when you process events synchronously before responding. Acknowledge receipt with a 200 response within 5 seconds, enqueue the event for asynchronous processing, and let a background worker handle the actual business logic.

How do I rotate webhook secrets without breaking verification?▼

Rotate webhook secrets by keeping both the current and previous secret active during a grace period, typically 24 hours. Verification tries the current secret first and falls back to the previous one, allowing in-flight webhooks signed with the old secret to succeed.