Overview

Integration

User guide

API reference

Webhooks

Tags triggers API

Tags triggers let you activate special behavior when you send messages with a certain tag.

Create a trigger for a tag 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/tags

Example request with curl

curl "https://api.postmarkapp.com/triggers/tags" \
  -X POST \
  -H "Accept: application/json" \
  -H "Content-Type: application/json" \
  -H "X-Postmark-Server-Token: server token" \
  -d "{MatchName: 'welcome', TrackOpens: true}"

Body format

MatchName string required
Name of the tag that will activate this trigger.
TrackOpens boolean Indicates if this trigger activates open tracking.

Body format

{
  "MatchName": "welcome",
  "TrackOpens": true
}


Response

ID integer Unique ID of the trigger
MatchName boolean Name of the tag that will activate this trigger.
TrackOpens boolean Indicates if this trigger activates open tracking.

Example response

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

{
  "ID": 15,
  "MatchName": "welcome",
  "TrackOpens": true
}

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

/triggers/tags/{triggerid}

Example request with curl

curl "https://api.postmarkapp.com/triggers/tags/{triggerid}" \
  -X POST \
  -H "Accept: application/json" \
  -H "X-Postmark-Server-Token: server token"

Response

MatchName string Name of the tag that will activate this trigger.
TrackOpens boolean Indicates if this trigger activates open tracking.

Example response

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

{
  "MatchName": "purchase",
  "TrackOpens": false
}

Edit a single 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.
put

/triggers/tags/{triggerid}

Example request with curl

curl "https://api.postmarkapp.com/triggers/tags/{triggerid}" \
  -X PUT \
  -H "Accept: application/json" \
  -H "Content-Type: application/json" \
  -H "X-Postmark-Server-Token: server token" \
  -d "{MatchName: 'welcome', TrackOpens: true}"

Body format

MatchName string required
Name of the tag that will activate this trigger.
TrackOpens boolean Indicates if this trigger activates open tracking.

Example body format

{
  "MatchName": "new-name",
  "TrackOpens": true
}

Response

MatchName string Name of the tag that will activate this trigger.
TrackOpens boolean Indicates if this trigger activates open tracking.

Example response

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

{
  "MatchName": "new-name",
  "TrackOpens": true
}

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/tags/{triggerid}

Example request with curl

curl "https://api.postmarkapp.com/triggers/tags/{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": "Tag 19 removed."
}

Search 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.
match_name Filter by delivery tag
get

/triggers/tags?

Example request with curl

curl "https://api.postmarkapp.com/triggers/tags?match_name=welcome&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.
Tags array List of objects that each represent a tag.

Example response

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

{
  "TotalCount": 3,
  "Tags": [
    {
      "ID": 3,
      "MatchName": "welcome",
      "TrackOpens": true
    },
    {
      "ID": 5,
      "MatchName": "purchase",
      "TrackOpens": true
    },
    {
      "ID": 7,
      "MatchName": "support",
      "TrackOpens": false
    }
  ]
}