Overview

Integration

User guide

API reference

Webhooks

Managing servers

Why use the servers API? #

In Postmark, servers are a way to organize the emails that you are sending or parsing. Each server has a unique inbound address and API token. Message activity and statistics are aggregated per server as well. You can use this to differentiate between different environments (production/staging), different clients, or different applications. You can use the /servers API to manage the servers in your account. For full details of this endpoint, please refer to the servers API reference.

Creating a server #

Creating a server is a pretty simple API call. Below is a discussion of some important points.

Authentication

Servers belong to an account. This is different from what you might be used to with sending emails, which belong to an individual server in Postmark. To manage your servers, you will need an Account API token. Only accessible by the account owner, you can find this on the API Tokens tab of your Postmark account. This token is used as the value for the X-Postmark-Account-Token HTTP header. This HTTP header should be used as the authentication method for all API requests for the /servers endpoint. If there is a problem with authentication, you will get an HTTP response with a status code of 401 (Unauthorized).

Required fields

Only one field is required to create a server, the Name field. All Postmark needs to know is what you want to call the server!

Response fields

The full list of response fields is located here, but below are the subset of fields that will help you further work with servers.

  • The ID field is an important field to save if you want to do further things with this server, like edit or delete it.
  • The ApiTokens array contains the API tokens available to send email using this server. When you first create the server, this array will only have one entry, but it’s possible to create new API tokens later.
  • The InboundHash field is important if you plan on using inbound processing for this server. Your server has a unique email address at :InboundHash@inbound.postmarkapp.com. Emails sent to that address will get processed for that server.

Fully manage the server #

Using the /servers API endpoint, you can fully manage your server. Some other important fields you can manage:

  • bounce webhook URL, a URL that POSTs bounce information to your application
  • inbound webhook URL, a URL that POSTs inbound information to your application
  • open webhook URL, a URL that POSTs email opens information to your application
  • inbound domain, a custom domain for your inbound address