Webhooks
Receive leads in real-time by configuring webhooks. Ledly will send HTTP POST requests to your endpoint whenever a new lead arrives.
Setting Up a Webhook
- Go to Settings → Webhooks
- Click Add Webhook
- Enter your endpoint URL
- Select the events you want to receive
- Click Save
Webhook Payload
When a lead is received, Ledly sends a JSON payload:
{
"event": "lead.created",
"timestamp": "2024-12-24T12:00:00Z",
"data": {
"id": "lead_123",
"email": "student@example.com",
"first_name": "John",
"last_name": "Doe",
"phone": "+1234567890",
"program": "MBA",
"source": "website",
"custom_fields": {
"start_date": "Fall 2025"
}
}
}Verifying Webhooks
Each webhook includes a signature header X-Ledly-Signature that you can use to verify the request came from Ledly.
const crypto = require('crypto');
function verifyWebhook(payload, signature, secret) {
const expected = crypto
.createHmac('sha256', secret)
.update(payload)
.digest('hex');
return signature === expected;
}Retry Policy
If your endpoint returns a non-2xx status code, Ledly will retry:
- 1st retry: 1 minute
- 2nd retry: 5 minutes
- 3rd retry: 30 minutes
- 4th retry: 2 hours
- 5th retry: 24 hours
After 5 failed attempts, the webhook is marked as failed.
Testing Webhooks
Use the Test Webhook button in Settings to send a test payload to your endpoint.