Overview

Integration

User guide

API reference

Webhooks

Servers API

Lets you manage servers for a specific account.

Get a server Try → #

get

/servers/{serverid}

Request headers

Accept required

application/json

X-Postmark-Account-Token required

This request requires account level privileges. Only accessible by the account owner, this token can be found on the Account tab of your Postmark account.

Example request with curl

curl "https://api.postmarkapp.com/servers/{serverid}" \
  -X GET \
  -H "Accept: application/json" \
  -H "X-Postmark-Account-Token: account token"

Response

ID integer

ID of server

Name string

Name of server

ApiTokens array

List of API tokens associated with server.

ServerLink string

URL to your server overview page in Postmark.

Color string

Color of the server in the rack screen. Purple Blue Turqoise Green Red Yellow Grey

SmtpApiActivated boolean

Specifies whether or not SMTP is enabled on this server.

RawEmailEnabled boolean

Allow raw email to be sent with inbound.

DeliveryHookUrl string

URL to POST to every time email is delivered.

InboundAddress string

Inbound email address

InboundHookUrl string

URL to POST to every time an inbound event occurs.

BounceHookUrl string

URL to POST to every time a bounce event occurs.

IncludeBounceContentInHook boolean

Include bounce content in webhook.

OpenHookUrl string

URL to POST to every time an open event occurs.

PostFirstOpenOnly boolean

If set to true, only the first open by a particular recipient will initiate the open webhook. Any subsequent opens of the same email by the same recipient will not initiate the webhook.

TrackOpens boolean

Indicates if all emails being sent through this server have open tracking enabled.

TrackLinks string

Indicates if all emails being sent through this server should have link tracking enabled for links in their HTML or Text bodies. Possible options: None HtmlAndText HtmlOnly TextOnly

InboundDomain string

Inbound domain for MX setup

InboundHash string

The inbound hash of your inbound email address.

InboundSpamThreshold integer

The maximum spam score for an inbound message before it's blocked.

Example response

HTTP/1.1 200 OK
Content-Type: application/json

{
  "ID": 1,
  "Name": "Staging Testing",
  "ApiTokens": [
    "server token"
  ],
  "ServerLink": "https://postmarkapp.com/servers/1/overview",
  "Color": "red",
  "SmtpApiActivated": true,
  "RawEmailEnabled": false,
  "DeliveryHookUrl": "http://hooks.example.com/delivery",
  "InboundAddress": "yourhash@inbound.postmarkapp.com",
  "InboundHookUrl": "http://hooks.example.com/inbound",
  "BounceHookUrl": "http://hooks.example.com/bounce",
  "IncludeBounceContentInHook": true,
  "OpenHookUrl": "http://hooks.example.com/open",
  "PostFirstOpenOnly": false,
  "TrackOpens": false,
  "TrackLinks": "None",
  "InboundDomain": "",
  "InboundHash": "yourhash",
  "InboundSpamThreshold": 0
}

Create a server Try → #

post

/servers

Request headers

Content-Type required

application/json

Accept required

application/json

X-Postmark-Account-Token required

This request requires account level privileges. Only accessible by the account owner, this token can be found on the Account tab of your Postmark account.

Example request with curl

curl "https://api.postmarkapp.com/servers" \
  -X POST \
  -H "Accept: application/json" \
  -H "Content-Type: application/json" \
  -H "X-Postmark-Account-Token: account token" \
  -d "{Name: 'Production', Color: 'Purple'}"

Body format

Name string required

Name of server

Color string

Color of the server in the rack screen. Purple Blue Turqoise Green Red Yellow Grey

SmtpApiActivated boolean

Specifies whether or not SMTP is enabled on this server.

RawEmailEnabled boolean

Enable raw email to be sent with inbound.

DeliveryHookUrl string

URL to POST to every time email is delivered.

InboundHookUrl string

URL to POST to every time an inbound event occurs.

BounceHookUrl string

URL to POST to every time a bounce event occurs.

IncludeBounceContentInHook boolean

Include bounce content in webhook.

OpenHookUrl string

URL to POST to every time an open event occurs.

PostFirstOpenOnly boolean

If set to true, only the first open by a particular recipient will initiate the open webhook. Any subsequent opens of the same email by the same recipient will not initiate the webhook.

TrackOpens boolean

Indicates if all emails being sent through this server have open tracking enabled.

TrackLinks string

Indicates if all emails being sent through this server should have link tracking enabled for links in their HTML or Text bodies. Possible options: None HtmlAndText HtmlOnly TextOnly

InboundDomain string

Inbound domain for MX setup.

InboundSpamThreshold integer

The maximum spam score for an inbound message before it's blocked.

Example body format

{
  "Name": "Staging Testing",
  "Color": "red",
  "SmtpApiActivated": true,
  "RawEmailEnabled": false,
  "DeliveryHookUrl": "http://hooks.example.com/delivery",
  "InboundHookUrl": "http://hooks.example.com/inbound",
  "BounceHookUrl": "http://hooks.example.com/bounce",
  "IncludeBounceContentInHook": true,
  "OpenHookUrl": "http://hooks.example.com/open",
  "PostFirstOpenOnly": false,
  "TrackOpens": false,
  "TrackLinks": "None",
  "InboundDomain": "",
  "InboundSpamThreshold": 5
}

Response

ID integer

ID of server

Name string

Name of server

ApiTokens array

List of API tokens associated with server.

ServerLink string

URL to your server overview page in Postmark.

Color string

Color of the server in the rack screen. Purple Blue Turqoise Green Red Yellow Grey

SmtpApiActivated boolean

Specifies whether or not SMTP is enabled on this server.

RawEmailEnabled boolean

Allow raw email to be sent with inbound.

DeliveryHookUrl string

URL to POST to every time email is delivered.

InboundAddress string

Inbound email address

InboundHookUrl string

URL to POST to every time an inbound event occurs.

BounceHookUrl string

URL to POST to every time a bounce event occurs.

IncludeBounceContentInHook boolean

Include bounce content in webhook.

OpenHookUrl string

URL to POST to every time an open event occurs.

PostFirstOpenOnly boolean

If set to true, only the first open by a particular recipient will initiate the open webhook. Any subsequent opens of the same email by the same recipient will not initiate the webhook.

TrackOpens boolean

Indicates if all emails being sent through this server have open tracking enabled.

TrackLinks string

Indicates if all emails being sent through this server should have link tracking enabled for links in their HTML or Text bodies. Possible options: None HtmlAndText HtmlOnly TextOnly

InboundDomain string

Inbound domain for MX setup.

InboundHash string

The inbound hash of your inbound email address.

InboundSpamThreshold integer

The maximum spam score for an inbound message before it's blocked.

Example response

HTTP/1.1 200 OK
Content-Type: application/json

{
  "ID": 1,
  "Name": "Staging Testing",
  "ApiTokens": [
    "server token"
  ],
  "ServerLink": "https://postmarkapp.com/servers/1/overview",
  "Color": "red",
  "SmtpApiActivated": true,
  "RawEmailEnabled": false,
  "DeliveryHookUrl": "http://hooks.example.com/delivery",
  "InboundAddress": "yourhash@inbound.postmarkapp.com",
  "InboundHookUrl": "http://hooks.example.com/inbound",
  "BounceHookUrl": "http://hooks.example.com/bounce",
  "IncludeBounceContentInHook": true,
  "OpenHookUrl": "http://hooks.example.com/open",
  "PostFirstOpenOnly": false,
  "TrackOpens": false,
  "TrackLinks": "None",
  "InboundDomain": "",
  "InboundHash": "yourhash",
  "InboundSpamThreshold": 5
}

Edit a server Try → #

put

/servers/{serverid}

Request headers

Content-Type required

application/json

Accept required

application/json

X-Postmark-Account-Token required

This request requires account level privileges. Only accessible by the account owner, this token can be found on the Account tab of your Postmark account.

Example request with curl

curl "https://api.postmarkapp.com/servers/{serverid}" \
  -X PUT \
  -H "Accept: application/json" \
  -H "Content-Type: application/json" \
  -H "X-Postmark-Account-Token: account token" \
  -d "{Name: 'Production 2', Color: 'Blue'}"

Body format

Name string

Name of server

Color string

Color of the server in the rack screen. Purple Blue Turqoise Green Red Yellow Grey

SmtpApiActivated boolean

Specifies whether or not SMTP is enabled on this server.

RawEmailEnabled boolean

Enable raw email to be sent with inbound.

DeliveryHookUrl string

URL to POST to every time email is delivered.

InboundHookUrl string

URL to POST to every time an inbound event occurs.

BounceHookUrl string

URL to POST to every time a bounce event occurs.

IncludeBounceContentInHook boolean

Include bounce content in webhook.

OpenHookUrl string

URL to POST to every time an open event occurs.

PostFirstOpenOnly boolean

If set to true, only the first open by a particular recipient will initiate the open webhook. Any subsequent opens of the same email by the same recipient will not initiate the webhook.

TrackOpens boolean

Indicates if all emails being sent through this server have open tracking enabled.

TrackLinks string

Indicates if all emails being sent through this server should have link tracking enabled for links in their HTML or Text bodies. Possible options: None HtmlAndText HtmlOnly TextOnly

InboundDomain string

Inbound domain for MX setup.

InboundSpamThreshold integer

The maximum spam score for an inbound message before it's blocked.

Example body format

{
  "Name": "Production 2",
  "Color": "blue",
  "SmtpApiActivated": false,
  "RawEmailEnabled": false,
  "DeliveryHookUrl": "http://hooks.example.com/delivery",
  "InboundHookUrl": "http://hooks.example.com/inbound",
  "BounceHookUrl": "http://hooks.example.com/bounce",
  "IncludeBounceContentInHook": true,
  "OpenHookUrl": "http://hooks.example.com/open",
  "PostFirstOpenOnly": false,
  "TrackOpens": false,
  "TrackLinks": "None",
  "InboundDomain": "",
  "InboundSpamThreshold": 0
}

Response

ID integer

ID of server

Name string

Name of server

ApiTokens array

List of API tokens associated with server.

ServerLink string

URL to your server overview page in Postmark.

Color string

Color of the server in the rack screen. Purple Blue Turqoise Green Red Yellow Grey

SmtpApiActivated boolean

Specifies whether or not SMTP is enabled on this server.

RawEmailEnabled boolean

Allow raw email to be sent with inbound.

DeliveryHookUrl string

URL to POST to every time email is delivered.

InboundAddress string

Inbound email address

InboundHookUrl string

URL to POST to every time an inbound event occurs.

BounceHookUrl string

URL to POST to every time a bounce event occurs.

IncludeBounceContentInHook boolean

Include bounce content in webhook.

OpenHookUrl string

URL to POST to every time an open event occurs.

PostFirstOpenOnly boolean

If set to true, only the first open by a particular recipient will initiate the open webhook. Any subsequent opens of the same email by the same recipient will not initiate the webhook.

TrackOpens boolean

Indicates if all emails being sent through this server have open tracking enabled.

TrackLinks string

Indicates if all emails being sent through this server should have link tracking enabled for links in their HTML or Text bodies. Possible options: None HtmlAndText HtmlOnly TextOnly

InboundDomain string

Inbound domain for MX setup.

InboundHash string

The inbound hash of your inbound email address.

InboundSpamThreshold integer

The maximum spam score for an inbound message before it's blocked.

Example response

HTTP/1.1 200 OK
Content-Type: application/json

{
  "ID": 1,
  "Name": "Production Testing",
  "ApiTokens": [
    "Server Token"
  ],
  "ServerLink": "https://postmarkapp.com/servers/1/overview",
  "Color": "blue",
  "SmtpApiActivated": false,
  "RawEmailEnabled": false,
  "DeliveryHookUrl": "http://hooks.example.com/delivery",
  "InboundAddress": "yourhash@inbound.postmarkapp.com",
  "InboundHookUrl": "http://hooks.example.com/inbound",
  "BounceHookUrl": "http://hooks.example.com/bounce",
  "IncludeBounceContentInHook": true,
  "OpenHookUrl": "http://hooks.example.com/open",
  "PostFirstOpenOnly": false,
  "TrackOpens": false,
  "TrackLinks": "None",
  "InboundDomain": "",
  "InboundHash": "yourhash",
  "InboundSpamThreshold": 0
}

List servers Try → #

get

/servers

Request headers

Accept required

application/json

X-Postmark-Account-Token required

This request requires account level privileges. Only accessible by the account owner, this token can be found on the Account tab of your Postmark account.

Example request with curl

curl "https://api.postmarkapp.com/servers?count=50&offset=0" \
  -X GET \
  -H "Accept: application/json" \
  -H "X-Postmark-Account-Token: account token"

Querystring parameters

count integer required

Number of servers to return per request.

offset integer required

Number of servers to skip.

name string

Filter by a specific server name.

Response

TotalCount integer

Number of servers retrieved

Servers array

List of servers

ID integer

ID of server

Name string

Name of server

ApiTokens array

List of API tokens associated with server.

ServerLink string

URL to your server overview page in Postmark.

Color string

Color of the server in the rack screen. Purple Blue Turqoise Green Red Yellow Grey

SmtpApiActivated boolean

Specifies whether or not SMTP is enabled on this server.

RawEmailEnabled boolean

Allow raw email to be sent with inbound.

DeliveryHookUrl string

URL to POST to every time email is delivered.

InboundAddress string

Inbound email address

InboundHookUrl string

URL to POST to every time an inbound event occurs.

BounceHookUrl string

URL to POST to every time a bounce event occurs.

IncludeBounceContentInHook boolean

Include bounce content in webhook.

OpenHookUrl string

URL to POST to every time an open event occurs.

PostFirstOpenOnly boolean

If set to true, only the first open by a particular recipient will initiate the open webhook. Any subsequent opens of the same email by the same recipient will not initiate the webhook.

TrackOpens boolean

Indicates if all emails being sent through this server have open tracking enabled.

TrackLinks string

Indicates if all emails being sent through this server should have link tracking enabled for links in their HTML or Text bodies. Possible options: None HtmlAndText HtmlOnly TextOnly

InboundDomain string

Inbound domain for MX setup.

InboundHash string

The inbound hash of your inbound email address.

InboundSpamThreshold integer

The maximum spam score for an inbound message before it's blocked.

Example response

HTTP/1.1 200 OK
Content-Type: application/json

{
  "TotalCount": 2,
  "Servers": [
    {
      "ID": 1,
      "Name": "Production01",
      "ApiTokens": [
        "server token"
      ],
      "ServerLink": "https://postmarkapp.com/servers/1/overview",
      "Color": "red",
      "SmtpApiActivated": true,
      "RawEmailEnabled": false,
      "DeliveryHookUrl": "http://hooks.example.com/delivery",
      "InboundAddress": "yourhash@inbound.postmarkapp.com",
      "InboundHookUrl": "http://inboundhook.example.com/inbound",
      "BounceHookUrl": "http://bouncehook.example.com/bounce",
      "IncludeBounceContentInHook": true,
      "OpenHookUrl": "http://openhook.example.com/open",
      "PostFirstOpenOnly": true,
      "TrackOpens": false,
      "TrackLinks": "None",
      "InboundDomain": "",
      "InboundHash": "yourhash",
      "InboundSpamThreshold": 5
    },
    {
      "ID": 2,
      "Name": "Production02",
      "ApiTokens": [
        "server token"
      ],
      "ServerLink": "https://postmarkapp.com/servers/2/overview",
      "Color": "green",
      "SmtpApiActivated": true,
      "RawEmailEnabled": false,
      "InboundAddress": "yourhash@inbound.postmarkapp.com",
      "InboundHookUrl": "",
      "BounceHookUrl": "",
      "IncludeBounceContentInHook": false,
      "OpenHookUrl": "",
      "PostFirstOpenOnly": false,
      "TrackOpens": true,
      "TrackLinks": "HtmlAndText",
      "InboundDomain": "",
      "InboundHash": "yourhash",
      "InboundSpamThreshold": 0
    }
  ]
}

Delete a server Try → #

delete

/servers/{serverid}

Request headers

Accept required

application/json

X-Postmark-Account-Token required

This request requires account level privileges. Only accessible by the account owner, this token can be found on the Account tab of your Postmark account.

Example request with curl

curl "https://api.postmarkapp.com/servers/{serverid}" \
  -X DELETE \
  -H "Accept: application/json" \
  -H "X-Postmark-Account-Token: account token"

Response

ErrorCode integer

API Error Codes

Message string

Response message

Example response

HTTP/1.1 200 OK
Content-Type: application/json

{
  "ErrorCode": 0,
  "Message": "Server Production Server 2 removed."
}