Skip to content

Lead Scoring

Lead scoring assigns a numeric score (0–100) to each lead based on configurable rules. Scores are stored and queryable.

  1. Create one or more scoring rules — each rule is a mathematical expression.
  2. Each rule produces a value; all rule values are combined (weighted sum, clamped to 0–100).
  3. Trigger recalculation for a single lead or all leads.
Terminal window
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
}'

Expressions can reference any standard lead field by name, or custom attributes using attr_<name>.

TypeSyntaxExample
Arithmetic+, -, *, /rating * 10
Comparison>, >=, <, <=, ==rating > 4
Ternarycondition ? value_if_true : value_if_falserating > 4 ? 30 : 0
Standard fieldField name as-israting, review_count
Custom attributeattr_<name>attr_employees
Missing fieldReturns 0 if the field is null or absent
rating * 20
review_count > 100 ? 30 : 0
(rating * 10) + (review_count > 50 ? 20 : 0)
attr_employees > 500 ? 40 : 20
Terminal window
# Single lead
curl -X POST https://api.klozeo.com/api/v1/leads/cl_.../score \
-H "X-API-Key: sk_live_your_key"
# All leads
curl -X POST https://api.klozeo.com/api/v1/leads/score/batch \
-H "X-API-Key: sk_live_your_key"
Terminal window
# 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.email

The dashboard uses the following thresholds to color-code lead scores:

ScoreColor
≥ 70Green
≥ 40Amber
< 40Red