Skip to main content
skill Claude Code CX Codex Cursor GitHub Copilot

resend — Claude Code skill: what it does, how to install

Skill for Resend Email API: send transactional emails, receive inbound via webhooks, manage templates, domains and request logs.

Install into Claude Code · Skills CLI (Vercel) All methods and platforms ↓
npx skills add resend/resend-skills --skill resend -a claude-code
Open on GitHub

What resend does

The skill gives the agent access to all Resend capabilities: sending single emails and batches up to 100 addresses, receiving inbound via webhooks, managing templates, domains, contacts, broadcasts, API keys, automations, and viewing request logs. Inside are reference docs for each task, code examples for Node.js, Python, Go and cURL, decision tables (single vs batch send, idempotency key format).

The Node.js SDK does not throw exceptions but returns {data, error} — check error explicitly. Webhooks send metadata only; the email body must be fetched separately with resend.emails.receiving.get(). That's worth accounting for when designing the inbound handler. You need RESEND_API_KEY to work; for webhook signature verification, add optional RESEND_WEBHOOK_SECRET.

What it helps with

  • send a transactional email with attachments and scheduled delivery
  • receive an inbound email and fetch its body via API
  • prevent duplicate emails when retrying failed requests
  • verify webhook authenticity before processing the event
  • send a batch of multiple emails in a single atomic request

Example prompts for the agent

  • Send an email via Resend with subject 'Welcome' to [email protected], add an idempotency key
  • Set up a webhook handler for Resend inbound emails, verify the signature
  • Show how to send a batch of five emails to different recipients via Resend

How to install resend

1Skills CLI (Vercel)

npx skills add resend/resend-skills --skill resend -a claude-code

2Manually: put the files in place

~/.claude/skills/resend/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/resend/

Similar

wp-wpcli-and-ops WordPress A skill for WordPress operations through wp: move domains, export the database, install plugins, inspect cron. Useful when the agent has to touch a live site, not just theme files. Claude Code CX Codex Cursor +1 5,400installs huggingface-tool-builder huggingface A skill for building reusable command-line scripts that fetch, enrich, and process data from Hugging Face. Useful when chaining multiple API calls or running repeated automation tasks. Claude Code CX Codex Cursor +1 1,600installs prisma-orm-setup prisma Walks an AI coding agent through Prisma ORM setup: find the version, connect the database, verify the link. New apps default to Prisma ORM 8. Claude Code CX Codex Cursor +1 66,000installs aws-containers aws Deploys containers on AWS: EKS, ECS, Fargate, ECR, Elastic Beanstalk. Use it when deploying, debugging, or optimizing containerized workloads. Claude Code CX Codex Cursor +1 9,300installs analyzing-dotnet-performance dotnet Scans C# and .NET code for about 50 performance anti-patterns across async, memory, LINQ, and I/O. Handy when auditing hot paths and memory allocations before release. Claude Code CX Codex Cursor +1 4,800installs fetch browserbase Retrieves HTML or JSON from static web pages via Browserbase Fetch API without starting a browser session. Useful for fast scraping and header inspection. Claude Code CX Codex Cursor +1 3,000installs mcp-builder official anthropics This skill walks through building an MCP server in TypeScript or Python, from reading the protocol spec to writing tests and evaluation questions. Claude Code Claude.ai 130,949installs google-agents-cli-adk-code official Google A reference skill for building ADK agents with tools, callbacks, state, and workflows. Use it when an agent project needs concrete API patterns or code examples. Claude Code CX Codex Cursor +1 511,400installs

Questions about resend

How to install resend in Claude Code?

Run npx skills add resend/resend-skills --skill resend -a claude-code. The skill will appear in ~/.claude/skills/resend/SKILL.md.

What does the resend skill do?

It gives the agent instructions and examples for working with the Resend Email API: sending single and batch emails, receiving inbound via webhooks, managing templates, domains, contacts, broadcasts, API keys, viewing request logs, and setting up automations.

What's needed to work with the resend skill?

Set the RESEND_API_KEY environment variable (get it from the Resend dashboard). For webhook signature verification, add RESEND_WEBHOOK_SECRET — it appears after creating an endpoint in the Webhooks section.

Source text

SKILL.md · MIT
---
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, 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.
license: MIT
metadata:
    author: resend
    version: "3.16.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
    - usage.md
    - inboxes.md
    - installation.md
    - fetch-all-templates.mjs
---

# Resend

## Quick Send — Node.js

```typescript
import { Resend } from 'resend';

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

const { data, error } = await resend.emails.send(
  {
    from: 'Acme <[email protected]>',
    to: ['[email protected]'],
    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

```python
import resend
import os

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

email = resend.Emails.send({
    "from": "Acme <[email protected]>",
    "to": ["[email protected]"],
    "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)

```typescript
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](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 |
| **Check account usage and quotas** | [usage.md](references/usage.md) — emails, contacts, segments, broadcasts, AI credits, automation runs, domains, rate limit |
| **Manage inboxes** (threads, replies, drafts) | [inboxes.md](references/inboxes.md) — labels, folders, search, agent settings, inbox webhook events |
| **Install SDK** (8+ languages) | [installation.md](references/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()`, or `domains.claims.*`.

> **If the project already has a Resend SDK installed**, check its version against the minimum versions in [installation.md](references/installation.md) and upgrade if it's below.

See [installation.md](references/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:
```bash
export RESEND_API_KEY=re_xxxxxxxxx
```

Get your key at [resend.com/api-keys](https://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 ([email protected])** | Use `[email protected]` — 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 `[email protected]` 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 `[email protected]` 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](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** ([email protected], [email protected]) — they bounce and destroy sender reputation.

| Address | Result |
|---------|--------|
| `[email protected]` | Simulates successful delivery |
| `[email protected]` | Simulates hard bounce |
| `[email protected]` | 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](references/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: 2 req/s) |
| 500 | Server error — retry with exponential backoff |

## Resources

- [Resend Documentation](https://resend.com/docs)
- [API Reference](https://resend.com/docs/api-reference)
- [Dashboard](https://resend.com/emails)

© resend · MIT · resend/resend-skills

See also

Project sponsors

Companies that keep this analytics open
Gold sponsor

Impressions, clicks and code copies — open statistics. We keep the numbers public for the same reason NeBlask itself is public. Become a sponsor