The Postmark Statistics API
The Postmark web app is full of great information about the emails you send and process. You can view emails sent, processed, bounced and even filter by tag and by date range. We also have weekly digests, showing combined statistics for each week per server. But what if you wanted to get these statistics into your own application? We’ve already made some huge leaps in our API when we launched endpoints for Messages, Servers and Sender Signatures.
Today, after a lot of work by Milan and the rest of the team, we’re launching the Stats API. This new endpoint will allow you to build statistics information directly into your own applications. Let’s cover some of the awesome things you can do with it.
What kind of stats can you get? #
For the initial release, stats are focused on Outbound emails only. Stats, like Messages, are also bound to a server and server token. Here are some of the general statistics you can requests:
The sent stats allows you to requests daily send counts by day, along with the total count for the date range. You can filter by a data range as well as tags that have been used for your emails.
For a while now we’ve had the /deliverystats endpoint. With the new stats API, we will eventually phase out that endpoint in favor of this new bounce stats API. With this call you can requests bounce counts and types across a date range and any tags that were used in your emails.
Similar to the bounce API, you can requests how many spam complaints a particular server has generated. In addition, you can filter spam complaints by tag and date range.
Open statistics
Wait, Opens!? Yep, right around the corner from this release is open tracking. In fact, it’s running in production as a beta feature and we’re already using it. Keep an eye out for the announcement coming very soon. For now, here is a sneak peek at what you can do with the open tracking statistics API:
- Tracked: Get the count of how many emails have open tracking enabled.
- Opens: Get the count of total and unique opens.
- Platforms: Request a list of platforms (webmail, mobile, desktop) used to open emails
- Clients: Request a list of email clients (Apple Mail, Outlook, etc) used to open your emails.
Each of the calls above can be filtered by date range and tag, allowing you to grab detailed statistics for specific emails (welcome email, drip campaigns) as well as allowing you to A/B test different content.
This is a big update. However, the better news is that it is only a small update to prepare for next week’s release of open tracking. You’re going to be thrilled to see it in action and we can’t wait to release it. Stay tuned!