Skip to content

Webhook Deduplication

How Hookbase automatically detects and handles duplicate webhook deliveries to prevent processing the same event multiple times.

The Problem

Webhook providers often retry deliveries when they don't receive a timely response. This can result in the same event being delivered multiple times. Without deduplication, your application might:

  • Process the same order twice
  • Send duplicate notifications
  • Double-charge customers
  • Corrupt data with repeated operations

How Hookbase Handles Duplicates

Hookbase automatically deduplicates incoming webhooks using multiple strategies:

1. Provider Event IDs

Many providers include a unique event ID in their payloads. Hookbase extracts and tracks these IDs:

ProviderEvent ID Field
Stripeid (e.g., evt_1234)
GitHubX-GitHub-Delivery header
ShopifyX-Shopify-Webhook-Id header
TwilioMessageSid

2. Content Hashing

For providers without event IDs, Hookbase generates a hash of the payload content. Identical payloads within the deduplication window are automatically rejected.

3. Delivery ID Tracking

Even if the same event is processed, Hookbase tracks delivery attempts separately. Each destination receives the event exactly once.

Configuration

Configure deduplication in your source settings:

json
{
  "deduplication": {
    "enabled": true,
    "window": 86400,
    "strategy": "event_id",
    "eventIdPath": "$.data.id"
  }
}
OptionDescription
enabledEnable/disable deduplication
windowDeduplication window in seconds (default: 24 hours)
strategyevent_id, content_hash, or both
eventIdPathJSONPath to extract event ID

Viewing Duplicates

In the Events tab, duplicate events are marked with a badge. Click to see:

  • Original event timestamp
  • Number of duplicate attempts
  • Which deliveries were skipped

API Response

When a duplicate is detected, Hookbase returns:

json
{
  "status": "duplicate",
  "originalEventId": "evt_abc123",
  "originalTimestamp": "2024-01-15T10:30:00Z"
}

The HTTP status is still 200 OK to prevent the provider from retrying.

Best Practices

  1. Use event IDs when available - More reliable than content hashing
  2. Set appropriate windows - Balance storage costs vs. protection
  3. Implement idempotency in your app - Defense in depth
  4. Monitor duplicate rates - High rates may indicate provider issues

Learn More

Released under the MIT License.