Skip to main content

GET /api/v1/customers//unified-profile

Build a unified 360-degree customer profile by aggregating data from schema tables, interaction history, metric values, and experiment assignments.

Query Parameters

ParameterTypeDescription
sectionsstringComma-separated list of profile sections to include (e.g., "attributes,interactions,metrics"). If omitted, all sections are returned.

Response

{
  "customerId": "CUST001",
  "attributes": {
    "email": "john@example.com",
    "tier": "gold",
    "lifetime_value": 15200.50,
    "tenure_months": 36
  },
  "interactions": {
    "totalCount": 142,
    "recentInteractions": [
      {
        "offerId": "offer_001",
        "interactionType": "click",
        "timestamp": "2026-03-15T10:30:00.000Z"
      }
    ]
  },
  "metrics": {
    "purchase_frequency_30d": 4,
    "engagement_score": 78.5
  },
  "segments": ["high_value", "active_buyer"]
}

DELETE /api/v1/customers/

Delete all data for a customer (GDPR right to erasure). Removes interaction history, interaction summaries, experiment assignments, and impression records.

Response

{
  "success": true,
  "deleted": {
    "interactionHistory": 142,
    "interactionSummary": 23,
    "experimentAssignments": 5,
    "impressions": 67
  }
}
This permanently deletes all customer data. This operation cannot be undone.

GET /api/v1/interaction-history

Query interaction history with filters. Supports cursor-based pagination.

Query Parameters

ParameterTypeDescription
customerIdstringFilter by customer
offerIdstringFilter by offer (alias: actionId)
creativeIdstringFilter by creative (alias: treatmentId)
typestringFilter by interaction type: "impression", "click", "dismiss", "convert"
limitintegerMax results (default: 20)
cursorstringCursor for pagination

Response

{
  "data": [
    {
      "id": "ih_001",
      "customerId": "CUST001",
      "offerId": "offer_001",
      "interactionType": "click",
      "timestamp": "2026-03-15T10:30:00.000Z",
      "offer": { "id": "offer_001", "name": "Platinum Card" },
      "creative": {
        "id": "creative_001",
        "name": "Email Hero",
        "channel": { "id": "ch_001", "name": "Marketing Email" }
      }
    }
  ],
  "total": 142,
  "hasMore": true
}

GET /api/v1/interaction-summary

Aggregated interaction metrics grouped by different dimensions. Uses materialized summary tables when available, falling back to on-the-fly SQL aggregation.

Query Parameters

ParameterTypeDefaultDescription
groupBystring"action"Grouping dimension: "action", "treatment", "channel", "customer"
daysinteger30Lookback window in days

Response (groupBy=action)

{
  "groupBy": "action",
  "days": 30,
  "summary": [
    {
      "id": "offer_001",
      "name": "Platinum Card",
      "issue": "Credit Cards",
      "group": "Premium",
      "status": "active",
      "priority": 90,
      "impression": 5200,
      "click": 416,
      "dismiss": 312,
      "convert": 52,
      "total": 5980,
      "ctr": 8.0,
      "cvr": 1.0
    }
  ]
}

Response (groupBy=customer)

{
  "groupBy": "customer",
  "days": 30,
  "summary": [
    {
      "customerId": "CUST001",
      "total": 142,
      "impression": 80,
      "click": 32,
      "dismiss": 20,
      "convert": 10,
      "uniqueActions": 8
    }
  ]
}

Roles

EndpointAllowed Roles
GET /customers/{id}/unified-profileadmin, editor, viewer
DELETE /customers/{id}admin
GET /interaction-historyadmin, editor, viewer
GET /interaction-summaryadmin, editor, viewer
See also: Dashboards