Webhook Integration Guide
Learn how to set up webhooks to integrate Postion with your existing tools. Automate workflows, sync data, and build custom integrations.
Webhooks allow your external applications to receive real-time notifications when events happen on your Postion site. Use them to automate workflows, sync data with your CRM, trigger emails, and more.
What Are Webhooks?
A webhook is an HTTP callback — when a specific event occurs on Postion (like a new subscriber or a purchase), we send a POST request to a URL you specify with data about that event.
Setting Up Webhooks
Step 1: Create a Webhook Endpoint
- Go to Dashboard → Webhooks
- Click "Add Webhook"
- Enter your endpoint URL (e.g.,
https://your-app.com/api/postion-webhook) - Select the events you want to receive
Step 2: Choose Your Events
| Event | Trigger | Payload |
|---|---|---|
subscriber.created | New subscriber signs up | User info, plan details |
subscriber.updated | Subscriber changes plan | Old/new plan, user info |
subscriber.deleted | Subscriber cancels | User info, reason |
post.published | New post is published | Post title, URL, author |
purchase.completed | One-time purchase made | Product, amount, buyer info |
payment.received | Subscription payment processed | Amount, subscriber, plan |
payment.failed | Payment fails | Subscriber info, failure reason |
Step 3: Verify Your Endpoint
After creating the webhook, Postion sends a verification request to your URL. Your endpoint must respond with a 200 OK status to confirm it's ready.
Webhook Payload Format
All webhook payloads follow this structure:
{
"event": "subscriber.created",
"timestamp": "2025-07-15T10:30:00Z",
"data": {
"id": "sub_abc123",
"email": "[email protected]",
"name": "Jane Doe",
"plan": "pro",
"site_id": "site_xyz789"
}
}Security: Verifying Webhook Signatures
Every webhook request includes a signature header (X-Postion-Signature) that you should verify to ensure the request is genuinely from Postion.
import crypto from 'crypto';
function verifyWebhookSignature(payload, signature, secret) {
const hash = crypto
.createHmac('sha256', secret)
.update(payload)
.digest('hex');
return hash === signature;
}Always verify webhook signatures in production. Never trust unverified webhook data.
Common Integration Patterns
Sync with Your CRM
When a subscriber signs up, automatically create a contact in your CRM:
- Listen for
subscriber.createdevents - Extract the subscriber's email and name
- Create or update the contact in your CRM (HubSpot, Salesforce, etc.)
Send Welcome Emails via Custom Service
Trigger a personalized welcome email through your own email service:
- Listen for
subscriber.createdevents - Use the subscriber data to personalize the email
- Send via your preferred email provider (SendGrid, Mailgun, etc.)
Slack Notifications
Get notified in Slack when key events occur:
- Create a Slack Incoming Webhook URL
- Set up a middleware that receives Postion webhooks
- Forward formatted messages to your Slack channel
Analytics Tracking
Log events to your analytics platform:
- Listen for all relevant events
- Forward to Mixpanel, Amplitude, or your custom analytics
- Build dashboards to track subscriber lifecycle
Retry Policy
If your endpoint is unavailable, Postion retries with exponential backoff:
| Attempt | Delay |
|---|---|
| 1st retry | 1 minute |
| 2nd retry | 5 minutes |
| 3rd retry | 30 minutes |
| 4th retry | 2 hours |
| 5th retry | 12 hours |
After 5 failed attempts, the webhook is marked as failing, and you'll receive an email notification.
Troubleshooting
"Webhook not receiving events"
- Verify your endpoint URL is publicly accessible (not
localhost) - Check that your endpoint returns a
200status code within 10 seconds - Ensure the correct events are selected in your webhook settings
"Invalid signature"
- Make sure you're using the correct webhook secret from your dashboard
- Verify you're computing the HMAC on the raw request body, not parsed JSON
"Events arriving out of order"
Webhooks may arrive out of order due to network conditions. Use the timestamp field to determine the true sequence of events.
For the full API reference, see our Public API Documentation. For technical details about the webhook system architecture, see Webhooks Architecture.