Receives and processes Postmark webhooks for email delivery events, bounces, opens, clicks, spam complaints, and subscription changes. Includes authentication patterns and event handling code.
Ships in webhook-skills. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Postmark does NOT use signature verification. Instead, webhooks are authenticated with credentials you configure on the webhook: Basic Auth or a token in the URL (shown below), or a custom header set with HttpHeaders (see references/verification.md).
// Express - Basic Auth in URL
// Configure webhook URL in Postmark as:
// https://username:[email protected]/webhooks/postmark
app.post('/webhooks/postmark', express.json(), (req, res) => {
// Basic auth is handled by your web server or proxy
// Additional validation can check expected payload structure
const event = req.body;
// Validate expected fields exist (Inbound payloads have no RecordType).
// SubscriptionChange can have MessageID: null, and a 4xx makes Postmark drop the event.
const recordType = event.RecordType || (event.FromFull ? 'Inbound' : undefined);
if (!recordType || (recordType !== 'SubscriptionChange' && !event.MessageID)) {
return res.status(400).send('Invalid payload structure');
}
// Process event
console.log(`Received ${event.RecordType || 'Inbound'} event for message ${event.MessageID}`);
res.sendStatus(200);
});
// Alternative: Token in URL
// Configure webhook URL as:
// https://yourdomain.com/webhooks/postmark?token=your-secret-token
app.post('/webhooks/postmark', express.json(), (req, res) => {
const token = req.query.token;
const expectedToken = process.env.POSTMARK_WEBHOOK_TOKEN;
// Fail closed: never accept a request when no token is configured
if (!expectedToken || token !== expectedToken) {
return res.status(401).send('Unauthorized');
}
const event = req.body;
console.log(`Received ${event.RecordType || 'Inbound'} event`);
res.sendStatus(200);
});
// Postmark sends one event per request (not batched)
app.post('/webhooks/postmark', express.json(), (req, res) => {
const event = req.body;
// Inbound webhooks have no RecordType, so identify them by FromFull
const recordType = event.RecordType || (event.FromFull ? 'Inbound' : undefined);
switch (recordType) {
case 'Bounce':
console.log(`Bounce: ${event.Email} - ${event.Type} - ${event.Description}`);
// Update contact as undeliverable
break;
case 'SpamComplaint':
console.log(`Spam complaint: ${event.Email}`);
// Remove from mailing list
break;
case 'Open':
console.log(`Email opened: ${event.Recipient} at ${event.ReceivedAt}`);
// Track engagement
break;
case 'Click':
console.log(`Link clicked: ${event.Recipient} - ${event.OriginalLink}`);
// Track click-through rate
break;
case 'Delivery':
console.log(`Delivered: ${event.Recipient} at ${event.DeliveredAt}`);
// Confirm delivery
break;
case 'SubscriptionChange':
console.log(`Subscription change: ${event.Recipient} - ${event.ChangedAt}`);
// Update subscription preferences
break;
case 'Inbound':
console.log(`Inbound email from: ${event.From} - Subject: ${event.Subject}`);
// Process incoming email
break;
case 'SMTP API Error':
// Postmark publishes no sample payload for this webhook: check these
// names against a real delivery
console.log(`SMTP API error: ${event.Email} - ${event.Error}`);
// Handle API error, maybe retry
break;
default:
console.log(`Unknown event type: ${recordType}`);
}
res.sendStatus(200);
});
| Event | RecordType | Description | Key Fields |
|---|---|---|---|
| Bounce | Bounce | Hard/soft bounce or blocked email | Email, Type, TypeCode, Description |
| Spam Complaint | SpamComplaint | Recipient marked as spam | Email, BouncedAt |
| Open | Open | Email opened (requires open tracking) | Recipient, ReceivedAt, Platform, UserAgent |
| Click | Click | Link clicked (requires click tracking) | Recipient, ReceivedAt, OriginalLink |
| Delivery | Delivery | Successfully delivered | Recipient, DeliveredAt, Details |
| Subscription Change | SubscriptionChange | Unsubscribe/resubscribe | Recipient, ChangedAt, SuppressionReason |
| Inbound | None | Incoming email received | From, FromFull, Subject, TextBody, HtmlBody |
| SMTP API Error | SMTP API Error | SMTP API call failed | Email, Error, ErrorCode, MessageID |
Inbound payloads have no RecordType, so identify them by FromFull. Postmark publishes no sample payload for SMTP API Error, so check that row's RecordType and fields against a real delivery.
# For token-based authentication
POSTMARK_WEBHOOK_TOKEN="your-secret-token-here"
# For basic auth (if not using URL-embedded credentials)
WEBHOOK_USERNAME="your-username"
WEBHOOK_PASSWORD="your-password"
For local webhook testing, use Hookdeck CLI:
npx hookdeck-cli listen 3000 postmark --path /webhooks/postmark
No account required. Provides local tunnel + web UI for inspecting requests.
For production-ready webhook handling, also install the webhook-handler-patterns skill:
TODO.md (opens in a new tab)examples/express/README.md (opens in a new tab)examples/express/package.json (opens in a new tab)examples/express/src/index.js (opens in a new tab)examples/express/test/webhook.test.js (opens in a new tab)examples/fastapi/README.md (opens in a new tab)examples/fastapi/main.py (opens in a new tab)examples/fastapi/requirements.txt (opens in a new tab)examples/fastapi/test_webhook.py (opens in a new tab)examples/nextjs/README.md (opens in a new tab)examples/nextjs/app/webhooks/postmark/route.ts (opens in a new tab)examples/nextjs/package.json (opens in a new tab)examples/nextjs/test/webhook.test.ts (opens in a new tab)examples/nextjs/vitest.config.ts (opens in a new tab)references/overview.md (opens in a new tab)references/setup.md (opens in a new tab)references/verification.md (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
/webhook-skills:postmark-webhooksfrom webhook-skills
npx claudepluginhub hookdeck/webhook-skills --plugin webhook-skills219 skills in this plugin
/ada-webhooksReceive and verify Ada (ada.cx) AI customer service webhooks, delivered through Svix. Use when setting up an Ada webhook endpoint, getting the per-endpoint whsec_ signing secret, debugging svix-id / svix-timestamp / svix-signature verification, or handling events like v1.conversation.created, v1.conversation.message, v1.conversation.ended, v1.conversation.handoff.ended, v1.end_user.created, v1.end_user.updated, v1.audit_log.emitted and v1.proactive_call.* voice outreach events.
/adyen-webhooksReceive and verify Adyen webhooks (standard notifications). Use when setting up Adyen webhook handlers, debugging HMAC signature verification, or handling payment events like AUTHORISATION, CAPTURE, REFUND, CANCELLATION, and CHARGEBACK.
/Other plugins' skills for the same job