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
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
| Parameter | Required | Type | Description |
|---|
entityType | Yes | string | The type of entity to restore (see valid types below). |
id | Yes | string | The ID of the entity to restore. |
Valid entity types
| Entity Type | Description |
|---|
category | Top-level offer category (business issue). |
subCategory | Child grouping under a category. |
channel | Delivery channel. |
placement | Channel placement. |
flowRoute | Decision flow routing rule. |
offer | Decisioning offer (action). |
creative | Content variant / treatment. |
outcomeType | Outcome type definition. |
qualificationRule | Qualification rule. |
contactPolicy | Contact policy rule. |
decisionFlow | Decision flow pipeline. |
triggerRule | Trigger rule. |
guardrailRule | Guardrail rule. |
arbitrationProfile | Multi-objective arbitration profile. |
summaryDefinition | Interaction 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
| Code | Reason |
|---|
400 | Missing entityType or id query parameter. |
400 | Invalid entityType (not in the supported list). |
400 | Entity not found, not soft-deleted, or restore failed. |
Example error
{
"error": "Entity not found or not soft-deleted"
}
Role requirements
| Method | Minimum role |
|---|
| POST | admin |
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.