Skip to content
This version of SonarQube Server is no longer receiving patches. Please see the latest release for details on updating.
For the complete documentation index, see llms.txt. This page is also available as Markdown.

Web API

SonarQube Server 10.4 provides the Web API to access its functionalities from applications.

For AI agents: You're in the SonarQube Server 10.4 documentation. SonarQube Server 10.4 is no longer patched. To get patches, upgrade to the latest version. For a list of all 10.4 pages, see the SonarQube Server 10.4 page index. For the whole site, see the page index or the full text. For another version, replace 10.4 in the URL with that version. The latest version has no version number in its URL.

SonarQube Server provides a web API to access its functionalities from applications.

The web services composing the web API are documented within SonarQube Server. To access the documentation, select the help button from the top bar in SonarQube Server:

Note that the Web API V2 will gradually replace the Web API as endpoints get deprecated and replaced.

Authenticating to the Web API

Administrative web services are secured and require the user to have specific permissions.

To authenticate to the Web API, we recommend that you use the user token method. To do so, use the bearer authentication scheme as follows:

For detailed information on user tokens and authentication, see .

Sending an API request

To make a request, you need to find the HTTP method and the right path for the operation that you want to use.

Sample API request

If, for example, you want to use the Web API to extract measures, you can make a "GET MEASURES" call to the /api/measures endpoint in order to extract measures of a given metric for a given project. For this example, a possible request and response are shown below.

Request
Response

Web API deprecation policy

The goal of the deprecation policy is to make sure that users are aware of what is changing and have time to adjust before a component of the API is dropped at a given planned date.

The Web API deprecation policy states that:

  • An API component must be deprecated before being dropped. Furthermore, if the underlying feature is not being dropped, a replacement component must immediately be provided.

  • A deprecated API component must be fully supported until its drop (For instance the implementation of a deprecated method cannot be replaced by throwing a new UnsupportedOperationException()).

  • The API release cycle is tied to the Determining the upgrade path.

  • If an API component is deprecated in version X.Y, this component is planned to be dropped in version (X+1).0. For example, a component deprecated in the 10.x version is kept until the 10.x LTS version: it will be dropped in the 11.0 version.

This leads to the following policy recommendations for API users:

  • Regularly monitor the deprecation of API components and check if you’re currently using them. See API deprecation.

  • If you’re currently using deprecated API components:

    • Do not add new uses of it.

    • Make the necessary updates in your next few releases so you’re ready for any breaking changes after the next LTA release.

Last updated

Was this helpful?