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/respond
Records the outcome of a recommendation delivered via the Recommend API. Outcomes feed into behavioral metrics, adaptive model training, experiment analysis, and attribution.Minimal Request (Recommended)
The smallest way to record an outcome — 4 fields. The system resolves the offer, creative, and channel from the recommendation record.Full Request (all optional fields)
Field Reference
| Field | Type | Required | Description |
|---|---|---|---|
customerId | string | Yes | The customer who interacted with the recommendation |
recommendationId | string | Yes* | The recommendationId from the Recommend API response. Used with rank to resolve the offer automatically |
rank | integer | Yes* | Which offer from the recommendation (1-based). Combined with recommendationId to look up the offer, creative, and channel |
outcome | string | Yes | The outcome type key (e.g., "click", "accept", "dismiss", "convert", "renewed", "unsubscribed"). Must match a registered Outcome Type |
creativeId | string | No | Explicit Creative ID. Only needed if NOT using recommendationId + rank |
idempotencyKey | string | Yes | Required. Unique key to prevent double-counting. Returns 400 if missing. Can also be sent as Idempotency-Key header |
interactionId | string | No | Legacy field — use recommendationId instead |
direction | string | No | Direction of the interaction: "inbound" or "outbound". Default is "inbound" for most outcome types. For impression-category outcomes (e.g., impression, delivery), the default is "outbound" since those represent platform-initiated contacts |
offerId | string | No | Offer ID. If omitted, resolved automatically from the creative’s parent offer |
channelId | string | No | Channel ID. Always resolved from the creative when creativeId is provided, regardless of whether channelId is passed in the request body. This ensures interaction summaries and contact policy frequency caps use the correct channel. |
placementId | string | No | Placement ID. If omitted, resolved from the creative |
rank | integer | No | The position at which the offer was displayed (1-indexed) |
context | object | No | Arbitrary context metadata (campaign source, UTM params, etc.) |
outcomeDetails | object | No | Structured details about the outcome (e.g., product SKU, plan selected) |
timestamp | string | No | ISO 8601 timestamp of the interaction. Defaults to the current server time |
conversionValue | number | No | Monetary value of the conversion (used for attribution and revenue reporting) |
attributes | object | No | Additional attributes (device, browser, etc.). Used for online model learning |
channel | string | No | Channel name string (stored in context) |
placement | string | No | Placement name string (stored in context) |
responseTime | number | No | Time in milliseconds the customer took to respond |
deviceType | string | No | Device type string (stored in context) |
Fields marked Yes* require at least one resolution path. You must provide either
creativeId OR recommendationId + rank to identify the offer. The field outcome is required (the legacy alias interactionType is also accepted).Prior to this fix,
channelId was only resolved when offerId was missing, causing per-channel frequency caps to be silently broken.Idempotency
Every call to the Respond API requires an idempotency key to prevent duplicate outcome recording. You can provide it in two ways:- Request body:
"idempotencyKey": "unique-key-here" - HTTP header:
Idempotency-Key: unique-key-here
"status": "already_recorded" and a 200 status code (not 201).
Response: New Record (201)
The response includes enriched names for easy display without additional lookups.Response: Duplicate (200)
When the sameidempotencyKey is sent again:
Outcome Types
Outcomes must be registered in the platform before they can be recorded. Each outcome type has a classification that drives downstream behavior:| Classification | Effect | Examples |
|---|---|---|
positive | Increments positive counters, triggers attribution, updates adaptive models with reward | click, accept, convert, purchase |
negative | Increments negative counters, updates models with penalty | dismiss, not_interested, unsubscribe |
neutral | Tracked but does not affect scoring | impression, view, requested_info |
POST /api/v1/outcome-types.
Examples
Record an Impression
Record a Click
Record a Conversion with Value
Error Responses
| Status | Cause |
|---|---|
400 | Missing required fields (customerId, creativeId/treatmentId, outcome/interactionType, idempotencyKey), unknown outcome type, or invalid JSON |
401 | Missing or invalid X-Tenant-Id / API key |
404 | Creative not found or belongs to another tenant |
415 | Content-Type header is not application/json |
429 | Rate limit exceeded (1,000 requests per 60s per tenant) |
500 | Internal server error |