Skip to main content

Profile Scoring Rules

Profile scoring rules assign points based on lead profile attributes (company size, industry, role, etc.) rather than behavioral actions. Use these to implement ICP (Ideal Customer Profile) scoring.

GET /profile-scoring/rulesets/{id}/rules

List all profile scoring rules for a specific ruleset.

Request

curl -u "CLIENT_ID:CLIENT_SECRET" \
"https://your-api.example.com/profile-scoring/rulesets/ruleset-abc/rules"

Response

Status: 200 OK

{
"rules": [
{
"id": "rule-123",
"ruleset_id": "ruleset-abc",
"profile_field": "company_employee_count",
"operator": "equals",
"value": "501+",
"weight": 50,
"active": true
},
{
"id": "rule-456",
"ruleset_id": "ruleset-abc",
"profile_field": "company_industry",
"operator": "equals",
"value": "Technology",
"weight": 30,
"active": true
}
]
}

POST /profile-scoring/rulesets/{id}/rules

Create a new profile scoring rule within a ruleset.

Request

curl -X POST https://your-api.example.com/profile-scoring/rulesets/ruleset-abc/rules \
-u "CLIENT_ID:CLIENT_SECRET" \
-H "Content-Type: application/json" \
-d '{
"profile_field": "company_employee_count",
"operator": "equals",
"value": "501+",
"weight": 50
}'

Request Body

FieldRequiredTypeDescription
profile_fieldYesstringThe profile field to evaluate (must be mapped via /profile-mappings)
operatorYesstringComparison operator: equals, not_equals, contains, greater_than, less_than
valueYesstringThe value to match against
weightYesnumberPoints to award when rule matches (can be negative)
activeNobooleanWhether rule is active (default: true)

Response

Status: 201 Created

{
"id": "rule-789",
"ruleset_id": "ruleset-abc",
"profile_field": "company_employee_count",
"operator": "equals",
"value": "501+",
"weight": 50,
"active": true,
"created_at": "2025-01-15T11:30:00Z"
}

Operators Explained

OperatorDescriptionExample
equalsExact matchcompany_size equals "501+"
not_equalsDoes not matchindustry not_equals "Healthcare"
containsSubstring matchjob_title contains "VP"
greater_thanNumeric comparisonrevenue greater_than "10M"
less_thanNumeric comparisonemployees less_than "50"

Common Errors

Status CodeErrorSolution
400Invalid profile_fieldEnsure field is mapped via /profile-mappings
400Invalid operatorUse: equals, not_equals, contains, greater_than, less_than
404Ruleset not foundVerify ruleset ID is correct

Example Use Cases

Use Case 1: Enterprise ICP Scoring

Score leads higher if they match enterprise criteria:

# High-value company size
POST /profile-scoring/rulesets/{id}/rules
{"profile_field": "company_employee_count", "operator": "equals", "value": "501+", "weight": 50}

# Target industry
POST /profile-scoring/rulesets/{id}/rules
{"profile_field": "company_industry", "operator": "equals", "value": "Technology", "weight": 30}

# Decision-maker role
POST /profile-scoring/rulesets/{id}/rules
{"profile_field": "contact_seniority", "operator": "contains", "value": "C-Level", "weight": 40}

# Result: C-level contacts from 500+ employee tech companies score 120 points

Use Case 2: Negative Scoring for Poor Fit

Penalize leads that don't match your ICP:

# Too small
POST /profile-scoring/rulesets/{id}/rules
{"profile_field": "company_employee_count", "operator": "equals", "value": "1-10", "weight": -20}

# Wrong industry
POST /profile-scoring/rulesets/{id}/rules
{"profile_field": "company_industry", "operator": "equals", "value": "Retail", "weight": -15}

Important Notes

Profile Fields Must Be Mapped

Before creating profile scoring rules, ensure the profile field is mapped via /profile-mappings:

# 1. Create mapping
POST /profile-mappings
{"metadata_key": "company_size", "profile_field": "company_employee_count"}

# 2. Then create rule
POST /profile-scoring/rulesets/{id}/rules
{"profile_field": "company_employee_count", "operator": "equals", "value": "501+", "weight": 50}

Profile Data Must Be Sent

Profile scoring only works if you send profile data in event metadata:

POST /ingest
{
"alias_kind": "email",
"alias": "jane@example.com",
"event_type": "form_submit",
"metadata": {
"company_size": "501+",
"industry": "Technology",
"job_title": "VP Sales"
}
}

See Also