Overview
Integration
User guide
API reference
Webhooks
Introduction
Official libraries
- Rails gem
- Ruby gem
- .NET
- Java
- PHP
- Craft plugin
- Node.js
- CLI
- WordPress plugin
- Grunt plugin
- Zapier Actions
Community libraries
- Classic ASP
- Clojure
- ColdFusion
- Django
- Drupal module
- Elixir
- Erlang
- Google Go
- Grails plugin
- Haskell
- Java
- Laravel
- Magento extension
- Node.js
- Objective-C
- Perl
- Pharo Smalltalk
- PHP 5
- PowerShell Snap-in
- Python
- Scala
- Swift
- WordPress
- Zend
Tools and Integrations
Sending email with API
- Send a single email
- Send batch emails
Sending email with SMTP
Processing email
- Configure an inbound server
- Inbound domain forwarding
- Parse an email
- Configure inbound blocking
- Sample inbound workflow
Tracking opens
- Tracking opens per Server
- Tracking opens per email
- Message opens API
Tracking links
Managing your account
- Managing sender signatures
- Managing servers
Sandbox mode
- Server sandbox mode
- Generate fake bounces
Overview
- Endpoint URL
- Authentication
- HTTP response codes
- API error codes
Email
- Send a single email
- Send batch emails
Bulk
- Send bulk emails
- Get the status/details of a bulk API request
Bounce
- Get delivery stats
- Get bounces
- Get a single bounce
- Get bounce dump
- Activate a bounce
- Bounce types
- Rebound
Templates
- Send email with template
- Send batch with templates
- Push templates to another server
- Get a template
- Create a template
- Edit a template
- List templates
- Delete a template
- Validate a template
Server
- Get the server
- Edit the server
Servers
- Get a server
- Create a server
- Edit a server
- List servers
- Delete a server
Message Streams
- List message streams
- Get a message stream
- Edit a message stream
- Create a message stream
- Archive a message stream
- Unarchive a message stream
Messages
- Outbound message search
- Outbound message details
- Outbound message dump
- Inbound message search
- Inbound message details
- Bypass rules for a blocked inbound message
- Retry a failed inbound message for processing
- Message opens
- Opens for a single message
- Message clicks
- Clicks for a single message
Domains
- List domains
- Get domain details
- Create domain
- Edit domain
- Delete domain
- Verify DKIM
- Verify Return-Path
- Verify an SPF record
- Rotate DKIM keys
Sender signatures
- List sender signatures
- Get sender signature
- Create a signature
- Edit a signature
- Delete a signature
- Resend a confirmation
- Verify an SPF record
- Request a new DKIM
Stats
- Get outbound overview
- Get sent counts
- Get bounce counts
- Get spam complaints
- Get tracked email counts
- Get email open counts
- Get email platform usage
- Get email client usage
- Get click counts
- Get browser usage
- Get browser platform usage
- Get click location
Triggers: Inbound rules
- List inbound rule triggers
- Create an inbound rule trigger
- Delete a single trigger
Webhooks
- List webhooks
- Get a webhook
- Create a webhook
- Edit a webhook
- Delete a webhook
Suppressions
- Suppression dump
- Create a Suppression
- Delete a Suppression
Data Removal
- Create a Data Removal request
- Check a Data Removal request status
Webhooks overview
- What is a webhook?
- Protecting your webhook
- Testing your webhook
- Retry attempts
Bounce webhook
- What is a bounce webhook?
- Set the webhook URL
- Bounce webhook data
- Testing with curl
- How you can use the data
- Rebound
Inbound webhook
- What is an inbound webhook?
- Inbound webhook data
- Testing with curl
- How you can use the data
- Errors and retries
- Set the webhook URL
Open tracking webhook
- What is an open webhook?
- Set the webhook URL
- Open webhook data
- Testing with curl
- How you can use the data
Delivery webhook
- What is a delivery webhook?
- Set the webhook URL
- Delivery webhook data
- Testing with curl
- How you can use the data
Click webhook
- What is a click webhook?
- Set the webhook URL
- Click webhook data
- Testing with curl
- How you can use the data
Spam complaint webhook
- What is a spam complaint?
- Set the webhook URL
- Spam complaint webhook data
- Testing the spam complaint webhook with curl
- How you can use the data
Subscription change webhook
- What is a subscription change?
- Set the subscription change webhook URL
- Subscription change webhook data
- Testing the subscription change webhook with curl
- How you can use the subscription change data
SMTP API Error
- What is an SMTP API Error
- Set SMTP API Errors for a Server
- SMTP API Error Data
- Testing the SMTP API Error
- How can you use SMTP API Error
Subscription change webhook
What is a subscription change? #
A subscription change is recorded when an email address is added or removed from a Message Stream's Suppression list. An email address is added to a Suppression List after a Hard Bounce, Spam Complaint, Unsubscribe, or Manual Suppression. A manual suppression is created in Postmark's UI or using the API .
An email address is removed from the suppression list manually by choosing an address to reactivate in Postmark's UI or using the API .
You can also get the suppression list using the API .
Note: The datetime for the ChangedAt
field is in ISO 8601 format.
Set the subscription change webhook URL #
Using the Postmark website
When logged into Postmark, select the Server, the Message Stream, and then go to the Webhooks tab. Choose Add webhook and input your webhook URL in Webhook URL and then select the Subscription Change checkbox.
Using the API
You can modify the SubscriptionChange
field using the Webhooks API to edit an existing Webhook . You can also use the Webhooks API to create webhooks and set the SubscriptionChange
field at the same time.
Subscription change webhook data #
An example of the full JSON document that would be POSTed to your webhook URL is to the right.
The SuppressSending field will inform whether that was a deactivation or reactivation. MessageID is null for Manual Suppressions with Origin value of Customer or Admin and Reactivations. Possible SuppressionReason values are: HardBounce, SpamComplaint, or ManualSuppression. If a recipient unsubscribes, they will be suppressed with the SuppressionReason of ManualSuppression. The SuppressionReason and Tag fields are null, while the Metadata field is an empty object when SuppressSending = false (reactivation). The Origin field shows where that originated from. e.g.: Recipient, Customer, Admin ChangedAt—timestamp of when the subscription changed.
Example JSON webhook data {
"RecordType":"SubscriptionChange",
"MessageID": "883953f4-6105-42a2-a16a-77a8eac79483",
"ServerID":123456,
"MessageStream": "outbound",
"ChangedAt": "2020-02-01T10:53:34.416071Z",
"Recipient": "bounced-address@wildbit.com",
"Origin": "Recipient",
"SuppressSending": true,
"SuppressionReason": "HardBounce",
"Tag": "my-tag",
"Metadata": {
"example": "value",
"example_2": "value"
}
}
Testing the subscription change webhook with curl #
If you’re developing on your local machine or don’t have a public URL for your API, the curl request to the right has an example webhook POST request. Replace with the API route that you want to use for your webhook URL. The curl request will allow you to verify that your webhook URL is able to accept requests with the same JSON format that the Postmark servers will use.
Example curl call curl <your-url> \
-X POST \
-H "Content-Type: application/json" \
-d '{
"RecordType": "SubscriptionChange",
"MessageID": "883953f4-6105-42a2-a16a-77a8eac79483",
"ServerID": 4509041,
"MessageStream": "outbound",
"ChangedAt": "2020-02-01T10:53:34.416071Z",
"Recipient": "hard-bounce@wildbit.com",
"Origin": "Customer",
"SuppressSending": true,
"SuppressionReason": "HardBounce",
"Tag": "my-tag",
"Metadata": {
"example": "value",
"example_2": "value"
}
}'
How you can use the subscription change data #
There are many possible uses for the data provided by using the subscription change webhook:
Use the webhook in place of the bounce and spam complaints webhook to receive notifications on inactive addresses. Maintain a suppression list of your own. Notify a user in your app their address is currently active/inactive.