curl -X POST "https://server.smartlead.ai/api/v1/webhook/2152/test?api_key=YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{"event_type": "EMAIL_REPLY"}'
import requests
response = requests.post(
"https://server.smartlead.ai/api/v1/webhook/2152/test",
params={"api_key": "YOUR_API_KEY"},
json={"event_type": "EMAIL_REPLY"},
)
print(response.status_code, response.json())
{
"ok": true,
"delivered": true,
"signed": true,
"webhook_id": 2152,
"event_type": "EMAIL_REPLY"
}
{
"ok": false,
"delivered": false,
"webhook_id": 2152,
"event_type": "EMAIL_REPLY",
"receiver_status_code": 500,
"error": "Your webhook URL answered HTTP 500"
}
{
"ok": false,
"delivered": false,
"webhook_id": 2152,
"event_type": "EMAIL_REPLY",
"error": "Test deliveries only go to public addresses; this webhook URL points to a private or local address."
}
{
"ok": false,
"error": "Webhook not found - Invalid webhook_id."
}
{
"ok": false,
"error": "Failed to send the test webhook"
}
Webhooks
Send a Test Webhook
Send one test event to a webhook’s saved URL and see what the URL answered
POST
/
api
/
v1
/
webhook
/
{webhook_id}
/
test
curl -X POST "https://server.smartlead.ai/api/v1/webhook/2152/test?api_key=YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{"event_type": "EMAIL_REPLY"}'
import requests
response = requests.post(
"https://server.smartlead.ai/api/v1/webhook/2152/test",
params={"api_key": "YOUR_API_KEY"},
json={"event_type": "EMAIL_REPLY"},
)
print(response.status_code, response.json())
{
"ok": true,
"delivered": true,
"signed": true,
"webhook_id": 2152,
"event_type": "EMAIL_REPLY"
}
{
"ok": false,
"delivered": false,
"webhook_id": 2152,
"event_type": "EMAIL_REPLY",
"receiver_status_code": 500,
"error": "Your webhook URL answered HTTP 500"
}
{
"ok": false,
"delivered": false,
"webhook_id": 2152,
"event_type": "EMAIL_REPLY",
"error": "Test deliveries only go to public addresses; this webhook URL points to a private or local address."
}
{
"ok": false,
"error": "Webhook not found - Invalid webhook_id."
}
{
"ok": false,
"error": "Failed to send the test webhook"
}
Sends one test delivery to the webhook’s saved URL, so an agent can check a receiver end to end before it relies on it. The body is the same sample payload the app’s Test button sends for that event, with the webhook’s own
webhook_id, webhook_name, event_type, campaign_id (when the webhook is on a campaign), webhookUrl and webhook_url filled in and is_test: true added.
When signing is on for the webhook (see Webhook Signing Secret), the test is signed like real deliveries only if your key may manage signing: a main account key, or a client key whose client has full access. Other keys get an unsigned test (signed: false) even though real deliveries are signed; the test is also sent unsigned if the signing lookup fails. Check signed before you test your signature verification.
Only public addresses are called: a webhook URL that points to a private or local address is refused with a 400, and redirects are not followed. The URL must answer within 10 seconds, with at most 64 KB.
With a client API key, only webhooks of that client can be tested.
Path Parameters
Query Parameters
Request Body
The event to send a sample of. One of
EMAIL_SENT, FIRST_EMAIL_SENT, EMAIL_OPEN, EMAIL_LINK_CLICK, EMAIL_REPLY, LEAD_UNSUBSCRIBED, LEAD_CATEGORY_UPDATED, EMAIL_BOUNCE, CAMPAIGN_STATUS_CHANGED, UNTRACKED_REPLIES, MANUAL_STEP_REACHED, MANUAL_REPLY_SENT. Default: the first event type the webhook is subscribed to that has a sample (EMAIL_ACCOUNT_DISCONNECTED and LINKEDIN_DISCONNECTED have none). A webhook subscribed to no event gets an EMAIL_SENT sample; one subscribed only to the two DISCONNECTED events gets a 400 unless you pass event_type.curl -X POST "https://server.smartlead.ai/api/v1/webhook/2152/test?api_key=YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{"event_type": "EMAIL_REPLY"}'
import requests
response = requests.post(
"https://server.smartlead.ai/api/v1/webhook/2152/test",
params={"api_key": "YOUR_API_KEY"},
json={"event_type": "EMAIL_REPLY"},
)
print(response.status_code, response.json())
Response Fields
Whether the test carried signature headers or a bearer token (only on success). See the signing note above.
On a 502: the HTTP status your URL answered, or
null when it could not be reached, timed out or answered with more than 64 KBResponse Codes
event_type is not one of the values above; the chosen event type has no test sample; the saved URL is not a valid URL or points to a private or local address; webhook_id is not a positive integer up to 2147483647; or an unknown query parameter or body keyYour URL answered with a non-2xx status, could not be reached, did not answer within 10 seconds, or answered with more than 64 KB
{
"ok": true,
"delivered": true,
"signed": true,
"webhook_id": 2152,
"event_type": "EMAIL_REPLY"
}
{
"ok": false,
"delivered": false,
"webhook_id": 2152,
"event_type": "EMAIL_REPLY",
"receiver_status_code": 500,
"error": "Your webhook URL answered HTTP 500"
}
{
"ok": false,
"delivered": false,
"webhook_id": 2152,
"event_type": "EMAIL_REPLY",
"error": "Test deliveries only go to public addresses; this webhook URL points to a private or local address."
}
{
"ok": false,
"error": "Webhook not found - Invalid webhook_id."
}
{
"ok": false,
"error": "Failed to send the test webhook"
}
