Docs / Guides / Migrate from Resend

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:

  1. Changing the API host: api.resend.comapi.mailgrid.space
  2. Changing the path: /emails/api/emails
  3. Changing the API key: re_…mb_live_…

Field-by-field mapping

Resend fieldMailgrid fieldNotes
fromfromSame
totoSame (string or string[])
cc / bcccc / bccSame
reply_toreplyTocamelCase
subjectsubjectSame
html / texthtml / textSame
attachments[].pathInline base64 or fileId only (no URL fetch)
attachments[].filename / contentSamecontent base64-encoded
tags (array of objects)tags (array of strings)Simpler shape
headersheadersSame

Codemod

A find-and-replace gets you 90% of the way:

sed
# 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 typeMailgrid event
email.sentsent
email.delivereddelivered
email.openedopened
email.clickedclicked
email.bouncedbounced
email.complainedcomplained

What you gain

What's different