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
| Parameter | Type | Required | Description |
|---|---|---|---|
id | string | Yes | Rule identifier (path parameter) |
Request Body
All fields are optional. Only provided fields will be updated.
| Field | Type | Description |
|---|---|---|
event_type | string | The event type to score |
weight | integer | Points to award per event (can be negative) |
active | boolean | Whether 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
| Status | Meaning | Solution |
|---|---|---|
| 401 | Unauthorized | Check authentication credentials |
| 404 | Not Found | Verify the rule ID is correct |
| 409 | Conflict | Another rule in this ruleset already scores this event type |
DELETE /rules/{id}
Delete an engagement rule. This action cannot be undone.
Request
| Parameter | Type | Required | Description |
|---|---|---|---|
id | string | Yes | Rule identifier (path parameter) |
Response
204 No Content
Example
curl -X DELETE "https://api.leadvibe.com/rules/rule-123" \
-H "Authorization: Bearer <token>"
Common Errors
| Status | Meaning | Solution |
|---|---|---|
| 401 | Unauthorized | Check authentication credentials |
| 404 | Not Found | Rule 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: falseinstead of deleting if you might need the rule later
Related Endpoints
- Engagement Rules - List and create engagement rules
- Engagement Rulesets - Manage rulesets
- Ruleset Rules - List rules within a ruleset