> ## Documentation Index
> Fetch the complete documentation index at: https://docs.paubox.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Migrate from Resend

> Switch from Resend to the Paubox Email API for HIPAA compliant transactional email.

## Why migrate

Resend does not sign Business Associate Agreements (BAAs). HIPAA requires a signed BAA with any vendor that handles Protected Health Information (PHI) in transit, including transactional email providers. Paubox is purpose-built for HIPAA compliant email and signs a BAA with every customer, and TLS is on by default for every message. Resend's API uses familiar Bearer-auth and JSON patterns, so the switch is a small refactor for developers already comfortable with Resend.

## What stays the same

* REST API over HTTPS with JSON request bodies
* API key authentication via the `Authorization: Bearer` header
* Domain authentication: Paubox verifies your sending domain with an SPF record
* SMTP as an alternative to the HTTP API
* Webhook-based event notifications for delivery status

## Key differences

| Dimension | Resend | Paubox Email API |
| :- | :- | :- |
| Base URL | `https://api.resend.com/emails` | `https://api.paubox.com/v1/email/messages` |
| Auth header | `Authorization: Bearer $RESEND_API_KEY` | `Authorization: Bearer $PAUBOX_API_KEY` |
| Request body shape | `from`, `to`, `subject`, `html` flat keys | `data.message` object with `headers` and `content` keys |
| Recipients field | `to` (array of strings) | `recipients` (array of strings, nested under `data.message`) |
| SMTP host | `smtp.resend.com` | `smtp.paubox.com` |
| SMTP username | `resend` (literal) | `apikey` (literal) |
| SMTP port | 465 (recommended), 587, 25 | 587 (also supports 465, 25) |
| Webhook events | email.sent, email.delivered, email.bounced, email.opened, email.clicked, email.complained, email.delivery\_delayed | delivered, opened, temporary\_failure, permanent\_failure |
| Batch send | `/emails/batch` endpoint | `/bulk_messages` endpoint, recommended max 50 per request |
| TLS enforcement | Optional | On by default; opt out per message with `allowNonTLS` |
| BAA available | No | Yes (signed with every customer) |

## Send a single email

```bash Resend (before) theme={null}
curl -X POST https://api.resend.com/emails \
  -H "Authorization: Bearer $RESEND_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "from": "provider@yourclinic.com",
    "to": ["patient@example.com"],
    "subject": "Your appointment summary",
    "html": "<p>See attached.</p>"
  }'
```

```bash Paubox (after) theme={null}
curl -X POST https://api.paubox.com/v1/email/messages \
  -H "Authorization: Bearer $PAUBOX_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "data": {
      "message": {
        "recipients": ["patient@example.com"],
        "headers": {
          "subject": "Your appointment summary",
          "from": "provider@yourclinic.com"
        },
        "content": {
          "text/html": "<p>See attached.</p>"
        }
      }
    }
  }'
```

## SMTP configuration

```js Resend (before) theme={null}
const transporter = nodemailer.createTransport({
  host: 'smtp.resend.com',
  port: 465,
  auth: {
    user: 'resend',
    pass: process.env.RESEND_API_KEY,
  },
});
```

```js Paubox (after) theme={null}
const transporter = nodemailer.createTransport({
  host: 'smtp.paubox.com',
  port: 587,
  auth: {
    user: 'apikey',
    pass: process.env.PAUBOX_API_KEY,
  },
});
```

> [!TIP]
>
> **Tip:**
>
> Two changes are required: update `host` from `smtp.resend.com` to `smtp.paubox.com`, and change the literal username from `resend` to `apikey`.

## Webhook event mapping

| Resend event | Paubox event key | Notes |
| :- | :- | :- |
| `email.delivered` | `api_mail_log_delivered` | |
| `email.opened` | `api_mail_log_opened` | |
| `email.bounced` | `api_mail_log_permanent_failure` | |
| `email.delivery_delayed` | `api_mail_log_temporary_failure` | |
| `email.clicked` | no equivalent | Remove handler or no-op; poll click data via [Get message receipt](https://docs.paubox.com/email-api/message-receipt.md) |
| `email.complained` | no equivalent | Remove handler |
| `email.sent` | no equivalent | Remove handler; `delivered` confirms acceptance |

> [!NOTE]
>
> **Note:**
>
> Click counts are available by polling `GET /message_receipt?sourceTrackingId=...`; they are not delivered as a push webhook event. The receipt includes them only when **Click Tracking** is turned on in [Settings > Email API](https://next.paubox.com/settings/email_api). It is off by default.

## Migration checklist

**1. Sign a BAA with Paubox**

Required before go-live. Contact Paubox to initiate the Business Associate Agreement.

**2. Create an account and verify your sending domain**

Add your domain on the [Settings > Domains](https://next.paubox.com/settings/domains) page, add `include:_spf.paubox.com` to your domain's SPF record as shown on the domain's page, then click **Verify**. The record shown adds the Paubox include to your existing SPF entries rather than replacing them, so Resend keeps working while you migrate. See the [Quickstart guide](https://docs.paubox.com/email-api/quickstart.md) for step-by-step instructions.

**3. Generate a Paubox API key**

From the [Settings > API Keys](https://next.paubox.com/settings/api_keys) page, generate an API key with the **Paubox Email API** scope for your verified domain. All requests use the base URL `https://api.paubox.com/v1/email`.

**4. Update base URL, auth header, and request body**

Apply the changes shown in the [Key differences](#key-differences) table and [Send a single email](#send-a-single-email) section above. Note that recipients move from a top-level `to` array into `data.message.recipients`.

**5. Update SMTP credentials**

If you use the SMTP path, update `host` to `smtp.paubox.com` and change the literal username from `resend` to `apikey`. See [SMTP configuration](#smtp-configuration) above.

**6. Remap or remove webhook handlers**

Update your webhook endpoint using the [event mapping table](#webhook-event-mapping) above. Remove handlers for `email.clicked`, `email.complained`, and `email.sent`.

**7. Remove any code that disables TLS**

Paubox sends every message over TLS by default and falls back to a Secure Portal message when the recipient server cannot accept TLS. Remove any `allowNonTLS: true` or equivalent settings unless you intend to allow non-TLS delivery, which is not HIPAA compliant for messages containing PHI.

**8. Send a test message**

Confirm delivery using the [Get message receipt](https://docs.paubox.com/email-api/message-receipt.md) endpoint with the `sourceTrackingId` returned from your test send.

**9. Remove Resend DNS records**

Once traffic has fully moved to Paubox, remove Resend's SPF entries and DKIM records from your DNS. Keep `include:_spf.paubox.com`. Paubox Email API domains need no DKIM record of their own.

**10. Revoke Resend API keys**

Once traffic has fully moved to Paubox, revoke your Resend API keys.

## Next steps

> [card] [Quickstart guide](https://docs.paubox.com/email-api/quickstart.md)
>
> Full setup walkthrough from account creation to first send

> [card] [Webhooks reference](https://docs.paubox.com/email-api/webhooks.md)
>
> Configure delivery event notifications

> [card] [Batch send](https://docs.paubox.com/email-api/bulk-messages.md)
>
> Send multiple messages in one request (recommended max 50)

> [card] [SMTP API](https://docs.paubox.com/email-api/smtp.md)
>
> Connect via SMTP instead of REST


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.