Skip to main content

DeleteUser

DELETE 

/v1/users/:user_id

DeleteUser soft-deletes a user (fraser#8692). The authn.user row is never removed: delete sets banned = true with the USER_DELETED ban reason, stamps deleted_at/deleted_by, revokes every live API key the user owns (writing deleted_at, revoked_at and is_active), deletes the RBAC bindings those keys carried, and removes their authn.session rows -- all in one transaction, so a key-revocation failure leaves the user unchanged. RestoreUser reverses it.

Restorable by design, and visibly distinct from an operator ban: a deleted account carries the USER_DELETED sentinel as its ban reason.

Refuses with FAILED_PRECONDITION when the target is the last active administrator -- of the platform (legacy admin role or a platform-scope admin binding) or of any customer they hold an org-scope admin binding for -- so a deployment cannot delete its way out of being administrable. Refuses with FAILED_PRECONDITION when the user is already deleted; NOT_FOUND for an unknown user_id.

Request

Responses

Success