What are Webhooks?
Webhooks allow you to receive real-time notifications when events occur in your SmartLead campaigns. Instead of polling the API, SmartLead will send HTTP POST requests to your server when events happen.Use Cases
CRM Integration
Update your CRM when leads reply or book meetings
Lead Scoring
Score leads based on engagement (opens, clicks)
Notifications
Get Slack/Email alerts for important replies
Analytics
Send data to your analytics platform
Available Events
Webhook Payload Format
All webhook events follow this structure:Setting Up Webhooks
1
Create Webhook Endpoint
Set up an HTTPS endpoint on your server that accepts POST requests
Python
2
Register Webhook in SmartLead
Use the API to register your webhook URL
cURL
3
Test Your Webhook
SmartLead will send test events when you save the webhook
4
Go Live
Activate your campaign and start receiving events
Webhook Association Types
Webhooks can be associated with:- User Level (association_type: 1): Receive events from all campaigns
- Client Level (association_type: 2): Events for specific client’s campaigns
- Campaign Level (association_type: 3): Events from a single campaign
Event Examples
EMAIL_SENT
EMAIL_OPENED
EMAIL_REPLIED
EMAIL_CLICKED
Webhook Security
Verify Webhook Origin
Always verify webhooks come from SmartLead:Python
Best Practices
- Return 200 Quickly: Process webhooks asynchronously
- Implement Retry Logic: Handle temporary failures
- Validate Payload: Check all required fields exist
- Log Everything: Keep webhook logs for debugging
- Use Idempotency: Handle duplicate events gracefully
Example Implementations
Node.js/Express
Python/Flask
Webhook Management
Create Webhook
cURL
Get Webhook Details
cURL
Delete Webhook
cURL
Retry Logic
SmartLead will retry failed webhook deliveries:- 1st retry: After 1 minute
- 2nd retry: After 5 minutes
- 3rd retry: After 15 minutes
- 4th retry: After 1 hour
- 5th retry: After 6 hours
Debugging Webhooks
Common Issues
Webhook Not Receiving Events
Webhook Not Receiving Events
Check:
- URL is publicly accessible
- HTTPS is properly configured
- Firewall allows SmartLead IPs
- Server is returning 200 status code
Events Arriving Out of Order
Events Arriving Out of Order
Solution: Use the
timestamp field to order events, not arrival timeDuplicate Events
Duplicate Events
Solution: Use idempotency keys (lead_id + event + timestamp)
Webhook Disabled
Webhook Disabled
Reason: Too many failures (5+ consecutive errors)
Solution: Fix your endpoint and re-enable webhook
Test Your Webhook
Use a webhook testing service:- webhook.site
- requestbin.com
- Postman’s webhook collection feature
Integration Examples
Update HubSpot
Send Slack Notification
Rate Limiting
Webhook deliveries are not subject to API rate limits. However, ensure your server can handle:- Burst traffic: Many events arriving simultaneously
- Sustained load: Continuous event stream during active campaigns
