The discussion revolves around creating users via the Discourse API and the approval process.
nadermx is creating users via the API but they still need to be approved manually. blake suggests making another API request to approve the user using http://localhost:3000/admin/users/<user_id>/approve.
vikas027 tries this approach but encounters issues due to using the username instead of the user ID. blake clarifies that the user ID should be used.
vikas027 wants to avoid sending an activation email to the user. blake suggests a workaround but acknowledges it’s not ideal.
Vocino and cck197 experience issues with users not receiving verification emails when created via the API.
cck197 discovers a workaround by creating, deactivating, and reactivating the user but still encounters login issues.
blake shares a fix that allows creating active users with a single API request without email confirmation.
Right now on my discourse set up, I have it set up to invite only, admin must approve users, and allow new registrations.
The issue I am having though is when I create a user via my API I still have to log in and approve the user on the forum.
So I was wondering if I had to uncheck any of those three to be able to make the user and they are auto created but I don’t have to log in to the discourse to approve them.
I don’t want other users to be able to invite other users to join though as I am creating users based on another sites sign ups.
Thank you, I’m using pydiscourse. Didn’t know you could do approvals. I ended up having to tweak their wrapper to have it work. But now it’s working. Thank you
Sorry to necro this post but it appears to be the most relevant discussion.
I’m currently adding users via the API but they aren’t getting the verification email. Is there something I can add to the response to ensure that this email gets triggered?
I’ve seen people setting active to true but that’s what I don’t want since I want them to be pruned if they never verify. Setting it to false doesn’t seem to trigger the activation email though.
I tried adding an HTTP get to /admin/users/<user_id>/approve and the API call returns something sensible, but still I get the “You can’t log in yet” message when I attempt to log in.
Does anyone have any clues as to where I went wrong?