Index of every page on this site: llms.txt
All skills
resend avatar

/resend

@063246e official
by resendresend/resend-skills215 stars
34
Run it yourself

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, inboxes (threads, labels, drafts, replies), automations, events, viewing API request logs, checking account usage and quotas, 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.

Use this Skill: https://skilld.dev/gh/resend/resend-skills/resend

Nothing lands on disk. Nothing to clean up.

Fork this Skill

Edit a local copy. It keeps the author and licence.

SKILL.md

≈166 tokens for metadata: the name and description. ≈3k when used: this file. ≈47k more on demand in 21 files.

Description uses 8.3% of example budget

Before choosing a Skill, your Agent reads its name and description. All available Skills share that space.

  • A shorter description leaves more room for other Skills. This entry exceeds our 1% size suggestion.

In our Claude Code example, all Skill names and descriptions share 8,000 characters. This Skill uses ≈660 characters, or 8.3%.

The 1% threshold is a size suggestion. Longer descriptions can still fit.

Your model, settings, and other Skills decide how much text your Agent can read.

Example settings and source

The example uses a 200k-token context and default Claude Code settings. The count includes the name, description, separators, and when_to_use when present. Codex also counts local file paths.

Skit's source and limits: Codex 0.160.1, Claude Code 2.1.292.

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

Choose When
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)
Expiration 24 hours
Max length 256 characters
Same key + same payload Returns original response without resending
Same key + different payload Returns 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?

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

SDK Version Requirements

Always install the latest SDK version. Older SDKs may be missing webhooks.verify(), emails.receiving.get(), domains.claims.*, domains.forge.*, or inboxes.*.

If the project already has a Resend SDK installed, check its version against the minimum versions in installation.md and upgrade if it's below. Inboxes need higher versions. See inboxes.md.

See installation.md for the minimum version per language, 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

# Mistake Fix
1 Retrying without idempotency key Always include idempotency key — prevents duplicate sends on retry. Format: <event-type>/<entity-id>
2 Not verifying webhook signatures Always verify with resend.webhooks.verify() — unverified events can't be trusted
3 Template variable name mismatch Variable names are case-sensitive — must match the template definition exactly. Use triple mustache {{{VAR}}} syntax
4 Expecting email body in webhook payload Webhooks contain metadata only — call resend.emails.receiving.get() for body content
5 Using try/catch for Node.js SDK errors SDK returns { data, error } — check error explicitly, don't wrap in try/catch
6 Using batch for emails with attachments Batch doesn't support attachments — use single sends instead
7 Testing with fake emails (test@gmail.com) Use delivered@resend.dev — fake addresses bounce and hurt reputation
8 Sending with draft template Templates must be published before sending — call .publish() first
9 html + template in same send call Mutually exclusive — remove html/text/react when using template
10 MX record not lowest priority for inbound Ensure Resend's MX has the lowest number (highest priority) or emails won't route
11 403 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
12 403 domain mismatch The from address domain must exactly match a verified domain. Verified send.acme.com but sending from user@acme.com will fail
13 Calling 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)
14 401 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)
  2. Set up sending (see 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 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.

Testing

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

Address Result
delivered@resend.dev Simulates successful delivery
bounced@resend.dev Simulates hard bounce
complained@resend.dev Simulates 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

Event Trigger
email.sent API request successful
email.delivered Reached recipient's mail server
email.bounced Permanently rejected (hard bounce)
email.complained Recipient marked as spam
email.opened / email.clicked Recipient engagement
email.delivery_delayed Soft bounce, Resend retries
email.received Inbound email arrived
domain.* / contact.* Domain/contact changes

See webhooks.md for full details, signature verification, and retry schedule.

Error Handling Quick Reference

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

Resources

Source: SKILL.md on GitHub

skilld matched fixed text patterns in SKILL.md and file names. Patterns miss obfuscated code.

skilld run checks every file with the same patterns. It asks for approval before it loads a Skill with a behavior marked Needs approval.

1 alerttoday5 checks · Risk SAFE
  • Gen Agent Trust Hubtoday

    This skill provides tools and documentation for the Resend email API. It follows security best practices like environment variable usage and signature verification. It is categorized as 'low' because it processes inbound email content, which is a common surface for indirect prompt injection.

  • Socket11d

    No alerts

  • Snyktoday

    Risk: MEDIUM · 1 issue

  • Runlayer8mo

    12/23 files flagged

  • ZeroLeaks7mo

    Score: 93/100 · 2 sections analyzed

Signed by skilld at 063246e. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub yesterday.

Activeupdated yesterday
Other metadata
metadata
{
  "author": "resend",
  "version": "3.18.2",
  "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",
  "usage.md",
  "inboxes.md",
  "installation.md",
  "fetch-all-templates.mjs"
]
  • Python
  • API
  • resend
  • email
  • transactional-email
  • webhooks
  • nodejs
  • templates
  • idempotency

README badge

README badge for resend/resend-skills/resend

Integrates the Resend email API for sending single or batch transactional emails, receiving inbound emails via webhooks, managing templates and domains, and tracking delivery events. Use this skill whenever working with Resend — it includes critical guidance on idempotency keys, webhook verification, template variable syntax, and common production gotchas like batch limitations and SDK error handling patterns.

Generated from the current SKILL.md.

Does this skill support both sending and receiving emails?
Yes. The skill covers transactional sends (single and batch), inbound email reception via webhooks, and email management. Receiving requires domain setup and webhook verification; batch sending does not support attachments or scheduling.
What are idempotency keys and why do I need them?
Idempotency keys prevent duplicate emails when retrying failed requests. Format them as `<event-type>/<entity-id>` (e.g. `welcome-email/user-123`) for single sends and `batch-<event-type>/<batch-id>` for batch sends. Keys expire after 24 hours.
How do I verify webhook signatures from Resend?
Use `resend.webhooks.verify()` with the raw request body and svix headers (`svix-id`, `svix-timestamp`, `svix-signature`). Always verify before processing events — unverified webhooks cannot be trusted.
Does the Node.js SDK throw exceptions for API errors?
No. The SDK returns `{ data, error }` for all API calls. Always check the `error` property explicitly instead of using try/catch for handling API failures.
Can I send batch emails with attachments?
No. Batch sending (`POST /emails/batch`) does not support attachments or scheduling. Use single sends when attachments are required.

Generated from the current SKILL.md. These answers refresh after source changes.