Documentation Index
Fetch the complete documentation index at: https://docs.kaireonai.com/llms.txt
Use this file to discover all available pages before exploring further.
See also: Qualification Rules REST API reference for request/response shapes, status codes, and error semantics.
Overview
A Qualification Rule is a configurable check that decides whether a customer may receive a particular Offer. Rules are evaluated inside the Filter stage of a Decision Flow. They come in two stages:| Stage | Behavior |
|---|---|
| qualification | Hard gate — if the rule fails the Offer is dropped from the candidate set. |
| fit | Soft penalty — if the rule fails the Offer’s score is multiplied by a decay factor (0.1 — 1.0) instead of being removed. |
Rule Types
Kaireon ships five rule types. Each type has its ownconfig shape and runtime evaluation logic.
- segment_required
- attribute_condition
- propensity_threshold
- recency_check
- metric_condition
- offer_attribute
Stage: qualification (hard gate)Checks that the customer belongs to all of the segments listed in Runtime behavior
requiredSegments (AND logic). If the customer is missing any of the required segments, the Offer is dropped.Config JSON- Read
requiredSegmentsfrom config. - Compare against the customer’s segment list (auto-resolved from enriched
customer.segmentfield, or provided in the Recommend request). - If the customer is in all of the required segments, the rule passes.
- If the customer is missing any required segment, the rule fails with a reason like
Missing required segments: high_value. - An empty
requiredSegmentsarray is treated as a pass (no restriction).
Scopes
Every Qualification Rule has a scope that controls which Offers it applies to. Narrower scopes let you write rules that target specific parts of your catalog without affecting everything else.| Scope | scopeId resolves to | When it applies |
|---|---|---|
global | (ignored) | Every Offer in the tenant |
segment | Segment ID | Only when the customer belongs to the segment |
channel | Channel ID | Only when the request targets that channel |
category | Category ID | Only Offers in that Category |
subcategory | SubCategory ID | Only Offers in that SubCategory |
offer | Offer ID | Only that specific Offer |
placement | Placement ID | Only when the request targets that placement |
When
scopeId is null for a non-global scope, the rule applies to all entities at that scope level. For example, a rule with scope: "category" and scopeId: null applies to every Category.Stages: Qualification vs Fit
| Qualification (hard gate) | Fit (soft penalty) | |
|---|---|---|
| On failure | Offer removed from candidate set | Offer score multiplied by a decay factor |
| Typical rule types | segment_required, attribute_condition, metric_condition | propensity_threshold, recency_check |
| Multiplier range | N/A | 0.1 — 1.0 |
| Combination | First failure short-circuits | All fit multipliers are combined multiplicatively |
0.8 x 0.5 = 0.4.
Evaluation Order
During the Filter stage of a Decision Flow, rules are evaluated as follows:- Load all active Qualification Rules that match the flow’s filter mode (
all,selected, ornone). - Separate rules into qualification (hard gate) and fit (soft penalty) groups.
- Sort each group by priority descending (highest priority first).
- For each candidate Offer:
- Evaluate all qualification rules whose scope matches the candidate. First failure drops the Offer.
- Evaluate all fit rules whose scope matches the candidate. Accumulate the combined multiplier.
- Surviving Offers proceed to the Scoring stage with their fit multiplier applied.
Decision Flow Filter Modes
| Mode | Behavior |
|---|---|
| all | Every active Qualification Rule in the tenant is evaluated. |
| selected | Only the rules whose IDs are listed in qualificationRuleIds are evaluated. |
| none | Qualification is skipped entirely. |
AND/OR Logic Trees
For advanced scenarios, Kaireon supports recursive AND/OR logic groups via a nested logic-group structure. This allows you to compose rules into arbitrarily nested boolean expressions.- An empty AND group (no ruleIds, no sub-groups) evaluates to true.
- An empty OR group evaluates to false.
ruleIds (via the qualification engine) and its nested groups, then applies the group’s operator ("AND" = every result must be true; "OR" = at least one must be true).
Field Reference
All fields accepted by thePOST /api/v1/qualification-rules endpoint:
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
name | string | Yes | — | Unique display name for the rule. |
description | string | No | "" | Free-text description. |
status | enum | No | "active" | One of draft, active, paused, archived. Only active rules are evaluated at decision time. |
scope | enum | No | "global" | One of global, segment, channel, category, subcategory, offer, placement. |
scopeId | string | null | No | null | The ID of the entity the scope targets (e.g., a Category ID when scope is category). Null means “all entities at this scope level.” |
ruleType | enum | Yes | — | One of segment_required, attribute_condition, propensity_threshold, recency_check, metric_condition, offer_attribute. |
config | object | No | {} | Rule-type-specific configuration (see each rule type tab above). |
priority | integer | No | 50 | 0—100. Higher-priority rules are evaluated first. |
stage | enum | No | "qualification" | One of qualification (hard gate) or fit (soft penalty). |
Worked Example
Customer C-4821 requests a decision for the “Gold Card Upgrade” Offer. Three Qualification Rules are active.Rule definitions
| # | Name | Type | Scope | Config |
|---|---|---|---|---|
| 1 | Premium Segment Gate | segment_required | global | { "requiredSegments": ["premium"] } |
| 2 | Min Credit Score | attribute_condition | category:credit-cards | { "attribute": "customer.credit_score", "operator": "gte", "value": 720 } |
| 3 | Impression Cap | metric_condition | global | { "metricId": "monthly_impressions", "operator": "gt", "threshold": 10, "dimensionMapping": { "offerId": "$candidate.offerId" } } |
Pass scenario (credit_score = 745)
Customer context:- Segments:
["premium", "high_value"] customer.credit_score: 745monthly_impressionsmetric value: 8
| Rule | Check | Result |
|---|---|---|
| 1 — Premium Segment Gate | "premium" in segments? | Pass |
| 2 — Min Credit Score | 745 >= 720? | Pass |
| 3 — Impression Cap | 8 > 10? false — condition not triggered | Pass |
qualificationReasons for this Offer because all three rules passed.
Fail scenario (credit_score = 680)
Same customer but withcustomer.credit_score = 680.
| Rule | Check | Result |
|---|---|---|
| 1 — Premium Segment Gate | "premium" in segments? | Pass |
| 2 — Min Credit Score | 680 >= 720? | Fail |
API Quick Reference
Create a Qualification Rule
201 Created with the full rule object including id, createdAt, and updatedAt.
List Qualification Rules
cursor and limit query parameters.
Update a Qualification Rule
id plus any fields to update. Only provided fields are changed.
Delete a Qualification Rule
deletedAt timestamp). Returns { "deleted": true, "warnings": [...] }. If the rule is referenced by any Decision Flow’s draftConfig, the response includes a warnings array listing affected flows (ghost reference check).
For complete request/response schemas, see the API Reference.
Related
Contact Policies
Frequency caps and cooldown rules that limit how often a customer is contacted.
Decision Flows
Orchestrate Qualification Rules, scoring, and ranking into a complete decision pipeline.
Behavioral Metrics
Define the metrics used by metric_condition rules.
Composable Pipeline
The v2 pipeline includes a dedicated qualify node for inline qualification.