Skip to main content
Once your Postmark provider and IP Pool are configured, you can send emails through Postmark using the standard SendPost API. Postmark is used for template-based sending only: you must specify a Postmark template alias.
Important: When routing to Postmark you must include:
  • ippool – The SendPost IP Pool that routes traffic to your Postmark provider
  • tpspTemplate – The Postmark template alias (required; without it, send returns an error)

Template-Based Sending (Required)

Postmark sends via the Send email with template API. The template alias is taken from the tpspTemplate parameter and passed to Postmark as TemplateAlias. Custom data for the template comes from your request’s custom fields (e.g. customFields / template model).

Basic Template Email Example

curl -X POST "https://api.sendpost.io/api/v1/subaccount/email/" \
  -H "X-SubAccount-ApiKey: YOUR_SENDPOST_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "from": {
      "email": "sender@yourdomain.com",
      "name": "Your Name"
    },
    "to": [{
      "email": "recipient@example.com",
      "name": "Recipient Name"
    }],
    "subject": "Hello from SendPost via Postmark",
    "ippool": "postmark-pool",
    "tpspTemplate": "welcome-template",
    "trackOpens": true,
    "trackClicks": true
  }'
  • ippool: SendPost IP Pool configured to route to your Postmark provider
  • tpspTemplate: Postmark template alias (e.g. welcome-template) – required when sending via Postmark
  • customFields: Object passed to Postmark as TemplateModel (use empty {} if no variables)

Template with Personalization (Template Model)

Pass template variables via customFields; they are sent to Postmark as TemplateModel:
curl -X POST "https://api.sendpost.io/api/v1/subaccount/email/" \
  -H "X-SubAccount-ApiKey: YOUR_SENDPOST_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "from": {
      "email": "sender@yourdomain.com",
      "name": "Your Company"
    },
    "to": [{
      "email": "john@example.com",
      "name": "John Doe",
      "customFields": {
        "firstName": "John",
        "accountType": "Premium"
      }
    }],
    "subject": "Welcome {{firstName}}!",
    "ippool": "postmark-pool",
    "tpspTemplate": "welcome-template",
    "trackOpens": true,
    "trackClicks": true
  }'
Postmark will receive TemplateModel with these keys for use inside the template.

Optional Parameters

ParameterDescription
replyToReply-to address (optional)
cc / bccCc and Bcc recipients (optional)
headersCustom headers; sent as Headers array to Postmark
trackOpensEnable open tracking (default: as configured)
trackClicksEnable click tracking; maps to TrackLinks: “HtmlAndText” or “HtmlOnly”
SendPost also sends metadata (e.g. accountId, tpspId, subAccountId, emailType, messageId, messageSubject) to Postmark for webhook attribution; you do not need to set these manually.

Message Stream

The Message Stream used for sending is the one you selected when creating the Postmark provider in SendPost. It is stored with the TPSP and sent with every request to Postmark; you do not pass it in each API call. The same stream is used for the webhook registered at setup.

Response

Success Response (HTTP 200):
[
  {
    "messageId": "abc123-def456-ghi789",
    "errorCode": 0,
    "to": "recipient@example.com"
  }
]
On success, Postmark accepts the message and SendPost records a PMProcessed (ID: 69) event. Delivery, opens, clicks, bounces, and spam complaints are reported via webhooks and appear as PM* event types in SendPost. Retries: SendPost retries on 429 (rate limit) and 5xx from Postmark. On 4xx (except 429), no retry is performed.

Next Steps