API by router
Admin tenant lifecycle
Teardown Tenant Endpoint
POST /internal/v1/admin/tenants/{tenant_id}/teardown
Tear down a tenant + its instances + cross-DB rows.
- Auth: ops bearer token (
verify_ops_bearer_token). - Body:
{"confirmation_phrase": "DELETE TENANT <slug>"}— mismatch → 400. - 404: tenant not found.
- 500: FK violation or unexpected DB failure on the final tenant DELETE.
- 200: teardown summary (instances terminated, rows per table, warnings).
The actual cascade lives in src.services.tenant_teardown. teardown_tenant. Reaper (☠️.4) calls the helper directly,
bypassing this HTTP layer.
Path Parameters
tenant_idTenant Id
Format
uuidHeader Parameters
authorization?Authorization
confirmation_phraseConfirmation Phrase
Literal DELETE TENANT <tenant_slug> where <tenant_slug> is the target tenant's actual slug. Mismatch returns 400.
Length
1 <= length <= 200Response Body
curl -X POST "https://loading/internal/v1/admin/tenants/497f6eca-6276-4993-bfeb-53cbbbba6f08/teardown" \ -H "authorization: string" \ -H "Content-Type: application/json" \ -d '{ "confirmation_phrase": "string" }'{
"actor_kind": "string",
"deleted_at": "string",
"instances_terminated": 0,
"rows_per_table": {
"property1": 0,
"property2": 0
},
"tenant_id": "string",
"tenant_name": "string",
"tenant_slug": "string",
"warnings": [
"string"
]
}{
"detail": [
{
"loc": [
"string"
],
"msg": "string",
"type": "string"
}
]
}