Due to GitLab coming with open signup out of the box, and me not initially noticing this, I now have 10,000+ accounts on my instance that are pure garbage. I want to delete them all.
There appears to be no bulk deletion mechanism in the web GUI.
I’ve found a way in the API to get a list of all users; great. The delete mechanism in the API is defeating me. For a sample username Fred, sample ID 4444, I have gotten “{“error”:“404 Not Found”}” from curl on all of the following URL attempts:
curl --request DELETE -H “PRIVATE-TOKEN: my-private-token” “https://gitlab.my.domain/api/v4/users/:4444/hard_delete”
curl --request DELETE -H “PRIVATE-TOKEN: my-private-token” “https://gitlab.my.domain/api/v4/users/:Fred/hard_delete”
curl --request DELETE -H “PRIVATE-TOKEN: my-private-token” “https://gitlab.my.domain/api/v4/users?id=4444&hard_delete”
curl --request DELETE -H “PRIVATE-TOKEN: my-private-token” “https://gitlab.my.domain/api/v4/users?username=Fred&hard_delete”
If I go with what is explicitly in the documentation, I get a much more detailed error message instead:
curl --request DELETE -H “PRIVATE-TOKEN: my-private-token” “https://gitlab.my.domain/users/:4444”
which boils down to “The page could not be found or you don’t have permission to view it.”.
What is an actual, proper, constructed URL for my sample user, so that the delete command will work? “DELETE /users/:id” (from Users API | GitLab) isn’t working as an example. I can extrapolate from a sample based on a given username or ID.