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.Documentation Index
Fetch the complete documentation index at: https://docs.sendpost.io/llms.txt
Use this file to discover all available pages before exploring further.
Template-Based Sending (Required)
Postmark sends via the Send email with template API. The template alias is taken from thetpspTemplate 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
ippool: SendPost IP Pool configured to route to your Postmark providertpspTemplate: Postmark template alias (e.g.welcome-template) – required when sending via PostmarkcustomFields: Object passed to Postmark asTemplateModel(use empty{}if no variables)
Template with Personalization (Template Model)
Pass template variables viacustomFields; they are sent to Postmark as TemplateModel:
TemplateModel with these keys for use inside the template.
Postmark Tag
Postmark supports a singleTag per email for categorization in dashboards and reports. SendPost maps the first entry of the groups array on the send request to Postmark’s Tag.
- Pass
groups: ["transactional"]to sendTag: "transactional"to Postmark - Postmark accepts only one tag per email — additional entries in
groupsare dropped silently - If
groupsis empty or omitted, noTagis sent
Custom Metadata
Postmark supports custom metadata attached to each email; it is visible in the Postmark dashboard, in Postmark search, and is included in payloads delivered to your own Postmark webhooks. To attach custom metadata when sending via SendPost, add entries to theheaders object in the request payload with keys prefixed by TPSP_METADATA_ (case-insensitive). SendPost strips the prefix and forwards each key/value pair to Postmark as Metadata. The TPSP_METADATA_* entries are removed from the Headers array sent to Postmark and will not appear as MIME headers on the message Postmark relays. Other (non-prefixed) entries in headers continue to be passed to Postmark as regular MIME headers.
For example, "TPSP_METADATA_order_id": "ORD-78921" in the payload becomes Metadata: { "order_id": "ORD-78921" } on Postmark, while "X-Entity-Ref-ID": "ORD-78921" is forwarded to Postmark as a regular MIME header on the email itself.
Reserved Keys
The following keys are used by SendPost for webhook attribution and cannot be overridden. Entries likeTPSP_METADATA_accountId are dropped silently:
accountIdtpspIdsubAccountIdemailTypemessageIdmessageSubject
The customer’s casing on the stripped key is preserved — Postmark accepts mixed-case keys, and SendPost does not normalize them.
TPSP_METADATA_OrderId is sent to Postmark as OrderId, not orderid.Limits
Postmark enforces the following limits. SendPost applies them before sending and drops any entry that violates a limit — the send still succeeds for the remaining metadata.| Limit | Value |
|---|---|
| Maximum keys per email | 25 |
Maximum key length (after the TPSP_METADATA_ prefix is stripped) | 50 characters |
| Maximum value length | 200 characters |
Visibility
Custom metadata is visible in the Postmark dashboard, in Postmark search, and on payloads Postmark delivers to your own webhooks. SendPost does not store custom metadata in its analytics — it is not surfaced in SendPost events or dashboards.
Optional Parameters
| Parameter | Description |
|---|---|
replyTo | Reply-to address (optional) |
cc / bcc | Cc and Bcc recipients (optional) |
groups | First entry is sent as Postmark’s Tag (see Postmark Tag) |
headers | Custom headers object; sent as Headers array to Postmark. Entries with keys prefixed TPSP_METADATA_ are stripped and routed to Postmark’s Metadata instead (see Custom Metadata) |
trackOpens | Enable open tracking (default: as configured) |
trackClicks | Enable click tracking; maps to TrackLinks: “HtmlAndText” or “HtmlOnly” |
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):Next Steps
- Understand event types for PMProcessed, PMDelivered, PMOpen, etc.
- View analytics for your Postmark emails
- Troubleshoot sending or template errors