Overview

Integration

User guide

API reference

Webhooks

Domains API

Lets you manage all of your domain details for a specific account.

List domains Try →

Gets a list of domains containing an overview of the domain and authentication status.

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.

Querystring parameters

count Required
Number of records to return per request. Max 500.
offset Required
Number of records to skip
get

/domains

Example request with curl

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

              

Response

TotalCount integer Indicates how many domains match the search criteria you specified. This can be more than what is fetched by a single call.
Domains array List of objects that each represent a domain.
Name string Domain name
SPFVerified boolean SPF DNS text record has been setup correctly at your domain registrar or DNS host.
DKIMVerified boolean DKIM DNS text record has been setup correctly at your domain registrar or DNS host.
WeakDKIM boolean DKIM is using a strength weaker than 1024 bit. If so, it’s possible to request a new DKIM using the RequestNewDKIM function below.
ReturnPathDomainVerified boolean The verification state of the Return-Path domain. Tells you if the Return-Path is actively being used or still needs further action to be used.
ID integer Unique ID of the Domain.

Example response

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

{
  "TotalCount": 2,
  "Domains": [
    {
      "Name": "wildbit.com",
      "SPFVerified": true,
      "DKIMVerified": true,
      "WeakDKIM": false,
      "ReturnPathDomainVerified": false,
      "ID": 36735
    },
    {
      "Name": "example.com",
      "SPFVerified": true,
      "DKIMVerified": true,
      "WeakDKIM": false,
      "ReturnPathDomainVerified": true,
      "ID": 81605
    }
  ]
}

Get a domain’s details Try →

Gets all the details for a specific domain.

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.
get

/domains/{domainid}

Example request with curl

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

Response

Name string Domain name
SPFVerified boolean SPF DNS text record has been setup correctly at your domain registrar or DNS host.
SPFHost string Host name used for the SPF configuration.
SPFTextValue string Value that must be setup at your domain registrar or DNS host in order for SPF to function correctly.
DKIMVerified boolean DKIM DNS text record has been setup correctly at your domain registrar or DNS host.
WeakDKIM boolean DKIM is using a strength weaker than 1024 bit. If so, it’s possible to request a new DKIM using the RequestNewDKIM function below.
DKIMHost string DNS TXT host being used to validate messages sent in.
DKIMTextValue string DNS TXT value being used to validate messages sent in.
DKIMPendingHost string If a DKIM rotation has been intiated or this DKIM is from a new Domain, this field will show the pending DKIM DNS TXT host which has yet to be setup and confirmed at your registrar or DNS host.
DKIMPendingTextValue string Similar to the DKIMPendingHost field, this will show the DNS TXT value waiting to be confirmed at your registrar or DNS host.
DKIMRevokedHost string Once a new DKIM has been confirmed at your registrar or DNS host, Postmark will revoke the old DKIM host in preparation for removing it permantly from the system.
DKIMRevokedTextValue string Similar to DKIMRevokedHost, this field will show the DNS TXT value that will soon be removed from the Postmark system.
SafeToRemoveRevokedKeyFromDNS boolean Indicates whether you may safely delete the old DKIM DNS TXT records at your registrar or DNS host. The new DKIM is now safely in use.
DKIMUpdateStatus string While DKIM renewal or new DKIM operations are being conducted or setup, this field will indicate Pending. After all DNS TXT records are up to date and any pending renewal operations are finished, it will indicate Verified.
ReturnPathDomain string The custom Return-Path for this domain, please read our support page.
ReturnPathDomainVerified boolean The verification state of the Return-Path domain. Tells you if the Return-Path is actively being used or still needs further action to be used.
ReturnPathDomainCNAMEValue string The CNAME DNS record that Postmark expects to find at the ReturnPathDomain value.
ID integer Unique ID of the Domain.

Example response

HTTP/1.1 200 OK
Content-Type: application/json
{
  "Name": "wildbit.com",
  "SPFVerified": true,
  "SPFHost": "wildbit.com",
  "SPFTextValue": "v=spf1 a mx include:spf.mtasv.net ~all",
  "DKIMVerified": false,
  "WeakDKIM": false,
  "DKIMHost": "jan2013.pm._domainkey.wildbit.com",
  "DKIMTextValue": "k=rsa; p=MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDJ...",
  "DKIMPendingHost": "20131031155228.pm._domainkey.wildbit.com",
  "DKIMPendingTextValue": "k=rsa; p=MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCFn...",
  "DKIMRevokedHost": "",
  "DKIMRevokedTextValue": "",
  "SafeToRemoveRevokedKeyFromDNS": false,
  "DKIMUpdateStatus": "Pending",
  "ReturnPathDomain": "pmbounces.wildbit.com",
  "ReturnPathDomainVerified": false,
  "ReturnPathDomainCNAMEValue": "pm.mtasv.net",
  "ID": 36735
}

Create a domain Try →

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.
post

/domains

Example request with curl

curl "https://api.postmarkapp.com/domains" \
  -X POST \
  -H "Accept: application/json" \
  -H "Content-Type: application/json" \
  -H "X-Postmark-Account-Token: account token" \
  -d "{Name: 'example.com',  ReturnPathDomain: 'pmbounces.example.com'}"

Body format

Name string Required
Domain name
ReturnPathDomain string A custom value for the Return-Path domain. It is an optional field, but it must be a subdomain of your From Email domain and must have a CNAME record that points to pm.mtasv.net. For more information about this field, please read our support page.

Example body format

{
  "Name": "example.com",
  "ReturnPathDomain": "pmbounces.example.com"
}
						

Response

Name string Domain name
SPFVerified boolean SPF DNS text record has been setup correctly at your domain registrar or DNS host.
SPFHost string Host name used for the SPF configuration.
SPFTextValue string Value that must be setup at your domain registrar or DNS host in order for SPF to function correctly.
DKIMVerified boolean DKIM DNS text record has been setup correctly at your domain registrar or DNS host.
WeakDKIM boolean DKIM is using a strength weaker than 1024 bit. If so, it’s possible to request a new DKIM using the RequestNewDKIM function below.
DKIMHost string DNS TXT host being used to validate messages sent in.
DKIMTextValue string DNS TXT value being used to validate messages sent in.
DKIMPendingHost string If a DKIM rotation has been intiated or this DKIM is from a new Domain, this field will show the pending DKIM DNS TXT host which has yet to be setup and confirmed at your registrar or DNS host.
DKIMPendingTextValue string Similar to the DKIMPendingHost field, this will show the DNS TXT value waiting to be confirmed at your registrar or DNS host.
DKIMRevokedHost string Once a new DKIM has been confirmed at your registrar or DNS host, Postmark will revoke the old DKIM host in preparation for removing it permantly from the system.
DKIMRevokedTextValue string Similar to DKIMRevokedHost, this field will show the DNS TXT value that will soon be removed from the Postmark system.
SafeToRemoveRevokedKeyFromDNS boolean Indicates whether you may safely delete the old DKIM DNS TXT records at your registrar or DNS host. The new DKIM is now safely in use.
DKIMUpdateStatus string While DKIM renewal or new DKIM operations are being conducted or setup, this field will indicate Pending. After all DNS TXT records are up to date and any pending renewal operations are finished, it will indicate Verified.
ReturnPathDomain string The custom Return-Path for this domain, please read our support page.
ReturnPathDomainVerified boolean The verification state of the Return-Path domain. Tells you if the Return-Path is actively being used or still needs further action to be used.
ReturnPathDomainCNAMEValue string The CNAME DNS record that Postmark expects to find at the ReturnPathDomain value.
ID integer Unique ID of the Domain.

Example response

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

{
  "Name": "newdomain.com",
  "SPFVerified": false,
  "SPFHost": "newdomain.com",
  "SPFTextValue": "v=spf1 a mx include:spf.mtasv.net ~all",
  "DKIMVerified": false,
  "WeakDKIM": false,
  "DKIMHost": "",
  "DKIMTextValue": "",
  "DKIMPendingHost": "20131031155228.pm._domainkey.newdomain.com",
  "DKIMPendingTextValue": "k=rsa; p=MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCFn...",
  "DKIMRevokedHost": "",
  "DKIMRevokedTextValue": "",
  "SafeToRemoveRevokedKeyFromDNS": false,
  "DKIMUpdateStatus": "Pending",
  "ReturnPathDomain": "pmbounces.newdomain.com",
  "ReturnPathDomainVerified": false,
  "ReturnPathDomainCNAMEValue": "pm.mtasv.net",
  "ID": 36736
}

Edit a domain Try →

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.
put

/domains/{domainid}

Example request with curl

curl "https://api.postmarkapp.com/domains/{domainid}" \
  -X PUT \
  -H "Accept: application/json" \
  -H "Content-Type: application/json" \
  -H "X-Postmark-Account-Token: account token" \
  -d "{ ReturnPathDomain: 'pmbounces.example.com'}"

Body format

ReturnPathDomain string A custom value for the Return-Path domain. It is an optional field, but it must be a subdomain of your From Email domain and must have a CNAME record that points to pm.mtasv.net. For more information about this field, please read our support page.

Example body format

{
  "ReturnPathDomain": "pmbounces.example.com"
}
						

Response

Name string Domain name
SPFVerified boolean SPF DNS text record has been setup correctly at your domain registrar or DNS host.
SPFHost string Host name used for the SPF configuration.
SPFTextValue string Value that must be setup at your domain registrar or DNS host in order for SPF to function correctly.
DKIMVerified boolean DKIM DNS text record has been setup correctly at your domain registrar or DNS host.
WeakDKIM boolean DKIM is using a strength weaker than 1024 bit. If so, it’s possible to request a new DKIM using the RequestNewDKIM function below.
DKIMHost string DNS TXT host being used to validate messages sent in.
DKIMTextValue string DNS TXT value being used to validate messages sent in.
DKIMPendingHost string If a DKIM rotation has been intiated or this DKIM is from a new Domain, this field will show the pending DKIM DNS TXT host which has yet to be setup and confirmed at your registrar or DNS host.
DKIMPendingTextValue string Similar to the DKIMPendingHost field, this will show the DNS TXT value waiting to be confirmed at your registrar or DNS host.
DKIMRevokedHost string Once a new DKIM has been confirmed at your registrar or DNS host, Postmark will revoke the old DKIM host in preparation for removing it permantly from the system.
DKIMRevokedTextValue string Similar to DKIMRevokedHost, this field will show the DNS TXT value that will soon be removed from the Postmark system.
SafeToRemoveRevokedKeyFromDNS boolean Indicates whether you may safely delete the old DKIM DNS TXT records at your registrar or DNS host. The new DKIM is now safely in use.
DKIMUpdateStatus string While DKIM renewal or new DKIM operations are being conducted or setup, this field will indicate Pending. After all DNS TXT records are up to date and any pending renewal operations are finished, it will indicate Verified.
ReturnPathDomain string The custom Return-Path for this domain, please read our support page.
ReturnPathDomainVerified boolean The verification state of the Return-Path domain. Tells you if the Return-Path is actively being used or still needs further action to be used.
ReturnPathDomainCNAMEValue string The CNAME DNS record that Postmark expects to find at the ReturnPathDomain value.
ID integer Unique ID of the Domain.

Example response

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

{
  "Name": "example.com",
  "SPFVerified": false,
  "SPFHost": "example.com",
  "SPFTextValue": "v=spf1 a mx include:spf.mtasv.net ~all",
  "DKIMVerified": false,
  "WeakDKIM": false,
  "DKIMHost": "20160921046319.pm._domainkey.example.com",
  "DKIMTextValue": "k=rsa; p=MIGfMA0GDRrFQJc5dZEBAQUAA4GNADCBiQKBgQCFn...",
  "DKIMPendingHost": "20131031155228.pm._domainkey.example.com",
  "DKIMPendingTextValue": "k=rsa; p=MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCFn...",
  "DKIMRevokedHost": "",
  "DKIMRevokedTextValue": "",
  "SafeToRemoveRevokedKeyFromDNS": false,
  "DKIMUpdateStatus": "Pending",
  "ReturnPathDomain": "pmbounces.example.com",
  "ReturnPathDomainVerified": false,
  "ReturnPathDomainCNAMEValue": "pm.mtasv.net",
  "ID": 36736
}

Delete a domain Try →

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.
delete

/domains/{domainid}

Example Request with curl

curl "https://api.postmarkapp.com/domains/{domainid}" \
  -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": "Domain example.com removed."
}

Verify an SPF record Try →

Will query DNS for your domain and attempt to verify the SPF record contains the information for Postmark's 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.
post

/domains/{domainid}/verifyspf

Example request with curl

curl "https://api.postmarkapp.com/domains/{domainid}/verifyspf" \
  -X POST \
  -H "Accept: application/json" \
  -H "Content-Type: application/json" \
  -H "X-Postmark-Account-Token: account token"
						

Response

The SPFVerified field that is returned will indicate whether or not SPF validation was successful.

SPFHost string Host name used for the SPF configuration.
SPFVerified boolean SPF DNS text record has been setup correctly at your domain registrar or DNS host.
SPFTextValue string Value that must be setup at your domain registrar or DNS host in order for SPF to function correctly.

Example response

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

{
  "SPFHost": "example.com",
  "SPFVerified": true,
  "SPFTextValue": "v=spf1 a mx include:spf.mtasv.net ~all"
}

Rotate DKIM keys Try →

Creates a new DKIM key to replace your current key. Until the new DNS entries are confirmed, the pending values will be in DKIMPendingHost and DKIMPendingTextValue fields. After the new DKIM value is verified in DNS, the pending values will migrate to DKIMTextValue and DKIMPendingTextValue and Postmark will begin to sign emails with the new DKIM key.

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.
post

/domains/{domainid}/rotatedkim

Example request with curl

curl "https://api.postmarkapp.com/domains/{domainid}/rotatedkim" \
  -X POST \
  -H "Accept: application/json" \
  -H "Content-Type: application/json" \
  -H "X-Postmark-Account-Token: account token"

Response

Name string Domain name
DKIMVerified boolean DKIM DNS text record has been setup correctly at your domain registrar or DNS host.
WeakDKIM boolean DKIM is using a strength weaker than 1024 bit. If so, it’s possible to request a new DKIM using the RequestNewDKIM function below.
DKIMHost string DNS TXT host being used to validate messages sent in.
DKIMTextValue string DNS TXT value being used to validate messages sent in.
DKIMPendingHost string If a DKIM rotation has been intiated or this DKIM is from a new Domain, this field will show the pending DKIM DNS TXT host which has yet to be setup and confirmed at your registrar or DNS host.
DKIMPendingTextValue string Similar to the DKIMPendingHost field, this will show the DNS TXT value waiting to be confirmed at your registrar or DNS host.
DKIMRevokedHost string Once a new DKIM has been confirmed at your registrar or DNS host, Postmark will revoke the old DKIM host in preparation for removing it permantly from the system.
DKIMRevokedTextValue string Similar to DKIMRevokedHost, this field will show the DNS TXT value that will soon be removed from the Postmark system.
SafeToRemoveRevokedKeyFromDNS boolean Indicates whether you may safely delete the old DKIM DNS TXT records at your registrar or DNS host. The new DKIM is now safely in use.
DKIMUpdateStatus string While DKIM renewal or new DKIM operations are being conducted or setup, this field will indicate Pending. After all DNS TXT records are up to date and any pending renewal operations are finished, it will indicate Verified.
ID integer Unique ID of the Domain.

Example response

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

{
  "Name": "wildbit.com",
  "DKIMVerified": false,
  "WeakDKIM": false,
  "DKIMHost": "jan2013.pm._domainkey.wildbit.com",
  "DKIMTextValue": "k=rsa; p=MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDJ...",
  "DKIMPendingHost": "20131031155228.pm._domainkey.wildbit.com",
  "DKIMPendingTextValue": "k=rsa; p=MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCFn...",
  "DKIMRevokedHost": "",
  "DKIMRevokedTextValue": "",
  "SafeToRemoveRevokedKeyFromDNS": false,
  "DKIMUpdateStatus": "Pending",
  "ID": 36735
}