curl -X POST "https://server.smartlead.ai/api/v1/campaigns/123/webhooks?api_key=YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{
"id": null,
"name": "CRM Integration",
"webhook_url": "https://crm.example.com/smartlead-webhook",
"event_types": ["LEAD_REPLIED", "LEAD_OPENED"]
}'
import requests
API_KEY = "YOUR_API_KEY"
def create_webhook(campaign_id, name, url, events):
payload = {
"id": None, # null for new
"name": name,
"webhook_url": url,
"event_types": events
}
response = requests.post(
f"https://server.smartlead.ai/api/v1/campaigns/{campaign_id}/webhooks",
params={"api_key": API_KEY},
json=payload
)
if response.status_code == 200:
webhook_id = response.json()['data']['id']
print(f"✅ Webhook created (ID: {webhook_id})")
return response.json()
# Create CRM webhook for replies
create_webhook(
campaign_id=123,
name="CRM Reply Integration",
url="https://crm.example.com/webhook",
events=["LEAD_REPLIED", "LEAD_CLICKED"]
)
const API_KEY = 'YOUR_API_KEY';
async function createWebhook(campaignId, name, url, events) {
const payload = {
id: null,
name,
webhook_url: url,
event_types: events
};
const response = await fetch(
`https://server.smartlead.ai/api/v1/campaigns/${campaignId}/webhooks?api_key=${API_KEY}`,
{
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify(payload)
}
);
return response.json();
}
await createWebhook(123, 'Slack Notifications',
'https://hooks.slack.com/...', ['LEAD_REPLIED']);
{
"success": true,
"data": {
"id": 456,
"name": "CRM Integration",
"webhook_url": "https://crm.example.com/webhook",
"event_types": ["LEAD_REPLIED", "LEAD_OPENED"]
}
}
Campaign Webhooks
Create/Update Campaign Webhook
Create a new webhook or update existing webhook for campaign events
POST
/
api
/
v1
/
campaigns
/
{campaign_id}
/
webhooks
curl -X POST "https://server.smartlead.ai/api/v1/campaigns/123/webhooks?api_key=YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{
"id": null,
"name": "CRM Integration",
"webhook_url": "https://crm.example.com/smartlead-webhook",
"event_types": ["LEAD_REPLIED", "LEAD_OPENED"]
}'
import requests
API_KEY = "YOUR_API_KEY"
def create_webhook(campaign_id, name, url, events):
payload = {
"id": None, # null for new
"name": name,
"webhook_url": url,
"event_types": events
}
response = requests.post(
f"https://server.smartlead.ai/api/v1/campaigns/{campaign_id}/webhooks",
params={"api_key": API_KEY},
json=payload
)
if response.status_code == 200:
webhook_id = response.json()['data']['id']
print(f"✅ Webhook created (ID: {webhook_id})")
return response.json()
# Create CRM webhook for replies
create_webhook(
campaign_id=123,
name="CRM Reply Integration",
url="https://crm.example.com/webhook",
events=["LEAD_REPLIED", "LEAD_CLICKED"]
)
const API_KEY = 'YOUR_API_KEY';
async function createWebhook(campaignId, name, url, events) {
const payload = {
id: null,
name,
webhook_url: url,
event_types: events
};
const response = await fetch(
`https://server.smartlead.ai/api/v1/campaigns/${campaignId}/webhooks?api_key=${API_KEY}`,
{
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify(payload)
}
);
return response.json();
}
await createWebhook(123, 'Slack Notifications',
'https://hooks.slack.com/...', ['LEAD_REPLIED']);
{
"success": true,
"data": {
"id": 456,
"name": "CRM Integration",
"webhook_url": "https://crm.example.com/webhook",
"event_types": ["LEAD_REPLIED", "LEAD_OPENED"]
}
}
Configure webhooks to receive real-time notifications when campaign events occur. Integrate with CRM, Slack, or custom systems.
Path Parameters
number
required
Campaign ID
Query Parameters
string
required
Your SmartLead API key
Request Body
number
Webhook ID (null for new webhook, number to update existing)
string
required
Webhook name for identification
string
required
URL to receive webhook POST requests
array
required
Array of event types to trigger webhookCommon events:
LEAD_REPLIEDLEAD_OPENEDLEAD_CLICKEDLEAD_BOUNCEDLEAD_UNSUBSCRIBED
curl -X POST "https://server.smartlead.ai/api/v1/campaigns/123/webhooks?api_key=YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{
"id": null,
"name": "CRM Integration",
"webhook_url": "https://crm.example.com/smartlead-webhook",
"event_types": ["LEAD_REPLIED", "LEAD_OPENED"]
}'
import requests
API_KEY = "YOUR_API_KEY"
def create_webhook(campaign_id, name, url, events):
payload = {
"id": None, # null for new
"name": name,
"webhook_url": url,
"event_types": events
}
response = requests.post(
f"https://server.smartlead.ai/api/v1/campaigns/{campaign_id}/webhooks",
params={"api_key": API_KEY},
json=payload
)
if response.status_code == 200:
webhook_id = response.json()['data']['id']
print(f"✅ Webhook created (ID: {webhook_id})")
return response.json()
# Create CRM webhook for replies
create_webhook(
campaign_id=123,
name="CRM Reply Integration",
url="https://crm.example.com/webhook",
events=["LEAD_REPLIED", "LEAD_CLICKED"]
)
const API_KEY = 'YOUR_API_KEY';
async function createWebhook(campaignId, name, url, events) {
const payload = {
id: null,
name,
webhook_url: url,
event_types: events
};
const response = await fetch(
`https://server.smartlead.ai/api/v1/campaigns/${campaignId}/webhooks?api_key=${API_KEY}`,
{
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify(payload)
}
);
return response.json();
}
await createWebhook(123, 'Slack Notifications',
'https://hooks.slack.com/...', ['LEAD_REPLIED']);
Response Example
{
"success": true,
"data": {
"id": 456,
"name": "CRM Integration",
"webhook_url": "https://crm.example.com/webhook",
"event_types": ["LEAD_REPLIED", "LEAD_OPENED"]
}
}
Related Endpoints
⌘I
