Overview

Integration

User guide

API reference

Webhooks

Inbound rules triggers API

Inbound rules triggers let you block messages from certain senders. You can block messages by email address or by domain.

Create an inbound rule trigger Try →

Request headers

Content-Type required
application/json
Accept required
application/json
X-Postmark-Server-Token required
This request requires server level priveledges. This token can be found on the Credentials tab under your Postmark server.
post

/triggers/inboundrules

Example request with curl

curl "https://api.postmarkapp.com/triggers/inboundrules" \
  -X POST \
  -H "Accept: application/json" \
  -H "Content-Type: application/json" \
  -H "X-Postmark-Server-Token: server token" \
  -d "{'Rule': 'someone@example.com'}"

Body format

Rule string required
Email address (or domain) that you would like to block from sending.

Body format

{
  "Rule": "someone@example.com",
}


Response

ID integer Unique ID of the trigger
Rule string The email address (or domain) that will be blocked.

Example response

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

{
  "ID": 15,
  "Rule": "someone@example.com"
}

Delete a single trigger Try →

Request headers

Accept required
application/json
X-Postmark-Server-Token required
This request requires server level priveledges. This token can be found on the Credentials tab under your Postmark server.
delete

/triggers/inboundrules/{triggerid}

Example request with curl

curl "https://api.postmarkapp.com/triggers/inboundrules/{triggerid}" \
  -X DELETE \
  -H "Accept: application/json" \
  -H "X-Postmark-Server-Token: server 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": "Rule someone@example.com removed."
}

List inbound rule triggers Try →

Request headers

Accept required
application/json
X-Postmark-Server-Token required
This request requires server level priveledges. This token can be found on the Credentials tab under your Postmark server.

Querystring parameters

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

/triggers/inboundrules

Example request with curl

curl "https://api.postmarkapp.com/triggers/inboundrules?count=50&offset=0" \
  -X GET \
  -H "Accept: application/json" \
  -H "X-Postmark-Server-Token: server token"

Response

TotalCount integer Indicates how many triggers match the search criteria you specified.
InboundRules array List of objects that each represent each inbound rule.

Example response

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

{
  "TotalCount": 3,
  "InboundRules": [
    {
      "ID": 3,
      "Rule": "someone@example.com"
    },
    {
      "ID": 5,
      "Rule": "badsender@example.com"
    },
    {
      "ID": 7,
      "Rule": "baddomain.com"
    }
  ]
}