A Postmark-compatible email API accepts Postmark’s POST /email and POST /email/batch requests unchanged, including the X-Postmark-Server-Token header. With Mailcandor you keep the Postmark client and change the host to api.mailcandor.com and the token to a Mailcandor API key. This page lists every field that carries over, the ones that do not, and the one response detail that catches people out.
What is compatible
Mailcandor serves two Postmark endpoints:
POST https://api.mailcandor.com/emailfor one messagePOST https://api.mailcandor.com/email/batchfor a JSON list of messages
Both read the key from X-Postmark-Server-Token (or from a normal Authorization: Bearer header) and both answer in Postmark’s response shape. Other Postmark endpoints, such as templates, bounces, message search, servers and inbound rules, are not available. Use Mailcandor’s own API and dashboard for those jobs.
Verify your sending domain in Mailcandor first. Until a domain is verified, your team can only send to its own members.
Before and after: Node.js
Before:
import postmark from 'postmark';
const client = new postmark.ServerClient(process.env.POSTMARK_SERVER_TOKEN);
await client.sendEmail({
From: 'Acme <hello@acme.com>',
To: 'sam@example.com',
Subject: 'Reset your password',
HtmlBody: '<p><a href="https://acme.com/reset/abc">Reset password</a></p>',
TextBody: 'Reset your password: https://acme.com/reset/abc',
Tag: 'password-reset',
MessageStream: 'outbound',
});
After:
import postmark from 'postmark';
const client = new postmark.ServerClient(process.env.MAILCANDOR_KEY, {
requestHost: 'api.mailcandor.com',
});
const result = await client.sendEmail({
From: 'Acme <hello@acme.com>',
To: 'sam@example.com',
Subject: 'Reset your password',
HtmlBody: '<p><a href="https://acme.com/reset/abc">Reset password</a></p>',
TextBody: 'Reset your password: https://acme.com/reset/abc',
Tag: 'password-reset',
});
if (result.ErrorCode !== 0) throw new Error(result.Message);
MessageStream can stay in your code; it is ignored. The ErrorCode check is the one line worth adding, as explained below.
Before and after: curl
curl https://api.mailcandor.com/email \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "X-Postmark-Server-Token: $MAILCANDOR_KEY" \
-d '{
"From": "Acme <hello@acme.com>",
"To": "sam@example.com",
"Subject": "Reset your password",
"TextBody": "Reset your password: https://acme.com/reset/abc"
}'
A successful send answers:
{ "To": "sam@example.com", "SubmittedAt": "2026-11-16T09:00:00+00:00", "MessageID": "3f1c0e2a-6a7b-4c51-9d0e-8f1a2b3c4d5e", "ErrorCode": 0, "Message": "OK" }
MessageID is the Mailcandor email id. Use it to look the email up with GET /v1/emails/{id} or to match webhook events.
Fields that carry over
| Postmark field | What Mailcandor does with it |
|---|---|
From |
Sender, on a verified domain |
To, Cc, Bcc |
Comma-separated lists become recipient lists, up to 50 per email |
ReplyTo |
Reply-To address or addresses |
Subject |
Subject |
HtmlBody, TextBody |
HTML and plain-text parts. With only HTML, a text part is made for you |
Headers |
The [{Name, Value}] list becomes custom headers |
Tag |
A tag named tag, returned in webhooks and filterable in the log |
Attachments |
Name, Content (base64), ContentType, and ContentID with any cid: prefix removed |
Addresses are split on commas. A display name that itself contains a comma, such as "Smith, Sam" <sam@example.com>, is split in the wrong place, so keep commas out of display names.
Fields that do not carry over
| Postmark field | What happens |
|---|---|
TemplateId, TemplateAlias, TemplateModel |
Refused with ErrorCode 300 and a message |
/email/withTemplate and /email/batchWithTemplates |
Not available |
MessageStream |
Ignored. Mailcandor has no streams |
Metadata |
Ignored. Put values you need back in Tag or use the native API’s tags |
TrackOpens, TrackLinks |
Ignored |
InlineCss |
Ignored. Inline CSS before sending |
Errors arrive inside a 200
Postmark clients usually treat any 200 as success. On these compatible endpoints, a message that fails validation (an unverified From domain, a refused template, a bad attachment) comes back inside a 200 response as:
{ "ErrorCode": 300, "Message": "Postmark templates are not supported. Send HtmlBody, or use a Mailcandor template." }
Check ErrorCode on every result. Authentication problems and rate limits are different: a missing or wrong key answers 401, and going over your team’s per-second limit answers 429, both with Mailcandor’s error body.
Batch sends
POST /email/batch takes a JSON list and returns one result per message, in order. Each message is checked and queued on its own, so one bad message does not stop the others, which matches how Postmark reports batch results. Attachments are allowed here. If the body is not a list, the answer is 422 with ErrorCode 300.
const results = await client.sendEmailBatch(messages);
const failed = results.filter((r) => r.ErrorCode !== 0);
Mailcandor’s native POST /v1/emails/batch behaves differently: it checks all emails first and sends all or none. Pick the one that matches what your code expects.
Webhooks, inbound and streams
Postmark webhooks do not carry over. Mailcandor sends its own webhooks, signed with Standard Webhooks and retried up to 8 times over about 28 hours. Inbound mail works differently too: rather than Postmark’s inbound server address, you point a domain’s MX record at Mailcandor and subscribe to email.received. Inbound is included on every plan; see email APIs with inbound.
Without message streams, the clean way to keep transactional and broadcast mail apart is by domain: send receipts from acme.com and newsletters from news.acme.com, each with its own domain-locked key.
A safe way to switch
- Add and verify your domain in Mailcandor. Postmark’s DKIM record can stay while you test.
- Create a sending-only Mailcandor key.
- Change
requestHostand the token in staging, add theErrorCodecheck, and send a test. - Move templates into your app or into Mailcandor, and move webhook handling.
- Roll out and keep Postmark as a fallback for a few weeks.
See switch from Postmark for the checklist and pricing to request access.