Migrate from Resend

Step-by-step guide to migrate from Resend to Postflare.

Overview

Postflare is an open-source, Resend-compatible email platform built on Cloudflare infrastructure. The API is designed to be a drop-in replacement for Resend, so migration typically requires minimal code changes.

Key advantages:

  • Self-hosted — deploy on your own Cloudflare account for full data ownership
  • Resend SDK compatible — use the official Resend SDK with a baseURL override
  • Open source — audit, extend, and customize to your needs

Step 1: Create a Postflare Account

Sign up at app.postflare.app and create an organization. If self-hosting, deploy Postflare to your own Cloudflare account first.

Step 2: Configure Your Domain

Add your sending domain in the Postflare dashboard. If you already have SPF, DKIM, and DMARC records configured for Resend, you will need to update them to point to Postflare.

  1. Go to Domains in the dashboard
  2. Click Add Domain and enter your domain name
  3. Update your DNS records as shown in the dashboard
  4. Click Verify to confirm the records are correct

Step 3: Create an API Key

Create a new API key in the Postflare dashboard. Postflare uses the same re_ prefix format as Resend for API keys.

Step 4: Update Your SDK Configuration

The Resend SDK can be used directly with Postflare by overriding the baseUrl:

Node.js / TypeScript

  import { Resend } from 'resend';

  const resend = new Resend('re_your_new_postflare_key', {
+   baseUrl: 'https://api.postflare.app',
  });

  // All SDK methods work the same
  const { data, error } = await resend.emails.send({
    from: 'hello@yourdomain.com',
    to: 'user@example.com',
    subject: 'Hello from Postflare',
    html: '<p>It works!</p>',
  });

Python

  import resend

- resend.api_key = "re_your_resend_key"
+ resend.api_key = "re_your_new_postflare_key"
+ resend.base_url = "https://api.postflare.app"

  params: resend.Emails.SendParams = {
      "from": "hello@yourdomain.com",
      "to": ["user@example.com"],
      "subject": "Hello from Postflare",
      "html": "<p>It works!</p>",
  }

  email = resend.Emails.send(params)

cURL

- curl -X POST 'https://api.resend.com/emails' \
+ curl -X POST 'https://api.postflare.app/emails' \
-   -H 'Authorization: Bearer re_your_resend_key' \
+   -H 'Authorization: Bearer re_your_new_postflare_key' \
    -H 'Content-Type: application/json' \
    -d '{
      "from": "hello@yourdomain.com",
      "to": "user@example.com",
      "subject": "Hello from Postflare",
      "html": "<p>It works!</p>"
    }'

Step 5: Migrate Webhooks

If you use webhooks, create new webhook endpoints in Postflare. The webhook event format is compatible with Resend.

Postflare also supports additional event types not available in Resend:

Event TypeDescription
domain.createdDomain was added
domain.updatedDomain status changed
domain.deletedDomain was removed
contact.createdContact was created
contact.updatedContact was updated
contact.deletedContact was deleted

Step 6: Test

Send a test email to verify everything works:

const { data, error } = await resend.emails.send({
  from: 'hello@yourdomain.com',
  to: 'test@example.com',
  subject: 'Migration Test',
  html: '<p>Postflare is working!</p>',
});

if (error) {
  console.error('Error:', error);
} else {
  console.log('Email sent:', data.id);
}

API Compatibility Reference

The following table lists all Postflare API endpoints and their Resend compatibility status.

Emails

EndpointMethodResend Compatible
/emailsPOSTCompatible
/emails/batchPOSTCompatible
/emailsGETCompatible
/emails/{id}GETCompatible
/emails/{id}PATCHCompatible
/emails/{id}/cancelPOSTCompatible

Domains

EndpointMethodResend Compatible
/domainsPOSTCompatible
/domainsGETCompatible
/domains/{id}GETCompatible
/domains/{id}/verifyPOSTCompatible
/domains/{id}DELETECompatible

Contacts

EndpointMethodResend Compatible
/contactsPOSTPartial -- adds properties, segments, topics fields
/contactsGETPartial -- organization-level instead of audience-scoped
/contacts/{id}GETPartial -- supports lookup by email address
/contacts/{id}PATCHPartial -- adds properties, topics fields
/contacts/{id}DELETEPartial -- supports lookup by email address

API Keys

EndpointMethodResend Compatible
/api-keysPOSTCompatible
/api-keysGETCompatible
/api-keys/{id}DELETECompatible

Webhooks

EndpointMethodResend Compatible
/webhooksPOSTPartial -- additional event types
/webhooksGETCompatible
/webhooks/{id}GETCompatible
/webhooks/{id}PATCHCompatible
/webhooks/{id}DELETECompatible

Additional Postflare Endpoints

Postflare includes additional endpoints not available in Resend:

EndpointMethodDescription
/segmentsPOST/GETSegment management
/segments/{id}GET/DELETESegment operations
/topicsPOST/GETTopic management
/topics/{id}GET/PATCH/DELETETopic operations
/contacts/{id}/segmentsGET/POST/DELETEContact segment membership
/contacts/{id}/topicsGET/PATCHContact topic subscriptions
/broadcastsPOST/GETBroadcast management
/broadcasts/{id}GET/PATCH/DELETEBroadcast operations
/broadcasts/{id}/sendPOSTSend a broadcast
/templatesPOST/GETTemplate management
/templates/{id}GET/PATCH/DELETETemplate operations
/templates/{id}/publishPOSTPublish a template
/templates/{id}/duplicatePOSTDuplicate a template

On this page