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 → #

post

/triggers/tags

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.

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.

Example body format

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

Response

ID integer

Unique ID of the trigger

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

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

Get a single trigger Try → #

get

/triggers/tags/{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/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 → #

put

/triggers/tags/{triggerid}

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.

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

ID integer

Unique ID of the trigger

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 → #

delete

/triggers/tags/{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/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 → #

get

/triggers/tags

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/tags?match_name=welcome&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.

match_name

Filter by delivery tag.

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