---
title: "Restore a deleted record"
method: POST
path: "/api/v1/ackdb/deletions/{id}/restore"
tags: ["ackDB"]
---

# Restore a deleted record

`POST /api/v1/ackdb/deletions/{id}/restore`

## Request

- Base URL: `http://localhost:3009`
- URL: `http://localhost:3009/api/v1/ackdb/deletions/{id}/restore`
- Auth: HTTP bearer

Puts every archived row back, in FK order, in one transaction, and clears the tombstone.

Only a `deleted` entry restores: a purged one is a 409 (there is nothing left to put back), a restored one is an idempotent no-op. **Fail-closed:** if any unique constraint would break — an identity link claimed after the tombstone was lifted, a person key, the `(entity_id, email)` active-unique, a re-used idempotency key — the restore is refused with every offender listed and NOTHING is written. No partial restores, ever.

Derived content is NOT restored because it was never archived: restored payloads come back marked unprocessed, and `pendingRebuild` names the (entity, source) pairs the embed + conversations pipelines must rebuild. Segment memberships are likewise not restored — the next sweep recomputes and emits `enter` naturally, which is the honest signal.

## Path parameters

- `id` string, required

## Response `200`

Restored. Reports rows per table, re-attached pointers, and the pending rebuild.

## Other responses

- `404`: `DELETION_NOT_FOUND`.
- `409`: `ALREADY_PURGED` — the archived rows were destroyed. `RESTORE_CONFLICT` — something claimed one of the record's identifiers while it was deleted; every offender is listed and nothing was written.

---

[API](https://skmtc.dev/floqer/apis/floqer-public-api.md) - [All operations](https://skmtc.dev/floqer/apis/floqer-public-api/llms.txt) - [OpenAPI document](https://skmtc.dev/floqer/apis/floqer-public-api/revisions/fce50dc07b20?raw)
