Skip to main content

Engagement Rule by ID API

Update or delete an individual engagement scoring rule.

PUT /rules/{id}

Update an existing engagement rule. Only the fields you provide are updated; omitted fields remain unchanged.

Request

ParameterTypeRequiredDescription
idstringYesRule identifier (path parameter)

Request Body

All fields are optional. Only provided fields will be updated.

FieldTypeDescription
event_typestringThe event type to score
weightintegerPoints to award per event (can be negative)
activebooleanWhether the rule is active
{
"weight": 15,
"active": true
}

Response

200 OK

{
"id": "rule-123",
"ruleset_id": "ruleset-abc",
"event_type": "page_view",
"weight": 15,
"active": true,
"updated_at": "2025-01-15T12:00:00Z"
}

Example

curl -X PUT "https://api.leadvibe.com/rules/rule-123" \
-H "Authorization: Bearer <token>" \
-H "Content-Type: application/json" \
-d '{"weight": 15, "active": true}'

Common Errors

StatusMeaningSolution
401UnauthorizedCheck authentication credentials
404Not FoundVerify the rule ID is correct
409ConflictAnother rule in this ruleset already scores this event type

DELETE /rules/{id}

Delete an engagement rule. This action cannot be undone.

Request

ParameterTypeRequiredDescription
idstringYesRule identifier (path parameter)

Response

204 No Content

Example

curl -X DELETE "https://api.leadvibe.com/rules/rule-123" \
-H "Authorization: Bearer <token>"

Common Errors

StatusMeaningSolution
401UnauthorizedCheck authentication credentials
404Not FoundRule does not exist

Notes

  • Deleting a rule does not recalculate historical scores
  • Future events of the deleted rule's event type will no longer award points
  • Consider setting active: false instead of deleting if you might need the rule later