Developers
Lead link
One URL that takes leads from any website form, portal, CRM or automation tool. Send JSON, a form or a query string; no API key needed.
Get your link
In Pixl, open Settings › Lead forms and add a Lead link. Choose the agent that looks after its leads, then use Copy link. The token at the end of the link is its key: anyone who has the link can send leads to it, so keep it on your server. If it leaks, use Make a new link; the old one stops working.
Send a lead
POST/webhooks/leads/push/{source_token}The lead link's token is the key
Send one lead, or a list of up to 50: a top-level list, or a list under leads, data, rows, items, records or enquiries. JSON, form-encoded and multipart bodies all work, and so does GET /webhooks/leads/push/{source_token} with the fields in the query string.
curl -X POST "https://api.pixlagents.com/api/v1/webhooks/leads/push/YOUR_LINK_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"id": "ext_123",
"name": "Asha Rao",
"phone": "+919876543210",
"email": "asha@example.com",
"treatment": "Consultation",
"message": "I'\''d like to book a consultation this week.",
"whatsapp_optin": true
}'{
"accepted": true
}To check the link without saving a lead, add pixl_test=true (in the body or the query string). It shows in the link's What arrived list in Pixl, and nothing else happens.
Fields Pixl reads
Pixl reads common field names. Capitals, spaces and dashes don't matter, and nested objects are read too (lead.mobile as mobile). Only these fields are kept; anything else in the request isn't saved.
Field names
namename,full_name,customer_name, orfirst_nameandlast_name.phonephone,mobile,whatsapp,phone_number,contact_number. Send the country code.emailemail,email_address.idid,lead_id,external_id,submission_id. Your own id; a lead sent twice with the same id is saved once.interestproduct,service,treatment,interest,course.messagemessage,comments,notes,enquiry.city, company, budgetcity,company,budget.source, campaignsource,utm_source,campaign,utm_campaign.whatsapp_optinwhatsapp_optin,opt_in,consent. Only a clear yes counts:true,yes,1, a ticked box.do_not_calldo_not_call,dnc. A yes puts the number on your do-not-call list, and it gets no WhatsApp opt-in.
A lead needs a phone number or an email address. Without either it isn't saved.
What happens next
- The lead appears in Pixl, looked after by the link's agent. A person who already has an open lead gets the new enquiry added to it.
- If the link's WhatsApp welcome is on, and the lead carries a clear WhatsApp opt-in, the agent sends the welcome template.
- A WhatsApp opt-in is recorded either way, so later sends can rely on it.
- Leads from the link aren't called automatically.
- A
lead.createdwebhook event tells your system about each new lead.
A lead sent twice
Limits and answers
- Up to 64 KB a request, and up to 50 leads in it.
- Up to 120 requests a minute for one link. Past that, a
429with aRetry-Afterheader. - Pixl queues each request and retries it, so a brief problem on our side doesn't lose the lead.
Answers
200- Accepted. A JSON request gets
{"accepted": true}; anything else, a plainOK. 400- The body couldn't be read.
404- No link with that token: a typo, or a link that was replaced or removed.
413- Over 64 KB. Send fewer leads at a time.
422- No lead in it has a phone number or an email address.
429- Too many requests. Wait for
Retry-Afterseconds, then send again.
