Documentation Menu

Resend Webhook Not Working? Delivery Event Debug Guide

Problem Introduction

Delivered, bounced, or complained events are not reflected in your internal email state.

Why It Happens

  • Incorrect webhook endpoint URL in Resend dashboard
  • Missing event-type mappings — bounce/complaint events silently dropped
  • Parser crashes on unexpected payload shape
  • Handler timeout causing Resend to stop retrying

Step-by-Step Fix

  1. 1In Resend Dashboard → Webhooks, confirm the endpoint URL and which events are enabled.
  2. 2Capture the full headers and raw payload for one failing event.
  3. 3Map each event type (email.delivered, email.bounced, email.complained) to explicit handler branches.
  4. 4Acknowledge within 3 seconds — process state updates asynchronously.
  5. 5Replay the failed event and verify state transition in your DB.

Working Code

Copy-paste verified examples. Use the tab that matches your stack.

javascript
app.post('/webhooks/resend', express.json(), async (req, res) => {
  // Resend does not sign payloads — use allowlist or auth token instead
  const event = req.body;
  const eventType = event.type;   // e.g. 'email.delivered'
  const emailId   = event.data?.email_id;

  if (!eventType || !emailId) return res.status(400).send('Invalid payload');

  // Idempotency — Resend may retry
  if (await isEmailEventProcessed(emailId, eventType)) {
    return res.status(200).json({ duplicate: true });
  }

  switch (eventType) {
    case 'email.delivered':
      await markEmailDelivered(emailId);
      break;
    case 'email.bounced':
      await markEmailBounced(emailId, event.data.bounce_type);
      break;
    case 'email.complained':
      await suppressEmailAddress(event.data.email);
      break;
    default:
      console.log('Unhandled Resend event:', eventType);
  }

  res.status(200).json({ received: true });
});

Common Mistakes

  • Ignoring bounce and complaint events (they affect your sender reputation)
  • No dedupe by event ID
  • Silent parsing failures with no error logging

Debugging Workflow

Provider event timeline → request capture → route handler branch → persistence verification.

Preventive Best Practices

  • Maintain event contract tests
  • Track lifecycle completeness metrics
  • Alert on abnormal event drop rates

Works with webhooks and other async event systems (including AI callbacks). Instead of guessing, inspecting the exact payload and headers can help debug faster.

Try the free webhook tester

Was this page helpful?

Your feedback helps us improve the docs.