What are webhooks?
Webhooks allow Pocketsflow to push real-time notifications to your application when events occur in your account. Instead of repeatedly polling for data, webhooks notify your server the moment something happens - like a completed order, failed payment, or new subscription.How webhooks work
Register your endpoint
Configure a webhook URL in your Pocketsflow dashboard (Settings → Developers → Webhooks)
Use cases for webhooks
Grant access to digital products
When a customer completes a purchase, automatically deliver course access, membership credentials, or license keys.Sync with your CRM
Keep customer data synchronized across HubSpot, Salesforce, or your internal systems.Update subscription access
Automatically grant or revoke access when subscriptions start, pause, or cancel.Send custom notifications
Trigger personalized emails, Slack notifications, or SMS messages based on events.Track metrics and analytics
Feed data into your analytics platform or internal dashboards.Creating a webhook
Step 1: Set up your endpoint
Create an HTTPS endpoint that can receive POST requests. Your endpoint must:- ✅ Accept POST requests with JSON payloads
- ✅ Use HTTPS (required for security)
- ✅ Respond within 5 seconds
- ✅ Return a 2xx status code (200, 201, 204)
- ✅ Verify webhook signatures (recommended)
Step 2: Register in your dashboard
- Navigate to Settings → Developers → Webhooks
- Click Create Webhook
- Enter your endpoint URL (must be HTTPS)
- Select the events you want to receive
- Add a description (optional)
- Click Create
Step 3: Test your webhook
Use the “Send Test Event” button in the dashboard to verify your endpoint is working correctly. Check:- ✅ Your server receives the request
- ✅ Signature verification passes
- ✅ You return a 2xx status code
- ✅ Response time is under 5 seconds
Webhook configuration
Endpoint URL requirements
- HTTPS only - HTTP endpoints are not supported for security
- Publicly accessible - Must be reachable from the internet
- Port 443 or 80 - Standard HTTPS/HTTP ports
- Valid SSL certificate - Self-signed certificates not supported
Event selection
Choose which events to receive:- All events - Receive every event type (use with caution)
- Specific events - Only receive selected event types (recommended)
Multiple webhooks
You can register multiple webhook endpoints:- Separate webhooks for different services (CRM, email, etc.)
- Staging vs production endpoints
- Development and testing webhooks
Managing webhooks via API
You can also manage webhooks programmatically:Create a webhook
List webhooks
Update webhook
Delete webhook
Webhook delivery
Timeout
Webhooks have a 5-second timeout. If your endpoint doesn’t respond within this time, the delivery is considered failed. Best practices:- Acknowledge receipt immediately (return 200)
- Process events asynchronously in the background
- Use a job queue for long-running tasks
Retry policy
Recommended approach:Delivery logs
View webhook delivery history in your dashboard:- Go to Settings → Developers → Webhook Logs
- View delivery status, timestamps, and responses
- Retry individual deliveries manually if needed
- Debug with full request/response data
Security
Signature verification
All webhooks include a signature header to verify authenticity: Header:X-Pocketsflow-Signature
Verify every webhook request to prevent forgery. See Authentication & Security for implementation details.
HTTPS requirement
Webhooks are only sent to HTTPS endpoints to prevent:- Man-in-the-middle attacks
- Eavesdropping on sensitive data
- Payload tampering
IP whitelisting
For additional security, you can whitelist Pocketsflow’s IP addresses in your firewall:Contact support@pocketsflow.com for current webhook IP ranges
Testing webhooks
Local development
Use tools to expose your local server for webhook testing: Option 1: ngrokTest mode
Use test mode webhooks during development:- Test API keys trigger test webhooks
- No real transactions
- Safe for experimentation
Manual testing
Trigger test events from the dashboard:- Go to Settings → Developers → Webhooks
- Click on your webhook
- Click Send Test Event
- Select event type
- Review the response
Best practices
1. Verify signatures
Always verify webhook signatures to prevent forgery.2. Use idempotency keys
Process each webhook only once using the event ID:3. Return 2xx immediately
Acknowledge receipt before processing:4. Handle failures gracefully
Store failed events for manual review and retry.5. Monitor webhook health
Track delivery success rates and response times.6. Keep secrets secure
Store webhook secrets in environment variables, never in code:Troubleshooting
Common issues
Webhooks not being received:- ✓ Verify URL is HTTPS and publicly accessible
- ✓ Check firewall/security group rules
- ✓ Ensure endpoint returns 2xx status
- ✓ Review webhook logs in dashboard
- ✓ Use the correct webhook secret
- ✓ Verify payload as raw bytes, not parsed JSON
- ✓ Check for whitespace or encoding issues
- ✓ Respond within 5 seconds
- ✓ Process events asynchronously
- ✓ Optimize endpoint performance
- ✓ Implement idempotency using event IDs
- ✓ Check for multiple webhook registrations
Next steps
Webhook Events
Explore all available event types and their payloads
Authentication & Security
Learn how to verify webhook signatures
Code Examples
See webhook implementations in multiple languages
Consuming Webhooks
Best practices for handling webhooks at scale