Lead Insights

Help / Leads and quality

Sending leads and statuses from your own code

Address, site key and secret key are on Snippet & settings → Send leads from the website’s own code.

A new lead

POST /api.php
X-LI-Key: your-site-key
X-LI-Secret: your-secret-key
{"name":"Jane Doe","email":"jane@example.com","phone":"","message":"…","form_name":"Chat",
 "visitor":"(cookie _li_v)","session":"(cookie _li_s)","gpc":0}

Passing the visitor and session cookies links the lead to its visit. Send gpc: 1 if the visitor’s browser sent Global Privacy Control.

A status from a CRM

POST /api.php?action=status
{"email":"jane@example.com","status":"Closed Won","value":4200}

Find the lead by lead_id, external_ref, email or phone. Use the CRM’s own status words, or quality: valid, high, converted, invalid, none.

The secret key lets anyone with it add leads and change their quality. Keep it on your server, never in a web page.