Lead Scoring
Lead scoring assigns a numeric score (0–100) to each lead based on configurable rules. Scores are stored and queryable.
How it works
Section titled “How it works”- Create one or more scoring rules — each rule is a mathematical expression.
- Each rule produces a value; all rule values are combined (weighted sum, clamped to 0–100).
- Trigger recalculation for a single lead or all leads.
Create a rule
Section titled “Create a rule”curl -X POST https://api.klozeo.com/api/v1/scoring-rules \ -H "X-API-Key: sk_live_your_key" \ -H "Content-Type: application/json" \ -d '{ "name": "Rating score", "expression": "rating * 10", "weight": 1.0 }'Expression reference
Section titled “Expression reference”Expressions can reference any standard lead field by name, or custom attributes using attr_<name>.
| Type | Syntax | Example |
|---|---|---|
| Arithmetic | +, -, *, / | rating * 10 |
| Comparison | >, >=, <, <=, == | rating > 4 |
| Ternary | condition ? value_if_true : value_if_false | rating > 4 ? 30 : 0 |
| Standard field | Field name as-is | rating, review_count |
| Custom attribute | attr_<name> | attr_employees |
| Missing field | Returns 0 if the field is null or absent | — |
Examples
Section titled “Examples”rating * 20review_count > 100 ? 30 : 0(rating * 10) + (review_count > 50 ? 20 : 0)attr_employees > 500 ? 40 : 20Recalculate
Section titled “Recalculate”# Single leadcurl -X POST https://api.klozeo.com/api/v1/leads/cl_.../score \ -H "X-API-Key: sk_live_your_key"
# All leadscurl -X POST https://api.klozeo.com/api/v1/leads/score/batch \ -H "X-API-Key: sk_live_your_key"Filter by score
Section titled “Filter by score”# Leads with score >= 70?filter=and.gte.score.70
# High-value leads (score >= 80, has email)?filter=and.gte.score.80&filter=and.is_not_empty.emailScore display in dashboard
Section titled “Score display in dashboard”The dashboard uses the following thresholds to color-code lead scores:
| Score | Color |
|---|---|
| ≥ 70 | Green |
| ≥ 40 | Amber |
| < 40 | Red |