Add user to organization via Web API


is it possible to add users to your sonarcloud organization via Web API? I only found how to add them to groups if they’re already in the organization. Maybe I’m missing something.



This is not possible at the moment since the users need to have a login footprint on our system, using a supported Identity Provider.

However, if you are using GitHub, you have the possibility to synchronize the users of the organization into SonarCloud. (You check the doc here if it’s your case)


What about users that have already a footprint in sonarcloud. Is there an existing api which allow to add members to an org?

One more question, I am using sonarcloud with the largest plan (20 M LOC) and having more than 700 apps and 5000 users. I want to automate the provisioning of projects, user groups, users and permissions, is there any existing tool for that? Or the only way is to write custom tools using th web api?


Still no answer? Just hit the same wall here… cant add the user to the default group, cant add the permission unless the user is member of the org… how can I do this via API?

1 Like

We have automated user management for all our products except for … Sonar :frowning:

We are currently in the same scenario, turns out after some analyses it seems that there is an endpoint but it is not yet documented.

We gave a quick try with:

curl -i -u ${token}: '' \
  -H 'Content-Type: application/x-www-form-urlencoded' \
  --data-raw "login=${add_user}%40gitlab&organization=${org}" 

and it worked fine.

HTTP/1.1 200 


Maybe it is missing documentation for this endpoint since it is sonarcloud only.

1 Like

Thanks for sharing this. It looks like, this API is not working for adding/removing an user when the synchronization of the organization is enabled with ALM.