Skip to main content

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
Always use HTTPS for your webhook endpoint to ensure data is encrypted in transit.

Best Practices

  1. Return 200 Quickly: Process webhooks asynchronously
  2. Implement Retry Logic: Handle temporary failures
  3. Validate Payload: Check all required fields exist
  4. Log Everything: Keep webhook logs for debugging
  5. 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
After 5 failed attempts, the webhook will be disabled.

Debugging Webhooks

Common Issues

Check:
  • URL is publicly accessible
  • HTTPS is properly configured
  • Firewall allows SmartLead IPs
  • Server is returning 200 status code
Solution: Use the timestamp field to order events, not arrival time
Solution: Use idempotency keys (lead_id + event + timestamp)
Reason: Too many failures (5+ consecutive errors) Solution: Fix your endpoint and re-enable webhook

Test Your Webhook

Use a webhook testing service:

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
Use a queue system (Redis, RabbitMQ) to handle webhook events asynchronously.