Webhooks allow you to receive real-time HTTP POST notifications when specific events occur in your campaigns. Configure webhooks at user, client, or campaign level.
Query Parameters
Request Body
The URL where webhook notifications will be sent via HTTP POST
Scope of the webhook. Valid values:
1 - User level (all campaigns)
2 - Client level (all campaigns for a client)
3 - Campaign level (single campaign)
Campaign ID (required when association_type=3)
Webhook name for identification
Map of events to subscribe to. Common events:
SENT - Email sent
OPENED - Email opened
CLICKED - Link clicked
REPLIED - Lead replied
BOUNCED - Email bounced
UNSUBSCRIBED - Lead unsubscribed
Map of category IDs to filter events by lead category
Client ID (required when association_type=2)
Force creation even if a similar webhook exists
curl -X POST "https://server.smartlead.ai/api/v1/webhook/create?api_key=YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "Reply Notifications",
"webhook_url": "https://your-domain.com/webhook",
"email_campaign_id": 123,
"association_type": 3,
"event_type_map": {
"REPLIED": true,
"OPENED": true
}
}'
Webhook Payload
When an event occurs, SmartLead sends a POST request to your webhook_url with this structure:
{
"event_type" : "REPLIED" ,
"campaign_id" : 123 ,
"lead_email" : "john@example.com" ,
"lead_first_name" : "John" ,
"lead_last_name" : "Doe" ,
"email_account" : "sender@yourdomain.com" ,
"subject" : "Re: Quick question" ,
"message" : "Thanks for reaching out..." ,
"timestamp" : "2025-11-26T10:30:00Z" ,
"category_id" : 5
}
Association Types
Receives events from all campaigns owned by the user. Use when you want centralized notifications.
Receives events from all campaigns for a specific client. Useful for agency/white-label setups.
Receives events only from a specific campaign. Most common use case for per-campaign tracking.
Response Codes
Webhook created successfully
Invalid or missing API key
Missing required fields or invalid association_type
200 - Success
401 - Unauthorized
422 - Validation Error
{
"ok" : true ,
"id" : 456 ,
"webhook_url" : "https://your-domain.com/webhook"
}