Skip to main content

Getting started

  1. Sign up for a free account
  2. Verify your domain
  3. Create an API key
  4. If you want to receive emails, create a webhook
  5. Use the API to start sending emails or retrieving information about the emails you received
After signing up, you can use our hackathon coupon to get extra sending credits for free.

Sending Emails

Step 1: Add your domain and verify it

  1. Go to Domains and click Add Domain
  2. Enter your domain name. We recommend using a subdomain, such as newsletter.yourdomain.com to protect your sender reputation.
  3. Copy the DNS records shown and add them to your DNS provider.
  4. Wait until your domain appears as verified in the Resend dashboard. It should take less than 5 minutes to verify.

Step 2: Create your API key

  1. Go to API Keys
  2. Click Create API Key
  3. Give it a name, and select the desired permissions.
Make sure to save your API key right after you create it. It will only appear once!

Step 3: Send your first email

Install the SDK. For example, using npm and the Resend Node.js SDK:
npm install resend
Send an email:
import { Resend } from 'resend';

const resend = new Resend('re_YOUR_API_KEY');

const { data, error } = await resend.emails.send({
  from: 'You <[email protected]>',
  to: ['[email protected]'],
  subject: 'Hello from the hackathon!',
  html: '<p>It works!</p>',
});
Or use cURL:
curl -X POST 'https://api.resend.com/emails' \
  -H 'Authorization: Bearer re_YOUR_API_KEY' \
  -H 'Content-Type: application/json' \
  -d '{
    "from": "You <[email protected]>",
    "to": ["[email protected]"],
    "subject": "Hello from the hackathon!",
    "html": "<p>It works!</p>"
  }'

Test addresses

If you need, you can send emails to these special addresses to test different scenarios:
AddressSimulates
[email protected]Successful delivery
[email protected]Email bounce
[email protected]Spam complaint

Receiving Emails

Step 1: Enable receiving on your domain

  1. Go to your domain in Domains
  2. Enable the “Receiving” toggle in the domain settings
  3. Add the MX record shown to your DNS provider
Any email sent to *@yourdomain.com will be received by Resend and forwarded to your webhook.
For quick testing without DNS setup, use your free Resend-managed domain found under the EmailsReceiving tab.

Step 2: Set up a webhook

  1. Go to Webhooks
  2. Click “Add Webhook”
  3. Enter your endpoint URL
  4. Select the email.received event
For local development, you can use a tunnel service like ngrok.

Step 3: Handle the webhook and get the email content

Once you receive your webhook, you can call the Resend API to fetch more details.
Webhooks only contain metadata (sender, recipient, subject, attachment list). To get the actual email body and attachments, call the Receiving API using the email_id from the webhook.
app/api/events/route.ts
import type { NextRequest } from 'next/server';
import { NextResponse } from 'next/server';
import { Resend } from 'resend';

const resend = new Resend('re_YOUR_API_KEY');

export const POST = async (request: NextRequest) => {
  const event = await request.json();

  if (event.type === 'email.received') {
    const { data: email } = await resend
      .emails
      .receiving
      .get(event.data.email_id);

    console.log(email.html);    // HTML body
    console.log(email.text);    // Plain text body
    console.log(email.headers); // Email headers

    return NextResponse.json(email);
  }

  return NextResponse.json({});
};

Further Reading

Hackathon Coupon

We have a special hackathon coupon that gives you extra sending credits on top of your free account. Ask someone from the Resend team for the coupon code.