Remove users script either via API or PG available?

I’m curious if it’s possible to delete users via Postgres or API?

1 Like

API definitely, you simply have to open the Dev Tools/Console of your browser, go to the Network tab, perform the action in the browser and see what calls show up in the Network tab, that will tell you how to implement it via API.

You should be able to do it via Rails Console too

2 Likes

I don’t see any documentation on what the API methods are to remove a user.

The entire Discourse platform uses the API, so if you watch what the web application does, you can see what API calls to make. Which is where the Dev Tools/Console comes in play on your browser.

3 Likes

So I’m using firefox with the Network tab open, I got the users page in the admin console, selected to open the user then clicked clear on the Network console to only monitor API calls when I click delete.

I noticed I got one GET and 2 POSTs…

http://pastebin.com/Etugzdfa

I don’t think you caught the request, it was this one

Request URL:https://_your_discourse_instance_/admin/users/18.json
Request Method:DELETE
Status Code:200 OK

As a form data of

context=/admin/users/_your_users_userid_/_username_
2 Likes