BizKitHub
DocsAPI ReferenceOrganisation/bff/organisation/lifecycle/purge
postOrganisationAdmin BFF

/bff/organisation/lifecycle/purge

Cascade-deletes an organisation and every row that FK-transitively depends on it (~276 tables). The target must have been deactivated first (deleted_date IS NOT NULL) unless skipDeactivationCheck: true is passed. Users whose canonical contact was in this org are repointed to another org membership if any, or deleted otherwise. Returns a per-table row-count report. Use dryRun: true first to preview the impact.

OrganisationpostBffOrganisationLifecyclePurge

Parameters

JSON body

Request body

application/json
organisationIdnumberRequired

Target organisation id to hard-purge.

dryRunbooleanOptional

Compute the plan + row counts without deleting.

skipDeactivationCheckbooleanOptional

Bypass the "must be deactivated first" gate. Only use for confirmed bot/spam organisations.

Response schema

1 status code documented

200Success
successbooleanRequired
reportobjectRequired
organisationIdnumberRequired
organisationNamestringRequired
dryRunbooleanRequired
statsobjectRequired
directCountnumberRequired
transitiveCountnumberRequired
fkEdgesInScopenumberRequired
selfRefsPreNullednumberRequired
tablesTouchednumberRequired
rowsDeletedByTableobjectRequired
totalRowsDeletednumberRequired
blobsDeletedFromStoragenumberRequired
usersRepointednumberRequired
usersDeletednumberRequired
nullableRefsSetNullnumberRequired

Response example

application/json
{
  "success": false,
  "report": {
    "organisationId": 0,
    "organisationName": "example_organisationName",
    "dryRun": false,
    "stats": {
      "directCount": 0,
      "transitiveCount": 0,
      "fkEdgesInScope": 0,
      "selfRefsPreNulled": 0
    },
    "tablesTouched": 0,
    "rowsDeletedByTable": {},
    "totalRowsDeleted": 0,
    "blobsDeletedFromStorage": 0,
    "usersRepointed": 0,
    "usersDeleted": 0,
    "nullableRefsSetNull": 0
  }
}

Request example

POST /bff/organisation/lifecycle/purge

post
curl -X POST "https://api.bizkithub.com/bff/organisation/lifecycle/purge" \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -d '{
  "organisationId": 0,
  "dryRun": false,
  "skipDeactivationCheck": false
}'

Need an API key?

All BizKitHub public API endpoints require authentication via API key.

Get API Key