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.

List inbound rule triggers Try → #

get

/triggers/inboundrules

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.

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"

Querystring parameters

count required

Number of records to return per request.

offset required

Number of records to skip.

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"
    }
  ]
}

Create an inbound rule trigger Try → #

post

/triggers/inboundrules

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 API Tokens tab under your Postmark server.

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.

Example body format

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

Response

ID integer

Unique ID of the trigger

Rule string

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

Example response

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

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

Delete a single trigger Try → #

delete

/triggers/inboundrules/{triggerid}

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.

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

{
  "ErrorCode": 0,
  "Message": "Rule someone@example.com removed."
}