Skip to main content

POST /api/v1/capture

Record a customer event (impression, click, view, etc.) for tracking and attribution.

Request Body

FieldTypeRequiredDescription
customerIdstringYesCustomer identifier
eventTypestringYesEvent type (e.g., "impression", "click", "view", "dismiss")
offerIdstringNoOffer associated with the event
channelIdstringNoChannel the event occurred on
creativeIdstringNoCreative that was displayed
metadataobjectNoAdditional event data
timestampstringNoISO 8601 timestamp (defaults to now)

Example

curl -X POST https://playground.kaireonai.com/api/v1/capture \
  -H "Content-Type: application/json" \
  -H "X-Tenant-Id: my-tenant" \
  -d '{
    "customerId": "C-1234",
    "eventType": "impression",
    "offerId": "offer_premium_card",
    "channelId": "ch_email",
    "metadata": { "placement": "hero-banner" }
  }'

POST /api/v1/attribution

Attribute a conversion event to a prior decision. Links the outcome back to the original Recommend API call.

Request Body

FieldTypeRequiredDescription
customerIdstringYesCustomer identifier
offerIdstringYesOffer that led to the conversion
outcomeTypestringYesOutcome type key (e.g., "purchase", "signup")
valuenumberNoMonetary value of the conversion
metadataobjectNoAdditional attribution data

Response

{
  "attributed": true,
  "decisionTraceId": "dt_abc123",
  "offerId": "offer_premium_card",
  "outcomeType": "purchase",
  "value": 49.99
}
The attribution endpoint automatically links the conversion to the most recent decision trace for that customer-offer pair. Use the Respond API for simpler outcome recording without explicit attribution linking.