Cognitive Load Rule Engine
API Contract
REST
/api/v1/cognitive-load-rules
8 endpoints
GET
/api/v1/cognitive-load-rules/api/v1/cognitive-load-rules
List all cognitive load validation rules
Public
Response Example
{
"data": [
{
"id": "rule-001",
"rule_name": "max_choices_per_screen",
"rule_type": "wizard_config",
"description": "Limits choices per wizard screen to reduce cognitive load",
"threshold": 7,
"severity": "error",
"is_active": true,
"created_at": "2026-01-15T09:00:00Z"
},
{
"id": "rule-002",
"rule_name": "explicit_advance_required",
"rule_type": "transition_config",
"description": "Prohibits auto-advance; user must explicitly continue",
"threshold": null,
"severity": "error",
"is_active": true,
"created_at": "2026-01-15T09:00:00Z"
}
],
"pagination": {
"page": 1,
"limit": 20,
"total": 9
}
}
GET
/api/v1/cognitive-load-rules/api/v1/cognitive-load-rules/:id
Get a single cognitive load rule by ID
Public
Response Example
{
"id": "rule-001",
"rule_name": "max_choices_per_screen",
"rule_type": "wizard_config",
"description": "Limits choices per wizard screen to reduce cognitive load",
"threshold": 7,
"severity": "error",
"is_active": true,
"created_at": "2026-01-15T09:00:00Z",
"updated_at": "2026-02-10T14:30:00Z"
}
POST
/api/v1/cognitive-load-rules/api/v1/cognitive-load-rules
Create a new cognitive load rule
Public
Request Example
{
"rule_name": "max_screen_text_density",
"rule_type": "wizard_config",
"description": "Maximum word count per screen to avoid information overload",
"threshold": 80,
"severity": "warning",
"is_active": true
}
Response Example
{
"id": "rule-010",
"rule_name": "max_screen_text_density",
"rule_type": "wizard_config",
"threshold": 80,
"severity": "warning",
"is_active": true,
"created_at": "2026-03-26T10:15:00Z"
}
PUT
/api/v1/cognitive-load-rules/api/v1/cognitive-load-rules/:id
Update an existing cognitive load rule
Public
Request Example
{
"threshold": 5,
"severity": "error",
"description": "Stricter limit: max 5 choices per screen"
}
Response Example
{
"id": "rule-001",
"rule_name": "max_choices_per_screen",
"threshold": 5,
"severity": "error",
"is_active": true,
"updated_at": "2026-03-26T10:22:00Z"
}
DELETE
/api/v1/cognitive-load-rules/api/v1/cognitive-load-rules/:id
Delete a cognitive load rule
Public
Response Example
{
"deleted": true,
"id": "rule-010"
}
POST
/api/v1/cognitive-load-rules/api/v1/cognitive-load-rules/validate-wizard-config
Validate a complete wizard configuration against all active rules
Public
Request Example
{
"wizard_id": "onboarding-wizard-v3",
"config": {
"screens": [
{
"screen_id": "screen-01",
"title": "Select your goals",
"choices": [
"A",
"B",
"C",
"D",
"E",
"F",
"G",
"H"
],
"advance_trigger": "auto"
}
]
}
}
Response Example
{
"is_valid": false,
"violations": [
{
"rule_id": "rule-001",
"rule_name": "max_choices_per_screen",
"screen_id": "screen-01",
"message": "Screen has 8 choices, exceeding maximum of 7",
"severity": "error"
},
{
"rule_id": "rule-002",
"rule_name": "explicit_advance_required",
"screen_id": "screen-01",
"message": "Auto-advance trigger is not permitted",
"severity": "error"
}
]
}
POST
/api/v1/cognitive-load-rules/api/v1/cognitive-load-rules/validate-screen-choices
Validate a single screen's choices against active rules
Public
Request Example
{
"screen_id": "screen-03",
"choices": [
{
"id": "opt-a",
"label": "Daily reminders",
"is_default": false
},
{
"id": "opt-b",
"label": "Weekly summaries",
"is_default": true
},
{
"id": "opt-c",
"label": "No notifications",
"is_default": false
}
]
}
Response Example
{
"is_valid": true,
"violations": [],
"warnings": [
{
"rule_name": "preselected_default",
"message": "A pre-selected default may bias user decisions",
"severity": "warning"
}
]
}
GET
/api/v1/cognitive-load-rules/api/v1/cognitive-load-rules/violations
Get violations for a given wizard config ID (query: ?wizard_id=)
Public
Response Example
{
"data": [
{
"rule_id": "rule-001",
"rule_name": "max_choices_per_screen",
"screen_id": "screen-01",
"wizard_id": "onboarding-wizard-v3",
"message": "8 choices exceed maximum of 7",
"severity": "error",
"detected_at": "2026-03-26T09:45:00Z"
}
],
"pagination": {
"page": 1,
"limit": 20,
"total": 1
}
}