Skip to content

Bulk delete organizations

DELETE
/api/v1/organizations/bulk
curl --request DELETE \
--url http://localhost:3000/api/v1/organizations/bulk \
--header 'X-API-Key: <X-API-Key>'

Purges multiple organizations, cascading through each org’s devices, deployments and applications (soft-deleted) before removing the org itself. The organization the caller is currently operating in (active tenant) is never deleted — it is dropped from the request and reported in the errors array as skipped. The response reports how many organizations were purged, the aggregated cascade counts, and a per-organization error for any that could not be removed. Requires Super Admin privileges.

Bulk delete completed

Media type application/json
object
deleted
required

Number of organizations successfully purged

number
errors
required

Per-organization error messages for any that could not be purged (e.g. the active tenant, which is always skipped)

Array<string>
devices
required

Total devices soft-deleted across all purged organizations

number
deployments
required

Total deployments soft-deleted (cancelled) across all purged organizations

number
applications
required

Total application packages soft-deleted across all purged organizations

number
Example generated
{
"deleted": 1,
"errors": [
"example"
],
"devices": 1,
"deployments": 1,
"applications": 1
}

Unauthorized

Forbidden - Super Admin required