- Deleting team is available via API also, given a team admin role - https://api.mattermost.com/#tag/teams%2Fpaths%2F~1teams~1{team_id}%2Fdelete
- Since you’re going to use your LDAP for authentication, you don’t need to create users but have them sync with Mattermost. See this docs to setup LDAP with Mattermost - https://docs.mattermost.com/deployment/sso-ldap.html. Passwords for LDAP users are not stored in Mattermost database; those were at your LDAP server.
- Once all users are in sync, you may use Go API to manage their teams.