ackDB

Delete specific events by id (with cascade)

Surgically delete events by id. Events are append-only - this is the supported way to remove bad data (test / duplicate / wrong-entity events) and to correct a wrong-field event: delete it, then re-ingest the corrected one.

Why delete enables correction: the idempotency key lives on the event's raw payload. Re-pushing a corrected event with the same key is normally deduplicated (silently dropped). Deleting the event also deletes its raw payload, which frees the idempotency key - so the corrected re-push is accepted as a new event.

What gets deleted per event (atomic, one transaction): the event row, its raw payload (frees the idempotency key), its attached files (rows + stored blobs), the affected entity+source pairs' embedding chunks (except chunks a surviving file still references), and every conversation built from a deleted payload — plus an audit row in event_deletions.

Derived content is invalidated, never left stale: deleted text must not stay semantically searchable or citable. Surviving payloads of the affected pairs are queued for re-embedding (pendingRebuild reports each pair); until the embed/conversations pipelines next run, search for those pairs is missing — deliberately.

Refusals (409, whole request, fail-closed): SYSTEM_EVENT_NOT_DELETABLE when any id is an ackDB bookkeeping event (source system/member — the audit log of state that still stands; undo the state via its inverse API instead). PENDING_INGEST_CONFLICT when a queued ingest shares an idempotency key with a to-be-deleted payload and would resurrect it (retry after the queue drains).

Deliberately retained (reported in retained): the affected entities' identity links — they are why a corrected re-ingest lands on the SAME entity — and any entity the delete leaves without source events/payloads (entity delete does not exist; the row stays, resolvable via its links).

IDs-only by design - no filter/query selectors. Look up ids first via the read API. Unknown ids are reported in notFound, never fatal. Use dryRun: true to preview the identical report without mutating. This is a destructive, irreversible operation (re-ingest from the source to recover).

delete/api/v1/ackdb/data/events

Request

  • Base URL
    http://localhost:3009
  • Auth
    HTTP bearer

Request body

idsstring[] required

Event ids (ULIDs) to delete. Duplicates are collapsed; unknown ids are reported in notFound.

dryRunboolean

When true, resolve and count what WOULD be deleted without mutating anything.

reasonstring

Optional reason, stored in the event_deletions audit row.

Example request

{
  "ids": [
    "01J9ABCDEF0123456789ABCDEF",
    "01J9ZYXWVU9876543210ZYXWVU"
  ],
  "reason": "duplicate Slack import"
}

Response

Delete (or dry-run preview) completed. Returns per-table counts, what was deliberately retained, and the per-pair pending-rebuild report.

Example response

{
  "data": {
    "deleted": {
      "events": 2,
      "rawPayloads": 2,
      "files": 1,
      "contentChunks": 3,
      "conversations": 1,
      "blobs": 1
    },
    "wouldDelete": {
      "events": 1,
      "rawPayloads": 1,
      "contentChunks": 2,
      "conversations": 1
    }
  }
}

Changes

No recorded changes to this operation across all 1 revision of this API.