K
Support

Webhooks

Receive real-time notifications about events in your LeadNest account.

Overview

Webhooks allow you to receive HTTP callbacks when specific events occur, enabling real-time integrations with your systems.

Setting Up Webhooks

  1. Go to Settings → Webhooks
  2. Click "Add Webhook"
  3. Enter your endpoint URL
  4. Select events to subscribe to
  5. Save and test

Available Events

Email Events

  • email.sent - Email sent successfully
  • email.delivered - Email delivered to inbox
  • email.opened - Email opened by recipient
  • email.clicked - Link clicked in email
  • email.bounced - Email bounced
  • email.unsubscribed - User unsubscribed
  • email.spam - Marked as spam

SMS Events

  • sms.sent - SMS sent
  • sms.delivered - SMS delivered
  • sms.failed - SMS delivery failed
  • sms.replied - User replied to SMS

WhatsApp Events

  • whatsapp.sent - Message sent
  • whatsapp.delivered - Message delivered
  • whatsapp.read - Message read
  • whatsapp.replied - User replied

Subscriber Events

  • subscriber.created - New subscriber added
  • subscriber.updated - Subscriber data updated
  • subscriber.deleted - Subscriber removed

Webhook Payload

Example webhook payload:

{ "event": "email.opened", "timestamp": "2024-01-15T10:30:00Z", "data": { "message_id": "msg_abc123", "campaign_id": "camp_xyz789", "email": "user@example.com", "opened_at": "2024-01-15T10:30:00Z", "user_agent": "Mozilla/5.0...", "ip_address": "192.168.1.1" } }

Security

Verify webhook authenticity:

  • Check the X-LeadNest-Signature header
  • Use HMAC SHA256 with your webhook secret
  • Verify timestamp to prevent replay attacks

Signature Verification (Node.js)

const crypto = require('crypto'); function verifyWebhook(payload, signature, secret) { const hmac = crypto.createHmac('sha256', secret); const digest = hmac.update(payload).digest('hex'); return crypto.timingSafeEqual( Buffer.from(signature), Buffer.from(digest) ); }

Best Practices

  • Respond with 200 OK quickly (process async)
  • Implement retry logic for failed webhooks
  • Use HTTPS endpoints only
  • Verify webhook signatures
  • Log all webhook events
  • Handle duplicate events (idempotency)

Testing Webhooks

Test your webhook endpoint:

  1. Use the "Send Test" button in dashboard
  2. Check webhook logs for delivery status
  3. View request/response details
  4. Retry failed deliveries

Coming Soon Features

We're constantly working on new features to help you scale your communications. Here's what's currently in development:

AI Lead Scoring
Predictive Optimization
Multi-language Bots
Expanded CRM Sync

Need Help Getting Started?

Book a personalized demo with our team and discover how LeadNest can transform your communication strategy.

Contact Support