Erase a tenant or a user
Delete everything the platform holds about one tenant, or about one of your end users, in a single controlled request. You see exactly what will be removed, kept or anonymised before anything happens, you get a grace period in which you can cancel, and when it finishes you get a receipt.
API: /api/v1/console/applications/{applicationId}/erasure
Who can run it: organization admins of the organization that owns the application.
1. Preview the plan
POST .../erasure/plan with { "tenantId": "..." } or { "userId": "..." } (exactly one). Nothing is changed. The answer lists every place the platform stores data, what will happen there (delete, anonymise, retain, notify, or precondition), how many records are affected, and why anything is kept.
Erasing a tenant also anonymises the members who belong to no other tenant. Members who also belong to another tenant keep their account.
If the plan lists a blocker you must clear it first: custom domains and cache databases provisioned for the tenant are released from their own screens, and a person who is the only admin of an organization needs the admin role transferred.
2. Schedule it
POST .../erasure/requests with the same tenantId or userId, plus:
| Field | What it is |
|---|---|
confirm | The tenant slug, or the user's email address, typed again |
graceDays | Days before it runs (default 7, between 1 and 30) |
reason | Optional note for your own records |
currentPassword or code | Your password, or your authenticator code if MFA is on |
Nothing is removed until the grace period ends. POST .../erasure/requests/{id}/cancel stops it for as long as it has not started.
3. What happens when it runs
Each store is cleared in turn and its result is saved straight away. If something fails, the request tries again later and carries on from where it stopped; steps that already finished are not repeated. After five failed attempts it shows as failed for a person to look at.
Files are deleted from storage as well as from our records. Billing records in TenaBill are kept for the statutory period with the customer's details removed; while that connection is not available the receipt says so (completed_with_gaps) instead of claiming it was done.
When it finishes, your webhook endpoints receive tenant.deleted or user.deleted with an erasureRequestId, so your own application can erase its copy. Use the id to ignore a repeat delivery.
What is kept, and why
- Credit and usage ledgers (ids and amounts, no names) for accounting and tax obligations.
- The audit trail, as security evidence. It points at the anonymised account.
- Evidence that a terms version was accepted, without the IP address.
- Backups are not edited. They age out on their normal retention schedule, after which the data no longer exists anywhere.
The receipt
GET .../erasure/requests/{id} returns receipt once finished: each step with its outcome, a record count and a hash, the date, and one overall hash. It holds hashes and counts only, never the data that was removed, so it is safe to keep and to show to the person who asked.
Your own application's data
The platform erases what it holds. Data your application keeps in its own database is yours to erase when you receive the webhook.
Buyer identifiers in storage entitlements
Storage entitlements (principalId) and the vendor owner of an object (ownerPrincipalId) are free-form text that your application writes. The platform can erase them for a person only when the value is that person's platform user id (the sub claim), written in any standard Guid format (D, N, B, P) and any letter case. Erasing that user in your application then removes their entitlement rows and clears the owner reference on objects they own as a vendor.
If your application identifies buyers by something else (an email address, your own customer number), the platform cannot tie that value to a platform user, so the erasure of a platform user does not reach it. Two options: write the platform user id into principalId, or delete those entitlements yourself when you receive the erasure webhook (a public entitlement revoke endpoint is not available yet, so until it ships write the platform user id). Do not put an email address or other personal data in principalId unless you are prepared to delete it that way.