curl -X PUT "https://server.smartlead.ai/api/v1/webhook/update/12345?api_key=YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "My Updated Webhook",
"webhook_url": "https://example.com/webhook",
"event_types": ["EMAIL_SENT", "EMAIL_REPLIED", "EMAIL_BOUNCED"],
"categories": []
}'
import requests
API_KEY = "YOUR_API_KEY"
WEBHOOK_ID = 12345
response = requests.put(
f"https://server.smartlead.ai/api/v1/webhook/update/{WEBHOOK_ID}",
params={"api_key": API_KEY},
json={
"name": "My Updated Webhook",
"webhook_url": "https://example.com/webhook",
"event_types": ["EMAIL_SENT", "EMAIL_REPLIED", "EMAIL_BOUNCED"],
"categories": []
}
)
result = response.json()
print(result)
const API_KEY = 'YOUR_API_KEY';
const WEBHOOK_ID = 12345;
const response = await fetch(
`https://server.smartlead.ai/api/v1/webhook/update/${WEBHOOK_ID}?api_key=${API_KEY}`,
{
method: 'PUT',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
name: 'My Updated Webhook',
webhook_url: 'https://example.com/webhook',
event_types: ['EMAIL_SENT', 'EMAIL_REPLIED', 'EMAIL_BOUNCED'],
categories: []
})
}
);
const result = await response.json();
console.log(result);
{
"ok": true,
"id": 12345,
"message": "Webhook saved successfully"
}
{
"message": "Invalid API Key"
}
Webhooks
Update Webhook
Update the configuration of an existing webhook
PUT
/
api
/
v1
/
webhook
/
update
/
:webhook_id
curl -X PUT "https://server.smartlead.ai/api/v1/webhook/update/12345?api_key=YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "My Updated Webhook",
"webhook_url": "https://example.com/webhook",
"event_types": ["EMAIL_SENT", "EMAIL_REPLIED", "EMAIL_BOUNCED"],
"categories": []
}'
import requests
API_KEY = "YOUR_API_KEY"
WEBHOOK_ID = 12345
response = requests.put(
f"https://server.smartlead.ai/api/v1/webhook/update/{WEBHOOK_ID}",
params={"api_key": API_KEY},
json={
"name": "My Updated Webhook",
"webhook_url": "https://example.com/webhook",
"event_types": ["EMAIL_SENT", "EMAIL_REPLIED", "EMAIL_BOUNCED"],
"categories": []
}
)
result = response.json()
print(result)
const API_KEY = 'YOUR_API_KEY';
const WEBHOOK_ID = 12345;
const response = await fetch(
`https://server.smartlead.ai/api/v1/webhook/update/${WEBHOOK_ID}?api_key=${API_KEY}`,
{
method: 'PUT',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
name: 'My Updated Webhook',
webhook_url: 'https://example.com/webhook',
event_types: ['EMAIL_SENT', 'EMAIL_REPLIED', 'EMAIL_BOUNCED'],
categories: []
})
}
);
const result = await response.json();
console.log(result);
{
"ok": true,
"id": 12345,
"message": "Webhook saved successfully"
}
{
"message": "Invalid API Key"
}
Use this endpoint to update the configuration of an existing webhook.
Path Parameters
number
required
The webhook ID to update
Query Parameters
string
required
Your SmartLead API key
Request Body
string
A descriptive name for the webhook
string
The URL to receive webhook events
array
Array of event types to subscribe to (e.g.
EMAIL_SENT, EMAIL_OPENED, EMAIL_REPLIED, EMAIL_CLICKED, LEAD_UNSUBSCRIBED, EMAIL_BOUNCED)array
Array of lead categories to filter events by
curl -X PUT "https://server.smartlead.ai/api/v1/webhook/update/12345?api_key=YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "My Updated Webhook",
"webhook_url": "https://example.com/webhook",
"event_types": ["EMAIL_SENT", "EMAIL_REPLIED", "EMAIL_BOUNCED"],
"categories": []
}'
import requests
API_KEY = "YOUR_API_KEY"
WEBHOOK_ID = 12345
response = requests.put(
f"https://server.smartlead.ai/api/v1/webhook/update/{WEBHOOK_ID}",
params={"api_key": API_KEY},
json={
"name": "My Updated Webhook",
"webhook_url": "https://example.com/webhook",
"event_types": ["EMAIL_SENT", "EMAIL_REPLIED", "EMAIL_BOUNCED"],
"categories": []
}
)
result = response.json()
print(result)
const API_KEY = 'YOUR_API_KEY';
const WEBHOOK_ID = 12345;
const response = await fetch(
`https://server.smartlead.ai/api/v1/webhook/update/${WEBHOOK_ID}?api_key=${API_KEY}`,
{
method: 'PUT',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
name: 'My Updated Webhook',
webhook_url: 'https://example.com/webhook',
event_types: ['EMAIL_SENT', 'EMAIL_REPLIED', 'EMAIL_BOUNCED'],
categories: []
})
}
);
const result = await response.json();
console.log(result);
Response Codes
Success
Webhook added/updated successfully
Bad Request
Invalid request parameters
Unauthorized
Invalid or missing API key
Not Found
Campaign not found
{
"ok": true,
"id": 12345,
"message": "Webhook saved successfully"
}
{
"message": "Invalid API Key"
}
