Overview

Integration

User guide

API reference

Webhooks

Server API

Lets you get or edit details for a specific server using the X-Postmark-Server-Token for authentication.

Get the server Try → #

get

/server

Request headers

Accept required

application/json

X-Postmark-Server-Token required

This request requires server level privileges. This token can be found on the API Tokens tab under your Postmark server.

Example request with curl

curl "https://api.postmarkapp.com/server" \
  -X GET \
  -H "Accept: application/json" \
  -H "X-Postmark-Server-Token: server token"

Response

ID integer

ID of server

Name string

Name of server

ApiTokens array

List of API tokens associated with server.

Color string

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

SmtpApiActivated boolean

Specifies whether or not SMTP is enabled on this server.

RawEmailEnabled boolean

When enabled, the raw email content will be included with inbound webhook payloads under the RawEmail key.

DeliveryType string

Specifies the type of environment for your server. Possible options: Live Sandbox. Defaults to Live if not specified. This cannot be changed after the server has been created.

ServerLink string

URL to your server overview page in Postmark.

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.

OpenHookUrl string

URL to POST to every time an open event occurs.

DeliveryHookUrl string

URL to POST to every time email is delivered.

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.

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.

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

IncludeBounceContentInHook boolean

Include bounce content in webhook.

ClickHookUrl string

URL to POST to when a unique click event occurs.

EnableSmtpApiErrorHooks boolean

Specifies whether or not SMTP API Errors will be included with bounce webhooks.

Example response

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

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

Edit the server Try → #

put

/server

Request headers

Content-Type required

application/json

Accept required

application/json

X-Postmark-Server-Token required

This request requires server level privileges. This token can be found on the Credentials tab under your Postmark server.

Example request with curl

curl "https://api.postmarkapp.com/server" \
  -X PUT \
  -H "Accept: application/json" \
  -H "Content-Type: application/json" \
  -H "X-Postmark-Server-Token: server 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 Turquoise Green Red Yellow Grey Orange

RawEmailEnabled boolean

When enabled, the raw email content will be included with inbound webhook payloads under the RawEmail key.

DeliveryHookUrl string

URL to POST to every time email is delivered.

SmtpApiActivated boolean

Specifies whether or not SMTP is enabled on this server.

InboundHookUrl string

URL to POST to every time an inbound event occurs.

BounceHookUrl string

URL to POST to every time a bounce event occurs.

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

ClickHookUrl string

URL to POST to when a unique click event occurs.

InboundDomain string

Inbound domain for MX setup.

InboundSpamThreshold integer

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

IncludeBounceContentInHook boolean

Include bounce content in webhook.

EnableSmtpApiErrorHooks boolean

Specifies whether or not SMTP API Errors will be included with bounce webhooks.

Example body format

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

Response

ID integer

ID of server

Name string

Name of server

ApiTokens array

List of API tokens associated with server.

Color string

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

SmtpApiActivated boolean

Specifies whether or not SMTP is enabled on this server.

RawEmailEnabled boolean

When enabled, the raw email content will be included with inbound webhook payloads under the RawEmail key.

DeliveryType boolean

Specifies the type of environment for your server. Initial possible options: Live Sandbox. Defaults to Live if not specified. This cannot be changed after the server has been created.

ServerLink string

URL to your server overview page in Postmark.

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.

OpenHookUrl string

URL to POST to every time an open event occurs.

DeliveryHookUrl string

URL to POST to every time email is delivered.

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.

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.

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

IncludeBounceContentInHook boolean

Include bounce content in webhook.

ClickHookUrl string

URL to POST to when a unique click event occurs.

EnableSmtpApiErrorHooks boolean

Specifies whether or not SMTP API Errors will be included with bounce webhooks.

Example response

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

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