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/simulate
Run a simulation against a customer segment to preview how a Decision Flow would perform. Creates aSimulationRun record for tracking. Supports A/B comparison mode.
Rate limit: 20 requests/min (expensive compute). Timeout: 120 seconds.
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
segmentId | string | Yes | Segment to simulate against |
decisionFlowKey | string | No | Decision Flow key to simulate |
blueprintKey | string | No | Alias for decisionFlowKey |
sampleSize | number | No | Number of customers to sample (default: 1000) |
channelFilter | string | No | Channel filter (e.g., "email", "sms") |
formulaOverride | object | No | Override formula values during simulation |
compare | object | No | If provided, runs A/B comparison mode (see below) |
Compare Mode
Whencompare is provided, the API runs two simulations side-by-side: scenario A uses the top-level config, and scenario B merges the compare object with segmentId. The response contains both results for comparison.
Example
Response
Returns aSimulationRun record with the simulation results merged in.
"failed" and a 500 error is returned.
GET /api/v1/simulate
List past simulation runs for the tenant. Supports pagination.Query Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
limit | integer | 20 | Max results per page (max 100) |
offset | integer | 0 | Number of records to skip |