Create user using API. Send email with reset password

Hello. I want create new user using API but I have one problem. Gitlab do not send reset_password email after registration. For example: I doing POST Request for address: https://gitlab.com/api/v4/users
with params:
email: test@test.pl
reset_password:true
name:test1
username:test1

After that I got answer with ID etc, so gitlab registered user correctly but I don’t get any email from gitlab, so user cannot reset password and log in to gitlab.

Per Users API | GitLab

Creates a new user. Note only administrators can create new users.

Unfortunately, “normal” users on GitLab.com aren’t able to programmatically create users through the API. This isn’t because we don’t want you to have easy access - it’s just a very, very, very abuseable endpoint.

If you really do need to create users on GitLab.com automatically, the best way would be to use SCIM provisioning using SAML SSO for GitLab.com groups. This can automatically create users on your behalf in a Group that has SSO enabled. Unfortunately (at writing) this is a feature for Silver and Gold customers only.

2 Likes