Skip to main content
Lettr automatically retries failed webhook deliveries to ensure you receive all events. Understanding the retry behavior helps you build resilient integrations that handle temporary failures gracefully.

Retry Schedule

When a webhook delivery fails, Lettr retries with exponential backoff. This approach balances timely delivery with giving your system time to recover from outages. After 7 failed attempts spanning approximately 35 hours, the webhook delivery is marked as permanently failed. At this point, no further automatic retries occur.
The retry schedule provides a balance between timely delivery and avoiding overwhelming a struggling endpoint. Most transient issues resolve within the first few retry attempts.

Success Criteria

For a webhook delivery to be considered successful, your endpoint must:
  1. Return a 2xx status code (200, 201, 202, 204, etc.)
  2. Respond within 30 seconds

Failure Conditions

Webhooks are retried when any of these conditions occur:

The 410 Gone Response

Returning a 410 Gone status code is a signal to permanently disable the webhook. Use this when:
  • You’re decommissioning an endpoint
  • The webhook should no longer receive events
  • You want to stop retries without deleting the webhook via API

Idempotency and Duplicate Handling

Because webhooks can be retried, your endpoint may receive the same event multiple times. Always implement idempotent handling.

Why Duplicates Occur

  1. Network issues: Your server responds 200, but the response doesn’t reach Lettr
  2. Timeout at boundary: Processing completes at exactly 30 seconds
  3. Infrastructure retries: Load balancers or proxies may retry requests

Handling Duplicates

Use the event id to detect and skip duplicate deliveries:
Always return a 200 status code for duplicate events. Returning an error will trigger unnecessary retries.

Database-Based Deduplication

If you don’t have Redis, use your database:

Monitoring Webhook Health

Webhook Status

Each webhook exposes two status fields via the API:

Check Webhook Status via API

You can check webhook status using the read-only API:
The response includes status information:

Dashboard Monitoring

The Lettr dashboard provides visibility into webhook delivery:
  1. Navigate to Webhooks in the sidebar
  2. Select a webhook to view its details
  3. See last attempt time, last status, and enabled state

Automatic Disabling

Webhooks are automatically disabled after sustained failures to protect both systems:
  • Prevents queue buildup of undeliverable events
  • Reduces load on your failing endpoint
  • Alerts you to investigate the issue
When a webhook is auto-disabled, you’ll see it in the dashboard and can re-enable it after fixing the issue. Navigate to Webhooks in the sidebar, select the disabled webhook, and toggle it back on.
Before re-enabling, ensure the underlying issue is resolved. Re-enabling without fixing the problem will lead to immediate failures and potentially another auto-disable.

Best Practices for Reliable Delivery

1. Respond Quickly

Return a 200 response as fast as possible. Process events asynchronously:

2. Use a Queue

For high-volume or complex processing, use a message queue:

3. Handle Partial Failures

If processing involves multiple steps, handle partial failures gracefully:

4. Monitor and Alert

Set up monitoring for webhook health:

5. Implement Health Checks

Ensure your webhook endpoint is monitored:

Troubleshooting

Common Issues

Debugging Failed Deliveries

  1. Check delivery history in dashboard or via API
  2. Review response codes and error messages
  3. Check your server logs for the corresponding requests
  4. Verify endpoint URL is correct and accessible
  5. Test with manual retry after fixing issues

Event Ordering

Webhooks are delivered in approximate order, but strict ordering is not guaranteed. Events may arrive out of order due to:
  • Retry delays
  • Network latency variations
  • Parallel processing
Design your handlers to be order-independent when possible:

Handling Webhooks

Best practices for processing webhooks reliably

Authorization

Secure your endpoints with authentication

Event Types

Complete reference of all webhook events

Testing

Test webhooks in development and production