# Postmark spam complaint notifications on your phone > Get a High-priority push notification when a recipient marks an email you sent through Postmark as spam. - Company: Postmark (https://www.justpush.io/recipes/postmark) - Event: `SpamComplaint` (Spam Complaint) - Tags: Email delivery, Email deliverability - Install: https://studio.justpush.io/recipes/postmark/spam-complaint - Web page: https://www.justpush.io/recipes/postmark/spam-complaint ## Setup 1. Click Install in Studio and sign in. The recipe is added to your account and you get a personal webhook URL. 2. In Postmark, open your Server, pick the Message Stream (for example Default Transactional Stream) and go to its Webhooks tab. 3. Click Add webhook and paste your webhook URL (shown in Studio after install) as the Webhook URL. 4. Tick Spam Complaint and save. Postmark checks that the endpoint answers before it starts sending. 5. Webhooks in Postmark belong to one **Message Stream** of one **Server**, so add this webhook to each stream you want to watch. Broadcast streams are where most complaints come from. 6. Every complaint pushes at High priority. Postmark deactivates the address after a complaint and you can't reactivate it yourself. The push includes the message's tag when it has one, so you can see which email people are reporting. 7. Postmark doesn't sign webhooks. It supports HTTP basic auth in the URL and custom headers, but JustPush doesn't check either yet, so keep your endpoint URL private. When you save the webhook, Postmark checks that the endpoint answers for each event type; that check may produce one test push. ## Code Studio calls `handleRequest(request)` with the incoming webhook (`{ method, headers, body, query, raw }`) and sends the message object it returns. Returning `null` sends nothing. ```js // Postmark → Spam complaint webhook // Fires when a recipient marks an email you sent through Postmark as spam. Postmark then // deactivates the address for good. // Docs: https://postmarkapp.com/developer/webhooks/spam-complaint-webhook // A trimmed string, or null. function text(value) { return typeof value === "string" && value.trim() ? value.trim() : null } function handleRequest(request) { const body = request.body && typeof request.body === "object" ? request.body : {} // Guard: only spam complaints, so other Postmark webhooks on this integration stay quiet. if (body.RecordType !== "SpamComplaint") { console.log(`Ignoring Postmark "${body.RecordType ?? "unknown"}" webhook`) return null } const subject = text(body.Subject) const tag = text(body.Tag) return { title: "🚨 Spam complaint", message: `${text(body.Email) ?? "A recipient"} marked ${subject ? `"${subject}"` : "your email"} as spam` + (tag ? ` · ${tag}` : ""), topic: "Postmark", priority: 1, // High: complaints hurt your sender reputation, and Postmark watches the rate } } ``` ## Postmark SpamComplaint webhook payload (sample) ```json { "ID": 692560174, "Tag": "weekly-digest", "From": "news@example.com", "Name": "Spam complaint", "Type": "SpamComplaint", "Email": "sam@example.com", "Details": "", "Subject": "This week at Acme", "Inactive": true, "Metadata": { "customer_id": "cus_1234" }, "ServerID": 23, "TypeCode": 100001, "BouncedAt": "2026-09-29T08:33:54.9070259Z", "MessageID": "883953f4-6105-42a2-a16a-77a8eac79483", "RecordType": "SpamComplaint", "CanActivate": false, "Description": "The subscriber explicitly marked this message as spam.", "DumpAvailable": true, "MessageStream": "broadcast" } ``` ## FAQ ### Does this work on iPhone and Android? Yes. Install the JustPush app from the App Store or Google Play and sign in. Every phone signed in to your account gets the notification. ### Do I need to write code? No. Install the recipe in Studio, paste your webhook URL into Postmark and you are done. The code is there if you want to change the text, the sound or the buttons. ### Can I change what the notification says? Yes. After install the recipe's code is yours. Edit it in Studio and test it against the sample payload before you save. ### What does it cost? JustPush is free for 30 days. After that it's $19.99 a year, or $39.99 once. There is no extra charge for recipes.