Connecting to Postmark
Using API Key Authentication
Postmark uses server API tokens to authenticate requests. Each Postmark server has its own API token, which controls access to messages, bounces, templates, and statistics associated with that server.
To obtain your Server API Token, log in to your Postmark account and navigate to the server you want to connect to. Go to API Tokens under the server settings and copy the token labeled Server API token.
After setting the following connection properties, you are ready to connect:
- AuthScheme: Set this to APIKey.
- APIKey: Set this to your Postmark Server API Token. This value is sent as the X-Postmark-Server-Token header on every request.
Example connection string:
Profile=C:\profiles\Postmark.apip;AuthScheme=APIKey;ProfileSettings="APIKey=your-server-api-token"
Connecting to Postmark
Once the authentication is configured, you can connect to Postmark and query data from any of the available tables such as OutboundMessages, Bounces, and Templates.
Available Tables
The Postmark API Profile provides access to the following tables:
- Bounces: Retrieve bounce records for the current Postmark server
- DeliveryStats: Retrieve delivery statistics summary for the current Postmark server
- InboundMessages: Retrieve inbound email messages received by the current Postmark server
- MessageClicks: Retrieve link click tracking events for outbound messages
- MessageOpens: Retrieve email open tracking events for outbound messages
- MessageStreams: Retrieve message streams configured for the current Postmark server
- OutboundBounceDays: Retrieve daily outbound bounce counts by type
- OutboundClickDays: Retrieve daily outbound link click counts
- OutboundMessages: Retrieve outbound email messages sent through the current Postmark server
- OutboundOpenDays: Retrieve daily outbound email open counts
- OutboundSendDays: Retrieve daily outbound email send counts
- OutboundSpamDays: Retrieve daily outbound spam complaint counts
- OutboundStats: Retrieve outbound email statistics summary
- OutboundTrackedDays: Retrieve daily counts of tracked outbound sends
- Server: Retrieve configuration and settings for the current Postmark server
- Templates: Retrieve email templates configured for the current Postmark server
Important Notes
- The APIKey must be a Server API Token, not an Account API Token. Each Postmark server has its own token.
- Statistics tables (OutboundStats, OutboundBounceDays, etc.) support optional date range filtering via FromDate and ToDate inputs.
- Message tracking tables (MessageClicks, MessageOpens) support filtering by MessageId to retrieve events for a single message.
- The Postmark API uses offset-based pagination with count and offset parameters. Count + Offset cannot exceed 10,000 for message endpoints.
- Date fields use ISO 8601 format (e.g. 2021-01-01T12:00:00). The Postmark API uses the Eastern Time Zone.
API Documentation
For more information about the Postmark API, see the official Postmark API documentation.
Usage Examples
Bounces:
SELECT * FROM Bounces
DeliveryStats:
SELECT * FROM DeliveryStats
InboundMessages:
SELECT * FROM InboundMessages
MessageClicks:
SELECT * FROM MessageClicks
MessageOpens:
SELECT * FROM MessageOpens
MessageStreams:
SELECT * FROM MessageStreams
OutboundBounceDays:
SELECT * FROM OutboundBounceDays
OutboundClickDays:
SELECT * FROM OutboundClickDays
OutboundMessages:
SELECT * FROM OutboundMessages
OutboundOpenDays:
SELECT * FROM OutboundOpenDays
OutboundSendDays:
SELECT * FROM OutboundSendDays
OutboundSpamDays:
SELECT * FROM OutboundSpamDays
OutboundStats:
SELECT * FROM OutboundStats
OutboundTrackedDays:
SELECT * FROM OutboundTrackedDays
Server:
SELECT * FROM Server
Templates:
SELECT * FROM Templates
Connection Properties
The connection string properties are the various options that can be used to establish a connection. This section provides a complete list of the options you can configure in the connection string for this provider.
| Property | Description |
| APIKey | Your Postmark Server API Token. |
| AuthScheme | The scheme used for authentication. Accepted entries are APIKey or None. Allowed values are: BASIC, NONE, NTLM, OAUTH, APIKEY, OAUTH_CLIENT |