Skip to main content
The Restore API allows administrators to recover entities that were soft-deleted. When an entity is deleted in KaireonAI, it is not immediately removed from the database — instead, a deletedAt timestamp is set. This endpoint clears that timestamp, making the entity active again. Admin only.

Base path

/api/v1/restore

Restore a soft-deleted entity

POST /api/v1/restore?entityType={type}&id={id}
Restores a single soft-deleted entity by clearing its deletedAt timestamp.

Query parameters

ParameterRequiredTypeDescription
entityTypeYesstringThe type of entity to restore (see valid types below).
idYesstringThe ID of the entity to restore.

Valid entity types

Entity TypeDescription
categoryTop-level offer category (business issue).
subCategoryChild grouping under a category.
channelDelivery channel.
placementChannel placement.
flowRouteDecision flow routing rule.
offerDecisioning offer (action).
creativeContent variant / treatment.
outcomeTypeOutcome type definition.
qualificationRuleQualification rule.
contactPolicyContact policy rule.
decisionFlowDecision flow pipeline.
triggerRuleTrigger rule.
guardrailRuleGuardrail rule.
arbitrationProfileMulti-objective arbitration profile.
summaryDefinitionInteraction summary definition.

Example request

curl -X POST "https://playground.kaireonai.com/api/v1/restore?entityType=offer&id=clx_abc123" \
  -H "X-Tenant-Id: my-tenant" \
  -H "X-User-Role: admin"

Response 200

{
  "restored": true,
  "entityType": "offer",
  "id": "clx_abc123"
}

Error codes

CodeReason
400Missing entityType or id query parameter.
400Invalid entityType (not in the supported list).
400Entity not found, not soft-deleted, or restore failed.

Example error

{
  "error": "Entity not found or not soft-deleted"
}

Role requirements

MethodMinimum role
POSTadmin
Only entities that have been soft-deleted (i.e., have a non-null deletedAt timestamp) can be restored. Attempting to restore an entity that was never deleted or was hard-deleted will return a 400 error.