{ }
Resource profile / Resend Email API Integration
About this skill

Workflow & requirements

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 <[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

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)

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
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. These are the minimum versions for full functionality (sending, receiving, webhook verification):

Language Package Min Version Install
Node.js resend >= 6.14.0 npm install resend
Python resend >= 2.34.0 pip install resend
Go resend-go/v3 >= 3.11.0 go get github.com/resend/resend-go/v3
Ruby resend >= 1.6.0 gem install resend
PHP resend/resend-php >= 1.1.0 composer require resend/resend-php
Rust resend-rs >= 0.26.1 cargo add resend-rs
Java resend-java >= 4.16.0 See installation.md
.NET Resend >= 0.2.1 dotnet 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 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

# 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) 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 ([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 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

PACKAGE TRANSPARENCY

Inspect before installing

Source: Resend · MIT · SHA-256 shown alongside the download.

27 files67321 ZIP bytes2 script/code files

License file included. A license and checksum are not a security certification. Review package instructions and scripts before running them.

View files and uncompressed sizes

An adaptation record is bundled. Inspect the declared changes and archived original before use. Review adaptation and original-file hashes →

Machine-readable installation guide →
CATALOG REVIEW NOTES

Know what you need before installing

Source and packaging checks recorded on 2026-10-03. These notes are not safety certification or measured task performance.

Requirements

An authorized Resend account, a suitable SDK/runtime, verified sender domain and securely configured RESEND_API_KEY. Receiving requires separate domain/MX setup, a reachable POST webhook and signing-secret verification. The included template-listing helper needs Node.js and the resend SDK; it reads account templates and prints their contents. Use only an authorized test account and avoid logging personal template data.

Costs, access & practical limits

Pinned upstream guidance is a snapshot. Check current official API/SDK/CLI documentation before relying on parameter support, authentication precedence, quotas or beta features. BB Skills does not provide accounts, credentials, domains, sending capacity or a model. No real email was sent or received and no full agent workflow was evaluated. Optional upstream fields depend on client support; this catalog checks core identity fields, not every client feature. The pinned main instructions state batch sending is atomic and excludes scheduling, while current official documentation exposes strict/permissive validation and scheduled_at; verify the endpoint and SDK version. Only references/fetch-all-templates.mjs is adapted: validate page shapes, reject empty continuation or repeated cursors, and stop after 1000 pages. The exact original script is archived; the primary instructions and other references are unchanged.

View the recorded checks
  • Pinned upstream files verified against Git blob hashes
  • Complete original MIT copyright and permission notice preserved
  • Main metadata, installed folder and local Markdown links verified
  • External credentials, version drift and scope disclosed
  • Pagination helper changes explicitly declared; original retained

Upstream commit: edbfece3f4029ff8258ac74e000ec8282377f317

Runtime status: not tested by this catalog. Configure your client and test the skill in your own environment.

SCENARIOS

Inputs, criteria and recorded outcomes

Records are supplied by the site administrator and bound to a specific package. They are not third-party safety certification. This page does not execute skills.

Template pagination helper: nine offline SDK fixtures

Reported passed · vedbfece3f402.bb1

View input and acceptance criteria

Input

Run the installed template-listing helper bytes in isolated Node processes against a local synthetic Resend SDK stub with outbound network APIs disabled. Cover normal/empty/multi-page responses, SDK error, invalid response shape, empty continuation, invalid/repeated cursor and the 1000-page bound. Use no real credentials or email data.

Acceptance criteria

All nine fixture assertions match expected exits, synthetic call counts and guard messages. An error exit is expected for invalid/error fixtures. This validates helper guards only, not real SDK/provider integration, email delivery or the full skill.

Recorded outcome

Nine synthetic pagination/helper checks only. No real Resend SDK, provider API, email sending, rendering, mailbox or full AI-agent evaluation.
[
  {
    "case": "single",
    "passed": true,
    "process_exit": 0,
    "mock_sdk_calls": 1,
    "expected_behavior": "Fetched 1 templates"
  },
  {
    "case": "empty-terminal",
    "passed": true,
    "process_exit": 0,
    "mock_sdk_calls": 1,
    "expected_behavior": "Fetched 0 templates"
  },
  {
    "case": "multi",
    "passed": true,
    "process_exit": 0,
    "mock_sdk_calls": 2,
    "expected_behavior": "Fetched 2 templates"
  },
  {
    "case": "provider-error",
    "passed": true,
    "process_exit": 1,
    "mock_sdk_calls": 1,
    "expected_behavior": "synthetic SDK failure"
  },
  {
    "case": "invalid-shape",
    "passed": true,
    "process_exit": 1,
    "mock_sdk_calls": 1,
    "expected_behavior": "Invalid template pagination response"
  },
  {
    "case": "empty-continuation",
    "passed": true,
    "process_exit": 1,
    "mock_sdk_calls": 1,
    "expected_behavior": "empty continuation page"
  },
  {
    "case": "invalid-cursor",
    "passed": true,
    "process_exit": 1,
    "mock_sdk_calls": 1,
    "expected_behavior": "invalid or repeated cursor"
  },
  {
    "case": "repeated-cursor",
    "passed": true,
    "process_exit": 1,
    "mock_sdk_calls": 2,
    "expected_behavior": "invalid or repeated cursor"
  },
  {
    "case": "page-limit",
    "passed": true,
    "process_exit": 1,
    "mock_sdk_calls": 1000,
    "expected_behavior": "exceeded 1000 pages"
  }
]
Original comparison: Original helper did not reject the empty continuation before the mock SDK stopped it; no real API requests occurred.
{
  "script_sha256": "0cfad3a68f8c14673a31870372879ab5f1f0e198dfad5bb0db5efc600533873e",
  "original_script_sha256": "6f98543145b4f8e1825c2cd609728f8696f8878b33323af235a241e8c8c2ae2e",
  "probe_sha256": "7b1a6875f1692ff0b0bfc44048f4e440ffc2bfbaa145581cdf1891eff110b77d"
}

Environment

v24.10.0; Windows; offline SDK stub; isolated subprocesses; network APIs disabled

Package SHA-256: d5c6dc17ec42f935d501cb510d9986f9e3514cfd8e775b15ed0f930e64ee6d5c

Outcome recorded: 2026-10-03 03:29 UTC

Community reviews

★ New

Be the first to share your experience.

Sign in to leave a review →

More to explore

View all ↗