Skip to content

Scoring Rules

Scoring rules evaluate expressions against lead fields and attributes to produce a numeric score (0–100).

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.


GET /scoring-rules

Response 200 OK: Array of scoring rule objects.


POST /scoring-rules
{
"name": "High rating bonus",
"expression": "rating * 10",
"weight": 1.0
}

Response 201 Created: Full scoring rule object.


GET /scoring-rules/{id}

PUT /scoring-rules/{id}
{ "expression": "rating * 15", "weight": 1.5 }

DELETE /scoring-rules/{id}

Response 204 No Content.


After creating or modifying rules, recalculate scores:

  • Single lead: POST /leads/{id}/score
  • All leads: POST /leads/score/batch