Scoring Rules
Scoring rules evaluate expressions against lead fields and attributes to produce a numeric score (0–100).
How scores are calculated
Section titled “How scores are calculated”Each rule produces a value via its expression. The final lead score is the weighted sum of all rule values, clamped to 0–100:
score = clamp(rule1.value × rule1.weight + rule2.value × rule2.weight + ..., 0, 100)weight lets you control how much each rule contributes. A rule with weight: 2.0 counts twice as much as one with weight: 1.0. Start with 1.0 for all rules and adjust once you see score distributions.
See the Lead Scoring guide for expression syntax and examples.
List Scoring Rules
Section titled “List Scoring Rules”GET /scoring-rulesResponse 200 OK: Array of scoring rule objects.
Create Scoring Rule
Section titled “Create Scoring Rule”POST /scoring-rules{ "name": "High rating bonus", "expression": "rating * 10", "weight": 1.0}Response 201 Created: Full scoring rule object.
Get Scoring Rule
Section titled “Get Scoring Rule”GET /scoring-rules/{id}Update Scoring Rule
Section titled “Update Scoring Rule”PUT /scoring-rules/{id}{ "expression": "rating * 15", "weight": 1.5 }Delete Scoring Rule
Section titled “Delete Scoring Rule”DELETE /scoring-rules/{id}Response 204 No Content.
Applying scores
Section titled “Applying scores”After creating or modifying rules, recalculate scores:
- Single lead:
POST /leads/{id}/score - All leads:
POST /leads/score/batch