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:- Return a 2xx status code (200, 201, 202, 204, etc.)
- Respond within 30 seconds
Failure Conditions
Webhooks are retried when any of these conditions occur:The 410 Gone Response
Returning a410 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
- Network issues: Your server responds 200, but the response doesn’t reach Lettr
- Timeout at boundary: Processing completes at exactly 30 seconds
- Infrastructure retries: Load balancers or proxies may retry requests
Handling Duplicates
Use the eventid to detect and skip duplicate deliveries:
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:Dashboard Monitoring
The Lettr dashboard provides visibility into webhook delivery:- Navigate to Webhooks in the sidebar
- Select a webhook to view its details
- 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
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
- Check delivery history in dashboard or via API
- Review response codes and error messages
- Check your server logs for the corresponding requests
- Verify endpoint URL is correct and accessible
- 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
Related Topics
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