Bulk Rule Operations
Update multiple scoring rules simultaneously to enable/disable entire sets of rules at once. This is useful for seasonal campaigns, A/B testing, or rule maintenance.
PATCH /api/v1/ou/{ouId}/scoring-rules/bulk
Update multiple engagement scoring rules in a single operation.
Request
curl -X PATCH "https://api.leadvibe.com/api/v1/ou/org-123/scoring-rules/bulk" \
-u "CLIENT_ID:CLIENT_SECRET" \
-H "Content-Type: application/json" \
-d '{
"rule_ids": ["rule-1", "rule-2", "rule-3"],
"updates": {
"active": false
}
}'
Request Body
| Field | Required | Type | Description |
|---|---|---|---|
rule_ids | Yes | array of strings | Rule IDs to update |
updates | Yes | object | Fields to update on all selected rules |
updates.active | No | boolean | Set active status for all selected rules |
Response
Status: 200 OK
{
"updated_count": 3,
"updated_rules": ["rule-1", "rule-2", "rule-3"]
}
Response Fields
| Field | Type | Description |
|---|---|---|
updated_count | number | Number of rules successfully updated |
updated_rules | array | List of rule IDs that were updated |
PATCH /api/v1/ou/{ouId}/profile-rules/bulk
Update multiple profile scoring rules simultaneously.
Request
curl -X PATCH "https://api.leadvibe.com/api/v1/ou/org-123/profile-rules/bulk" \
-u "CLIENT_ID:CLIENT_SECRET" \
-H "Content-Type: application/json" \
-d '{
"rule_ids": ["prof-rule-1", "prof-rule-2"],
"updates": {
"active": true
}
}'
Request Body
Same structure as engagement rules bulk update.
Response
Status: 200 OK
{
"updated_count": 2,
"updated_rules": ["prof-rule-1", "prof-rule-2"]
}
PATCH /api/v1/ou/{ouId}/account-rules/bulk
Update multiple account scoring rules simultaneously.
Request
curl -X PATCH "https://api.leadvibe.com/api/v1/ou/org-123/account-rules/bulk" \
-u "CLIENT_ID:CLIENT_SECRET" \
-H "Content-Type: application/json" \
-d '{
"rule_ids": ["acct-rule-1", "acct-rule-2", "acct-rule-3"],
"updates": {
"active": false
}
}'
Request Body
Same structure as engagement rules bulk update.
Response
Status: 200 OK
{
"updated_count": 3,
"updated_rules": ["acct-rule-1", "acct-rule-2", "acct-rule-3"]
}
Common Errors
| Status | Meaning | Solution |
|---|---|---|
| 400 | Invalid request body | Ensure rule_ids is an array and updates contains valid fields |
| 401 | Unauthorized | Verify your API credentials are correct |
| 404 | One or more rules not found | Check that all rule IDs exist in the specified OU |
| 422 | Invalid update fields | Verify updates object contains only allowed fields |
Use Cases
1. Disable Seasonal Campaign Rules
After a promotion ends, disable all related rules at once:
curl -X PATCH "https://api.leadvibe.com/api/v1/ou/org-123/scoring-rules/bulk" \
-u "CLIENT_ID:CLIENT_SECRET" \
-H "Content-Type: application/json" \
-d '{
"rule_ids": [
"holiday-promo-rule-1",
"holiday-promo-rule-2",
"holiday-promo-rule-3",
"holiday-promo-rule-4"
],
"updates": {
"active": false
}
}'
2. Enable A/B Test Variant
Swap scoring strategies by disabling one set of rules and enabling another:
# Disable variant A rules
curl -X PATCH ".../scoring-rules/bulk" \
-u "CLIENT_ID:CLIENT_SECRET" \
-d '{"rule_ids": ["var-a-1", "var-a-2"], "updates": {"active": false}}'
# Enable variant B rules
curl -X PATCH ".../scoring-rules/bulk" \
-u "CLIENT_ID:CLIENT_SECRET" \
-d '{"rule_ids": ["var-b-1", "var-b-2"], "updates": {"active": true}}'
3. Maintenance Window
Temporarily disable rules during data migration or system changes:
# Before maintenance: disable all rules
curl -X PATCH "https://api.leadvibe.com/api/v1/ou/org-123/scoring-rules/bulk" \
-u "CLIENT_ID:CLIENT_SECRET" \
-H "Content-Type: application/json" \
-d '{
"rule_ids": ["rule-1", "rule-2", "rule-3", "rule-4", "rule-5"],
"updates": {
"active": false
}
}'
# After maintenance: re-enable all rules
curl -X PATCH "https://api.leadvibe.com/api/v1/ou/org-123/scoring-rules/bulk" \
-u "CLIENT_ID:CLIENT_SECRET" \
-H "Content-Type: application/json" \
-d '{
"rule_ids": ["rule-1", "rule-2", "rule-3", "rule-4", "rule-5"],
"updates": {
"active": true
}
}'
4. Archive Low-Performing Rules
Disable rules that aren't contributing value based on analytics:
curl -X PATCH "https://api.leadvibe.com/api/v1/ou/org-123/scoring-rules/bulk" \
-u "CLIENT_ID:CLIENT_SECRET" \
-H "Content-Type: application/json" \
-d '{
"rule_ids": [
"low-performance-rule-1",
"low-performance-rule-2",
"low-performance-rule-3"
],
"updates": {
"active": false
}
}'
Best Practices
Verify Rule IDs Before Updating
- Use
GET /rulesto retrieve current rules and their IDs - Double-check rule IDs to avoid accidentally disabling the wrong rules
Test with Small Batches First
- Start with 2-3 rules to verify the update works as expected
- Expand to larger batches once confident in the operation
Document Bulk Operations
- Keep notes on which rules were updated and why
- Record timestamps for audit trails
Monitor Impact After Updates
- Check that scores behave as expected after enabling/disabling rules
- Watch for unexpected trigger activations or score shifts
Use for Cleanup, Not Deletion
- Disable rules instead of deleting them to preserve history
- Re-enable later if needed without recreating rules
Response Behavior
Partial Success
If some rule IDs are invalid, the operation fails entirely (atomic update). Either all rules update or none do.
Empty Rule List
If rule_ids is an empty array, the request returns 200 OK with updated_count: 0.
Duplicate Rule IDs
If the same rule ID appears multiple times in rule_ids, it's only updated once. The response updated_count reflects unique rules updated.
Rate Limits
Bulk operations count as a single API call regardless of how many rules are updated. However, very large batches (100+ rules) may take longer to process.
Recommended Batch Sizes:
- Small batches: 5-10 rules (instant)
- Medium batches: 10-50 rules (<1 second)
- Large batches: 50-100 rules (~2-3 seconds)
- Very large batches: 100+ rules (may require retry logic)
If you need to update more than 100 rules, consider breaking them into multiple bulk operations with a short delay between requests.