Score Explanation API
Get a concise explanation of what is driving a lead's score within a recent time window. This endpoint surfaces the top scoring factors, current rule weights, and any decay applied, helping your team understand why a lead has a particular score.
GET /lead/{leadID}/score-explain
Returns score drivers, a snapshot of active rule weights, and total decay applied within the specified time window.
Request
| Parameter | Type | Required | Description |
|---|---|---|---|
leadID | string | Yes | Lead identifier (path parameter) |
hours | integer | No | Time window in hours (default: 24) |
Response
200 OK
{
"top_drivers": [
{
"rule_id": "rl_abc123",
"event_type": "page_view",
"count": 4,
"weight": 10,
"total": 40,
"filter_label": "path contains /pricing"
},
{
"rule_id": "rl_def456",
"event_type": "page_view",
"count": 7,
"weight": 5,
"total": 35
},
{
"rule_id": "rl_ghi789",
"event_type": "email_click",
"count": 3,
"weight": 5,
"total": 15
}
],
"snapshot": [
{ "event_type": "page_view", "weight": 10 },
{ "event_type": "email_click", "weight": 5 }
],
"decay_applied": -6,
"inorganic_count": 0,
"range_hours": 24,
"score_reset_at": null,
"reset_excluded_count": 0
}
Response Fields
| Field | Type | Description |
|---|---|---|
top_drivers | array | Scoring rules that contributed to the lead's score in the window, sorted by absolute contribution (highest first) |
top_drivers[].rule_id | string | Unique identifier of the scoring rule |
top_drivers[].event_type | string | Event type this rule scores |
top_drivers[].count | integer | Number of events attributed to this rule in the window |
top_drivers[].weight | integer | Point value of the rule |
top_drivers[].total | integer | Total points contributed by this rule (count × weight) |
top_drivers[].filter_label | string | Human-readable description of the rule's attribute filters, if any (e.g., path contains /pricing). Omitted when the rule has no filters. |
snapshot | array | Current rule weights from active rulesets (highest absolute value first) |
snapshot[].event_type | string | Event type name |
snapshot[].weight | integer | Point value assigned to this event type by active rules |
decay_applied | integer | Total decay points applied in the window (negative value, aggregated across rulesets) |
inorganic_count | integer | Number of events excluded by inorganic activity filters |
range_hours | integer | The time window used for the explanation |
score_reset_at | timestamp | When the lead's scores were last reset (null if never reset) |
reset_excluded_count | integer | Number of pre-reset events excluded from scoring. These events still exist in history but no longer contribute to the score. |
Examples
Default 24-hour window:
curl -X GET "https://api.kenbun.io/lead/ld_abc123/score-explain" \
-H "Authorization: Bearer <token>"
Custom 72-hour window:
curl -X GET "https://api.kenbun.io/lead/ld_abc123/score-explain?hours=72" \
-H "Authorization: Bearer <token>"
Common Errors
| Status | Meaning | Solution |
|---|---|---|
| 401 | Unauthorized | Check authentication credentials |
| 404 | Not Found | Lead does not exist or is not accessible |
Score Reset Awareness
When a lead's scores have been reset, the explanation reflects this:
score_reset_atshows the timestamp of the most recent resetreset_excluded_countindicates how many historical events no longer contribute to the score- Only events that occurred after the reset contribute to the current score breakdown
In the kenbun UI, the Score Explain panel displays a banner when a reset has occurred, showing the reset date and the number of excluded events.
Notes
- This endpoint is OU-scoped to the active Organizational Unit
- Only active rules in active rulesets are considered
- Both global and OU-specific rules are included in the explanation
top_driversreturns one row per scoring rule, not one row per event type. If two rules match the same event type but with different attribute filters (for example, one rule scoring all page views and a separate rule scoring page views wherepath contains /pricing), they appear as separate rows. Each row includes afilter_labeldescribing its conditions.- When a lead triggers multiple rules for the same event, each event is attributed to the first matching rule (by rule priority). This mirrors how kenbun's scoring engine assigns points.
- Use in combination with Score History for a complete picture of score trends
Sharing a Score Explanation
You can share a read-only view of any lead's score explanation with people who don't have a kenbun account. Use the share feature to brief stakeholders, hand off leads across teams, or document scoring for a deal review.
From the kenbun UI: Open the Score Explain panel on any lead detail page and click Share. kenbun generates a link that expires after 7 days.
Via the API: Use POST /leads/{id}/share-explain to create a share link programmatically. The response includes a share_url that recipients can open in a browser — no login required.
See Share Score Explanation for full API documentation.
Related Endpoints
- Score - Get current score breakdown
- Score History - View score changes over time
- Score Gains - See recent scoring activity across leads
- Reset Scores - Zero a lead's engagement scores
- Share Score Explanation - Create and retrieve shareable score explanation links