Delete user
DELETE
https://app.speybooks.com/api/v1/admin/users/{id}Permanently delete a user and all associated data. Implements GDPR Article 17 (Right to be Forgotten). This operation is irreversible.
Confirmation
Requires confirm: "DELETE" (literal string) and a reason (minimum 5 characters) in the request body.
Safety Checks
- Cannot delete yourself (
SELF_DELETE) - Cannot delete admin users (
CANNOT_DELETE_ADMIN)
Cascade Delete (Transaction)
Deletes in dependency order within a single transaction:
sessionsaudit_log(entries by this user)admin_impersonation_sessions(as target)user_organisationsusers
Side Effects
- Writes
USER_DELETED_GDPRtoadmin_audit_logwith the deleted email and name for compliance records
Note: the user's organisation is not deleted. If the organisation should also be removed, use the delete organisation endpoint separately.
Path parameters
id string requiredUser ID to permanently delete.
Response
200 User permanently deleted (GDPR). All sessions, audit entries, and memberships removed.
Show response fields
message stringError codes
400 Cannot delete yourself or admin users.
404 User not found.