Skip to content
Resend Email API

Resend Email API Skill

Resend's official skill for the whole email lifecycle — transactional sends, inbound webhooks, templates, broadcasts, domains and delivery events.

GitHub Docs

Install

Install with the skills CLI

One command for Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, Windsurf and dozens of other agents. Needs Node.js; the skill is fetched straight from resend/resend-skills.

$ npx skills add resend/resend-skills --skill resend

Run it in a terminal. The CLI finds the agents installed on your machine, asks which ones to add the skill to, and whether to install it into the folder you ran it from or for all your projects.

Other ways to install

Copy the whole skill folder — SKILL.md and any scripts or references beside it — into ~/.claude/skills/resend/, where Claude Code picks it up in every project. Only git is needed.

tmp=$(mktemp -d) && \
  git clone --depth 1 --branch main https://github.com/resend/resend-skills.git "$tmp" && \
  mkdir -p ~/.claude/skills && \
  cp -R "$tmp"/skills/resend ~/.claude/skills/resend

No scripts or references next to it? Saving the SKILL.md alone as ~/.claude/skills/resend/SKILL.md works too.

Using another agent? Its personal skills folder
Codex
~/.agents/skills/
Cursor
~/.cursor/skills/
GitHub Copilot
~/.copilot/skills/
Gemini CLI
~/.gemini/skills/
Windsurf
~/.codeium/windsurf/skills/
OpenCode
~/.config/opencode/skills/

About

  • Single and batch transactional sends with idempotency-key handling
  • Inbound email over webhooks, including signature verification
  • Template management with the correct variable syntax
  • Domains, contacts, broadcasts, API keys and automations
  • Delivery-event tracking and API request-log inspection
  • Registers Resend's hosted MCP server for direct tool access

resend is the flagship skill in Resend's official resend/resend-skills repository, covering the email API end to end: single and batch transactional sends, inbound email received over webhooks, template management, delivery-event tracking, and administration of domains, contacts, broadcasts, webhooks, API keys and automations — plus reading the API request log when something did not arrive.

What makes it worth installing over letting a model improvise against the docs is the gotchas it encodes. Resend's own framing is that the skill should be loaded even for a request as simple as "send an email with Resend", because the failure modes are not in the happy path: idempotency keys on retried sends, webhook signature verification, and the exact template-variable syntax are each things an agent gets subtly wrong in a way that only shows up in production.

Setup. A Resend account with a verified sending domain, and an API key in RESEND_API_KEY. RESEND_WEBHOOK_SECRET is optional and only needed to verify inbound event payloads. The skill declares both as typed inputs, so a compatible harness can prompt for them rather than failing mid-task.

The wider set. The same repository ships agent-email-inbox (a secure webhook-backed inbox for agents), resend-cli for terminal operation, react-email for building HTML emails as React components, and email-best-practices for deliverability, DNS authentication and compliance. It also registers Resend's hosted MCP server at https://mcp.resend.com/mcp over streamable HTTP, authenticated by OAuth, so an agent can have tool access to the full API without any header configuration.

MIT-licensed. Packaged as a plugin for Claude Code, Cursor, OpenAI Codex and Grok.

Try it

Once installed, ask your agent something like:

"Add a Resend-backed password-reset email to this Next.js app, with a React Email template and retry-safe sending."

SKILL.md

The instructions your agent loads, as published by Resend.

SKILL.md
name
resend
description
Use when working with the Resend email API — sending transactional emails (single or batch), receiving inbound emails via webhooks, managing email templates, tracking delivery events, managing domains, contacts, broadcasts, webhooks, API keys, automations, events, viewing API request logs, or setting up the Resend SDK. Always use this skill when the user mentions Resend, even for simple tasks like "send an email with Resend" — the skill contains critical gotchas (idempotency keys, webhook verification, template variable syntax) that prevent common production issues.
license
MIT
metadata
author: resend version: "3.6.0" homepage: https://resend.com/agent-skills source: https://github.com/resend/resend-skills openclaw: primaryEnv: RESEND_API_KEY requires: env: - RESEND_API_KEY envVars: - name: RESEND_API_KEY required: true description: Resend API key for sending and receiving emails - name: RESEND_WEBHOOK_SECRET required: false description: Webhook signing secret for verifying event payloads links: repository: https://github.com/resend/resend-skills documentation: https://resend.com/docs/resend-skill
inputs
- name: RESEND_API_KEY description: Resend API key for sending and receiving emails. Get yours at https://resend.com/api-keys required: true - name: RESEND_WEBHOOK_SECRET description: Webhook signing secret for verifying event payloads. Found in the Resend dashboard under Webhooks after creating an endpoint. required: false
references
- sending - receiving.md - templates.md - webhooks.md - domains.md - contacts.md - broadcasts.md - api-keys.md - logs.md - contact-properties.md - segments.md - topics.md - automations.md - events.md - installation.md - fetch-all-templates.mjs

Resend

Quick Send — Node.js
import { Resend } from 'resend';

const resend = new Resend(process.env.RESEND_API_KEY);

const { data, error } = await resend.emails.send(
  {
    from: 'Acme <onboarding@resend.dev>',
    to: ['delivered@resend.dev'],
    subject: 'Hello World',
    html: '<p>Email body here</p>',
  },
  { idempotencyKey: `welcome-email/${userId}` }
);

if (error) {
  console.error('Failed:', error.message);
  return;
}
console.log('Sent:', data.id);

Key gotcha: The Resend Node.js SDK does NOT throw exceptions — it returns { data, error }. Always check error explicitly instead of using try/catch for API errors.

Quick Send — Python
import resend
import os

resend.api_key = os.environ["RESEND_API_KEY"]

email = resend.Emails.send({
    "from": "Acme <onboarding@resend.dev>",
    "to": ["delivered@resend.dev"],
    "subject": "Hello World",
    "html": "<p>Email body here</p>",
}, idempotency_key=f"welcome-email/{user_id}")
Single vs Batch Decision
ChooseWhen
Single (POST /emails)1 email, needs attachments, needs scheduling
Batch (POST /emails/batch)2-100 distinct emails, no attachments, no scheduling

Batch is atomic — if one email fails validation, the entire batch fails. Always validate before sending. Batch does NOT support attachments or scheduled_at.

Idempotency Keys (Critical for Retries)

Prevent duplicate emails when retrying failed requests:

Key Facts
Format (single)<event-type>/<entity-id> (e.g., welcome-email/user-123)
Format (batch)batch-<event-type>/<batch-id> (e.g., batch-orders/batch-456)
Expiration24 hours
Max length256 characters
Same key + same payloadReturns original response without resending
Same key + different payloadReturns 409 error
Quick Receive (Node.js)
import { Resend } from 'resend';

const resend = new Resend(process.env.RESEND_API_KEY);

export async function POST(req: Request) {
  const payload = await req.text(); // Must use raw text, not req.json()

  const event = resend.webhooks.verify({
    payload,
    headers: {
      'svix-id': req.headers.get('svix-id'),
      'svix-timestamp': req.headers.get('svix-timestamp'),
      'svix-signature': req.headers.get('svix-signature'),
    },
    secret: process.env.RESEND_WEBHOOK_SECRET,
  });

  if (event.type === 'email.received') {
    // Webhook has metadata only — call API for body
    const { data: email } = await resend.emails.receiving.get(
      event.data.email_id
    );
    console.log(email.text);
  }

  return new Response('OK', { status: 200 });
}

Key gotcha: Webhook payloads do NOT contain the email body. You must call resend.emails.receiving.get() separately.

What Do You Need?
TaskReference
Send a single email[sending/overview.md](references/sending/overview.md) — parameters, deliverability, testing
Send batch emails[sending/overview.md](references/sending/overview.md) → [sending/batch-email-examples.md](references/sending/batch-email-examples.md)
Full SDK examples (Node.js, Python, Go, cURL)[sending/single-email-examples.md](references/sending/single-email-examples.md)
Idempotency, retries, error handling[sending/best-practices.md](references/sending/best-practices.md)
Get, list, reschedule, cancel emails, retrieve metrics[sending/email-management.md](references/sending/email-management.md)
Receive inbound emails[receiving.md](references/receiving.md) — domain setup, webhooks, attachments
Manage templates (CRUD, variables)[templates.md](references/templates.md) — lifecycle, aliases, pagination
Set up webhooks (events, verification)[webhooks.md](references/webhooks.md) — verification, CRUD, retry schedule, IP allowlist
Manage domains (create, verify, claim, DNS)[domains.md](references/domains.md) — regions, TLS, tracking, claiming, capabilities
Manage contacts (CRUD, properties)[contacts.md](references/contacts.md) — segments, topics, custom properties, bulk CSV import
Send broadcasts (marketing campaigns)[broadcasts.md](references/broadcasts.md) — lifecycle, scheduling, template variables
Manage API keys[api-keys.md](references/api-keys.md) — permission scoping, domain restrictions
View API request logs[logs.md](references/logs.md) — list and retrieve API call history, debugging
Define contact properties[contact-properties.md](references/contact-properties.md) — custom fields for contacts
Manage segments (contact groups)[segments.md](references/segments.md) — broadcast targeting, contact grouping
Manage topics (subscriptions)[topics.md](references/topics.md) — opt-in/out preferences, broadcast filtering
Create automations (event-driven workflows)[automations.md](references/automations.md) — steps, connections, runs, conditions
Define and send events (automation triggers)[events.md](references/events.md) — schemas, payloads, contact association
Install SDK (8+ languages)[installation.md](references/installation.md)
Set up an AI agent inboxInstall the agent-email-inbox skill — covers security levels for untrusted input
SDK Version Requirements

Always install the latest SDK version. These are the minimum versions for full functionality (sending, receiving, webhook verification):

LanguagePackageMin VersionInstall
Node.jsresend>= 6.14.0npm install resend
Pythonresend>= 2.34.0pip install resend
Goresend-go/v3>= 3.11.0go get github.com/resend/resend-go/v3
Rubyresend>= 1.6.0gem install resend
PHPresend/resend-php>= 1.1.0composer require resend/resend-php
Rustresend-rs>= 0.26.1cargo add resend-rs
Javaresend-java>= 4.16.0See [installation.md](references/installation.md)
.NETResend>= 0.2.1dotnet add package Resend
If the project already has a Resend SDK installed, check the version and upgrade if it's below the minimum. Older SDKs may be missing webhooks.verify(), emails.receiving.get(), or domains.claims.*.

See [installation.md](references/installation.md) for full installation commands, language detection, and cURL fallback.

Common Setup
API Key

Store in environment variable — never hardcode:

export RESEND_API_KEY=re_xxxxxxxxx

Get your key at resend.com/api-keys.

Detect Project Language

Check for these files: package.json (Node.js), requirements.txt/pyproject.toml (Python), go.mod (Go), Gemfile (Ruby), composer.json (PHP), Cargo.toml (Rust), pom.xml/build.gradle (Java), *.csproj (.NET).

Common Mistakes
#MistakeFix
1Retrying without idempotency keyAlways include idempotency key — prevents duplicate sends on retry. Format: <event-type>/<entity-id>
2Not verifying webhook signaturesAlways verify with resend.webhooks.verify() — unverified events can't be trusted
3Template variable name mismatchVariable names are case-sensitive — must match the template definition exactly. Use triple mustache {{{VAR}}} syntax
4Expecting email body in webhook payloadWebhooks contain metadata only — call resend.emails.receiving.get() for body content
5Using try/catch for Node.js SDK errorsSDK returns { data, error } — check error explicitly, don't wrap in try/catch
6Using batch for emails with attachmentsBatch doesn't support attachments — use single sends instead
7Testing with fake emails (test@gmail.com)Use delivered@resend.dev — fake addresses bounce and hurt reputation
8Sending with draft templateTemplates must be published before sending — call .publish() first
9`html` + `template` in same send callMutually exclusive — remove html/text/react when using template
10MX record not lowest priority for inboundEnsure Resend's MX has the lowest number (highest priority) or emails won't route
11403 when sending from `resend.dev`The default onboarding@resend.dev is a sandbox — it can only deliver to your Resend account email. Verify your own domain first
12403 domain mismatchThe from address domain must exactly match a verified domain. Verified send.acme.com but sending from user@acme.com will fail
13Calling Resend API from the browser (CORS)The API does not support CORS — this is intentional to protect your API key. Always call from server-side (API routes, serverless functions)
14401 `restricted_api_key`A sending-only API key was used on a non-sending endpoint (domains, contacts, etc.). Create a full-access key instead
Cross-Cutting Concerns
Send + Receive Together

Auto-replies, email forwarding, or any receive-then-send workflow requires both capabilities:

  1. Set up inbound domain first (see [receiving.md](references/receiving.md))
  2. Set up sending (see [sending/overview.md](references/sending/overview.md))
  3. Note: batch sending does NOT support attachments or scheduling — use single sends when forwarding with attachments
AI Agent Inbox

If your system processes untrusted email content and takes actions (refunds, database changes, forwarding), install the agent-email-inbox skill. This applies whether or not AI is involved — any system interpreting freeform email content from external senders needs security measures.

Marketing Emails

The sending capabilities in this skill are for transactional email (receipts, confirmations, notifications). For marketing campaigns to large subscriber lists with unsubscribe links and engagement tracking, use Resend Broadcasts — see [broadcasts.md](references/broadcasts.md) for the API.

Domain Warm-up

New domains must gradually increase sending volume. Day 1 limit: ~150 emails (new domain) or ~1,000 (existing domain). See the warm-up schedule in [sending/overview.md](references/sending/overview.md).

Testing

Never test with fake addresses at real email providers (test@gmail.com, fake@outlook.com) — they bounce and destroy sender reputation.

AddressResult
delivered@resend.devSimulates successful delivery
bounced@resend.devSimulates hard bounce
complained@resend.devSimulates spam complaint
Suppression List

Resend automatically suppresses hard-bounced and spam-complained addresses. Sending to suppressed addresses fires the email.suppressed webhook event instead of attempting delivery. Manage in Dashboard → Suppressions.

Webhook Event Types
EventTrigger
email.sentAPI request successful
email.deliveredReached recipient's mail server
email.bouncedPermanently rejected (hard bounce)
email.complainedRecipient marked as spam
email.opened / email.clickedRecipient engagement
email.delivery_delayedSoft bounce, Resend retries
email.receivedInbound email arrived
domain.* / contact.*Domain/contact changes

See [webhooks.md](references/webhooks.md) for full details, signature verification, and retry schedule.

Error Handling Quick Reference
CodeAction
400, 422Fix request parameters, don't retry
401Check API key — restricted_api_key means sending-only key used on non-sending endpoint
403Verify domain ownership — common causes: resend.dev sandbox, from domain mismatch, unverified domain
409Idempotency conflict — use new key or fix payload
429Rate limited — retry with exponential backoff (default rate limit: 2 req/s)
500Server error — retry with exponential backoff
Resources
Install

Courier's official skill for building and debugging multi-channel notifications — email, SMS, push, in-app inbox, Slack, Teams and WhatsApp — from one send call.

Wire up Cloudflare Email Sending and Email Routing — the send_email binding, the inbound email() handler, and the deliverability setup that keeps mail out of spam.

Harden a Twilio integration against credential leaks and fraud — API keys instead of auth tokens, webhook signature validation, geo-permissions, SMS pumping prevention and zero-downtime credential rotation.

Browse all skills →