We currently don’t have any public API to do the import of repositories.
If your repositories are compatible with Autoscan it should be enabled by default when you import your projects.
Otherwise I’m wondering, do you know that you can import multiple projects at once ? Does this not answer your need ? Could you clarify your use case behind the need for an API to do the import ?
Let me explain in other words. You know, we are working with microservices. And it means that you have dozens of repositories and every day we are creating a new repository. We automized the creation of repositories by integrating them with other DevSecOps tools (SNYK, Veracode, etc). So, now we want to import repo to SonarCloud immediately right after the creation of repo.
It is not the solution, because we want to add right after creation with API.
Thanks for the explanation, it seems like a valid use case that we don’t support yet and as far as I know we don’t have plan to support it either. So I suggest that you do a feature request.
And unfortunately, in the mean time, I don’t really have any solution for you…
Also to note (because it was misleading for me), you should use this API instead of /api/projects/create and not in conjunction with it, as it creates project in SonarCloud itself.