← Back to docs
Inbound Webhooks
Inbound Webhooks
Postscale can parse incoming emails and deliver them to your application via webhooks. This enables powerful use cases like support ticket systems, reply detection, and email-based workflows.
Setup
- Configure your domain's MX records to point to Postscale
- Set your webhook URL in the dashboard
- Start receiving parsed emails as JSON
Webhook Payload
When an email arrives, we send a POST request to your endpoint:
{
"id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"message_id": "<unique-id@example.com>",
"from": "customer@example.com",
"to": "support@yourapp.com",
"subject": "Help with my order",
"text": "Hi, I need help with order #12345...",
"html": "<p>Hi, I need help with order #12345...</p>",
"headers": {
"message-id": "<unique-id@example.com>",
"in-reply-to": "<previous-id@yourapp.com>"
},
"attachments": [],
"received_at": "2026-01-18T10:30:00Z",
"status": "processed"
}
Verifying Webhooks
Verify webhook signatures to ensure requests come from Postscale:
import { Postscale } from '@postscale/sdk';
const isValid = Postscale.webhooks.verify(
request.body,
request.headers['x-postscale-signature'],
webhookSecret
);
Threading
Use the in-reply-to header to match replies to original messages and maintain conversation threads.