Migrate from Resend
Drop-in API compatibility. Migrate a typical Resend app in under an hour.
API shape compatibility
Mailgrid's POST /api/emails takes the same fields as Resend's POST /emails with a few additions. Your existing call sites should work after only:
- Changing the API host:
api.resend.com→api.mailgrid.space - Changing the path:
/emails→/api/emails - Changing the API key:
re_…→mb_live_…
Field-by-field mapping
| Resend field | Mailgrid field | Notes |
|---|---|---|
from | from | Same |
to | to | Same (string or string[]) |
cc / bcc | cc / bcc | Same |
reply_to | replyTo | camelCase |
subject | subject | Same |
html / text | html / text | Same |
attachments[].path | — | Inline base64 or fileId only (no URL fetch) |
attachments[].filename / content | Same | content base64-encoded |
tags (array of objects) | tags (array of strings) | Simpler shape |
headers | headers | Same |
Codemod
A find-and-replace gets you 90% of the way:
# 1. Host + path sed -i 's|api.resend.com/emails|api.mailgrid.space/api/emails|g' src/**/*.{ts,js} # 2. Env var sed -i 's|process.env.RESEND_API_KEY|process.env.MAILGRID_API_KEY|g' src/**/*.{ts,js} # 3. reply_to → replyTo sed -i 's|reply_to:|replyTo:|g' src/**/*.{ts,js}
Webhook events
Resend's webhook event names map cleanly:
| Resend type | Mailgrid event |
|---|---|
email.sent | sent |
email.delivered | delivered |
email.opened | opened |
email.clicked | clicked |
email.bounced | bounced |
email.complained | complained |
What you gain
- 2.5× cost reduction ($0.40 vs $1.00 per 1k)
- MCP server — your agents can drive sends directly
- Multi-stream — proper transactional/marketing isolation
- File Cache — attach-by-id, dramatic payload reduction
- Dedicated IPs at $24.95/mo (Resend: $30/mo)
- Self-host option — MIT-licensed, ~$8/mo to run yourself
What's different
- No React Email template engine — Mailgrid uses Handlebars (simpler, deterministic). Pre-render React on your side and pass the resulting HTML.
- No native dashboard UI yet — API + MCP only.
- Attachments don't auto-fetch from URLs — use File Cache or inline base64.