Postmark
Postmark API

Manage all servers on the account. Requires an account token.


List servers

GET
https://api.postmarkapp.com
/servers

Lists the servers on the account. Requires an account token.

List servers › query Parameters

count
​integer · min: 1 · max: 500 · required

Number of records to return per request. Max 500.

offset
​integer · min: 0 · required

Number of records to skip.

name
​string

Filter by server name.

List servers › Responses

A page of servers.

Paged list of servers.
TotalCount
​integer · required

Number of servers matching the request.

Example: 2
​Server[] · required

Servers for the requested page.

Example: [{"ID":12345,"Name":"Staging Testing","Color":"Blue","SmtpApiActivated":true,"RawEmailEnabled":false,"InboundHookUrl":"https://hooks.example.com/inbound","BounceHookUrl":"https://hooks.example.com/bounce","OpenHookUrl":"https://hooks.example.com/open","DeliveryHookUrl":"https://hooks.example.com/delivery","ClickHookUrl":"https://hooks.example.com/click","PostFirstOpenOnly":false,"InboundDomain":"","InboundSpamThreshold":5,"TrackOpens":false,"TrackLinks":"HtmlAndText","IncludeBounceContentInHook":true,"EnableSmtpApiErrorHooks":false,"ApiTokens":["xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"],"ServerLink":"https://postmarkapp.com/servers/12345/streams","InboundAddress":"xxxxxxxxxxxxxxxx@inbound.postmarkapp.com","InboundHash":"xxxxxxxxxxxxxxxx","DeliveryType":"Live"}]

Create a server

POST
https://api.postmarkapp.com
/servers

Creates a server on the account. Requires an account token.

Create a server › Request Body

Settings for the new server. Field of `CreateServerRequest`.
Name
​string · required

Server name.

Example: Staging Testing
Color
​ServerColor · enum

Color used to identify the server in the Postmark UI.

Enum values:
Purple
Blue
Turquoise
Green
Red
Yellow
Grey
Orange
Example: Blue
SmtpApiActivated
​boolean

Whether sending through SMTP is enabled.

Example: true
RawEmailEnabled
​boolean

Whether the raw email content is included in inbound webhooks.

Example: false
InboundHookUrl
​string

Webhook URL for inbound messages.

Example: https://hooks.example.com/inbound
BounceHookUrl
​string

Webhook URL for bounces (legacy; prefer the Webhooks API).

Example: https://hooks.example.com/bounce
OpenHookUrl
​string

Webhook URL for opens (legacy; prefer the Webhooks API).

Example: https://hooks.example.com/open
DeliveryHookUrl
​string

Webhook URL for deliveries (legacy; prefer the Webhooks API).

Example: https://hooks.example.com/delivery
ClickHookUrl
​string

Webhook URL for clicks (legacy; prefer the Webhooks API).

Example: https://hooks.example.com/click
PostFirstOpenOnly
​boolean

Only post the open webhook for the first open of a message.

Example: false
InboundDomain
​string

Your own inbound domain, with an MX record pointing to inbound.postmarkapp.com. Empty string to unset.

Example:
InboundSpamThreshold
​integer · min: 0 · max: 30

Spam score at or above which inbound messages are blocked. 0 disables blocking (valid range 0-30).

Example: 5
TrackOpens
​boolean

Track opens by default for messages sent from this server.

Example: false
TrackLinks
​TrackLinks · enum

Link tracking mode. None disables link tracking, HtmlAndText tracks links in both bodies, HtmlOnly tracks only HTML links, TextOnly tracks only plain-text links.

Enum values:
None
HtmlAndText
HtmlOnly
TextOnly
Example: HtmlAndText
IncludeBounceContentInHook
​boolean

Include the bounce content in bounce webhooks.

Example: true
EnableSmtpApiErrorHooks
​boolean

Post SMTP API errors to the bounce webhook URL.

Example: false
DeliveryType
​string · enum

Live (default) delivers email; Sandbox captures email without delivering it. Cannot be changed after creation.

Enum values:
Live
Sandbox
Example: Live

Create a server › Responses

The created server.

A Postmark server.
ID
​integer

Unique ID of the server. Field of Server.

Example: 12345

Server name.

Example: Staging Testing
Color
​ServerColor · enum

Color used to identify the server in the Postmark UI.

Enum values:
Purple
Blue
Turquoise
Green
Red
Yellow
Grey
Orange
Example: Blue

Whether sending through SMTP is enabled.

Example: true

Whether the raw email content is included in inbound webhooks.

Example: false

Webhook URL for inbound messages.

Example: https://hooks.example.com/inbound

Webhook URL for bounces (legacy; prefer the Webhooks API).

Example: https://hooks.example.com/bounce

Webhook URL for opens (legacy; prefer the Webhooks API).

Example: https://hooks.example.com/open

Webhook URL for deliveries (legacy; prefer the Webhooks API).

Example: https://hooks.example.com/delivery

Webhook URL for clicks (legacy; prefer the Webhooks API).

Example: https://hooks.example.com/click

Only post the open webhook for the first open of a message.

Example: false

Your own inbound domain, with an MX record pointing to inbound.postmarkapp.com. Empty string to unset.

Example:
InboundSpamThreshold
​CreateServerRequest/properties/InboundSpamThreshold · min: 0 · max: 30

Spam score at or above which inbound messages are blocked. 0 disables blocking (valid range 0-30).

Example: 5

Track opens by default for messages sent from this server.

Example: false
TrackLinks
​TrackLinks · enum

Link tracking mode. None disables link tracking, HtmlAndText tracks links in both bodies, HtmlOnly tracks only HTML links, TextOnly tracks only plain-text links.

Enum values:
None
HtmlAndText
HtmlOnly
TextOnly
Example: HtmlAndText

Include the bounce content in bounce webhooks.

Example: true

Post SMTP API errors to the bounce webhook URL.

Example: false
ApiTokens
​string[]

Server API tokens (X-Postmark-Server-Token values).

Example: ["xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"]
ServerLink
​string · uri

URL of the server in the Postmark UI.

Example: https://postmarkapp.com/servers/12345/streams
InboundAddress
​string

Inbound email address of the server.

Example: xxxxxxxxxxxxxxxx@inbound.postmarkapp.com
InboundHash
​string

Hash used in the server's inbound address.

Example: xxxxxxxxxxxxxxxx
DeliveryType
​string · enum

Whether the server delivers email (Live) or runs in sandbox mode (Sandbox).

Enum values:
Live
Sandbox
Example: Live

Get a server

GET
https://api.postmarkapp.com
/servers/{serverId}

Returns a server by ID. Requires an account token.

Get a server › path Parameters

serverId
​integer · required

Unique ID of the server.

Get a server › Responses

The server. See getServer.

A Postmark server.
ID
​integer

Unique ID of the server. Field of Server.

Example: 12345

Server name.

Example: Staging Testing
Color
​ServerColor · enum

Color used to identify the server in the Postmark UI.

Enum values:
Purple
Blue
Turquoise
Green
Red
Yellow
Grey
Orange
Example: Blue

Whether sending through SMTP is enabled.

Example: true

Whether the raw email content is included in inbound webhooks.

Example: false

Webhook URL for inbound messages.

Example: https://hooks.example.com/inbound

Webhook URL for bounces (legacy; prefer the Webhooks API).

Example: https://hooks.example.com/bounce

Webhook URL for opens (legacy; prefer the Webhooks API).

Example: https://hooks.example.com/open

Webhook URL for deliveries (legacy; prefer the Webhooks API).

Example: https://hooks.example.com/delivery

Webhook URL for clicks (legacy; prefer the Webhooks API).

Example: https://hooks.example.com/click

Only post the open webhook for the first open of a message.

Example: false

Your own inbound domain, with an MX record pointing to inbound.postmarkapp.com. Empty string to unset.

Example:
InboundSpamThreshold
​CreateServerRequest/properties/InboundSpamThreshold · min: 0 · max: 30

Spam score at or above which inbound messages are blocked. 0 disables blocking (valid range 0-30).

Example: 5

Track opens by default for messages sent from this server.

Example: false
TrackLinks
​TrackLinks · enum

Link tracking mode. None disables link tracking, HtmlAndText tracks links in both bodies, HtmlOnly tracks only HTML links, TextOnly tracks only plain-text links.

Enum values:
None
HtmlAndText
HtmlOnly
TextOnly
Example: HtmlAndText

Include the bounce content in bounce webhooks.

Example: true

Post SMTP API errors to the bounce webhook URL.

Example: false
ApiTokens
​string[]

Server API tokens (X-Postmark-Server-Token values).

Example: ["xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"]
ServerLink
​string · uri

URL of the server in the Postmark UI.

Example: https://postmarkapp.com/servers/12345/streams
InboundAddress
​string

Inbound email address of the server.

Example: xxxxxxxxxxxxxxxx@inbound.postmarkapp.com
InboundHash
​string

Hash used in the server's inbound address.

Example: xxxxxxxxxxxxxxxx
DeliveryType
​string · enum

Whether the server delivers email (Live) or runs in sandbox mode (Sandbox).

Enum values:
Live
Sandbox
Example: Live

Edit a server

PUT
https://api.postmarkapp.com
/servers/{serverId}

Updates a server by ID. Omitted fields are left unchanged. Requires an account token.

Edit a server › path Parameters

serverId
​integer · required

Unique ID of the server.

Edit a server › Request Body

Settings to change. Omitted fields are left unchanged.

Server name.

Example: Staging Testing
Color
​ServerColor · enum

Color used to identify the server in the Postmark UI.

Enum values:
Purple
Blue
Turquoise
Green
Red
Yellow
Grey
Orange
Example: Blue

Whether sending through SMTP is enabled.

Example: true

Whether the raw email content is included in inbound webhooks.

Example: false

Webhook URL for inbound messages.

Example: https://hooks.example.com/inbound

Webhook URL for bounces (legacy; prefer the Webhooks API).

Example: https://hooks.example.com/bounce

Webhook URL for opens (legacy; prefer the Webhooks API).

Example: https://hooks.example.com/open

Webhook URL for deliveries (legacy; prefer the Webhooks API).

Example: https://hooks.example.com/delivery

Webhook URL for clicks (legacy; prefer the Webhooks API).

Example: https://hooks.example.com/click

Only post the open webhook for the first open of a message.

Example: false

Your own inbound domain, with an MX record pointing to inbound.postmarkapp.com. Empty string to unset.

Example:
InboundSpamThreshold
​CreateServerRequest/properties/InboundSpamThreshold · min: 0 · max: 30

Spam score at or above which inbound messages are blocked. 0 disables blocking (valid range 0-30).

Example: 5

Track opens by default for messages sent from this server.

Example: false
TrackLinks
​TrackLinks · enum

Link tracking mode. None disables link tracking, HtmlAndText tracks links in both bodies, HtmlOnly tracks only HTML links, TextOnly tracks only plain-text links.

Enum values:
None
HtmlAndText
HtmlOnly
TextOnly
Example: HtmlAndText

Include the bounce content in bounce webhooks.

Example: true

Post SMTP API errors to the bounce webhook URL.

Example: false

Edit a server › Responses

The updated server. See editServer.

A Postmark server.
ID
​integer

Unique ID of the server. Field of Server.

Example: 12345

Server name.

Example: Staging Testing
Color
​ServerColor · enum

Color used to identify the server in the Postmark UI.

Enum values:
Purple
Blue
Turquoise
Green
Red
Yellow
Grey
Orange
Example: Blue

Whether sending through SMTP is enabled.

Example: true

Whether the raw email content is included in inbound webhooks.

Example: false

Webhook URL for inbound messages.

Example: https://hooks.example.com/inbound

Webhook URL for bounces (legacy; prefer the Webhooks API).

Example: https://hooks.example.com/bounce

Webhook URL for opens (legacy; prefer the Webhooks API).

Example: https://hooks.example.com/open

Webhook URL for deliveries (legacy; prefer the Webhooks API).

Example: https://hooks.example.com/delivery

Webhook URL for clicks (legacy; prefer the Webhooks API).

Example: https://hooks.example.com/click

Only post the open webhook for the first open of a message.

Example: false

Your own inbound domain, with an MX record pointing to inbound.postmarkapp.com. Empty string to unset.

Example:
InboundSpamThreshold
​CreateServerRequest/properties/InboundSpamThreshold · min: 0 · max: 30

Spam score at or above which inbound messages are blocked. 0 disables blocking (valid range 0-30).

Example: 5

Track opens by default for messages sent from this server.

Example: false
TrackLinks
​TrackLinks · enum

Link tracking mode. None disables link tracking, HtmlAndText tracks links in both bodies, HtmlOnly tracks only HTML links, TextOnly tracks only plain-text links.

Enum values:
None
HtmlAndText
HtmlOnly
TextOnly
Example: HtmlAndText

Include the bounce content in bounce webhooks.

Example: true

Post SMTP API errors to the bounce webhook URL.

Example: false
ApiTokens
​string[]

Server API tokens (X-Postmark-Server-Token values).

Example: ["xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"]
ServerLink
​string · uri

URL of the server in the Postmark UI.

Example: https://postmarkapp.com/servers/12345/streams
InboundAddress
​string

Inbound email address of the server.

Example: xxxxxxxxxxxxxxxx@inbound.postmarkapp.com
InboundHash
​string

Hash used in the server's inbound address.

Example: xxxxxxxxxxxxxxxx
DeliveryType
​string · enum

Whether the server delivers email (Live) or runs in sandbox mode (Sandbox).

Enum values:
Live
Sandbox
Example: Live

Delete a server

DELETE
https://api.postmarkapp.com
/servers/{serverId}

Permanently deletes a server and its data. API deletion must be permitted for your account (otherwise error code 604). Requires an account token.

Delete a server › path Parameters

serverId
​integer · required

Unique ID of the server.

Delete a server › Responses

The server was deleted.

Generic response returned by operations that only report a result code and message.
ErrorCode
​integer · required

Postmark API error code. 0 means the request succeeded. See the API error code table in the API description.

Example: 0
Message
​string · required

Human-readable result of the request.

Example: OK