[API] Don't send mails on user creation

Hi at all,
I have a Nextclub Instance running in version 25.0.3
I want to use the NextCloud API to import a bunch of users (using the Post mthod with …/ocs/v1.php/cloud/users) and I want to set random passwords for them and inform them later about their passwords.
I already have a script to add the users with random password to NextCloud, but at the moment the system/API always sents a mail to the user that the NextCloud account is created, and I don’t want this mail being sent, cause I want to sent my own mail later.
So my question is: Is there a way to disable this sending of mails for API requests?


Welcome to the community!

I usually setup a profiles with no email address this disables the function from what I have found.

I did not know its built in and working now until I added my own email on another user’s profile creation.

Thanks. And yes it works without email.
I solved it now by doing two requests, first POST creation of user with password and without email and then as second request PUT update which sets the email. This way no mail is send to the user.
Would be a nice addon to have a parameter -nomail or so which just turns it off.


Maybe the functionality is there under the hood at least because if you hit the gear on the users page, there’s a checkbox whether to send mail to new users.

Actually, I wonder if you uncheck this box in the UI and then create users what it will do?

@KarlF12 Thanks for that hint. I didn’t event realize that there is a gear for options :slight_smile: Unchecked the box and it works as desired :+1: