Leads

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

ENES

πŸ“‹ 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.

Since the 2026-10-10 audit (M21) the submission is signed with a hidden form_key field: the copy-paste snippet lives in Admin β†’ Field mappings β†’ Embedded form. A form without that signature keeps working β€”forms already published don't breakβ€” but the lead is flagged as "LEGACY unsigned", capped at 30 submissions per hour per business, and recorded in its timeline. The business must also exist and be active, and there is a 300-captures-per-hour cap per business (counters are evaluated inside MySQL).

2

Social webhooks

incoming.php?source=facebook or incoming.php?source=instagram, with your business code (we give it to you when we connect it) 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.
↑