Skip to content
Pyck docs

deleteTenant

Since pyck v0.27.0

Manually delete a tenant by setting deleted_at via soft-delete. This triggers the soft-delete half of the tenant lifecycle — the row remains in the database and can be reactivated via restoreTenant during the grace period. Nothing hard-deletes the row, so the tenant keeps its name for good.

The target tenant is named by input.tenantId. The caller must hold ROLE_ADMIN on it; ROLE_SYSTEM satisfies this for system flows. A tenant in any registration status can be deleted; a registration that is still running (status pending) notices the delete itself and deactivates the organization it created. No other registration can take the tenant’s name.

Served by: management

Name Type Default Description
input DeleteTenantInput!

DeleteTenantResponse!

Manually triggers the soft-delete half of the tenant lifecycle by setting deleted_at. The tenant-lifecycle NATS subscriber observes the resulting CRUD event and starts DisableTenantWorkflow to deactivate the Zitadel org. A registration that is still running notices the delete itself. Returns an error when the tenant does not exist; idempotent on already-deleted tenants. The tenant row stays in the database and can be reactivated via restoreTenant during the grace period. The caller must hold ROLE_ADMIN on input.tenantId.

mutation DeleteTenant($input: DeleteTenantInput!) {
deleteTenant(input: $input) {
success
}
}

Variables

{
"input": {
"tenantId": "<tenant ID>"
}
}