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.
POST /api/v1/qualification-rules/reach-estimate
Estimates the impact of a proposed qualification rule by querying the actual customer data in a schema table. Returns qualifying/excluded counts, field distribution statistics, and a breakdown by segment.Request Body
| Field | Type | Required | Description |
|---|---|---|---|
ruleType | string | Yes | Rule type identifier |
field | string | Yes | Field name to evaluate (e.g., age, credit_score) |
operator | string | Yes | Comparison operator (see table below) |
value | string, number, boolean, or array | Yes | Value to compare against |
schema | string | Yes | Schema name containing the customer data |
sampleSize | integer | No | Max rows to sample (100-10000, default: 1000) |
Supported Operators
| Operator | SQL Equivalent | Description |
|---|---|---|
eq | = | Equals |
neq | != | Not equals |
gt | > | Greater than |
gte | >= | Greater than or equal |
lt | < | Less than |
lte | <= | Less than or equal |
in | SQL in | Value in array |
not_in | SQL not in | Value not in array |
contains | SQL like | String contains |
not_contains | SQL not like | String does not contain |
Example
Response
Response Fields
| Field | Type | Description |
|---|---|---|
totalSampled | integer | Number of rows sampled |
qualifying | integer | Rows matching the condition |
excluded | integer | Rows not matching the condition |
qualifyPercent | number | Percentage of qualifying rows |
excludedBySegment | array | Breakdown of excluded customers by segment (if segments exist) |
fieldDistribution | object or null | Statistical distribution for numeric fields (min, max, avg, median, p25, p75) |
Field distribution statistics are only available for numeric fields. For text fields,
fieldDistribution is null.