Leads

Lead capture, scoring and routing β€” from a form or webhook to a working list with score, notes and a full timeline.

ES

πŸ“‹ What is this module?

Leads receives prospects from several sources, scores each one against rules you define, fires automatic actions once that score crosses a threshold, and gives you a working screen to follow up β€” status, internal notes, and a full per-lead timeline.

πŸ“₯ Capture

Embedded forms, Facebook/Instagram webhooks, or manual entry.

🎯 Scoring

Per-field point rules (admin.php) that score every lead the moment it arrives.

πŸ”€ Routing

Routes that fire an email, WhatsApp, or webhook once score reaches a minimum.

πŸ—‚οΈ Daily work

index.php β€” filters, detail panel, status changes, and notes.

πŸ“₯ How Leads Arrive

1

Embedded forms

capture.php accepts POST from any form on your site. It carries three layers of anti-spam protection: a honeypot (hidden "website" field), a time trap (rejects submissions under 3 seconds), and a 10-requests-per-minute-per-IP limit.

2

Social webhooks

incoming.php?source=facebook&entity_id=YOUR_ID or source=instagram receive the payload from Meta's native lead forms and translate it into your format via a per-source adapter. Limited to 100 requests per minute per IP.

3

Manual entry

The source filter on index.php includes "WhatsApp" and "Manual" as options, but today only Form, Facebook and Instagram have a live intake path wired up β€” those two remain reserved for when that channel gets activated.

Every field that arrives is stored in a flexible table (one row per field), so any form can send whatever fields it needs with no database changes.

🎯 Scoring Rules

Each rule evaluates a lead field against a value, with an operator (=, >, <, contains) and awards points if it matches. A lead's total score is the sum of every rule that applies β€” calculated automatically the moment the lead is created.

πŸ’‘ Example: rule budget > 5000 β†’ +50 points. If city = "Monterrey" is also worth +20, a lead matching both arrives with 70 points.

πŸ”€ Routes

A route fires an action once a lead's score reaches the configured minimum. The config JSON changes per action β€” for email, {"to":"[email protected]"}.

ActionWhat it does
EmailSends an email with every lead field and its score to the JSON's recipient. Fully working today.
WhatsAppCurrently a placeholder: logs the attempt on the lead's timeline but doesn't actually send the message yet (Meta/Twilio API still needs to be wired up).
WebhookShows up as an option on the form, but the routing engine has no logic yet to fire an outbound webhook β€” selecting it currently does nothing.
⚠️ If you need to rely on an automatic route today, use the Email action β€” it's the only one that's fully functional.

πŸ”— Field Mappings

Every social platform sends its own field names β€” Facebook, for example, might send full_name while your system stores name. Mappings translate the external name into your internal one automatically before the lead is created, per source. Without a mapping, the field arrives exactly as the source sent it.

πŸ—‚οΈ Working a Lead

index.php lists every lead with filters by date, status and source. Opening one shows a two-column panel:

πŸ“„ Fields + Status

Every captured field, plus (admins only) a selector to move status between New, Contacted, Qualified and Closed.

πŸ•’ Timeline + Notes

Every lead event (created, scored, email sent, status changed) is logged automatically. You can add free-text internal notes anytime.

πŸ”§ FAQ

Who finds out when a lead arrives? The entity owner gets an automatic notification in Team as soon as the lead is created, on top of any email route you've configured.
Can I edit a lead's captured fields? Captured fields aren't editable from the interface β€” what you can do is change its status and add internal notes.
↑