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
| Parameter | Type | Description |
|---|
sections | string | Comma-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
| Parameter | Type | Description |
|---|
customerId | string | Filter by customer |
offerId | string | Filter by offer (alias: actionId) |
creativeId | string | Filter by creative (alias: treatmentId) |
type | string | Filter by interaction type: "impression", "click", "dismiss", "convert" |
limit | integer | Max results (default: 20) |
cursor | string | Cursor 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
| Parameter | Type | Default | Description |
|---|
groupBy | string | "action" | Grouping dimension: "action", "treatment", "channel", "customer" |
days | integer | 30 | Lookback 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
| Endpoint | Allowed Roles |
|---|
GET /customers/{id}/unified-profile | admin, editor, viewer |
DELETE /customers/{id} | admin |
GET /interaction-history | admin, editor, viewer |
GET /interaction-summary | admin, editor, viewer |
See also: Dashboards