Create User API, force a password reset on account creation possible?

Hi All,

Just working on some integration with Discourse’s API.

In terms of Creating a user, specifically under the Post /user.json endpoint, is there any way to force a password reset email as opposed to mandating a password input on calling that specific endpoint? I’ve tried using the “staged” option, with a random password at the time of calling the /user.json endpoint when creating the user in Discourse to try and prompt an email that would force the user to set a new password. the other option here is to call the /forgot_password.json flow as soon as I create the user but just wondering if it’s possible to do this in that /users.json api as opposed to calling an additional API. i.e. something that’s not currently documented such as adding “staged” to the body.

Obviously the other option here is to go with Invite API, but that in it self has issues as only 1 invite can be issued at once per user and i’m finding people are loosing the original email sent to them by discourse. This could be fixed by the expires_at just that’s not an ideal scenario as my web hook only fires once on an event and I would have to cater for additional logic here…

Essentially the use case i’m looking at is I want to create a user, have that email of the user be sent a “setup password” flow as my application is only a backend web hook and I can’t request the user to enter a password before it fires.

Any thoughts / opinions would be greatly appreciated. If the answer is one of the options above that’s totally fine just thought I’d check as it’s late here!

Cheers!

Any thoughts by anyone?