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.
Overview
This tutorial covers everything you need to integrate with KaireonAI’s two core APIs:- Recommend API — Get personalized offer recommendations for a customer
- Respond API — Record customer interactions (impressions, clicks, conversions)
Prerequisites
Before starting, ensure you have:- A running KaireonAI instance (local or
https://playground.kaireonai.com) - At least one active Decision Flow with Offers, channels, and Creatives configured
- Your tenant ID (found in Settings > General)
- An API key (generated in Settings > API Keys)
Authentication
All API requests require two headers:| Header | Description |
|---|---|
x-tenant-id | Your tenant identifier |
x-api-key | Your API key (hashed with HMAC-SHA256 on the server) |
Base URL
| Environment | Base URL |
|---|---|
| Local development | http://localhost:3000/api/v1 |
| Playground | https://playground.kaireonai.com/api/v1 |
| Production | Your custom domain + /api/v1 |
Recommend API
The Recommend API is the primary decisioning endpoint. It executes a Decision Flow for a specific customer and returns ranked, personalized offers.Endpoint
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
customerId | string | Yes | The customer to generate recommendations for |
decisionFlowKey | string | No | Decision flow key to execute (uses default flow if omitted) |
limit | number | No | Maximum offers to return (default: 5) |
channel | string | No | Filter by delivery channel |
placement | string | No | Named placement slot within the channel |
attributes | object | No | Request-time attributes available as attributes.* in formulas |
debug | boolean | No | If true, includes pipeline funnel counts in meta |
Response
Response Fields
| Field | Description |
|---|---|
decisions[] | Ordered array of recommended offers (highest score first) |
decisions[].score | Final composite score after arbitration |
decisions[].content | Rendered creative content with personalization variables resolved |
decisions[].personalization | Computed values from the Compute stage |
recommendationId | Decision trace ID (only when debug: true in request) |
Respond API
The Respond API records customer interactions with recommendations. KaireonAI feeds this data back into behavioral metrics, contact policies, and experiment analysis.Endpoint
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
customerId | string | Yes | The customer who interacted |
creativeId | string | Yes | The creative they interacted with |
channelId | string | Yes | The channel the interaction occurred on |
outcome | string | Yes | The type of interaction (see Outcome Types) |
idempotencyKey | string | Yes | Unique key to prevent duplicate recordings |
recommendationId | string | No | Links this interaction back to the original recommendation |
metadata | object | No | Arbitrary key-value data attached to the interaction |
Response
Common Outcome Types
| Type | When to Record |
|---|---|
impression | Customer was shown the recommendation |
click | Customer clicked/tapped the recommendation |
conversion | Customer completed the desired action (purchase, application, etc.) |
dismiss | Customer explicitly dismissed the recommendation |
not_interested | Customer indicated disinterest |
opt_out | Customer opted out of this type of communication |
Advanced Topics
Decision Traces
When you setdebug: true in the Recommend request, KaireonAI records a forensic trace of the entire decision process. Retrieve it with:
Experiments
When an A/B experiment is active, KaireonAI automatically assigns customers to control or variant groups based on creative weights. The response includes experiment metadata:- Conversion rate per variant
- Uplift (percentage improvement over control)
- Statistical significance (z-test)
- Confidence interval
Computed Values in Responses
Thepersonalization field in each recommendation contains the evaluated computed values from the Decision Flow’s Compute stage. These values are calculated per customer using:
- Offer custom fields —
base_rate,annual_fee, etc. - Enriched customer data —
customer.loyalty_score,customer.credit_score - Request-time attributes —
attributes.tier,attributes.device
Error Handling
Common Error Responses
| Status | Code | Description |
|---|---|---|
| 400 | VALIDATION_ERROR | Invalid request body (missing required fields, wrong types) |
| 401 | UNAUTHORIZED | Missing or invalid API key |
| 403 | FORBIDDEN | Tenant does not have access to the requested resource |
| 404 | NOT_FOUND | Decision Flow, customer, or Offer not found |
| 429 | PLAYGROUND_QUOTA_EXCEEDED | Playground decision limit reached (see Open-Source Model) |
| 500 | INTERNAL_ERROR | Server error — contact support |
Rate Limiting
KaireonAI protects the platform with a sliding-window rate limit of 1,000 requests per minute per tenant. When rate-limited, the API returns:Rate limits apply per tenant, not per API key. Multiple API keys for the same tenant share the same rate limit window.
What’s Next?
Platform Walkthrough
Follow the end-to-end setup guide with hands-on examples.
Decision Flows
Learn how the decisioning pipeline works under the hood.
Formula Reference
Complete syntax reference for computed value formulas.
Behavioral Metrics
Build dynamic rules from interaction history.
Sample Data
Load demo data to test the APIs with realistic content.
MCP Quickstart
Connect your AI IDE to query and configure KaireonAI.