Auto generate password for account created through API?

The API about invitation is not well presented in the documentation… I guess I’ll have to read the code to find out how it works.

Is there a way to accept the invitation for the user and just send him the “reset password” mail ? The goal here is to easily add a willing user without asking him to set his password directly. In our case, we have a contact form on our website (with name, email and message) bearing a checkbox “register me on the forum”.

So I’d like the server handling the form to add the user to discourse though API.