Skip to main content
The GDPR Erasure API permanently deletes all records associated with a specific customer across all data tables. This supports GDPR Article 17 (right to erasure). The deletion runs inside a single database transaction to ensure atomicity. Admin only.

Base path

/api/v1/gdpr/erasure

Erase customer data

POST /api/v1/gdpr/erasure
Permanently deletes all data linked to a customer ID within the tenant. The operation is transactional — if any table deletion fails, the entire operation is rolled back.

Request body

FieldTypeRequiredDescription
customerIdstringYesThe customer identifier to erase all data for.

Example request

curl -X POST https://playground.kaireonai.com/api/v1/gdpr/erasure \
  -H "Content-Type: application/json" \
  -H "X-Tenant-Id: my-tenant" \
  -H "X-User-Role: admin" \
  -d '{ "customerId": "cust_12345" }'

Response 200

{
  "success": true,
  "customerId": "cust_12345",
  "deletedCounts": {
    "interactionHistory": 47,
    "interactionSummary": 12,
    "suppression": 3,
    "decisionTrace": 8,
    "attributionResult": 5
  },
  "totalDeleted": 75
}

Response fields

FieldTypeDescription
successbooleanWhether the erasure completed successfully.
customerIdstringThe customer ID that was erased.
deletedCountsobjectBreakdown of deleted records per table.
deletedCounts.interactionHistorynumberInteraction history records deleted.
deletedCounts.interactionSummarynumberAggregated interaction summary records deleted.
deletedCounts.suppressionnumberActive suppression records deleted.
deletedCounts.decisionTracenumberDecision trace (forensic audit) records deleted.
deletedCounts.attributionResultnumberAttribution result records deleted.
totalDeletednumberSum of all deleted records across all tables.

Error codes

CodeReason
400Missing or invalid customerId (must be a non-empty string).
400Invalid JSON body.
500Transaction failed — all deletions are rolled back.
This operation is irreversible. All interaction history, summaries, suppressions, decision traces, and attribution results for the customer are permanently deleted. An audit log entry is created to record the erasure event.

Audit trail

Every erasure request is logged with:
  • Action: gdpr_erasure
  • Entity type: customer
  • Entity ID: The erased customer ID
  • Changes: The deletedCounts breakdown

Data tables affected

TableWhat is deleted
InteractionHistoryAll recommendation, impression, click, and conversion events for the customer.
InteractionSummaryPre-aggregated performance summaries per offer/channel for the customer.
SuppressionActive contact policy suppressions (frequency caps, cooldowns, etc.).
DecisionTraceForensic traces of decision pipeline executions involving the customer.
AttributionResultAttribution results linking outcomes to recommendations for the customer.
Data stored in custom schema tables (created via the Data module) is not automatically erased by this endpoint. If you store PII in custom schemas, you must handle deletion of those records separately.

Role requirements

MethodMinimum role
POSTadmin