company logo

Help center

Go to Smartlead.ai
API Documentation
All collectionsAPI, Integrations, and Webhooks Quick Tips for Testing With Sample Webhook Payloads

Quick Tips for Testing With Sample Webhook Payloads

Before going live, test that your endpoint can receive and handle Smartlead’s webhook events.

Overview

Before going live with webhooks in Smartlead, it's critical to test how your system handles real-time event payloads. This ensures your application can correctly receive, validate, and process the data Smartlead sends, such as when a sending inbox disconnects or a campaign crosses the bounce threshold.

Smartlead supports sample payload testing using real test events from your account, so you can validate the entire flow—from signature verification to response handling—before using webhooks in production.

This article covers how to quickly test webhook payloads, recommended security practices, and common questions developers face during setup.

Quick Setup

  1. Prepare your endpoint
    Your webhook URL must accept HTTPS POST requests with JSON.
    For a quick check, you can use a tool like webhook.site.

  2. Add the webhook in Smartlead
    Go to Settings → Webhooks, enter your endpoint URL, and choose the events you want delivered.

  3. Trigger test events
    In a test account, try actions like:

    • Disconnect a sending inbox

    • Push a campaign over the bounce threshold

    Watch your endpoint or inspector for the payload and response codes.

Tips

  • If a User-level webhook exists, it will override Client or Campaign-level webhooks.

  • Make your handler idempotent (able to safely handle the same event more than once) by using the X-Request-Id.

  • Always return:

    • 2xx for success

    • 4xx for invalid requests

    • 5xx for temporary server errors

Recommended headers from Smartlead

  • Content-Type: application/json

  • X-Request-Id: a unique ID for each event

  • X-Webhook-Level: user | client | campaign

  • X-Smartlead-Signature: sha256=… (HMAC of the raw body using your signing secret)

Sample payloads

Email account disconnected

{
  "id": "evt_test_001",
  "type": "email.account.disconnected",
  "created_at": "2025-09-07T10:15:00Z",
  "data": {
    "account_id": 139919,
    "email": "[email protected]",
    "reason": "SMTP Failure - Host unavailable"
  },
  "links": { "app": "https://app.smartlead.ai" },
  "meta": { "attempt": 1, "level": "user" }
}

Campaign bounce threshold breached

{
  "id": "evt_test_002",
  "type": "campaign.bounce_threshold.breached",
  "created_at": "2025-09-07T10:16:00Z",
  "data": {
    "campaign_id": 139919,
    "threshold": 3.0,
    "current_bounce_rate": 4.8,
    "action": "paused"
  },
  "links": { "app": "https://app.smartlead.ai/app/email-campaign/139919" },
  "meta": { "attempt": 1, "level": "campaign" }
}

Minimal server-side verification

  • Read the raw request body.

  • Validate the signature in X-Smartlead-Signature.

  • Ensure idempotency using X-Request-Id.

  • Reply with a simple 200 OK and JSON response, e.g.:

{ "status": "ok" }

Pro Tips

  • Keep it fast: Return 2xx immediately; do heavy processing in the background.

  • Be idempotent: Use X-Request-Id or payload hash to prevent double-processing.

  • Scope awareness: User-level webhooks override Client and Campaign-level ones.

  • Secure it: Always verify X-Smartlead-Signature

Frequently Asked Questions (FAQs)

Q: Can I test webhooks without going live?

Yes. Use test campaigns and events like inbox disconnection to simulate real events. Tools like webhook.site are useful during initial setup.

Q: Will Smartlead retry if my server is slow or down?

Yes. Smartlead retries webhooks if you return 5xx errors or fail to respond quickly. Always return a 2xx as soon as possible.

Q: Can I verify the authenticity of the webhook?

Yes. Use the X-Smartlead-Signature header and your secret to validate the payload integrity using HMAC SHA256.

Q: What happens if I return a 4xx status?

4xx responses are treated as permanent failures—Smartlead will not retry.

Q: How do I avoid duplicate events?

Use the X-Request-Id header as a unique event identifier. Store and compare it before processing.

Q: Can I trigger custom events?

Currently, Smartlead supports system-defined events like sends, opens, bounces, and campaign changes. Custom triggers are not supported directly via webhook.

🆘 Need Help? Contact Support

If you're unsure how to:

  • Validate webhook signatures

  • Debug failed deliveries

  • Handle repeated events

  • Or configure your endpoint securely

👉 Reach out to our support team:

Email: [email protected]
Chat: Use the in-app support widget for live help

Related Articles

  • Set Up Smartlead Webhooks for Campaign Automation

  • Smartlead's full API documentation for automation

Did this answer your question?
😞
😐
😁