Webhooks
Send every Leadux lead to your own CRM, Make, n8n or Zapier with a signed webhook, using the field names and format your receiver expects.
A webhook sends each new lead to any web address that accepts HTTP requests: your own CRM, an automation tool such as Make, n8n or Zapier, or your own code. You choose the fields, their names, the format and when to send. Webhooks are included in every plan, including the trial. Only account admins can set them up.
Account webhook and website webhooks
Go to Integrations and click Set up a webhook (or Edit webhook) on the Webhook card.
- The account webhook gets the leads of every website. Choose All websites (account webhook) under Settings for.
- To treat one website differently, choose it under Settings for. Under Where leads from … go you pick:
- Use the account webhook: the default.
- Use its own webhook: leads from this website go to a different address, with their own fields and settings.
- Send nothing: leads from this website aren't sent to any webhook, not even the account's.
Set up the receiver
- Under Receiver, enter the Webhook address. It must start with
https://. - Optional: give it a Name, such as "Our CRM". The Leads page then shows "Sent to Our CRM".
- Choose the Format: JSON or Form fields (x-www-form-urlencoded).
- Under When to send, choose how often (see below).
- Choose the Fields, and add Fixed values and Headers if your receiver needs them.
- Check the Preview, click Send a test lead, then Save.
When to send
- Once per lead: Leadux sends the lead when the lead email goes out. That's right away when the visitor has given all the contact details you ask for, otherwise 5 minutes after the lead is first captured, so details the visitor adds in the meantime are included. Use this for receivers that create a new record on every call.
- Every time the lead changes: Leadux also sends the lead each time the visitor adds or changes details, and once more 30 minutes after capture with the whole conversation. Your receiver must update the record with the same
lead_idinstead of creating a new one.
Fields
Switch fields on or off and set the name your receiver expects for each. These are the fields and their default names:
| Default name | Field | On by default |
|---|---|---|
lead_id |
Lead ID | Always sent |
name |
Full name | Yes |
first_name |
First name | No |
last_name |
Last name | No |
email |
Yes | |
phone |
Phone | Yes |
country |
Visitor country, such as Germany | Yes |
country_code |
Visitor country code (ISO 3166, such as DE) | No |
details |
Other details the visitor gave | Yes |
conversation |
Chat conversation | Yes |
conversation_url |
Link to the conversation in Leadux | No |
website |
Website name | Yes |
website_domain |
Website domain | No |
page_url |
Page the chat started on | Yes |
page_title |
Title of that page | No |
captured_at |
Captured at (ISO 8601, UTC) | Yes |
gclid |
Google Ads click ID (gclid) | No |
fbclid |
Meta click ID (fbclid) | No |
utm_source |
UTM source | No |
utm_medium |
UTM medium | No |
utm_campaign |
UTM campaign | No |
utm_term |
UTM term | No |
utm_content |
UTM content | No |
lead_idis always sent and never changes for a lead, so your receiver can recognise a lead it has seen before. You can rename it.- Empty values are left out. A lead without a phone number has no
phonekey. - Names may use letters, digits,
_and-. A dot nests the value:contact.emailandcontact.phonearrive as{"contact": {"email": …, "phone": …}}, or ascontact[email]=…in form format. Two fields can't share a name. detailsholds screening answers and other details as lines such asInterest: Implants.conversationis the chat asVisitor:andAssistant:lines, cut off after 30,000 characters.first_nameandlast_namesplit the name at the last space.conversation_urlopens the conversation in Leadux and needs a Leadux login.
Fixed values are sent with every lead, for example source = Leadux chat, under any name that doesn't clash with a field. You can add up to 20.
Example payload
With the default fields, in JSON format:
{
"lead_id": "01JTESTLEAD0000000000000000",
"name": "Anna Schmidt",
"email": "anna@example.com",
"phone": "+49 30 1234567",
"country": "Germany",
"details": "Interest: Dental implants\nPreferred time: Mornings",
"conversation": "Assistant: Hi! How can I help?\n\nVisitor: Do you have any appointments next week?\n\n…",
"website": "Example Dental Clinic",
"page_url": "https://example.com/implants",
"captured_at": "2026-11-23T09:41:00Z"
}
Headers
Every request has these headers:
| Header | Value |
|---|---|
Content-Type |
application/json or application/x-www-form-urlencoded |
User-Agent |
Leadux-Webhook/1.0 |
X-Leadux-Event |
lead.created the first time a lead arrives, lead.updated after that, test for a test lead |
X-Leadux-Delivery |
A unique ID for this request |
X-Leadux-Timestamp |
The time of sending, in Unix seconds |
X-Leadux-Signature |
sha256= and the signature (see below) |
Under Headers you can add up to 20 of your own, for example Authorization: Bearer … for receivers that need a key. They are stored encrypted. You can't set Host, Content-Length, Content-Type, User-Agent, Transfer-Encoding, Connection or any X-Leadux- header.
Verify the signature
Each webhook has a signing secret, shown under Signature. Click Copy to copy it, or New to create another one and Save. The signature is the HMAC-SHA256, in lowercase hex, of the timestamp header, a dot and the raw request body, with the secret as key:
X-Leadux-Signature: sha256=HMAC_SHA256(secret, X-Leadux-Timestamp + "." + body)
Compute it over the body exactly as received, before parsing it. To guard against replayed requests, also reject timestamps that are more than a few minutes old.
PHP:
$secret = getenv('LEADUX_WEBHOOK_SECRET');
$body = file_get_contents('php://input');
$timestamp = $_SERVER['HTTP_X_LEADUX_TIMESTAMP'] ?? '';
$signature = $_SERVER['HTTP_X_LEADUX_SIGNATURE'] ?? '';
$expected = 'sha256=' . hash_hmac('sha256', $timestamp . '.' . $body, $secret);
if (! hash_equals($expected, $signature) || abs(time() - (int) $timestamp) > 300) {
http_response_code(401);
exit;
}
$lead = json_decode($body, true);
Node.js (Express):
const crypto = require('crypto');
const express = require('express');
const app = express();
app.post('/leadux', express.raw({ type: '*/*' }), (req, res) => {
const timestamp = req.get('X-Leadux-Timestamp') || '';
const signature = req.get('X-Leadux-Signature') || '';
const expected = 'sha256=' + crypto
.createHmac('sha256', process.env.LEADUX_WEBHOOK_SECRET)
.update(timestamp + '.' + req.body)
.digest('hex');
const valid = signature.length === expected.length
&& crypto.timingSafeEqual(Buffer.from(signature), Buffer.from(expected))
&& Math.abs(Date.now() / 1000 - Number(timestamp)) <= 300;
if (!valid) return res.sendStatus(401);
const lead = JSON.parse(req.body);
res.sendStatus(200);
});
Delivery, retries and failures
A delivery succeeds when your receiver answers with a 2xx status within 10 seconds.
- Retried: no answer within 10 seconds, an address that can't be reached or found, and the statuses 408, 429 and 5xx. Leadux tries up to five times in total, after 1 minute, 5 minutes, 30 minutes and 2 hours.
- Not retried: other 4xx statuses and redirects. Leadux doesn't follow redirects: enter the address the receiver redirects to.
The Webhook page shows Leads sent, the leads Leadux Couldn't send and the Last problem. When leads failed, click Send them again once you have fixed the cause. On the Leads page, each lead shows Sent to … or Not sent to …, with the reason when you hover over it.
Test lead
Send a test lead posts a made-up lead with the settings on the page, saved or not, exactly as shown in the Preview. It carries X-Leadux-Event: test and is not retried. The result shows the status your receiver answered with.
Addresses Leadux won't call
Leadux only sends webhooks to public internet addresses over https://. Addresses that resolve to private or reserved networks, such as localhost, 10.x.x.x or 192.168.x.x, are refused. To receive webhooks on a local machine while testing, use a public tunnel or a request inspector.
Remove a webhook
On the account webhook, click Remove webhook and confirm. Websites with their own webhook keep sending to theirs. To stop a website's own webhook, set it to Use the account webhook or Send nothing. All leads remain in Leadux.
Related
Last updated . Questions? Write to support@leadux.com.