Scoring Rules
Lead scoring assigns numerical scores to contacts based on their behavior and engagement. Scores help prioritize leads and trigger automations.
List Scoring Rules
GET /api/workspaces/{workspaceId}/scoring-rules
Auth: Session required
Response:
[
{
"id": "sr_abc123",
"name": "Page Views",
"description": "Score contacts who view pages",
"active": true,
"eventType": "page_view",
"condition": null,
"delta": 5,
"decayPoints": 1,
"decayDays": 7,
"maxScore": 100,
"minScore": 0,
"createdAt": "2026-01-15T10:00:00.000Z"
}
]Create Scoring Rule
POST /api/workspaces/{workspaceId}/scoring-rules
Auth: Session required
Request Body:
{
"name": "Purchase Bonus",
"description": "Award points for purchases",
"active": true,
"eventType": "purchase",
"condition": {
"field": "metadata.amount",
"operator": "gte",
"value": 50
},
"delta": 25,
"decayPoints": 2,
"decayDays": 30,
"maxScore": 200,
"minScore": 0
}| Field | Type | Required | Description |
|---|---|---|---|
name | string | Yes | Rule name |
description | string | No | Description |
active | boolean | No | Whether rule is active (default: true) |
eventType | string | Yes | Event type that triggers scoring |
condition | object | No | Optional condition to match against event |
delta | number | Yes | Points to add (positive) or subtract (negative) |
decayPoints | number | No | Points to decay per period |
decayDays | number | No | Days between decay applications |
maxScore | number | No | Maximum score cap |
minScore | number | No | Minimum score floor |
Get Scoring Rule
GET /api/workspaces/{workspaceId}/scoring-rules/{ruleId}
Returns details of a single scoring rule.
Update Scoring Rule
PATCH /api/workspaces/{workspaceId}/scoring-rules/{ruleId}
Partially updates a scoring rule.
Delete Scoring Rule
DELETE /api/workspaces/{workspaceId}/scoring-rules/{ruleId}
Deletes a scoring rule.
Score Decay
Scores automatically decay over time based on the decayPoints and decayDays settings. Decay is applied automatically on a recurring schedule, reducing each contact’s score by decayPoints every decayDays days.
Last updated on