Approving an already-existing user through API?

AI-generated summary

Frank_Bailey is trying to approve 17,500 users created via the Discourse API, but they are stuck in a “pending” state. Although the API calls had “approved” set to “true”, the users were not actually approved. Frank_Bailey wants to know if there’s an API endpoint to approve the users in bulk, rather than doing it manually.

After some research, Frank_Bailey found a solution, thanks to a helpful topic zogstrip shared. The solution involves using a specific syntax to approve the users via the API.

I have created 17500 users via the Discourse API and uploaded all user avatars with the help of some very nice people here on Meta Discourse. All these users are in a “pending” state, and I would like to approve these users in bulk via the API. However, I only see an API endpoint to “activate” a user. As all my users are already active (but not approved) my question is, can I approve the users via the API, or must approval be done manually by the screenfull in the admin backend of Discourse? 17500 users will be a lot to have to approve manually.

Thanks in advance!

I must also mention here that my user creation calls already had “approved” set to “true”, however this did not actually set the users to the approved state on creation.

This topic might come handy :wink:

Thanks, that was an interesting read and very helpful.

For anyone finding this topic on the Googles, this is the syntax I used: