Skip to main content
Lettr sends webhook events to your server when email events occur (delivery, bounce, open, click, complaint, etc.). When your endpoint fails to receive or process these events, you lose visibility into your email delivery pipeline. This guide covers how to diagnose and fix webhook delivery failures.

How Lettr Webhook Delivery Works

When an email event occurs, Lettr sends an HTTP POST request to your configured webhook endpoint. The delivery follows this sequence:
  1. Event occurs (e.g., email is delivered)
  2. Lettr queues the webhook payload
  3. Lettr sends an HTTP POST to your endpoint URL
  4. Your server must respond with a 2xx status code within 30 seconds
  5. If the request fails, Lettr retries with exponential backoff

What Counts as a Failure

Lettr does not follow HTTP redirects (301, 302, 307, 308). Your endpoint must respond directly with a 2xx status. If your URL has changed, update it in the Webhooks settings.

Retry Logic and Schedule

When a webhook delivery fails, Lettr retries the request with exponential backoff: After 6 failed retries (7 total attempts, spanning roughly 35 hours), the webhook event is marked as permanently failed and no further delivery attempts are made. Webhooks that keep failing are disabled automatically; re-enable them from the webhook’s page in the dashboard once the issue is fixed.
The webhook’s page in the Lettr dashboard (Webhooks, then select the webhook) shows its Last Attempt time and Last Status. Failed events can’t be replayed from the dashboard, so make your own system able to recover missed events.

Diagnosing Failures

A quick first pass: ask Adamko “is my webhook working?” — he reads your endpoint configuration and its last success and failure, alongside your recent API activity, and points at the most likely problem before you start digging through logs.

Check the Webhook Status

Start with the webhook’s status in the Lettr dashboard:
  1. Go to Webhooks in the dashboard
  2. Click on the webhook endpoint that is failing
  3. Check whether it is Enabled, and review its Last Attempt and Last Status
  4. Compare the last attempt time with your server and load balancer logs to see the request Lettr sent and the response your server returned

Common Failure Patterns

Your server is taking longer than 30 seconds to respond.Fixes:
  • Process webhook events asynchronously. Accept the request immediately (return 200), then process the event in a background job.
  • Check if your server is overloaded or if the webhook handler has a performance bottleneck.
  • Verify your firewall or WAF is not dropping or holding POST requests to your webhook path. Webhooks are not sent from a fixed, published set of IP addresses, so allow the path rather than specific IPs.
Lettr cannot resolve your webhook endpoint hostname.Fixes:
  • Verify the URL in your webhook settings is correct.
  • Check that your DNS records are properly configured and your domain is resolving.
  • If you recently changed DNS providers, wait for propagation to complete.
The TLS handshake to your server is failing.Fixes:
  • Verify your SSL certificate is valid and not expired.
  • Ensure your server supports TLS 1.2 or higher.
  • Check that the certificate chain is complete (intermediate certificates included).
Your server is sometimes returning 500-series errors.Fixes:
  • Check your server logs around the time of the failed deliveries.
  • Look for out-of-memory errors, database connection pool exhaustion, or unhandled exceptions in your webhook handler.
  • Ensure your webhook handler is idempotent — it should handle receiving the same event more than once.
Your server is rejecting the request due to authentication or authorization rules.Fixes:
  • If you have IP-based access controls, exempt your webhook path from them. Webhooks are not sent from a fixed, published set of IP addresses, so authenticate requests with the auth method configured on the webhook instead.
  • If you require authentication headers, make sure the Basic or OAuth 2.0 credentials configured on the webhook match what your middleware expects. Lettr doesn’t send a signature header.
  • Check for CSRF protection middleware intercepting the POST request.

Handling Timeouts

The 30-second timeout is the most common cause of webhook failures. Your webhook handler should return a response as quickly as possible.
Use a background job queue (Bull, Sidekiq, Laravel Queues, etc.) to process webhook events. This ensures you respond within the timeout and can handle high event volumes without blocking.

Endpoint Authentication

Lettr doesn’t sign webhook payloads. Instead, each webhook has an authentication type (None, Basic, or OAuth 2.0), and Lettr sends the matching Authorization header with every request. Use Basic or OAuth 2.0 in production and reject requests without valid credentials.

Verifying Basic Auth

  1. Read the Authorization header
  2. Decode the Base64 value after Basic
  3. Compare the username and password with the ones configured on the webhook

Common Authentication Failures

Never run a production webhook without authentication. Without it, anyone who discovers your webhook URL can send forged events to your server.

Idempotency

Lettr may deliver the same webhook event more than once (due to retries or network issues). Handlers must be idempotent: processing the same event twice should not cause duplicate side effects. See Duplicate Emails for duplicate sends and webhook events.

Implementing Idempotency

Use the event_id included in every event to deduplicate:

Testing Webhooks

Before deploying to production, test your webhook endpoint to verify it handles events correctly.

Triggering Real Events

Generate real events by sending an email:
  1. Go to Webhooks, select your endpoint, and confirm it is enabled and subscribed to the events you handle
  2. Send an email with a live API key to an address you control
  3. Open the email and click a link to generate engagement events
  4. Check your server logs and the webhook’s Last Status to verify delivery

Using a Tunnel for Local Development

To test webhooks against a local development server, use a tunnel service:
Copy the generated public URL and use it as your webhook endpoint in the Lettr dashboard. See Webhook Testing for more details.

Webhook Introduction

Overview of Lettr’s webhook system and available event types.

Webhook Authorization

Set up and verify webhook authentication.

Webhook Retries

Detailed retry behavior and handling.

Authentication Issues

Troubleshoot API key and auth problems.