Skip to main content

POST /api/v1/contact-policies/impact-preview

Previews the customer impact of a proposed contact policy configuration. Samples customers from recent interaction history and simulates how many would be affected by the proposed frequency cap.

Request Body

FieldTypeRequiredDescription
policyTypestringYesPolicy type identifier
scopestringNoScope: global, offer, category, or channel (default: global)
scopeIdstringNoID of the scoped entity (required when scope is offer, category, or channel)
config.maxFrequencyintegerYesMaximum allowed contacts per period (minimum: 1)
config.periodDaysintegerYesLookback period in days (1-365)
config.outcomeTypestringYesInteraction type to count (e.g., impression, click, convert)
sampleSizeintegerNoMax customers to analyze (100-10000, default: 1000)

Example

curl -X POST https://playground.kaireonai.com/api/v1/contact-policies/impact-preview \
  -H "Content-Type: application/json" \
  -H "X-Tenant-Id: my-tenant" \
  -d '{
    "policyType": "frequency_cap",
    "scope": "channel",
    "scopeId": "ch_email",
    "config": {
      "maxFrequency": 3,
      "periodDays": 7,
      "outcome": "impression"
    },
    "sampleSize": 2000
  }'

Response

{
  "totalCustomersAnalyzed": 2000,
  "customersAffected": 420,
  "affectedPercent": 21.0,
  "offersSuppressed": {
    "Platinum Card Upgrade": 85,
    "Auto Loan Refinance": 62,
    "Savings Account Promo": 45
  },
  "avgOffersBeforePolicy": 4.2,
  "avgOffersAfterPolicy": 2.8,
  "topAffectedSegments": [
    { "segment": "High Value", "affected": 180, "total": 500 },
    { "segment": "Active Traders", "affected": 95, "total": 320 }
  ]
}

Response Fields

FieldTypeDescription
totalCustomersAnalyzedintegerNumber of customers in the sample
customersAffectedintegerCustomers who would hit the frequency cap
affectedPercentnumberPercentage of analyzed customers affected
offersSuppressedobjectMap of offer names to suppression counts
avgOffersBeforePolicynumberAverage contacts per customer before the policy
avgOffersAfterPolicynumberAverage contacts per customer after the policy
topAffectedSegmentsarraySegments most impacted (sorted by affected count)
Use this endpoint before creating a contact policy to understand which customers and offers will be impacted. High affectedPercent values may indicate the policy is too restrictive.

Roles

admin, editor See also: Contact Policies | Policy Conflicts