Erase a tenant and all of its users' data — irreversible
const url = 'http://localhost:3000/admin/tenants/example';const options = { method: 'DELETE', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"confirm":"example"}'};
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/admin/tenants/example \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "confirm": "example" }'Drops the tenant’s database, deletes its Outpost webhook tenant and destinations, removes its jobs from the fan-out, notify and publish queues and the dead-letter queues, deletes every tenant-scoped Redis key, then deletes the registry row (which cascades its dashboard operators). The row is locked for the whole operation and goes LAST, so a failure part-way leaves a suspended tenant an operator can re-run this against. Every step is idempotent, so re-running is always safe. (Spec: 2026-09-11-tenant-erasure-design.md.)
Two interlocks: the tenant must already be SUSPENDED, and the body must repeat the id.
Does not reach existing backups — erased data persists in them until they age out (up to 7 days) — Outpost delivery logs (~14 days), or the queues’ event history (job ids and failure text, the last ~10,000 events per queue). Re-run erasure after restoring any backup that predates it.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”Request Bodyrequired
Section titled “Request Bodyrequired”object
Must equal the id in the path.
Examplegenerated
{ "confirm": "example"}Responses
Section titled “Responses”The tenant has been erased.
object
Examplegenerated
{ "id": "example", "erased_at": "2026-04-15T12:00:00Z"}The id is not a valid tenant id or is reserved, or confirm is missing or does not match it. Nothing was changed.
object
object
Present only for VALIDATION_FAILED.
object
Example
{ "error": { "code": "VALIDATION_FAILED" }}Invalid, expired, revoked, or absent token.
object
object
Present only for VALIDATION_FAILED.
object
Example
{ "error": { "code": "VALIDATION_FAILED" }}Authenticated but not permitted.
object
object
Present only for VALIDATION_FAILED.
object
Example
{ "error": { "code": "VALIDATION_FAILED" }}No such tenant.
object
object
Present only for VALIDATION_FAILED.
object
Example
{ "error": { "code": "VALIDATION_FAILED" }}The tenant is not suspended. Suspend it first. Nothing was changed.
object
object
Present only for VALIDATION_FAILED.
object
Example
{ "error": { "code": "VALIDATION_FAILED" }}Erasure stopped part-way — for example a queued job of the tenant was still running. The tenant is still suspended and still listed; re-run once its last jobs settle.
object
object
Present only for VALIDATION_FAILED.
object
Example
{ "error": { "code": "VALIDATION_FAILED" }}