Skip to main content

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.

The Interaction Summary API provides pre-aggregated analytics from the materialized InteractionSummary table. Falls back to on-the-fly SQL aggregation from raw InteractionHistory if no materialized data exists.

GET /api/v1/interaction-summary

Get aggregated interaction data grouped by a chosen dimension.

Query Parameters

ParameterTypeRequiredDefaultDescription
groupBystringNoactionGrouping dimension: action, treatment, channel, customer
daysintegerNo30Lookback window in days
limitintegerNo100Maximum results (capped at 500)
offsetintegerNo0Offset for pagination

Response — groupBy=action

{
  "groupBy": "action",
  "days": 30,
  "summary": [
    {
      "id": "off_001",
      "name": "Premium Card Upgrade",
      "issue": "Revenue Growth",
      "group": "Credit Cards",
      "status": "active",
      "priority": 90,
      "impression": 1250,
      "click": 87,
      "dismiss": 45,
      "accept": 0,
      "convert": 32,
      "total": 1414,
      "ctr": 6.96,
      "cvr": 2.56,
      "positive": 87,
      "negative": 45,
      "neutral": 1118
    }
  ],
  "total": 15,
  "limit": 100,
  "offset": 0
}

Response — groupBy=treatment

{
  "groupBy": "treatment",
  "days": 30,
  "summary": [
    {
      "id": "cr_001",
      "name": "Email Variant A",
      "offerName": "Premium Card Upgrade",
      "channelType": "email",
      "channelName": "Marketing Email",
      "templateType": "html",
      "abTestVariant": "A",
      "weight": 50,
      "status": "active",
      "impression": 625,
      "click": 52,
      "dismiss": 20,
      "accept": 0,
      "convert": 18,
      "total": 715,
      "ctr": 8.32,
      "cvr": 2.88
    }
  ],
  "total": 8,
  "limit": 100,
  "offset": 0
}

Response — groupBy=channel

{
  "groupBy": "channel",
  "days": 30,
  "summary": [
    {
      "id": "ch_001",
      "name": "Marketing Email",
      "channelType": "email",
      "treatmentCount": 6,
      "impression": 2500,
      "click": 175,
      "dismiss": 90,
      "accept": 0,
      "convert": 0,
      "total": 2765,
      "ctr": 7.0
    }
  ],
  "total": 4,
  "limit": 100,
  "offset": 0
}

Response — groupBy=customer

Returns top customers by total interactions.
{
  "groupBy": "customer",
  "days": 30,
  "summary": [
    {
      "customerId": "C-1234",
      "total": 42,
      "impression": 20,
      "click": 8,
      "dismiss": 4,
      "accept": 0,
      "convert": 3,
      "uniqueActions": 5
    }
  ],
  "total": 150,
  "limit": 100,
  "offset": 0
}

Period resolution (materialized path)

When using materialized summaries, the days parameter maps to a period type:
DaysPeriod Type
1daily
2-7weekly
8-31monthly
32+alltime

Role requirements

MethodMinimum role
GETviewer