Webhooks
Test Subscription
Test a webhook subscription by sending a test signal. Supports three test modes.
Endpoint: (POST) https://api.lusha.com/api/subscriptions/{id}/test
Test Modes:
direct- Quick HTTP check only (validates URL responds correctly)kafka- Fanout handler only (tests Kafka message processing)full- Complete Kafka flow (default - end-to-end test)
What Gets Tested:
- URL accessibility and response time
- Complete delivery pipeline (for full mode)
- Signature generation and headers
Important Notes:
- Test deliveries do NOT consume credits
- Test payloads use mock data
- Useful for verifying webhook configuration before going live
POST
/
api
/
subscriptions
/
{id}
/
test
Test Subscription
curl --request POST \
--url https://api.lusha.com/api/subscriptions/{id}/test \
--header 'api_key: <api-key>'import requests
url = "https://api.lusha.com/api/subscriptions/{id}/test"
headers = {"api_key": "<api-key>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {api_key: '<api-key>'}};
fetch('https://api.lusha.com/api/subscriptions/{id}/test', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));HttpResponse<String> response = Unirest.post("https://api.lusha.com/api/subscriptions/{id}/test")
.header("api_key", "<api-key>")
.asString();package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.lusha.com/api/subscriptions/{id}/test"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("api_key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}{
"subscriptionId": "507f1f77bcf86cd799439011",
"subscriptionName": "My Test Webhook",
"url": "https://example.com/webhook",
"mode": "full",
"flowCheck": {
"success": true,
"statusCode": 200,
"durationMs": 150
},
"testPayload": {
"entityType": "contact",
"signalType": "promotion",
"data": {}
},
"isSuccess": true,
"timestamp": "2024-01-01T00:00:00.000Z"
}{
"statusCode": 400,
"message": "Invalid request parameters"
}{
"statusCode": 401,
"message": "Invalid API key"
}{
"statusCode": 403,
"message": "Subscription does not belong to your account"
}{
"statusCode": 404,
"message": "Resource not found"
}{
"statusCode": 500,
"message": "Internal server error. Please try again later."
}Authorizations
Your Lusha API key. You can find this in your Lusha dashboard under API settings.
Include this key in the api_key header for all requests.
Path Parameters
Subscription ID
Query Parameters
Test mode
Available options:
direct, kafka, full Response
Test executed successfully
Subscription ID that was tested
Example:
"507f1f77bcf86cd799439011"
Webhook URL that was tested
Example:
"https://example.com/webhook"
Test mode used
Available options:
direct, kafka, full Example:
"full"
Overall test success
Example:
true
When the test was executed
Example:
"2024-01-01T00:00:00.000Z"
Name of the subscription
Example:
"My Test Webhook"
Results of the test
Show child attributes
Show child attributes
Test payload that was sent
Show child attributes
Show child attributes
Was this page helpful?
⌘I
Test Subscription
curl --request POST \
--url https://api.lusha.com/api/subscriptions/{id}/test \
--header 'api_key: <api-key>'import requests
url = "https://api.lusha.com/api/subscriptions/{id}/test"
headers = {"api_key": "<api-key>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {api_key: '<api-key>'}};
fetch('https://api.lusha.com/api/subscriptions/{id}/test', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));HttpResponse<String> response = Unirest.post("https://api.lusha.com/api/subscriptions/{id}/test")
.header("api_key", "<api-key>")
.asString();package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.lusha.com/api/subscriptions/{id}/test"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("api_key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}{
"subscriptionId": "507f1f77bcf86cd799439011",
"subscriptionName": "My Test Webhook",
"url": "https://example.com/webhook",
"mode": "full",
"flowCheck": {
"success": true,
"statusCode": 200,
"durationMs": 150
},
"testPayload": {
"entityType": "contact",
"signalType": "promotion",
"data": {}
},
"isSuccess": true,
"timestamp": "2024-01-01T00:00:00.000Z"
}{
"statusCode": 400,
"message": "Invalid request parameters"
}{
"statusCode": 401,
"message": "Invalid API key"
}{
"statusCode": 403,
"message": "Subscription does not belong to your account"
}{
"statusCode": 404,
"message": "Resource not found"
}{
"statusCode": 500,
"message": "Internal server error. Please try again later."
}