Skip to content

Erase a tenant and all of its users' data — irreversible

DELETE
/admin/tenants/{id}
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.

id
required
string
/^[a-z0-9_]{1,48}$/
Media typeapplication/json
object
confirm
required

Must equal the id in the path.

string
Examplegenerated
{
"confirm": "example"
}

The tenant has been erased.

Media typeapplication/json
object
id
required
string
erased_at
required
string format: date-time
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.

Media typeapplication/json
object
error
required
object
code
required
string
Allowed values: VALIDATION_FAILED UNAUTHENTICATED FORBIDDEN NOT_FOUND CONFLICT RATE_LIMITED INTERNAL CONTENT_REJECTED
message
required
string
requestId
required
string
fields

Present only for VALIDATION_FAILED.

Array<object>
object
path
string
message
string
Example
{
"error": {
"code": "VALIDATION_FAILED"
}
}

Invalid, expired, revoked, or absent token.

Media typeapplication/json
object
error
required
object
code
required
string
Allowed values: VALIDATION_FAILED UNAUTHENTICATED FORBIDDEN NOT_FOUND CONFLICT RATE_LIMITED INTERNAL CONTENT_REJECTED
message
required
string
requestId
required
string
fields

Present only for VALIDATION_FAILED.

Array<object>
object
path
string
message
string
Example
{
"error": {
"code": "VALIDATION_FAILED"
}
}

Authenticated but not permitted.

Media typeapplication/json
object
error
required
object
code
required
string
Allowed values: VALIDATION_FAILED UNAUTHENTICATED FORBIDDEN NOT_FOUND CONFLICT RATE_LIMITED INTERNAL CONTENT_REJECTED
message
required
string
requestId
required
string
fields

Present only for VALIDATION_FAILED.

Array<object>
object
path
string
message
string
Example
{
"error": {
"code": "VALIDATION_FAILED"
}
}

No such tenant.

Media typeapplication/json
object
error
required
object
code
required
string
Allowed values: VALIDATION_FAILED UNAUTHENTICATED FORBIDDEN NOT_FOUND CONFLICT RATE_LIMITED INTERNAL CONTENT_REJECTED
message
required
string
requestId
required
string
fields

Present only for VALIDATION_FAILED.

Array<object>
object
path
string
message
string
Example
{
"error": {
"code": "VALIDATION_FAILED"
}
}

The tenant is not suspended. Suspend it first. Nothing was changed.

Media typeapplication/json
object
error
required
object
code
required
string
Allowed values: VALIDATION_FAILED UNAUTHENTICATED FORBIDDEN NOT_FOUND CONFLICT RATE_LIMITED INTERNAL CONTENT_REJECTED
message
required
string
requestId
required
string
fields

Present only for VALIDATION_FAILED.

Array<object>
object
path
string
message
string
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.

Media typeapplication/json
object
error
required
object
code
required
string
Allowed values: VALIDATION_FAILED UNAUTHENTICATED FORBIDDEN NOT_FOUND CONFLICT RATE_LIMITED INTERNAL CONTENT_REJECTED
message
required
string
requestId
required
string
fields

Present only for VALIDATION_FAILED.

Array<object>
object
path
string
message
string
Example
{
"error": {
"code": "VALIDATION_FAILED"
}
}