Bouncewise

Bouncewise › Guides › Postmark message streams: transactional, broadcast, inbound

Postmark guide

Postmark message streams: transactional, broadcast and inbound

Updated · 2 min read

Short answer

A message stream is a separate lane for one kind of mail inside a Postmark server. Every server starts with a transactional stream with the ID outbound and an inbound stream; you create broadcast streams (and extra transactional ones) yourself, up to 10 streams per server. You choose the stream per email with the MessageStream field, or the X-PM-Message-Stream header over SMTP; leave it out and the email goes through outbound. Suppressions, webhooks and settings belong to each stream, and many API calls default to outbound.

The three stream types

Type (MessageStreamType)ForDefault streamUnsubscribe handling
TransactionalOne-to-one mail triggered by a user: password resets, receipts, notificationsoutbound, created with the server; it can't be archivedNone by default
BroadcastsOne-to-many mail you send on your schedule: product updates, digests, terms changesNone; you create it and choose its IDRequired; Postmark's own by default
InboundEmail received at the server's inbound address, POSTed to your webhook as JSONCreated with the server; a server can only have oneNone

Postmark sends broadcast and transactional mail over separate, parallel IP pools, so the two kinds of traffic don't share a sending reputation.

Send through a stream

Set MessageStream to the stream's ID on every message that isn't for outbound:

curl "https://api.postmarkapp.com/email" \
  -X POST \
  -H "Accept: application/json" \
  -H "Content-Type: application/json" \
  -H "X-Postmark-Server-Token: $POSTMARK_SERVER_TOKEN" \
  -d '{
    "From": "[email protected]",
    "To": "[email protected]",
    "Subject": "What is new in March",
    "HtmlBody": "<p>...</p>",
    "MessageStream": "broadcast"
  }'

Over SMTP, add the header X-PM-Message-Stream: broadcast (using your stream's ID). Broadcast mail uses its own SMTP host, smtp-broadcasts.postmarkapp.com, rather than smtp.postmarkapp.com. Alternatively generate an SMTP Token in the stream's Settings tab; those credentials only work for that stream.

A misspelt stream ID fails with ErrorCode 1235, The stream provided does not exist on this server. Sending to the inbound stream fails with 1236.

Find a stream's ID

The ID is shown at the top right of the stream's page in Postmark, or list them all:

curl "https://api.postmarkapp.com/message-streams?MessageStreamType=All&IncludeArchivedStreams=true" \
  -H "Accept: application/json" \
  -H "X-Postmark-Server-Token: $POSTMARK_SERVER_TOKEN"

Broadcast IDs aren't fixed: Postmark's own pages use both broadcast and broadcasts in examples. Use the ID your server returns. IDs start with a letter, are at most 30 characters and can't start with pm-.

Server picker listing servers with their message streams, including outbound and a broadcast stream
Each server lists its own streams.

The gotcha: many API calls default to outbound

If you leave out messagestream, the Bounce API and outbound message search only look at the outbound stream. That is why broadcast bounces seem to be missing:

curl "https://api.postmarkapp.com/bounces?count=50&offset=0&messagestream=broadcast" \
  -H "Accept: application/json" \
  -H "X-Postmark-Server-Token: $POSTMARK_SERVER_TOKEN"

The Stats API (for example /stats/outbound/spam) works the other way: without messagestream it adds up every stream on the server. Compare like with like when a dashboard and an API call disagree.

What else is per stream

  • Suppressions. Each stream has its own Suppressions tab and API (/message-streams/{stream_id}/suppressions). A hard bounce in broadcast sits on the broadcast list.
  • Webhooks. Bounce, delivery, spam complaint and other outbound webhooks are set on a stream. The inbound webhook URL is set on the inbound stream's Settings tab (or InboundHookUrl on the server), one per inbound stream.
  • Archiving. POST /message-streams/{stream_ID}/archive archives a stream; it and its activity are deleted 45 days later unless you restore it. The default transactional and inbound streams can't be archived.

Questions

What is the ID of Postmark's default stream?

outbound, a transactional stream every server has. Email sent without a MessageStream value goes through it.

How many message streams can a Postmark server have?

Up to 10, including the default ones, and only one inbound stream. Your plan may set its own limit.

Can I send newsletters through the outbound stream?

Use a broadcast stream. Postmark designates broadcast streams for one-to-many mail such as newsletters and announcements; they use separate IPs and come with unsubscribe handling.

Why can't I find a bounce in the Postmark API?

The Bounce API defaults to the outbound stream. Add messagestream with the ID of the stream the email was sent through.

Sources