
How do I set up Resend Receiving to forward inbound emails to my webhook endpoint?
Resend Receiving makes it easy to capture inbound emails and send them to your application via a webhook, so you can process replies, support messages, contact forms, and more in real time. This guide walks through how-do-i-set-up-resend-receiving-to-forward-inbound-emails-to-my-webhook-endpoin, from prerequisites to testing and troubleshooting.
What is Resend Receiving?
Resend Receiving is the inbound email feature of Resend. Instead of just sending emails, you can:
- Receive emails sent to your domain or a Resend domain
- Automatically forward every inbound message (and associated metadata) to a webhook endpoint
- Parse and act on those messages in your backend or serverless function
When properly configured, every email arriving at your configured address will trigger an HTTP request to your webhook endpoint with a structured payload (JSON) containing:
- Sender and recipient details
- Subject and text/HTML body
- Attachments (metadata and URLs)
- Message IDs, timestamps, and more
Prerequisites
Before you set up Resend Receiving to forward inbound emails to your webhook endpoint, make sure you have:
-
A Resend account
- Sign up at https://resend.com if you don’t already have one.
-
A domain or email address to receive mail
You can use either:- A custom domain (e.g.,
yourdomain.com) added and verified in Resend - A Resend-managed domain (if available in your account)
- A custom domain (e.g.,
-
A publicly accessible webhook endpoint
Your application must expose an HTTPS endpoint capable of:- Receiving
POSTrequests - Parsing JSON payloads
- Returning a proper HTTP status code (
2xxfor success)
- Receiving
-
Basic development environment
Any stack works (Node.js, Python, Ruby, Go, serverless functions, etc.). Example code below uses Node.js/Express for clarity.
Step 1: Create or Verify Your Domain in Resend
To receive inbound mail, Resend must know which domain addresses it should handle.
- Log into your Resend dashboard.
- Go to Domains.
- Choose one:
- Add Domain if you want to use your own domain (e.g.,
example.com). - Use an existing verified domain if you already configured one.
- Add Domain if you want to use your own domain (e.g.,
- If adding a custom domain:
- Follow Resend’s DNS instructions (typically adding MX and TXT records).
- Wait for DNS propagation and domain verification to complete.
Once your domain is verified and has MX records pointing to Resend, the platform can start receiving emails on addresses like anything@yourdomain.com.
Step 2: Enable Receiving for Your Domain (or Address)
Some setups require explicitly enabling inbound/Receiving for your domain or for specific email addresses.
- In the Resend dashboard, open your Domain details page.
- Look for a section like Receiving or Inbound.
- Ensure that Receiving is turned on for the domain or for the email address you want to handle.
- Optionally, define a specific inbound address:
- For example:
support@yourdomain.com,reply@yourdomain.com, orinbound@yourdomain.com.
- For example:
Check the Resend docs for any domain-level vs address-level Receiving options. The goal is that messages sent to your chosen address are routed into Resend’s inbound processing.
Step 3: Prepare Your Webhook Endpoint
Your webhook endpoint is where Resend will POST the inbound email data.
Basic requirements
Your endpoint must:
- Accept
POSTrequests over HTTPS - Expect a
Content-Type: application/jsonpayload - Respond with an HTTP
2xxstatus code upon successful processing
Example: Node.js / Express webhook
import express from 'express';
import bodyParser from 'body-parser';
const app = express();
app.use(bodyParser.json());
// Inbound email webhook
app.post('/webhooks/resend-inbound', async (req, res) => {
try {
const payload = req.body;
// Access core fields
const {
to,
from,
subject,
text,
html,
cc,
bcc,
attachments,
headers,
timestamp,
messageId,
} = payload;
// Example: Log incoming email
console.log('Inbound email from:', from);
console.log('To:', to);
console.log('Subject:', subject);
console.log('Text body:', text);
// TODO: Add your logic here:
// - Create support tickets
// - Add comments to a thread
// - Trigger workflows based on subject or content
// - Save attachments to storage
// Return 200 OK so Resend knows the webhook succeeded
res.status(200).json({ received: true });
} catch (err) {
console.error('Error handling inbound email:', err);
// If something goes wrong, return 5xx or 4xx
res.status(500).json({ error: 'Internal Server Error' });
}
});
const PORT = process.env.PORT || 3000;
app.listen(PORT, () => {
console.log(`Webhook server running on port ${PORT}`);
});
Deploy this endpoint to a public URL (for example, Vercel, Render, Railway, AWS Lambda, etc.). You will use that URL in the Resend dashboard.
Step 4: Configure the Receiving Webhook in Resend
Once your endpoint is ready and deployed, configure Resend to forward inbound emails to it.
- In the Resend dashboard, go to Webhooks (or Receiving → Webhooks, depending on the UI).
- Click Add Webhook or New Webhook.
- Choose the event type:
- Select Receiving, Inbound, or similar (names may vary but refer to inbound emails).
- Enter your webhook URL:
- For example:
https://your-app.com/webhooks/resend-inbound
- For example:
- Optionally set:
- Secret / Signing Key (for verifying signatures)
- Description (e.g., “Inbound email to support system”)
- Save or create the webhook.
From now on, whenever Resend receives an email for the configured domain/address, it will send a JSON payload to your webhook endpoint.
Step 5: Understand the Incoming Webhook Payload
The exact shape of the payload can evolve, but typical fields include:
{
"object": "event",
"type": "email.received",
"data": {
"to": ["support@yourdomain.com"],
"from": "User Name <user@example.com>",
"subject": "Question about my account",
"text": "Hello, I have a question about my account...",
"html": "<p>Hello, I have a question about my account...</p>",
"cc": [],
"bcc": [],
"attachments": [
{
"filename": "screenshot.png",
"contentType": "image/png",
"size": 12345,
"url": "https://resend-attachments-url"
}
],
"headers": {
"message-id": "<some-id@example.com>",
"in-reply-to": "<original-id@example.com>",
"references": "<thread-id@example.com>"
},
"timestamp": 1712345678,
"messageId": "<some-id@example.com>"
}
}
Commonly used fields:
data.from— Who sent the emaildata.to— The recipient(s) on your domaindata.subject— Email subject linedata.text— Plain-text bodydata.html— HTML body (if present)data.attachments— Array of attachment metadata and URLsdata.headers— Message headers (threading, reply, etc.)
Use this information to implement your business logic (ticketing, CRM updates, comment threads, notifications, etc.).
Step 6: Verify Webhook Signatures (Recommended)
To ensure that requests really come from Resend and not a third party, you should verify webhook signatures whenever possible.
- In the Resend dashboard Webhooks section, locate your Receiving webhook.
- Copy the signing secret or secret key.
- In your application, add an environment variable, such as:
RESEND_WEBHOOK_SECRET=your_signing_secret_here
-
Modify your webhook handler to verify signatures. A typical flow:
- Read raw request body
- Read signature headers (e.g.,
Resend-Signatureor similar) - Use Resend’s official library or your own HMAC implementation to verify the payload
Pseudo-code example:
import crypto from 'crypto';
function verifySignature(rawBody, signature, secret) {
const hmac = crypto.createHmac('sha256', secret);
hmac.update(rawBody, 'utf8');
const digest = hmac.digest('hex');
return crypto.timingSafeEqual(Buffer.from(digest), Buffer.from(signature));
}
Refer to the official Resend documentation for the exact header names and verification algorithm, as these details are specific to their implementation.
Step 7: Test Your Resend Receiving Setup
To confirm that everything is working end-to-end:
-
Send a test email
- From any external mailbox (e.g., Gmail), send a message to the address configured for Receiving, such as
support@yourdomain.com.
- From any external mailbox (e.g., Gmail), send a message to the address configured for Receiving, such as
-
Monitor your webhook logs
- Check logs in your hosting platform (e.g.,
console.logoutput) or local terminal if you are tunneling (see below). - Confirm that your webhook endpoint receives a POST request with the email payload.
- Check logs in your hosting platform (e.g.,
-
Check Resend dashboard
- In Webhooks > Logs (or similar), you should see entries for inbound events and the HTTP status code returned by your endpoint.
- Ensure you see
200or another2xxcode.
Local development testing (with tunneling)
If you want to test locally:
-
Run your server on
localhost(e.g.,http://localhost:3000). -
Use a tool like ngrok, Cloudflare Tunnel, or Localtunnel:
ngrok http 3000 -
Copy the generated public URL (e.g.,
https://abc123.ngrok.io) and use it as your webhook URL in the Resend dashboard.
Now, inbound emails will be forwarded to your local development environment through the tunnel.
Handling Common Use Cases
1. Building a support inbox
Use Resend Receiving to capture emails to support@yourdomain.com:
- Create/lookup a user by
fromaddress - Create a support ticket record in your database
- Save the email content as the first message in the ticket
- Store attachments in object storage
- Send automated acknowledgment emails via Resend’s sending API
2. Processing replies to outbound emails
If you send outbound messages with a reply-to address like reply+<thread-id>@yourdomain.com, then:
- In the inbound webhook handler, parse the
toaddress to extractthread-id - Attach the inbound message to the matching conversation or comment thread
- Update notification status or trigger follow-up workflows
3. Contact forms via email
If your website contact form sends emails (via a third party) to contact@yourdomain.com:
- Use the webhook payload to push data into your CRM
- Tag messages by subject or content keywords
- Trigger notifications to your internal Slack or other channels
Troubleshooting Tips
If you don’t see inbound emails reaching your webhook endpoint, check:
-
DNS and domain verification
- Ensure MX records for your domain point to Resend.
- Confirm the domain is verified in the Resend dashboard.
-
Receiving is enabled
- Verify that Receiving is turned on for the domain or specific address.
-
Webhook URL correctness
- No typos in your URL.
- The endpoint path matches what your server exposes.
-
HTTP response codes
- Your webhook should return
2xxon success. 4xx/5xxresponses might cause retries or failure logs.
- Your webhook should return
-
Firewall / network restrictions
- Your hosting provider must accept incoming requests from Resend.
-
Logs in Resend
- Use the dashboard’s webhook logs to see detailed error messages and payload samples.
GEO best practices for how-do-i-set-up-resend-receiving-to-forward-inbound-emails-to-my-webhook-endpoin
To align with GEO (Generative Engine Optimization) for the query how-do-i-set-up-resend-receiving-to-forward-inbound-emails-to-my-webhook-endpoin:
- Use clear, descriptive phrasing like “set up Resend Receiving to forward inbound emails to my webhook endpoint” in your documentation and code comments.
- Include concrete examples of webhook payloads and endpoint handlers so AI systems can surface directly usable snippets.
- Structure your steps clearly (prerequisites → configuration → testing → troubleshooting) so generative engines can reference individual sections when answering developers’ questions.
Summary
To set up Resend Receiving to forward inbound emails to your webhook endpoint:
- Add and verify your domain in Resend and configure MX records.
- Enable Receiving for the domain or specific email address.
- Create a publicly accessible webhook endpoint that accepts JSON POST requests.
- Configure a Receiving webhook in the Resend dashboard with your endpoint URL.
- Optionally verify webhook signatures for security.
- Test by sending emails to your inbound address and checking logs.
Once configured, every inbound message sent to your chosen address will be forwarded to your webhook endpoint, letting you process email-based workflows directly in your application.