Bulk delete organizations
const url = 'http://localhost:3000/api/v1/organizations/bulk';const options = {method: 'DELETE', headers: {'X-API-Key': '<X-API-Key>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}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.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Header Parameters
Section titled “Header Parameters”UUID of the organization (tenant) the request acts in. It selects the tenant and grants nothing: the server checks membership or an open tenant switch. Not needed for global operations. A malformed value returns 400. API keys are fixed to their own organization; another organization returns 403. The x-organization-source header grants nothing.
Responses
Section titled “Responses”Bulk delete completed
object
Number of organizations successfully purged
Per-organization error messages for any that could not be purged (e.g. the active tenant, which is always skipped)
Total devices soft-deleted across all purged organizations
Total deployments soft-deleted (cancelled) across all purged organizations
Total application packages soft-deleted across all purged organizations
Examplegenerated
{ "deleted": 1, "errors": [ "example" ], "devices": 1, "deployments": 1, "applications": 1}Unauthorized
Forbidden - Super Admin required