Skip to main contentSkip to Content
Scoring Rules

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 }
FieldTypeRequiredDescription
namestringYesRule name
descriptionstringNoDescription
activebooleanNoWhether rule is active (default: true)
eventTypestringYesEvent type that triggers scoring
conditionobjectNoOptional condition to match against event
deltanumberYesPoints to add (positive) or subtract (negative)
decayPointsnumberNoPoints to decay per period
decayDaysnumberNoDays between decay applications
maxScorenumberNoMaximum score cap
minScorenumberNoMinimum 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