Postmark
Send and track transactional email through the Postmark API. Send raw or template-based emails, list bounces, and pull delivery and outbound statistics.
- Base URL:
https://api.postmarkapp.com - Auth:
X-Postmark-Server-Token: <apiKey>header (Postmark Server API Token) - Standard library only (Python
urllib/json) — no external dependencies. Response bodies are capped at 5 MB.
Operations
| Operation | Method / Endpoint | Purpose |
|---|---|---|
send-email |
POST /email |
Send a single transactional email (HTML and/or text). |
send-email-template |
POST /email/withTemplate |
Send an email rendered from a Postmark template. |
list-bounces |
GET /bounces |
List bounced messages, optionally filtered by type/recipient. |
get-delivery-stats |
GET /deliverystats |
Summary of bounce counts and inactive addresses. |
get-outbound-stats |
GET /stats/outbound |
Aggregate outbound send statistics. |
apiKey setup
- Sign in to the Postmark dashboard.
- Open your Server, then go to the API Tokens tab.
- Copy the Server API Token and pass it as the
apiKeyinput. The tool sends it as theX-Postmark-Server-Tokenheader. - For testing without sending real mail, use the special token value
POSTMARK_API_TEST.
Note: the
fromaddress must be a verified Sender Signature (or be on a verified domain) in your Postmark account, or the send will be rejected.
Inputs
apiKey(required) — Postmark Server API Token.operation(required) — one of the operations above.from,to,subject,htmlBody,textBody,cc,bcc,replyTo,tag,messageStream— forsend-email(at least one ofhtmlBody/textBodyis required).from,to,templateIdortemplateAlias,templateModel(JSON),messageStream— forsend-email-template.type,recipient,count,offset— optional filters forlist-bounces.fromDate,toDate,tag— optional filters forget-outbound-stats.
Output
Every call prints a single JSON envelope:
{ "result": "<response body as JSON string>", "status": "<http status code>" }
On failure it prints { "error": "...", "status": "0", "result": "" } and exits non-zero, marking the step as failed.
Examples
Send a transactional email
operation: send-email
apiKey: <your-server-token>
from: [email protected]
to: [email protected]
subject: Your receipt
textBody: Thanks for your purchase!
tag: receipt
A successful send returns { "MessageID": "...", "SubmittedAt": "...", "ErrorCode": 0, "Message": "OK", "To": "[email protected]" }.
Send via a template
operation: send-email-template
apiKey: <your-server-token>
from: [email protected]
to: [email protected]
templateAlias: welcome
templateModel: {"name":"Sam","product_url":"https://app.example.com"}
List recent hard bounces
operation: list-bounces
apiKey: <your-server-token>
type: HardBounce
count: 50
Check delivery stats
operation: get-delivery-stats
apiKey: <your-server-token>