Overview

Integration

User guide

API reference

Webhooks

Tracking opens per tag

Create a trigger for a tag

You can use triggers to enable open tracking on every email you send with a specific Tag without having to specify it in every request. Keep in mind that a single Tag can only have one trigger associated with it.

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: 'welome', TrackOpens: 'true'}"

Authentication headers

Triggers belong to servers, which means that requests for creating a trigger should use the X-Postmark-Server-Token header for authentication and authorization.

The header name and value are case insensitive. Should you execute the request with wrong or missing headers, you will receive an HTTP response with a status code of 401 (Unauthorized).

Example header

X-Postmark-Server-Token: server token

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

A successful request will return a JSON message in the following format.

ID integer

ID of new trigger

MatchName boolean

Name of tag

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
}

Check out the Triggers API reference for all the details about this endpoint.