An example of the full JSON document that would be POSTed to your webhook URL is to the right. A brief description of some of the more interesting fields is below:
Email
—the email address of the recipient.Tag
—delivery tag that was used when the message was sentBouncedAt
—timestamp of when complaint occurred.Subject
—Subject line of the email that was sentMetadata
—custom metadata that was included in the email.{
"RecordType": "SpamComplaint",
"MessageStream": "outbound",
"ID": 42,
"Type": "SpamComplaint",
"TypeCode": 512,
"Name": "Spam complaint",
"Tag": "Test",
"MessageID": "00000000-0000-0000-0000-000000000000",
"Metadata" : {
"a_key" : "a_value",
"b_key": "b_value"
},
"ServerID": 1234,
"Description": "",
"Details": "Test spam complaint details",
"Email": "john@example.com",
"From": "sender@example.com",
"BouncedAt": "2019-11-05T16:33:54.9070259Z",
"DumpAvailable": true,
"Inactive": true,
"CanActivate": false,
"Subject": "Test subject",
"Content": "<Abuse report dump>"
}
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 <your-url>
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.
curl <your-url> \
-X POST \
-H "Content-Type: application/json" \
-d '{
"ID": 42,
"Type": "SpamComplaint",
"TypeCode": 512,
"Name": "Spam complaint",
"Tag": "Test",
"MessageID": "00000000-0000-0000-0000-000000000000",
"ServerID": 1234,
"Description": "",
"Details": "Test spam complaint details",
"Email": "john@example.com",
"From": "sender@example.com",
"BouncedAt": "2018-02-20T12:54:23.3396434-05:00",
"DumpAvailable": true,
"Inactive": true,
"CanActivate": false,
"Subject": "Test subject"
}'
There are many possible uses for the data provided by using the spam complaint webhook: