Sending

Postmark-compatible email API: keep your client, change the host

Short answer

A Postmark-compatible email API accepts Postmark's POST /email and /email/batch requests with the X-Postmark-Server-Token header, so the Postmark client keeps working after you change the host and the token. Mailcandor carries over From, To, Cc, Bcc, ReplyTo, Subject, HtmlBody, TextBody, Headers, Tag and Attachments. Templates are refused, and MessageStream, Metadata and tracking flags are ignored.

Last checked 16 November 2026

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/email for one message
  • POST https://api.mailcandor.com/email/batch for 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

  1. Add and verify your domain in Mailcandor. Postmark’s DKIM record can stay while you test.
  2. Create a sending-only Mailcandor key.
  3. Change requestHost and the token in staging, add the ErrorCode check, and send a test.
  4. Move templates into your app or into Mailcandor, and move webhook handling.
  5. Roll out and keep Postmark as a fallback for a few weeks.

See switch from Postmark for the checklist and pricing to request access.

Questions

Can I keep the official Postmark Node.js client?

Yes. Create the ServerClient with a Mailcandor API key and the option requestHost set to api.mailcandor.com. sendEmail and sendEmailBatch then send through Mailcandor.

Do Postmark templates work?

No. A message with TemplateId or TemplateAlias is refused, and the /email/withTemplate endpoint does not exist. Send HtmlBody, or move the template into Mailcandor and use its native API.

What happens to MessageStream?

It is ignored. Mailcandor has no message streams. To separate transactional and broadcast mail, send them from different domains or subdomains and use a key locked to each.

Why did a failed send return HTTP 200?

Message errors come back in the Postmark style, as ErrorCode 300 with a Message, inside a 200 response. Always check ErrorCode, as you would with Postmark batch results.

Do Postmark webhooks keep working?

No. Mailcandor sends its own signed webhook events in its own JSON shape. Point a new handler at them.

Related

Send with someone on your side.

Unlimited domains on every plan, a person before any block, and 3,000 emails a month free. Tell us what you send and we set you up within one business day.