How I can get the list of projects from sonarqube community server via api?

sonarqube version * Community Build v25.5.0.107428
sonarqube deploy using helm chart 

my user account has admin privilege and generated global analysis token apart from that I am not able to set any privileges for the generated token

When I try to access with valid token on postman to this api --> https://<sonar server>/api/projects/search

Getting this error
{
    "message": "Insufficient privileges"
}

How I can fix this? 

here the idea is to clean up the old projects which is stale more than 90 days. But listing the project itself throwing the error.

Hi Vinoth,

Welcome to the community! :tada: :tada: :tada:

I believe you’ll need a User Token rather than a Global Analysis Token to perform Web API actions.

You can find more details here - Authentication tokens | SonarQube Community Build Documentation

Thanks,
Aravind

Hi Aravind,

I really appreciate your immediate response,
I have created the user token and able to retrieve the projects on json.
Let me go through the document for further details..

Thank you!!!
Regards,
Vino

1 Like