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:

  1. sessions
  2. audit_log (entries by this user)
  3. admin_impersonation_sessions (as target)
  4. user_organisations
  5. users

Side Effects

  • Writes USER_DELETED_GDPR to admin_audit_log with 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 required
User ID to permanently delete.

Response

200 User permanently deleted (GDPR). All sessions, audit entries, and memberships removed.
Show response fields
message string

Error codes

400 Cannot delete yourself or admin users.
404 User not found.