---
title: "Migrating from Postmark"
description: "You can keep sending through your Postmark server: connect it under Sending providers (server token, plus the account token if you want OneSend to manage the domain) and OneSend routes through it."
url: https://onesend.email/docs/migrate/postmark/
---
# Migrating from Postmark

You can keep sending through your Postmark server: connect it under **Sending providers** (server token, plus the account token if you want OneSend to manage the domain) and OneSend routes through it.

## Option 1: the compatibility endpoints

| Postmark | OneSend |
|---|---|
| `POST /email` | `POST /compat/postmark/email` |
| `POST /email/batch` | `POST /compat/postmark/email/batch` (up to 500) |
| `POST /email/withTemplate` | `POST /compat/postmark/email/withTemplate` |
| `POST /email/batchWithTemplates` | `POST /compat/postmark/email/batchWithTemplates` |

Authenticate with the `X-Postmark-Server-Token` header carrying a OneSend API key, as the Postmark libraries do. `Authorization: Bearer` is not accepted on these endpoints. Responses use Postmark's shape: `{ "To", "SubmittedAt", "MessageID", "ErrorCode": 0, "Message": "OK" }`, where `MessageID` is the OneSend email id. Batch requests return one result per message; check `ErrorCode` in each, as with Postmark.

With the Postmark Node.js library, set the request host:

```js
const postmark = require('postmark');
const client = new postmark.ServerClient(process.env.ONESEND_API_KEY, { requestHost: 'mail.example.com/compat/postmark' });
await client.sendEmail({ From: 'hello@acme.dev', To: 'ada@example.com', Subject: 'Hello', TextBody: 'Hi' });
```

Check the option name against the library version you use. With plain HTTP, replace `https://api.postmarkapp.com` with `https://<your server>/compat/postmark`.

### Field mapping

| Postmark | OneSend | Notes |
|---|---|---|
| `From`, `Subject`, `HtmlBody`, `TextBody` | `from`, `subject`, `html`, `text` | |
| `To`, `Cc`, `Bcc`, `ReplyTo` (comma-separated) | lists | Quoted names with commas are kept together. At most 50 recipients across To, Cc and Bcc. |
| `Tag` | `tags: [Tag]` | |
| `Metadata` | `metadata` | |
| `Headers: [{ Name, Value }]` | `headers` | Reserved headers (To, From, Subject, …) are refused, as in `/v1/emails`. |
| `TrackOpens` | `tracking.opens` | |
| `TrackLinks` | `tracking.clicks` | `None` turns click tracking off; any other value turns it on for HTML links. Text-only link tracking is not available. |
| `MessageStream` | `type` | A stream whose name contains `broadcast` sends as marketing (List-Unsubscribe headers, campaign providers only). Others send as transactional. |
| `Attachments: [{ Name, Content, ContentType }]` | `attachments` | |
| `TemplateId` or `TemplateAlias`, `TemplateModel` | `template`, `variables` | A OneSend template id or slug. OneSend templates use `{{variable}}` syntax; check sections and loops after moving a Postmark template. |

Ignored (listed in `X-OneSend-Ignored-Fields`): `InlineCss` (OneSend templates are already inlined), attachment `ContentID` (inline images).

Errors use Postmark's shape `{ "ErrorCode", "Message" }`: 401 with code 10 for a missing or invalid token, and 422 with code 300 (invalid request), 400 (the key may not send from this domain), 402 (invalid JSON), 405 (the key may not send), 1101 (template not found) or 410 (more than 500 messages).

Other Postmark APIs (bounces, message streams, templates, stats) have no compat equivalent. Use `/v1/emails`, `/v1/suppressions`, `/v1/templates` and `/v1/statistics/overview`.

## Option 2: the native API

| Postmark | OneSend |
|---|---|
| `client.sendEmail(...)` | `onesend.emails.send(...)` or `POST /v1/emails` |
| `client.sendEmailBatch([...])` | `POST /v1/emails/batch` (up to 100 per request) |
| `client.sendEmailWithTemplate(...)` | `template` + `variables` on `/v1/emails` |
| Broadcast stream | `type: "broadcast"`, or campaigns (`/v1/campaigns`) |
| Webhooks | OneSend webhooks ([Webhooks](https://onesend.email/docs/webhooks/)) |

## DNS

Keep Postmark's DKIM record (`<date>pm._domainkey`) and its custom Return-Path CNAME (`pm-bounces.<domain>`). Postmark's SPF is handled by the Return-Path, so your root SPF needs no Postmark include. Add the `_onesend-verify` TXT record and records for any providers you add.

## Suppressions

Export inactive recipients (hard bounces, spam complaints, manual suppressions) per message stream from Postmark and import them as described in the [cutover checklist](https://onesend.email/docs/migrate/#general-cutover-checklist). Suppressions from a broadcast stream map to `"scope":"broadcast"`.

Then follow the [general cutover checklist](https://onesend.email/docs/migrate/#general-cutover-checklist).
