From b8d9ebc1a94519ab3a0f285945c894b31de05c9a Mon Sep 17 00:00:00 2001
From: Daniel Schwarz Each result contains: Require 'Administer System' permission or authentication with passcode
+#foreach($possibleValue in $param.possibleValues)
+ *
+#end
+#if ($param.deprecatedSince.asString)
+ * @deprecated since $param.deprecatedSince.asString
+#end
+ */
+#if ($param.deprecatedSince.asString)
+ @Deprecated
+#end
+ public $helper.requestType($webService.path.asString, $action.key.asString) ${helper.parameterSetter($param.key.asString)}($helper.setterParameterType($param.key.asString, $param.description) ${helper.setterParameter($param.key.asString)}) {
+ this.${helper.setterParameter($param.key.asString)} = ${helper.setterParameter($param.key.asString)};
+ return this;
+ }
+
+ public $helper.setterParameterType($param.key.asString, $param.description) ${helper.parameterGetter($param.key.asString)}() {
+ return ${helper.setterParameter($param.key.asString)};
+ }
+#end
+}
diff --git a/sonar-ws-generator/src/main/resources/responseClasses.config b/sonar-ws-generator/src/main/resources/responseClasses.config
new file mode 100644
index 00000000000..e69de29bb2d
diff --git a/sonar-ws-generator/src/main/resources/snapshot-of-api.json b/sonar-ws-generator/src/main/resources/snapshot-of-api.json
new file mode 100644
index 00000000000..c6f421ea15b
--- /dev/null
+++ b/sonar-ws-generator/src/main/resources/snapshot-of-api.json
@@ -0,0 +1,10672 @@
+{
+ "webServices": [
+ {
+ "path": "api/analysis_reports",
+ "description": "Get details about Compute Engine tasks.",
+ "actions": [
+ {
+ "key": "is_queue_empty",
+ "description": "Check if the queue of Compute Engine is empty",
+ "since": "5.1",
+ "internal": true,
+ "post": false,
+ "hasResponseExample": true,
+ "changelog": []
+ }
+ ]
+ },
+ {
+ "path": "api/authentication",
+ "description": "Handle authentication.",
+ "actions": [
+ {
+ "key": "login",
+ "description": "Authenticate a user.",
+ "since": "6.0",
+ "internal": false,
+ "post": true,
+ "hasResponseExample": false,
+ "changelog": [],
+ "params": [
+ {
+ "key": "login",
+ "description": "Login of the user",
+ "required": true,
+ "internal": false
+ },
+ {
+ "key": "password",
+ "description": "Password of the user",
+ "required": true,
+ "internal": false
+ }
+ ]
+ },
+ {
+ "key": "logout",
+ "description": "Logout a user.",
+ "since": "6.3",
+ "internal": false,
+ "post": true,
+ "hasResponseExample": false,
+ "changelog": []
+ },
+ {
+ "key": "validate",
+ "description": "Check credentials.",
+ "since": "3.3",
+ "internal": false,
+ "post": false,
+ "hasResponseExample": true,
+ "changelog": []
+ }
+ ]
+ },
+ {
+ "path": "api/ce",
+ "description": "Get information on Compute Engine tasks.",
+ "actions": [
+ {
+ "key": "activity",
+ "description": "Search for tasks.
Requires the system administration permission, or project administration permission if componentId is set.",
+ "since": "5.2",
+ "internal": false,
+ "post": false,
+ "hasResponseExample": true,
+ "changelog": [
+ {
+ "description": "fields \"branch\" and \"branchType\" added",
+ "version": "6.6"
+ },
+ {
+ "description": "field \"logs\" is deprecated and its value is always false",
+ "version": "6.1"
+ },
+ {
+ "description": "it's no more possible to specify the page parameter.",
+ "version": "5.5"
+ }
+ ],
+ "params": [
+ {
+ "key": "componentId",
+ "description": "Id of the component (project) to filter on",
+ "required": false,
+ "internal": false,
+ "exampleValue": "AU-TpxcA-iU5OvuD2FL0"
+ },
+ {
+ "key": "componentQuery",
+ "description": "Limit search to:
Must not be set together with componentId.
Deprecated and replaced by 'q'",
+ "required": false,
+ "internal": false,
+ "exampleValue": "Apache",
+ "deprecatedSince": "5.5"
+ },
+ {
+ "key": "maxExecutedAt",
+ "description": "Maximum date of end of task processing (inclusive)",
+ "required": false,
+ "internal": false,
+ "exampleValue": "2017-11-10T10:01:57+0100"
+ },
+ {
+ "key": "minSubmittedAt",
+ "description": "Minimum date of task submission (inclusive)",
+ "required": false,
+ "internal": false,
+ "exampleValue": "2017-11-10T10:01:57+0100"
+ },
+ {
+ "key": "onlyCurrents",
+ "description": "Filter on the last tasks (only the most recent finished task by project)",
+ "required": false,
+ "internal": false,
+ "defaultValue": "false",
+ "possibleValues": [
+ "true",
+ "false",
+ "yes",
+ "no"
+ ]
+ },
+ {
+ "key": "p",
+ "description": "Deprecated parameter",
+ "required": false,
+ "internal": false,
+ "deprecatedSince": "5.5",
+ "deprecatedKey": "pageIndex",
+ "deprecatedKeySince": "5.4"
+ },
+ {
+ "key": "ps",
+ "description": "Page size. Must be greater than 0 and less than 1000",
+ "required": false,
+ "internal": false,
+ "defaultValue": "100",
+ "exampleValue": "20",
+ "deprecatedKey": "pageSize",
+ "deprecatedKeySince": "5.2",
+ "maximumValue": 1000
+ },
+ {
+ "key": "q",
+ "description": "Limit search to:
Must not be set together with componentId",
+ "since": "5.5",
+ "required": false,
+ "internal": false,
+ "exampleValue": "Apache"
+ },
+ {
+ "key": "status",
+ "description": "Comma separated list of task statuses",
+ "required": false,
+ "internal": false,
+ "defaultValue": "SUCCESS,FAILED,CANCELED",
+ "exampleValue": "IN_PROGRESS,SUCCESS",
+ "possibleValues": [
+ "SUCCESS",
+ "FAILED",
+ "CANCELED",
+ "PENDING",
+ "IN_PROGRESS"
+ ]
+ },
+ {
+ "key": "type",
+ "description": "Task type",
+ "required": false,
+ "internal": false,
+ "exampleValue": "REPORT",
+ "possibleValues": [
+ "REPORT"
+ ]
+ }
+ ]
+ },
+ {
+ "key": "activity_status",
+ "description": "Return CE activity related metrics.
Requires 'Administer System' permission or 'Administer' rights on the specified project.",
+ "since": "5.5",
+ "internal": true,
+ "post": false,
+ "hasResponseExample": true,
+ "changelog": [
+ {
+ "description": "New field 'inProgress' in response",
+ "version": "6.6"
+ }
+ ],
+ "params": [
+ {
+ "key": "componentId",
+ "description": "Id of the component (project) to filter on",
+ "required": false,
+ "internal": false,
+ "exampleValue": "AU-TpxcA-iU5OvuD2FL0"
+ },
+ {
+ "key": "componentKey",
+ "description": "Key of the component (project) to filter on",
+ "required": false,
+ "internal": false,
+ "exampleValue": "my_project"
+ }
+ ]
+ },
+ {
+ "key": "cancel",
+ "description": "Cancels a pending task.
In-progress tasks cannot be canceled.
Requires one of the following permissions:
",
+ "since": "5.2",
+ "internal": true,
+ "post": true,
+ "hasResponseExample": false,
+ "changelog": [],
+ "params": [
+ {
+ "key": "id",
+ "description": "Id of the task to cancel.",
+ "required": true,
+ "internal": false,
+ "exampleValue": "AU-Tpxb--iU5OvuD2FLy"
+ }
+ ]
+ },
+ {
+ "key": "cancel_all",
+ "description": "Cancels all pending tasks. Requires system administration permission. In-progress tasks are not canceled.",
+ "since": "5.2",
+ "internal": true,
+ "post": true,
+ "hasResponseExample": false,
+ "changelog": []
+ },
+ {
+ "key": "component",
+ "description": "Get the pending tasks, in-progress tasks and the last executed task of a given component (usually a project).
Requires the following permission: 'Browse' on the specified component.
Either 'componentId' or 'component' must be provided.",
+ "since": "5.2",
+ "internal": false,
+ "post": false,
+ "hasResponseExample": true,
+ "changelog": [
+ {
+ "description": "fields \"branch\" and \"branchType\" added",
+ "version": "6.6"
+ },
+ {
+ "description": "field \"logs\" is deprecated and its value is always false",
+ "version": "6.1"
+ }
+ ],
+ "params": [
+ {
+ "key": "component",
+ "required": false,
+ "internal": false,
+ "exampleValue": "my_project",
+ "deprecatedKey": "componentKey",
+ "deprecatedKeySince": "6.6"
+ },
+ {
+ "key": "componentId",
+ "required": false,
+ "internal": false,
+ "exampleValue": "AU-Tpxb--iU5OvuD2FLy",
+ "deprecatedSince": "6.6"
+ }
+ ]
+ },
+ {
+ "key": "submit",
+ "description": "Submits a scanner report to the queue. Report is processed asynchronously. Requires analysis permission. If the project does not exist, then the provisioning permission is also required.",
+ "since": "5.2",
+ "internal": true,
+ "post": true,
+ "hasResponseExample": true,
+ "changelog": [],
+ "params": [
+ {
+ "key": "characteristic",
+ "description": "Optional characteristic of the analysis. Can be repeated to define multiple characteristics.",
+ "since": "6.6",
+ "required": false,
+ "internal": false,
+ "exampleValue": "branchType=long"
+ },
+ {
+ "key": "organization",
+ "description": "Key of the organization the project belongs to",
+ "since": "6.3",
+ "required": false,
+ "internal": true,
+ "exampleValue": "my-org"
+ },
+ {
+ "key": "projectBranch",
+ "description": "Optional branch of project",
+ "required": false,
+ "internal": false,
+ "exampleValue": "branch-1.x"
+ },
+ {
+ "key": "projectKey",
+ "description": "Key of project",
+ "required": true,
+ "internal": false,
+ "exampleValue": "my_project",
+ "maximumLength": 400
+ },
+ {
+ "key": "projectName",
+ "description": "Optional name of the project, used only if the project does not exist yet.",
+ "required": false,
+ "internal": false,
+ "exampleValue": "My Project",
+ "maximumLength": 2000
+ },
+ {
+ "key": "report",
+ "description": "Report file. Format is not an API, it changes among SonarQube versions.",
+ "required": true,
+ "internal": false
+ }
+ ]
+ },
+ {
+ "key": "task",
+ "description": "Give Compute Engine task details such as type, status, duration and associated component.
Requires 'Administer System' or 'Execute Analysis' permission.
Since 6.1, field \"logs\" is deprecated and its value is always false.",
+ "since": "5.2",
+ "internal": false,
+ "post": false,
+ "hasResponseExample": true,
+ "changelog": [
+ {
+ "description": "fields \"branch\" and \"branchType\" added",
+ "version": "6.6"
+ }
+ ],
+ "params": [
+ {
+ "key": "additionalFields",
+ "description": "Comma-separated list of the optional fields to be returned in response.",
+ "since": "6.1",
+ "required": false,
+ "internal": false,
+ "possibleValues": [
+ "stacktrace",
+ "scannerContext"
+ ]
+ },
+ {
+ "key": "id",
+ "description": "Id of task",
+ "required": true,
+ "internal": false,
+ "exampleValue": "AU-Tpxb--iU5OvuD2FLy"
+ }
+ ]
+ },
+ {
+ "key": "task_types",
+ "description": "List available task types",
+ "since": "5.5",
+ "internal": true,
+ "post": false,
+ "hasResponseExample": true,
+ "changelog": []
+ },
+ {
+ "key": "worker_count",
+ "description": "Return number of Compute Engine workers.
Requires the system administration permission",
+ "since": "6.5",
+ "internal": true,
+ "post": false,
+ "hasResponseExample": true,
+ "changelog": []
+ }
+ ]
+ },
+ {
+ "path": "api/components",
+ "since": "4.2",
+ "description": "Get information about a component (file, directory, project, ...) and its ancestors or descendants. Update a project or module key.",
+ "actions": [
+ {
+ "key": "app",
+ "description": "Coverage data required for rendering the component viewer.
Requires the following permission: 'Browse'.",
+ "since": "4.4",
+ "internal": true,
+ "post": false,
+ "hasResponseExample": true,
+ "changelog": [],
+ "params": [
+ {
+ "key": "branch",
+ "description": "Branch key",
+ "since": "6.6",
+ "required": false,
+ "internal": true,
+ "exampleValue": "feature/my_branch"
+ },
+ {
+ "key": "component",
+ "description": "Component key",
+ "since": "6.4",
+ "required": false,
+ "internal": false,
+ "exampleValue": "my_project"
+ },
+ {
+ "key": "componentId",
+ "description": "Component ID",
+ "required": false,
+ "internal": false,
+ "exampleValue": "AU-Tpxb--iU5OvuD2FLy",
+ "deprecatedSince": "6.4",
+ "deprecatedKey": "uuid",
+ "deprecatedKeySince": "6.4"
+ }
+ ]
+ },
+ {
+ "key": "search",
+ "description": "Search for components",
+ "since": "6.3",
+ "internal": false,
+ "post": false,
+ "hasResponseExample": true,
+ "changelog": [],
+ "params": [
+ {
+ "key": "language",
+ "description": "Language key. If provided, only components for the given language are returned.",
+ "required": false,
+ "internal": false,
+ "exampleValue": ""
+ },
+ {
+ "key": "organization",
+ "description": "Organization key",
+ "since": "6.3",
+ "required": false,
+ "internal": true,
+ "exampleValue": "my-org"
+ },
+ {
+ "key": "p",
+ "description": "1-based page number",
+ "required": false,
+ "internal": false,
+ "defaultValue": "1",
+ "exampleValue": "42",
+ "deprecatedKey": "pageIndex",
+ "deprecatedKeySince": "5.2"
+ },
+ {
+ "key": "ps",
+ "description": "Page size. Must be greater than 0.",
+ "required": false,
+ "internal": false,
+ "defaultValue": "100",
+ "exampleValue": "20",
+ "deprecatedKey": "pageSize",
+ "deprecatedKeySince": "5.2"
+ },
+ {
+ "key": "q",
+ "description": "Limit search to:
",
+ "required": false,
+ "internal": false,
+ "exampleValue": "sonar"
+ },
+ {
+ "key": "qualifiers",
+ "description": "Comma-separated list of component qualifiers. Filter the results with the specified qualifiers. Possible values are:
",
+ "required": true,
+ "internal": false,
+ "possibleValues": [
+ "BRC",
+ "DIR",
+ "FIL",
+ "TRK",
+ "UTS"
+ ]
+ }
+ ]
+ },
+ {
+ "key": "search_projects",
+ "description": "Search for projects",
+ "since": "6.2",
+ "internal": true,
+ "post": false,
+ "hasResponseExample": true,
+ "changelog": [
+ {
+ "description": "The 'filter' parameter now allows 'NO_DATA' as value for numeric metrics",
+ "version": "6.5"
+ },
+ {
+ "description": "Added the option 'analysisDate' for the 'sort' parameter",
+ "version": "6.5"
+ },
+ {
+ "description": "Value 'leakPeriodDate' is added to parameter 'f'",
+ "version": "6.5"
+ },
+ {
+ "description": "The 'languages' parameter accepts 'filter' to filter by language",
+ "version": "6.4"
+ },
+ {
+ "description": "The 'visibility' field is added",
+ "version": "6.4"
+ }
+ ],
+ "params": [
+ {
+ "key": "asc",
+ "description": "Ascending sort",
+ "required": false,
+ "internal": false,
+ "defaultValue": "true",
+ "possibleValues": [
+ "true",
+ "false",
+ "yes",
+ "no"
+ ]
+ },
+ {
+ "key": "f",
+ "description": "Comma-separated list of the fields to be returned in response",
+ "since": "6.4",
+ "required": false,
+ "internal": false,
+ "possibleValues": [
+ "analysisDate",
+ "leakPeriodDate"
+ ]
+ },
+ {
+ "key": "facets",
+ "description": "Comma-separated list of the facets to be computed. No facet is computed by default.",
+ "required": false,
+ "internal": false,
+ "possibleValues": [
+ "alert_status",
+ "coverage",
+ "duplicated_lines_density",
+ "languages",
+ "ncloc",
+ "new_coverage",
+ "new_duplicated_lines_density",
+ "new_lines",
+ "new_maintainability_rating",
+ "new_reliability_rating",
+ "new_security_rating",
+ "reliability_rating",
+ "security_rating",
+ "sqale_rating",
+ "tags"
+ ]
+ },
+ {
+ "key": "filter",
+ "description": "Filter of projects on name, key, measure value, quality gate, language, tag or whether a project is a favorite or not.
The filter must be encoded to form a valid URL (for example '=' must be replaced by '%3D').
Examples of use:
To filter on project name or key, use the 'query' keyword, for instance :
filter=\"alert_status = ERROR and isFavorite and coverage >= 60 and coverage < 80\"
filter=\"reliability_rating>=2 and security_rating>=2 and sqale_rating>=2\"
filter=\"duplicated_lines_density = NO_DATA\"
filter='query = \"Sonar\"'
.
To filter on a numeric metric, provide the metric key.
These are the supported metric keys:
To filter on a rating, provide the corresponding metric key (ex: reliability_rating for reliability rating).
The possible values are:
To filter on a Quality Gate status use the metric key 'alert_status'. Only the '=' operator can be used.
The possible values are:
To filter on language keys use the language key:
Use the WS api/languages/list to find the key of a language.
To filter on tags use the 'tag' keyword:
",
+ "required": false,
+ "internal": false
+ },
+ {
+ "key": "organization",
+ "description": "the organization to search projects in",
+ "since": "6.3",
+ "required": false,
+ "internal": true
+ },
+ {
+ "key": "p",
+ "description": "1-based page number",
+ "required": false,
+ "internal": false,
+ "defaultValue": "1",
+ "exampleValue": "42",
+ "deprecatedKey": "pageIndex",
+ "deprecatedKeySince": "5.2"
+ },
+ {
+ "key": "ps",
+ "description": "Page size. Must be greater than 0 and less than 500",
+ "required": false,
+ "internal": false,
+ "defaultValue": "100",
+ "exampleValue": "20",
+ "deprecatedKey": "pageSize",
+ "deprecatedKeySince": "5.2",
+ "maximumValue": 500
+ },
+ {
+ "key": "s",
+ "description": "Sort projects by numeric metric key, quality gate status (using 'alert_status'), last analysis date (using 'analysisDate'), or by project name.",
+ "since": "6.4",
+ "required": false,
+ "internal": false,
+ "defaultValue": "name",
+ "possibleValues": [
+ "alert_status",
+ "analysisDate",
+ "coverage",
+ "duplicated_lines_density",
+ "lines",
+ "name",
+ "ncloc",
+ "ncloc_language_distribution",
+ "new_coverage",
+ "new_duplicated_lines_density",
+ "new_lines",
+ "new_maintainability_rating",
+ "new_reliability_rating",
+ "new_security_rating",
+ "reliability_rating",
+ "security_rating",
+ "sqale_rating"
+ ]
+ }
+ ]
+ },
+ {
+ "key": "show",
+ "description": "Returns a component (file, directory, project, viewâ¦) and its ancestors. The ancestors are ordered from the parent to the root project. The 'componentId' or 'component' parameter must be provided.tag = finance
tag in (offshore, java)
Requires the following permission: 'Browse' on the project of the specified component.",
+ "since": "5.4",
+ "internal": false,
+ "post": false,
+ "hasResponseExample": true,
+ "changelog": [
+ {
+ "description": "'branch' is added to the response",
+ "version": "6.6"
+ },
+ {
+ "description": "'version' is added to the response",
+ "version": "6.6"
+ },
+ {
+ "description": "Leak period date is added to the response",
+ "version": "6.5"
+ },
+ {
+ "description": "Analysis date has been added to the response",
+ "version": "6.4"
+ },
+ {
+ "description": "The field 'id' is deprecated in the response",
+ "version": "6.4"
+ },
+ {
+ "description": "The 'visibility' field is added to the response",
+ "version": "6.4"
+ }
+ ],
+ "params": [
+ {
+ "key": "branch",
+ "description": "Branch key",
+ "since": "6.6",
+ "required": false,
+ "internal": true,
+ "exampleValue": "feature/my_branch"
+ },
+ {
+ "key": "component",
+ "description": "Component key",
+ "required": false,
+ "internal": false,
+ "exampleValue": "my_project",
+ "deprecatedKey": "key",
+ "deprecatedKeySince": "6.4"
+ },
+ {
+ "key": "componentId",
+ "description": "Component id",
+ "required": false,
+ "internal": false,
+ "exampleValue": "AU-Tpxb--iU5OvuD2FLy",
+ "deprecatedSince": "6.4",
+ "deprecatedKey": "id",
+ "deprecatedKeySince": "6.4"
+ }
+ ]
+ },
+ {
+ "key": "suggestions",
+ "description": "Internal WS for the top-right search engine. The result will contain component search results, grouped by their qualifiers.
",
+ "since": "4.2",
+ "internal": true,
+ "post": false,
+ "hasResponseExample": true,
+ "changelog": [
+ {
+ "description": "Parameter 's' is optional",
+ "version": "6.4"
+ }
+ ],
+ "params": [
+ {
+ "key": "more",
+ "description": "Category, for which to display the next 20 results (skipping the first 6 results)",
+ "since": "6.4",
+ "required": false,
+ "internal": false,
+ "possibleValues": [
+ "VW",
+ "SVW",
+ "APP",
+ "TRK",
+ "BRC",
+ "FIL",
+ "UTS"
+ ]
+ },
+ {
+ "key": "recentlyBrowsed",
+ "description": "Comma separated list of component keys, that have recently been browsed by the user. Only the first 50 items will be used. Order is not taken into account.",
+ "since": "6.4",
+ "required": false,
+ "internal": false,
+ "exampleValue": "org.sonarsource:sonarqube,some.other:project",
+ "maxValuesAllowed": 50
+ },
+ {
+ "key": "s",
+ "description": "Search query with a minimum of two characters. Can contain several search tokens, separated by spaces. Search tokens with only one character will be ignored.",
+ "required": false,
+ "internal": false,
+ "exampleValue": "sonar"
+ }
+ ]
+ },
+ {
+ "key": "tree",
+ "description": "Navigate through components based on the chosen strategy. The componentId or the component parameter must be provided.
Requires the following permission: 'Browse' on the specified project.
When limiting search with the q parameter, directories are not returned.",
+ "since": "5.4",
+ "internal": false,
+ "post": false,
+ "hasResponseExample": true,
+ "changelog": [
+ {
+ "description": "The field 'id' is deprecated in the response",
+ "version": "6.4"
+ }
+ ],
+ "params": [
+ {
+ "key": "asc",
+ "description": "Ascending sort",
+ "required": false,
+ "internal": false,
+ "defaultValue": "true",
+ "possibleValues": [
+ "true",
+ "false",
+ "yes",
+ "no"
+ ]
+ },
+ {
+ "key": "branch",
+ "description": "Branch key",
+ "since": "6.6",
+ "required": false,
+ "internal": true,
+ "exampleValue": "feature/my_branch"
+ },
+ {
+ "key": "component",
+ "description": "Base component key. The search is based on this component.",
+ "required": false,
+ "internal": false,
+ "exampleValue": "my_project",
+ "deprecatedKey": "baseComponentKey",
+ "deprecatedKeySince": "6.4"
+ },
+ {
+ "key": "componentId",
+ "description": "Base component id. The search is based on this component.",
+ "required": false,
+ "internal": false,
+ "exampleValue": "AU-TpxcA-iU5OvuD2FLz",
+ "deprecatedSince": "6.4",
+ "deprecatedKey": "baseComponentId",
+ "deprecatedKeySince": "6.4"
+ },
+ {
+ "key": "p",
+ "description": "1-based page number",
+ "required": false,
+ "internal": false,
+ "defaultValue": "1",
+ "exampleValue": "42",
+ "deprecatedKey": "pageIndex",
+ "deprecatedKeySince": "5.2"
+ },
+ {
+ "key": "ps",
+ "description": "Page size. Must be greater than 0 and less than 500",
+ "required": false,
+ "internal": false,
+ "defaultValue": "100",
+ "exampleValue": "20",
+ "deprecatedKey": "pageSize",
+ "deprecatedKeySince": "5.2",
+ "maximumValue": 500
+ },
+ {
+ "key": "q",
+ "description": "Limit search to:
Must have at least 3 characters",
+ "required": false,
+ "internal": false,
+ "exampleValue": "FILE_NAM"
+ },
+ {
+ "key": "qualifiers",
+ "description": "Comma-separated list of component qualifiers. Filter the results with the specified qualifiers. Possible values are:
",
+ "required": false,
+ "internal": false,
+ "possibleValues": [
+ "BRC",
+ "DIR",
+ "FIL",
+ "TRK",
+ "UTS"
+ ]
+ },
+ {
+ "key": "s",
+ "description": "Comma-separated list of sort fields",
+ "required": false,
+ "internal": false,
+ "defaultValue": "name",
+ "exampleValue": "name, path",
+ "deprecatedKey": "sort",
+ "deprecatedKeySince": "5.4",
+ "possibleValues": [
+ "name",
+ "path",
+ "qualifier"
+ ]
+ },
+ {
+ "key": "strategy",
+ "description": "Strategy to search for base component descendants:
",
+ "required": false,
+ "internal": false,
+ "defaultValue": "all",
+ "possibleValues": [
+ "all",
+ "children",
+ "leaves"
+ ]
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "path": "api/custom_measures",
+ "since": "5.2",
+ "description": "Manage custom measures for a project. See also api/metrics.",
+ "actions": [
+ {
+ "key": "create",
+ "description": "Create a custom measure.
The project id or the project key must be provided (only project and module custom measures can be created). The metric id or the metric key must be provided.
Requires 'Administer System' permission or 'Administer' permission on the project.",
+ "since": "5.2",
+ "internal": false,
+ "post": true,
+ "hasResponseExample": false,
+ "changelog": [],
+ "params": [
+ {
+ "key": "description",
+ "description": "Description",
+ "required": false,
+ "internal": false,
+ "exampleValue": "Team size growing."
+ },
+ {
+ "key": "metricId",
+ "description": "Metric id",
+ "required": false,
+ "internal": false,
+ "exampleValue": "16"
+ },
+ {
+ "key": "metricKey",
+ "description": "Metric key",
+ "required": false,
+ "internal": false,
+ "exampleValue": "ncloc"
+ },
+ {
+ "key": "projectId",
+ "description": "Project id",
+ "required": false,
+ "internal": false,
+ "exampleValue": "ce4c03d6-430f-40a9-b777-ad877c00aa4d"
+ },
+ {
+ "key": "projectKey",
+ "description": "Project key",
+ "required": false,
+ "internal": false,
+ "exampleValue": "my_project"
+ },
+ {
+ "key": "value",
+ "description": "Measure value. Value type depends on metric type:
",
+ "required": true,
+ "internal": false,
+ "exampleValue": "47"
+ }
+ ]
+ },
+ {
+ "key": "delete",
+ "description": "Delete a custom measure.
Requires 'Administer System' permission or 'Administer' permission on the project.",
+ "since": "5.2",
+ "internal": false,
+ "post": true,
+ "hasResponseExample": false,
+ "changelog": [],
+ "params": [
+ {
+ "key": "id",
+ "description": "Id",
+ "required": true,
+ "internal": false,
+ "exampleValue": "24"
+ }
+ ]
+ },
+ {
+ "key": "metrics",
+ "description": "List all custom metrics for which no custom measure already exists on a given project.
The project id or project key must be provided.
Requires 'Administer System' permission or 'Administer' permission on the project.",
+ "since": "5.2",
+ "internal": true,
+ "post": false,
+ "hasResponseExample": true,
+ "changelog": [],
+ "params": [
+ {
+ "key": "projectId",
+ "description": "Project id",
+ "required": false,
+ "internal": false,
+ "exampleValue": "ce4c03d6-430f-40a9-b777-ad877c00aa4d"
+ },
+ {
+ "key": "projectKey",
+ "description": "Project key",
+ "required": false,
+ "internal": false,
+ "exampleValue": "my_project"
+ }
+ ]
+ },
+ {
+ "key": "search",
+ "description": "List custom measures. The project id or project key must be provided.
Requires 'Administer System' permission or 'Administer' permission on the project.",
+ "since": "5.2",
+ "internal": false,
+ "post": false,
+ "hasResponseExample": true,
+ "changelog": [],
+ "params": [
+ {
+ "key": "f",
+ "description": "Comma-separated list of the fields to be returned in response. All the fields are returned by default.",
+ "required": false,
+ "internal": false,
+ "possibleValues": [
+ "projectId",
+ "projectKey",
+ "value",
+ "description",
+ "metric",
+ "createdAt",
+ "updatedAt",
+ "user",
+ "pending"
+ ]
+ },
+ {
+ "key": "p",
+ "description": "1-based page number",
+ "required": false,
+ "internal": false,
+ "defaultValue": "1",
+ "exampleValue": "42",
+ "deprecatedKey": "pageIndex",
+ "deprecatedKeySince": "5.2"
+ },
+ {
+ "key": "projectId",
+ "description": "Project id",
+ "required": false,
+ "internal": false,
+ "exampleValue": "ce4c03d6-430f-40a9-b777-ad877c00aa4d"
+ },
+ {
+ "key": "projectKey",
+ "description": "Project key",
+ "required": false,
+ "internal": false,
+ "exampleValue": "my_project"
+ },
+ {
+ "key": "ps",
+ "description": "Page size. Must be greater than 0 and less than 500",
+ "required": false,
+ "internal": false,
+ "defaultValue": "100",
+ "exampleValue": "20",
+ "deprecatedKey": "pageSize",
+ "deprecatedKeySince": "5.2",
+ "maximumValue": 500
+ }
+ ]
+ },
+ {
+ "key": "update",
+ "description": "Update a custom measure. Value and/or description must be provided
Requires 'Administer System' permission or 'Administer' permission on the project.",
+ "since": "5.2",
+ "internal": false,
+ "post": true,
+ "hasResponseExample": false,
+ "changelog": [],
+ "params": [
+ {
+ "key": "description",
+ "required": false,
+ "internal": false,
+ "exampleValue": "Team size growing."
+ },
+ {
+ "key": "id",
+ "description": "id",
+ "required": true,
+ "internal": false,
+ "exampleValue": "42"
+ },
+ {
+ "key": "value",
+ "description": "Measure value. Value type depends on metric type:
",
+ "required": false,
+ "internal": false,
+ "exampleValue": "true"
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "path": "api/duplications",
+ "since": "4.4",
+ "description": "Get duplication information for a project.",
+ "actions": [
+ {
+ "key": "show",
+ "description": "Get duplications. Require Browse permission on file's project",
+ "since": "4.4",
+ "internal": false,
+ "post": false,
+ "hasResponseExample": true,
+ "changelog": [
+ {
+ "description": "The fields 'uuid', 'projectUuid', 'subProjectUuid' are deprecated in the response.",
+ "version": "6.5"
+ }
+ ],
+ "params": [
+ {
+ "key": "branch",
+ "description": "Branch key",
+ "required": false,
+ "internal": true,
+ "exampleValue": "feature/my_branch"
+ },
+ {
+ "key": "key",
+ "description": "File key",
+ "required": false,
+ "internal": false,
+ "exampleValue": "my_project:/src/foo/Bar.php"
+ },
+ {
+ "key": "uuid",
+ "description": "File ID. If provided, 'key' must not be provided.",
+ "required": false,
+ "internal": false,
+ "exampleValue": "584a89f2-8037-4f7b-b82c-8b45d2d63fb2",
+ "deprecatedSince": "6.5"
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "path": "api/editions",
+ "since": "6.7",
+ "description": "Manage SonarSource commercial editions.",
+ "actions": [
+ {
+ "key": "apply_license",
+ "description": "Apply changes to SonarQube to match the specified license. Clear error message of previous automatic install of an edition, if there is any. Require 'Administer System' permission.",
+ "since": "6.7",
+ "internal": false,
+ "post": true,
+ "hasResponseExample": true,
+ "changelog": [],
+ "params": [
+ {
+ "key": "license",
+ "description": "the license",
+ "since": "6.7",
+ "required": true,
+ "internal": false
+ }
+ ]
+ },
+ {
+ "key": "clear_error_message",
+ "description": "Clear error message of last install of an edition (if any). Require 'Administer System' permission.",
+ "since": "6.7",
+ "internal": false,
+ "post": true,
+ "hasResponseExample": false,
+ "changelog": []
+ },
+ {
+ "key": "form_data",
+ "description": "Provide data to prefill license request forms: the server ID and the total number of lines of code.",
+ "since": "6.7",
+ "internal": true,
+ "post": false,
+ "hasResponseExample": true,
+ "changelog": []
+ },
+ {
+ "key": "preview",
+ "description": "Preview the changes to SonarQube to match the specified license. Requires 'Administer System' permission.",
+ "since": "6.7",
+ "internal": false,
+ "post": true,
+ "hasResponseExample": true,
+ "changelog": [],
+ "params": [
+ {
+ "key": "license",
+ "description": "the license",
+ "since": "6.7",
+ "required": true,
+ "internal": false
+ }
+ ]
+ },
+ {
+ "key": "status",
+ "description": "Provide status of SonarSource commercial edition of the current SonarQube. Requires 'Administer System' permission.",
+ "since": "6.7",
+ "internal": false,
+ "post": false,
+ "hasResponseExample": true,
+ "changelog": []
+ },
+ {
+ "key": "uninstall",
+ "description": "Uninstall the currently installed edition. Requires 'Administer System' permission.",
+ "since": "6.7",
+ "internal": false,
+ "post": true,
+ "hasResponseExample": false,
+ "changelog": []
+ }
+ ]
+ },
+ {
+ "path": "api/emails",
+ "since": "6.1",
+ "description": "Manage emails",
+ "actions": [
+ {
+ "key": "send",
+ "description": "Test email configuration by sending an email
Requires 'Administer System' permission.",
+ "since": "6.1",
+ "internal": true,
+ "post": true,
+ "hasResponseExample": false,
+ "changelog": [],
+ "params": [
+ {
+ "key": "message",
+ "description": "Content of the email",
+ "required": true,
+ "internal": false
+ },
+ {
+ "key": "subject",
+ "description": "Subject of the email",
+ "required": false,
+ "internal": false,
+ "exampleValue": "Test Message from SonarQube"
+ },
+ {
+ "key": "to",
+ "description": "Email address",
+ "required": true,
+ "internal": false,
+ "exampleValue": "john@doo.com"
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "path": "api/favorites",
+ "since": "6.3",
+ "description": "Manage user favorites",
+ "actions": [
+ {
+ "key": "add",
+ "description": "Add a component (project, directory, file etc.) as favorite for the authenticated user.
Requires authentication and the following permission: 'Browse' on the project of the specified component.",
+ "since": "6.3",
+ "internal": false,
+ "post": true,
+ "hasResponseExample": false,
+ "changelog": [],
+ "params": [
+ {
+ "key": "component",
+ "description": "Component key",
+ "required": true,
+ "internal": false,
+ "exampleValue": "my_project:/src/foo/Bar.php"
+ }
+ ]
+ },
+ {
+ "key": "remove",
+ "description": "Remove a component (project, directory, file etc.) as favorite for the authenticated user.
Requires authentication.",
+ "since": "6.3",
+ "internal": false,
+ "post": true,
+ "hasResponseExample": false,
+ "changelog": [],
+ "params": [
+ {
+ "key": "component",
+ "description": "Component key",
+ "required": true,
+ "internal": false,
+ "exampleValue": "my_project"
+ }
+ ]
+ },
+ {
+ "key": "search",
+ "description": "Search for the authenticated user favorites.
Requires authentication.",
+ "since": "6.3",
+ "internal": false,
+ "post": false,
+ "hasResponseExample": true,
+ "changelog": [],
+ "params": [
+ {
+ "key": "p",
+ "description": "1-based page number",
+ "required": false,
+ "internal": false,
+ "defaultValue": "1",
+ "exampleValue": "42",
+ "deprecatedKey": "pageIndex",
+ "deprecatedKeySince": "5.2"
+ },
+ {
+ "key": "ps",
+ "description": "Page size. Must be greater than 0 and less than 500",
+ "required": false,
+ "internal": false,
+ "defaultValue": "100",
+ "exampleValue": "20",
+ "deprecatedKey": "pageSize",
+ "deprecatedKeySince": "5.2",
+ "maximumValue": 500
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "path": "api/favourites",
+ "since": "2.6",
+ "description": "Removed since 6.3, please use api/favorites instead",
+ "actions": [
+ {
+ "key": "index",
+ "description": "The web service is removed and you're invited to use api/favorites instead",
+ "since": "2.6",
+ "deprecatedSince": "6.3",
+ "internal": false,
+ "post": false,
+ "hasResponseExample": true,
+ "changelog": []
+ }
+ ]
+ },
+ {
+ "path": "api/issues",
+ "since": "3.6",
+ "description": "Read and update issues.",
+ "actions": [
+ {
+ "key": "add_comment",
+ "description": "Add a comment.
Requires authentication and the following permission: 'Browse' on the project of the specified issue.",
+ "since": "3.6",
+ "internal": false,
+ "post": true,
+ "hasResponseExample": true,
+ "changelog": [
+ {
+ "description": "the database ids of the components are removed from the response",
+ "version": "6.5"
+ },
+ {
+ "description": "the response field components.uuid is deprecated. Use components.key instead.",
+ "version": "6.5"
+ },
+ {
+ "description": "the response returns the issue with all its details",
+ "version": "6.3"
+ }
+ ],
+ "params": [
+ {
+ "key": "issue",
+ "description": "Issue key",
+ "required": true,
+ "internal": false,
+ "exampleValue": "AU-Tpxb--iU5OvuD2FLy"
+ },
+ {
+ "key": "text",
+ "description": "Comment text",
+ "required": true,
+ "internal": false,
+ "exampleValue": "Won't fix because it doesn't apply to the context"
+ }
+ ]
+ },
+ {
+ "key": "assign",
+ "description": "Assign/Unassign an issue. Requires authentication and Browse permission on project",
+ "since": "3.6",
+ "internal": false,
+ "post": true,
+ "hasResponseExample": true,
+ "changelog": [
+ {
+ "description": "the database ids of the components are removed from the response",
+ "version": "6.5"
+ },
+ {
+ "description": "the response field components.uuid is deprecated. Use components.key instead.",
+ "version": "6.5"
+ }
+ ],
+ "params": [
+ {
+ "key": "assignee",
+ "description": "Login of the assignee. When not set, it will unassign the issue. Use '_me' to assign to current user",
+ "required": false,
+ "internal": false,
+ "exampleValue": "admin"
+ },
+ {
+ "key": "issue",
+ "description": "Issue key",
+ "required": true,
+ "internal": false,
+ "exampleValue": "AU-Tpxb--iU5OvuD2FLy"
+ },
+ {
+ "key": "me",
+ "description": "(deprecated) Assign the issue to the logged-in user. Replaced by the parameter assignee=_me",
+ "required": false,
+ "internal": false,
+ "deprecatedSince": "5.2",
+ "possibleValues": [
+ "true",
+ "false",
+ "yes",
+ "no"
+ ]
+ }
+ ]
+ },
+ {
+ "key": "authors",
+ "description": "Search SCM accounts which match a given query",
+ "since": "5.1",
+ "internal": false,
+ "post": false,
+ "hasResponseExample": true,
+ "changelog": [],
+ "params": [
+ {
+ "key": "ps",
+ "description": "The size of the list to return",
+ "required": false,
+ "internal": false,
+ "defaultValue": "10",
+ "exampleValue": "25"
+ },
+ {
+ "key": "q",
+ "description": "A pattern to match SCM accounts against",
+ "required": false,
+ "internal": false,
+ "exampleValue": "luke"
+ }
+ ]
+ },
+ {
+ "key": "bulk_change",
+ "description": "Bulk change on issues.
Requires authentication.",
+ "since": "3.7",
+ "internal": false,
+ "post": true,
+ "hasResponseExample": true,
+ "changelog": [
+ {
+ "description": "'actions' parameter is ignored",
+ "version": "6.3"
+ }
+ ],
+ "params": [
+ {
+ "key": "add_tags",
+ "description": "Add tags",
+ "required": false,
+ "internal": false,
+ "exampleValue": "security,java8",
+ "deprecatedKey": "add_tags.tags",
+ "deprecatedKeySince": "6.2"
+ },
+ {
+ "key": "assign",
+ "description": "To assign the list of issues to a specific user (login), or un-assign all the issues",
+ "required": false,
+ "internal": false,
+ "exampleValue": "john.smith",
+ "deprecatedKey": "assign.assignee",
+ "deprecatedKeySince": "6.2"
+ },
+ {
+ "key": "comment",
+ "description": "To add a comment to a list of issues",
+ "required": false,
+ "internal": false,
+ "exampleValue": "Here is my comment"
+ },
+ {
+ "key": "do_transition",
+ "description": "Transition",
+ "required": false,
+ "internal": false,
+ "exampleValue": "reopen",
+ "deprecatedKey": "do_transition.transition",
+ "deprecatedKeySince": "6.2",
+ "possibleValues": [
+ "confirm",
+ "unconfirm",
+ "reopen",
+ "resolve",
+ "falsepositive",
+ "wontfix",
+ "close"
+ ]
+ },
+ {
+ "key": "issues",
+ "description": "Comma-separated list of issue keys",
+ "required": true,
+ "internal": false,
+ "exampleValue": "AU-Tpxb--iU5OvuD2FLy,AU-TpxcA-iU5OvuD2FLz"
+ },
+ {
+ "key": "plan",
+ "description": "In 5.5, action plans are dropped. Has no effect. To plan the list of issues to a specific action plan (key), or unlink all the issues from an action plan",
+ "required": false,
+ "internal": false,
+ "deprecatedSince": "5.5"
+ },
+ {
+ "key": "remove_tags",
+ "description": "Remove tags",
+ "required": false,
+ "internal": false,
+ "exampleValue": "security,java8",
+ "deprecatedKey": "remove_tags.tags",
+ "deprecatedKeySince": "6.2"
+ },
+ {
+ "key": "sendNotifications",
+ "since": "4.0",
+ "required": false,
+ "internal": false,
+ "defaultValue": "false",
+ "possibleValues": [
+ "true",
+ "false",
+ "yes",
+ "no"
+ ]
+ },
+ {
+ "key": "set_severity",
+ "description": "To change the severity of the list of issues",
+ "required": false,
+ "internal": false,
+ "exampleValue": "BLOCKER",
+ "deprecatedKey": "set_severity.severity",
+ "deprecatedKeySince": "6.2",
+ "possibleValues": [
+ "INFO",
+ "MINOR",
+ "MAJOR",
+ "CRITICAL",
+ "BLOCKER"
+ ]
+ },
+ {
+ "key": "set_type",
+ "description": "To change the type of the list of issues",
+ "since": "5.5",
+ "required": false,
+ "internal": false,
+ "exampleValue": "BUG",
+ "deprecatedKey": "set_type.type",
+ "deprecatedKeySince": "6.2",
+ "possibleValues": [
+ "CODE_SMELL",
+ "BUG",
+ "VULNERABILITY"
+ ]
+ }
+ ]
+ },
+ {
+ "key": "changelog",
+ "description": "Display changelog of an issue.
Requires the 'Browse' permission on the project of the specified issue.",
+ "since": "4.1",
+ "internal": false,
+ "post": false,
+ "hasResponseExample": true,
+ "changelog": [
+ {
+ "description": "changes on effort is expressed with the raw value in minutes (instead of the duration previously)",
+ "version": "6.3"
+ }
+ ],
+ "params": [
+ {
+ "key": "issue",
+ "description": "Issue key",
+ "required": true,
+ "internal": false,
+ "exampleValue": "AU-Tpxb--iU5OvuD2FLy"
+ }
+ ]
+ },
+ {
+ "key": "component_tags",
+ "description": "List tags for the issues under a given component (including issues on the descendants of the component)",
+ "since": "5.1",
+ "internal": true,
+ "post": false,
+ "hasResponseExample": true,
+ "changelog": [],
+ "params": [
+ {
+ "key": "componentUuid",
+ "description": "A component UUID",
+ "required": true,
+ "internal": false,
+ "exampleValue": "7d8749e8-3070-4903-9188-bdd82933bb92"
+ },
+ {
+ "key": "createdAfter",
+ "description": "To retrieve tags on issues created after the given date (inclusive).
Either a date (server timezone) or datetime can be provided.",
+ "required": false,
+ "internal": false,
+ "exampleValue": "2017-10-19 or 2017-10-19T13:00:00+0200"
+ },
+ {
+ "key": "ps",
+ "description": "The maximum size of the list to return",
+ "required": false,
+ "internal": false,
+ "defaultValue": "10",
+ "exampleValue": "25"
+ }
+ ]
+ },
+ {
+ "key": "delete_comment",
+ "description": "Delete a comment.
Requires authentication and the following permission: 'Browse' on the project of the specified issue.",
+ "since": "3.6",
+ "internal": false,
+ "post": true,
+ "hasResponseExample": true,
+ "changelog": [
+ {
+ "description": "the response field components.uuid is deprecated. Use components.key instead.",
+ "version": "6.5"
+ },
+ {
+ "description": "the database ids of the components are removed from the response",
+ "version": "6.5"
+ },
+ {
+ "description": "the response returns the issue with all its details",
+ "version": "6.3"
+ },
+ {
+ "description": "the 'key' parameter is renamed 'comment'",
+ "version": "6.3"
+ }
+ ],
+ "params": [
+ {
+ "key": "comment",
+ "description": "Comment key",
+ "since": "6.3",
+ "required": true,
+ "internal": false,
+ "exampleValue": "AU-Tpxb--iU5OvuD2FLy",
+ "deprecatedKey": "key",
+ "deprecatedKeySince": "6.3"
+ }
+ ]
+ },
+ {
+ "key": "do_transition",
+ "description": "Do workflow transition on an issue. Requires authentication and Browse permission on project.
The transitions 'wontfix' and 'falsepositive' require the permission 'Administer Issues'.",
+ "since": "3.6",
+ "internal": false,
+ "post": true,
+ "hasResponseExample": true,
+ "changelog": [
+ {
+ "description": "the database ids of the components are removed from the response",
+ "version": "6.5"
+ },
+ {
+ "description": "the response field components.uuid is deprecated. Use components.key instead.",
+ "version": "6.5"
+ }
+ ],
+ "params": [
+ {
+ "key": "issue",
+ "description": "Issue key",
+ "required": true,
+ "internal": false,
+ "exampleValue": "AU-Tpxb--iU5OvuD2FLy"
+ },
+ {
+ "key": "transition",
+ "description": "Transition",
+ "required": true,
+ "internal": false,
+ "possibleValues": [
+ "confirm",
+ "unconfirm",
+ "reopen",
+ "resolve",
+ "falsepositive",
+ "wontfix",
+ "close"
+ ]
+ }
+ ]
+ },
+ {
+ "key": "edit_comment",
+ "description": "Edit a comment.
Requires authentication and the following permission: 'Browse' on the project of the specified issue.",
+ "since": "3.6",
+ "internal": false,
+ "post": true,
+ "hasResponseExample": true,
+ "changelog": [
+ {
+ "description": "the database ids of the components are removed from the response",
+ "version": "6.5"
+ },
+ {
+ "description": "the response field components.uuid is deprecated. Use components.key instead.",
+ "version": "6.5"
+ },
+ {
+ "description": "the response returns the issue with all its details",
+ "version": "6.3"
+ },
+ {
+ "description": "the 'key' parameter has been renamed comment",
+ "version": "6.3"
+ }
+ ],
+ "params": [
+ {
+ "key": "comment",
+ "description": "Comment key",
+ "since": "6.3",
+ "required": true,
+ "internal": false,
+ "exampleValue": "AU-Tpxb--iU5OvuD2FLy",
+ "deprecatedKey": "key",
+ "deprecatedKeySince": "6.3"
+ },
+ {
+ "key": "text",
+ "description": "Comment text",
+ "required": true,
+ "internal": false,
+ "exampleValue": "Won't fix because it doesn't apply to the context"
+ }
+ ]
+ },
+ {
+ "key": "search",
+ "description": "Search for issues.
At most one of the following parameters can be provided at the same time: componentKeys, componentUuids, components, componentRootUuids, componentRoots.
Requires the 'Browse' permission on the specified project(s).",
+ "since": "3.6",
+ "internal": false,
+ "post": false,
+ "hasResponseExample": true,
+ "changelog": [
+ {
+ "description": "parameters 'projects', 'projectUuids', 'moduleUuids', 'directories', 'fileUuids' are marked as internal",
+ "version": "6.5"
+ },
+ {
+ "description": "response field 'email' is renamed 'avatar'",
+ "version": "6.3"
+ },
+ {
+ "description": "response fields 'reporter' and 'actionPlan' are removed (drop of action plan and manual issue features)",
+ "version": "5.5"
+ },
+ {
+ "description": "parameters 'reporters', 'actionPlans' and 'planned' are dropped and therefore ignored (drop of action plan and manual issue features)",
+ "version": "5.5"
+ },
+ {
+ "description": "response field 'debt' is renamed 'effort'",
+ "version": "5.5"
+ }
+ ],
+ "params": [
+ {
+ "key": "additionalFields",
+ "description": "Comma-separated list of the optional fields to be returned in response. Action plans are dropped in 5.5, it is not returned in the response.",
+ "since": "5.2",
+ "required": false,
+ "internal": false,
+ "possibleValues": [
+ "_all",
+ "comments",
+ "languages",
+ "actionPlans",
+ "rules",
+ "transitions",
+ "actions",
+ "users"
+ ]
+ },
+ {
+ "key": "asc",
+ "description": "Ascending sort",
+ "required": false,
+ "internal": false,
+ "defaultValue": "true",
+ "possibleValues": [
+ "true",
+ "false",
+ "yes",
+ "no"
+ ]
+ },
+ {
+ "key": "assigned",
+ "description": "To retrieve assigned or unassigned issues",
+ "required": false,
+ "internal": false,
+ "possibleValues": [
+ "true",
+ "false",
+ "yes",
+ "no"
+ ]
+ },
+ {
+ "key": "assignees",
+ "description": "Comma-separated list of assignee logins. The value '__me__' can be used as a placeholder for user who performs the request",
+ "required": false,
+ "internal": false,
+ "exampleValue": "admin,usera,__me__"
+ },
+ {
+ "key": "authors",
+ "description": "Comma-separated list of SCM accounts",
+ "required": false,
+ "internal": false,
+ "exampleValue": "torvalds@linux-foundation.org"
+ },
+ {
+ "key": "branch",
+ "description": "Branch key",
+ "since": "6.6",
+ "required": false,
+ "internal": true,
+ "exampleValue": "feature/my_branch"
+ },
+ {
+ "key": "componentKeys",
+ "description": "Comma-separated list of component keys. Retrieve issues associated to a specific list of components (and all its descendants). A component can be a portfolio, project, module, directory or file.",
+ "required": false,
+ "internal": false,
+ "exampleValue": "my_project"
+ },
+ {
+ "key": "componentRootUuids",
+ "description": "If used, will have the same meaning as componentUuids AND onComponentOnly=false.",
+ "required": false,
+ "internal": false,
+ "deprecatedSince": "5.1"
+ },
+ {
+ "key": "componentRoots",
+ "description": "If used, will have the same meaning as componentKeys AND onComponentOnly=false.",
+ "required": false,
+ "internal": false,
+ "deprecatedSince": "5.1"
+ },
+ {
+ "key": "componentUuids",
+ "description": "To retrieve issues associated to a specific list of components their sub-components (comma-separated list of component IDs). This parameter is mostly used by the Issues page, please prefer usage of the componentKeys parameter. A component can be a project, module, directory or file.",
+ "required": false,
+ "internal": false,
+ "exampleValue": "584a89f2-8037-4f7b-b82c-8b45d2d63fb2",
+ "deprecatedSince": "6.5"
+ },
+ {
+ "key": "components",
+ "description": "If used, will have the same meaning as componentKeys AND onComponentOnly=true.",
+ "required": false,
+ "internal": false,
+ "deprecatedSince": "5.1"
+ },
+ {
+ "key": "createdAfter",
+ "description": "To retrieve issues created after the given date (inclusive).
Either a date (server timezone) or datetime can be provided.
If this parameter is set, createdSince must not be set",
+ "required": false,
+ "internal": false,
+ "exampleValue": "2017-10-19 or 2017-10-19T13:00:00+0200"
+ },
+ {
+ "key": "createdAt",
+ "description": "Datetime to retrieve issues created during a specific analysis",
+ "required": false,
+ "internal": false,
+ "exampleValue": "2017-10-19T13:00:00+0200"
+ },
+ {
+ "key": "createdBefore",
+ "description": "To retrieve issues created before the given date (inclusive).
Either a date (server timezone) or datetime can be provided.",
+ "required": false,
+ "internal": false,
+ "exampleValue": "2017-10-19 or 2017-10-19T13:00:00+0200"
+ },
+ {
+ "key": "createdInLast",
+ "description": "To retrieve issues created during a time span before the current time (exclusive). Accepted units are 'y' for year, 'm' for month, 'w' for week and 'd' for day. If this parameter is set, createdAfter must not be set",
+ "required": false,
+ "internal": false,
+ "exampleValue": "1m2w (1 month 2 weeks)"
+ },
+ {
+ "key": "directories",
+ "description": "To retrieve issues associated to a specific list of directories (comma-separated list of directory paths). This parameter is only meaningful when a module is selected. This parameter is mostly used by the Issues page, please prefer usage of the componentKeys parameter. ",
+ "since": "5.1",
+ "required": false,
+ "internal": true,
+ "exampleValue": "src/main/java/org/sonar/server/"
+ },
+ {
+ "key": "facetMode",
+ "description": "Choose the returned value for facet items, either count of issues or sum of debt.
Since 5.5, 'debt' mode is deprecated and replaced by 'effort'",
+ "required": false,
+ "internal": false,
+ "defaultValue": "count",
+ "possibleValues": [
+ "count",
+ "effort",
+ "debt"
+ ]
+ },
+ {
+ "key": "facets",
+ "description": "Comma-separated list of the facets to be computed. No facet is computed by default.
Since 5.5, facet 'actionPlans' is deprecated.
Since 5.5, facet 'reporters' is deprecated.",
+ "required": false,
+ "internal": false,
+ "possibleValues": [
+ "severities",
+ "statuses",
+ "resolutions",
+ "actionPlans",
+ "projectUuids",
+ "rules",
+ "assignees",
+ "assigned_to_me",
+ "reporters",
+ "authors",
+ "moduleUuids",
+ "fileUuids",
+ "directories",
+ "languages",
+ "tags",
+ "types",
+ "createdAt"
+ ]
+ },
+ {
+ "key": "fileUuids",
+ "description": "To retrieve issues associated to a specific list of files (comma-separated list of file IDs). This parameter is mostly used by the Issues page, please prefer usage of the componentKeys parameter. ",
+ "required": false,
+ "internal": true,
+ "exampleValue": "bdd82933-3070-4903-9188-7d8749e8bb92"
+ },
+ {
+ "key": "issues",
+ "description": "Comma-separated list of issue keys",
+ "required": false,
+ "internal": false,
+ "exampleValue": "5bccd6e8-f525-43a2-8d76-fcb13dde79ef"
+ },
+ {
+ "key": "languages",
+ "description": "Comma-separated list of languages. Available since 4.4",
+ "required": false,
+ "internal": false,
+ "exampleValue": "java,js"
+ },
+ {
+ "key": "moduleUuids",
+ "description": "To retrieve issues associated to a specific list of modules (comma-separated list of module IDs). This parameter is mostly used by the Issues page, please prefer usage of the componentKeys parameter. ",
+ "required": false,
+ "internal": true,
+ "exampleValue": "7d8749e8-3070-4903-9188-bdd82933bb92"
+ },
+ {
+ "key": "onComponentOnly",
+ "description": "Return only issues at a component's level, not on its descendants (modules, directories, files, etc). This parameter is only considered when componentKeys or componentUuids is set. Using the deprecated componentRoots or componentRootUuids parameters will set this parameter to false. Using the deprecated components parameter will set this parameter to true.",
+ "required": false,
+ "internal": false,
+ "defaultValue": "false",
+ "possibleValues": [
+ "true",
+ "false",
+ "yes",
+ "no"
+ ]
+ },
+ {
+ "key": "organization",
+ "description": "Organization key",
+ "since": "6.4",
+ "required": false,
+ "internal": true,
+ "exampleValue": "my-org"
+ },
+ {
+ "key": "p",
+ "description": "1-based page number",
+ "required": false,
+ "internal": false,
+ "defaultValue": "1",
+ "exampleValue": "42",
+ "deprecatedKey": "pageIndex",
+ "deprecatedKeySince": "5.2"
+ },
+ {
+ "key": "projectUuids",
+ "description": "To retrieve issues associated to a specific list of projects (comma-separated list of project IDs). This parameter is mostly used by the Issues page, please prefer usage of the componentKeys parameter. Portfolios are not supported. If this parameter is set, 'projects' must not be set.",
+ "required": false,
+ "internal": true,
+ "exampleValue": "7d8749e8-3070-4903-9188-bdd82933bb92"
+ },
+ {
+ "key": "projects",
+ "description": "To retrieve issues associated to a specific list of projects (comma-separated list of project keys). This parameter is mostly used by the Issues page, please prefer usage of the componentKeys parameter. If this parameter is set, projectUuids must not be set.",
+ "required": false,
+ "internal": true,
+ "exampleValue": "my_project",
+ "deprecatedKey": "projectKeys",
+ "deprecatedKeySince": "6.5"
+ },
+ {
+ "key": "ps",
+ "description": "Page size. Must be greater than 0 and less than 500",
+ "required": false,
+ "internal": false,
+ "defaultValue": "100",
+ "exampleValue": "20",
+ "deprecatedKey": "pageSize",
+ "deprecatedKeySince": "5.2",
+ "maximumValue": 500
+ },
+ {
+ "key": "resolutions",
+ "description": "Comma-separated list of resolutions",
+ "required": false,
+ "internal": false,
+ "exampleValue": "FIXED,REMOVED",
+ "possibleValues": [
+ "FALSE-POSITIVE",
+ "WONTFIX",
+ "FIXED",
+ "REMOVED"
+ ]
+ },
+ {
+ "key": "resolved",
+ "description": "To match resolved or unresolved issues",
+ "required": false,
+ "internal": false,
+ "possibleValues": [
+ "true",
+ "false",
+ "yes",
+ "no"
+ ]
+ },
+ {
+ "key": "rules",
+ "description": "Comma-separated list of coding rule keys. Format is <repository>:<rule>",
+ "required": false,
+ "internal": false,
+ "exampleValue": "squid:AvoidCycles"
+ },
+ {
+ "key": "s",
+ "description": "Sort field",
+ "required": false,
+ "internal": false,
+ "deprecatedKey": "sort",
+ "deprecatedKeySince": "5.4",
+ "possibleValues": [
+ "CREATION_DATE",
+ "UPDATE_DATE",
+ "CLOSE_DATE",
+ "ASSIGNEE",
+ "SEVERITY",
+ "STATUS",
+ "FILE_LINE"
+ ]
+ },
+ {
+ "key": "severities",
+ "description": "Comma-separated list of severities",
+ "required": false,
+ "internal": false,
+ "exampleValue": "BLOCKER,CRITICAL",
+ "possibleValues": [
+ "INFO",
+ "MINOR",
+ "MAJOR",
+ "CRITICAL",
+ "BLOCKER"
+ ]
+ },
+ {
+ "key": "sinceLeakPeriod",
+ "description": "To retrieve issues created since the leak period.
If this parameter is set to a truthy value, createdAfter must not be set and one component id or key must be provided.",
+ "required": false,
+ "internal": false,
+ "defaultValue": "false",
+ "possibleValues": [
+ "true",
+ "false",
+ "yes",
+ "no"
+ ]
+ },
+ {
+ "key": "statuses",
+ "description": "Comma-separated list of statuses",
+ "required": false,
+ "internal": false,
+ "exampleValue": "OPEN,REOPENED",
+ "possibleValues": [
+ "OPEN",
+ "CONFIRMED",
+ "REOPENED",
+ "RESOLVED",
+ "CLOSED"
+ ]
+ },
+ {
+ "key": "tags",
+ "description": "Comma-separated list of tags.",
+ "required": false,
+ "internal": false,
+ "exampleValue": "security,convention"
+ },
+ {
+ "key": "types",
+ "description": "Comma-separated list of types.",
+ "since": "5.5",
+ "required": false,
+ "internal": false,
+ "exampleValue": "CODE_SMELL,BUG",
+ "possibleValues": [
+ "CODE_SMELL",
+ "BUG",
+ "VULNERABILITY"
+ ]
+ }
+ ]
+ },
+ {
+ "key": "set_severity",
+ "description": "Change severity.
Requires the following permissions:
",
+ "since": "3.6",
+ "internal": false,
+ "post": true,
+ "hasResponseExample": true,
+ "changelog": [
+ {
+ "description": "the database ids of the components are removed from the response",
+ "version": "6.5"
+ },
+ {
+ "description": "the response field components.uuid is deprecated. Use components.key instead.",
+ "version": "6.5"
+ }
+ ],
+ "params": [
+ {
+ "key": "issue",
+ "description": "Issue key",
+ "required": true,
+ "internal": false,
+ "exampleValue": "AU-Tpxb--iU5OvuD2FLy"
+ },
+ {
+ "key": "severity",
+ "description": "New severity",
+ "required": true,
+ "internal": false,
+ "possibleValues": [
+ "INFO",
+ "MINOR",
+ "MAJOR",
+ "CRITICAL",
+ "BLOCKER"
+ ]
+ }
+ ]
+ },
+ {
+ "key": "set_tags",
+ "description": "Set tags on an issue.
Requires authentication and Browse permission on project",
+ "since": "5.1",
+ "internal": false,
+ "post": true,
+ "hasResponseExample": true,
+ "changelog": [
+ {
+ "description": "the database ids of the components are removed from the response",
+ "version": "6.5"
+ },
+ {
+ "description": "the response field components.uuid is deprecated. Use components.key instead.",
+ "version": "6.5"
+ },
+ {
+ "description": "response contains issue information instead of list of tags",
+ "version": "6.4"
+ }
+ ],
+ "params": [
+ {
+ "key": "issue",
+ "description": "Issue key",
+ "since": "6.3",
+ "required": true,
+ "internal": false,
+ "exampleValue": "AU-Tpxb--iU5OvuD2FLy",
+ "deprecatedKey": "key",
+ "deprecatedKeySince": "6.3"
+ },
+ {
+ "key": "tags",
+ "description": "Comma-separated list of tags. All tags are removed if parameter is empty or not set.",
+ "required": false,
+ "internal": false,
+ "exampleValue": "security,cwe,misra-c"
+ }
+ ]
+ },
+ {
+ "key": "set_type",
+ "description": "Change type of issue, for instance from 'code smell' to 'bug'.
Requires the following permissions:
",
+ "since": "5.5",
+ "internal": false,
+ "post": true,
+ "hasResponseExample": true,
+ "changelog": [
+ {
+ "description": "the database ids of the components are removed from the response",
+ "version": "6.5"
+ },
+ {
+ "description": "the response field components.uuid is deprecated. Use components.key instead.",
+ "version": "6.5"
+ }
+ ],
+ "params": [
+ {
+ "key": "issue",
+ "description": "Issue key",
+ "required": true,
+ "internal": false,
+ "exampleValue": "AU-Tpxb--iU5OvuD2FLy"
+ },
+ {
+ "key": "type",
+ "description": "New type",
+ "required": true,
+ "internal": false,
+ "possibleValues": [
+ "CODE_SMELL",
+ "BUG",
+ "VULNERABILITY"
+ ]
+ }
+ ]
+ },
+ {
+ "key": "tags",
+ "description": "List tags matching a given query",
+ "since": "5.1",
+ "internal": false,
+ "post": false,
+ "hasResponseExample": true,
+ "changelog": [],
+ "params": [
+ {
+ "key": "organization",
+ "description": "Organization key",
+ "since": "6.4",
+ "required": false,
+ "internal": true,
+ "exampleValue": "my-org"
+ },
+ {
+ "key": "ps",
+ "description": "Page size. Must be greater than 0 and less than 100",
+ "required": false,
+ "internal": false,
+ "defaultValue": "10",
+ "exampleValue": "20",
+ "deprecatedKey": "pageSize",
+ "deprecatedKeySince": "5.2",
+ "maximumValue": 100
+ },
+ {
+ "key": "q",
+ "description": "Limit search to tags that contain the supplied string.",
+ "required": false,
+ "internal": false,
+ "exampleValue": "misra"
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "path": "api/l10n",
+ "since": "4.4",
+ "description": "Manage localization.",
+ "actions": [
+ {
+ "key": "index",
+ "description": "Get all localization messages for a given locale",
+ "since": "4.4",
+ "internal": true,
+ "post": false,
+ "hasResponseExample": true,
+ "changelog": [],
+ "params": [
+ {
+ "key": "locale",
+ "description": "BCP47 language tag, used to override the browser Accept-Language header",
+ "required": false,
+ "internal": false,
+ "defaultValue": "en",
+ "exampleValue": "fr-CH"
+ },
+ {
+ "key": "ts",
+ "description": "Date of the last cache update.",
+ "required": false,
+ "internal": false,
+ "exampleValue": "2014-06-04T09:31:42+0000"
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "path": "api/languages",
+ "since": "5.1",
+ "description": "Get the list of programming languages supported in this instance.",
+ "actions": [
+ {
+ "key": "list",
+ "description": "List supported programming languages",
+ "since": "5.1",
+ "internal": false,
+ "post": false,
+ "hasResponseExample": true,
+ "changelog": [],
+ "params": [
+ {
+ "key": "ps",
+ "description": "The size of the list to return, 0 for all languages",
+ "required": false,
+ "internal": false,
+ "defaultValue": "0",
+ "exampleValue": "25"
+ },
+ {
+ "key": "q",
+ "description": "A pattern to match language keys/names against",
+ "required": false,
+ "internal": false,
+ "exampleValue": "java"
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "path": "api/measures",
+ "since": "5.4",
+ "description": "Get components or children with specified measures.",
+ "actions": [
+ {
+ "key": "component",
+ "description": "Return component with specified measures. The componentId or the component parameter must be provided.
Requires the following permission: 'Browse' on the project of specified component.",
+ "since": "5.4",
+ "internal": false,
+ "post": false,
+ "hasResponseExample": true,
+ "changelog": [
+ {
+ "description": "the response field id is deprecated. Use key instead.",
+ "version": "6.6"
+ },
+ {
+ "description": "the response field refId is deprecated. Use refKey instead.",
+ "version": "6.6"
+ }
+ ],
+ "params": [
+ {
+ "key": "additionalFields",
+ "description": "Comma-separated list of additional fields that can be returned in the response.",
+ "required": false,
+ "internal": false,
+ "exampleValue": "periods,metrics",
+ "possibleValues": [
+ "metrics",
+ "periods"
+ ]
+ },
+ {
+ "key": "branch",
+ "description": "Branch key",
+ "since": "6.6",
+ "required": false,
+ "internal": true,
+ "exampleValue": "feature/my_branch"
+ },
+ {
+ "key": "component",
+ "description": "Component key",
+ "required": false,
+ "internal": false,
+ "exampleValue": "my_project",
+ "deprecatedKey": "componentKey",
+ "deprecatedKeySince": "6.6"
+ },
+ {
+ "key": "componentId",
+ "description": "Component id",
+ "required": false,
+ "internal": false,
+ "exampleValue": "AU-Tpxb--iU5OvuD2FLy",
+ "deprecatedSince": "6.6"
+ },
+ {
+ "key": "developerId",
+ "description": "Deprecated parameter, used previously with the Developer Cockpit plugin. No measures are returned if parameter is set.",
+ "required": false,
+ "internal": false,
+ "deprecatedSince": "6.4"
+ },
+ {
+ "key": "developerKey",
+ "description": "Deprecated parameter, used previously with the Developer Cockpit plugin. No measures are returned if parameter is set.",
+ "required": false,
+ "internal": false,
+ "deprecatedSince": "6.4"
+ },
+ {
+ "key": "metricKeys",
+ "description": "Metric keys",
+ "required": true,
+ "internal": false,
+ "exampleValue": "ncloc,complexity,violations"
+ }
+ ]
+ },
+ {
+ "key": "component_tree",
+ "description": "Navigate through components based on the chosen strategy with specified measures. The baseComponentId or the component parameter must be provided.
Requires the following permission: 'Browse' on the specified project.
When limiting search with the q parameter, directories are not returned.",
+ "since": "5.4",
+ "internal": false,
+ "post": false,
+ "hasResponseExample": true,
+ "changelog": [
+ {
+ "description": "the response field id is deprecated. Use key instead.",
+ "version": "6.6"
+ },
+ {
+ "description": "the response field refId is deprecated. Use refKey instead.",
+ "version": "6.6"
+ },
+ {
+ "description": "Number of metric keys is limited to 15",
+ "version": "6.3"
+ }
+ ],
+ "params": [
+ {
+ "key": "additionalFields",
+ "description": "Comma-separated list of additional fields that can be returned in the response.",
+ "required": false,
+ "internal": false,
+ "exampleValue": "periods,metrics",
+ "possibleValues": [
+ "metrics",
+ "periods"
+ ]
+ },
+ {
+ "key": "asc",
+ "description": "Ascending sort",
+ "required": false,
+ "internal": false,
+ "defaultValue": "true",
+ "possibleValues": [
+ "true",
+ "false",
+ "yes",
+ "no"
+ ]
+ },
+ {
+ "key": "baseComponentId",
+ "description": "Base component id. The search is based on this component.",
+ "required": false,
+ "internal": false,
+ "exampleValue": "AU-TpxcA-iU5OvuD2FLz",
+ "deprecatedSince": "6.6"
+ },
+ {
+ "key": "branch",
+ "description": "Branch key",
+ "since": "6.6",
+ "required": false,
+ "internal": true,
+ "exampleValue": "feature/my_branch"
+ },
+ {
+ "key": "component",
+ "description": "Component key. The search is based on this component.",
+ "required": false,
+ "internal": false,
+ "exampleValue": "my_project",
+ "deprecatedKey": "baseComponentKey",
+ "deprecatedKeySince": "6.6"
+ },
+ {
+ "key": "developerId",
+ "description": "Deprecated parameter, used previously with the Developer Cockpit plugin. No measures are returned if parameter is set.",
+ "required": false,
+ "internal": false,
+ "deprecatedSince": "6.4"
+ },
+ {
+ "key": "developerKey",
+ "description": "Deprecated parameter, used previously with the Developer Cockpit plugin. No measures are returned if parameter is set.",
+ "required": false,
+ "internal": false,
+ "deprecatedSince": "6.4"
+ },
+ {
+ "key": "metricKeys",
+ "description": "Metric keys. Types DISTRIB, DATA are not allowed",
+ "required": true,
+ "internal": false,
+ "exampleValue": "ncloc,complexity,violations",
+ "maxValuesAllowed": 15
+ },
+ {
+ "key": "metricPeriodSort",
+ "description": "Sort measures by leak period or not ?. The 's' parameter must contain the 'metricPeriod' value.",
+ "since": "5.5",
+ "required": false,
+ "internal": false,
+ "possibleValues": [
+ "1"
+ ]
+ },
+ {
+ "key": "metricSort",
+ "description": "Metric key to sort by. The 's' parameter must contain the 'metric' or 'metricPeriod' value. It must be part of the 'metricKeys' parameter",
+ "required": false,
+ "internal": false,
+ "exampleValue": "ncloc"
+ },
+ {
+ "key": "metricSortFilter",
+ "description": "Filter components. Sort must be on a metric. Possible values are:
",
+ "required": false,
+ "internal": false,
+ "defaultValue": "all",
+ "possibleValues": [
+ "all",
+ "withMeasuresOnly"
+ ]
+ },
+ {
+ "key": "p",
+ "description": "1-based page number",
+ "required": false,
+ "internal": false,
+ "defaultValue": "1",
+ "exampleValue": "42",
+ "deprecatedKey": "pageIndex",
+ "deprecatedKeySince": "5.2"
+ },
+ {
+ "key": "ps",
+ "description": "Page size. Must be greater than 0 and less than 500",
+ "required": false,
+ "internal": false,
+ "defaultValue": "100",
+ "exampleValue": "20",
+ "deprecatedKey": "pageSize",
+ "deprecatedKeySince": "5.2",
+ "maximumValue": 500
+ },
+ {
+ "key": "q",
+ "description": "Limit search to:
Must have at least 3 characters.",
+ "required": false,
+ "internal": false,
+ "exampleValue": "FILE_NAM"
+ },
+ {
+ "key": "qualifiers",
+ "description": "Comma-separated list of component qualifiers. Filter the results with the specified qualifiers. Possible values are:
",
+ "required": false,
+ "internal": false,
+ "possibleValues": [
+ "BRC",
+ "DIR",
+ "FIL",
+ "TRK",
+ "UTS"
+ ]
+ },
+ {
+ "key": "s",
+ "description": "Comma-separated list of sort fields",
+ "required": false,
+ "internal": false,
+ "defaultValue": "name",
+ "exampleValue": "name,path",
+ "deprecatedKey": "sort",
+ "deprecatedKeySince": "5.4",
+ "possibleValues": [
+ "metric",
+ "metricPeriod",
+ "name",
+ "path",
+ "qualifier"
+ ]
+ },
+ {
+ "key": "strategy",
+ "description": "Strategy to search for base component descendants:
",
+ "required": false,
+ "internal": false,
+ "defaultValue": "all",
+ "possibleValues": [
+ "all",
+ "children",
+ "leaves"
+ ]
+ }
+ ]
+ },
+ {
+ "key": "search",
+ "description": "Search for project measures ordered by project names.
At most 100 projects can be provided.
Returns the projects with the 'Browse' permission.",
+ "since": "6.2",
+ "internal": true,
+ "post": false,
+ "hasResponseExample": true,
+ "changelog": [],
+ "params": [
+ {
+ "key": "metricKeys",
+ "description": "Metric keys",
+ "required": true,
+ "internal": false,
+ "exampleValue": "ncloc,complexity,violations"
+ },
+ {
+ "key": "projectKeys",
+ "description": "Comma-separated list of project, view or sub-view keys",
+ "required": true,
+ "internal": false,
+ "exampleValue": "my_project,another_project"
+ }
+ ]
+ },
+ {
+ "key": "search_history",
+ "description": "Search measures history of a component.
Measures are ordered chronologically.
Pagination applies to the number of measures for each metric.
Requires the following permission: 'Browse' on the specified component",
+ "since": "6.3",
+ "internal": false,
+ "post": false,
+ "hasResponseExample": true,
+ "changelog": [],
+ "params": [
+ {
+ "key": "branch",
+ "description": "Branch key",
+ "since": "6.6",
+ "required": false,
+ "internal": true,
+ "exampleValue": "feature/my_branch"
+ },
+ {
+ "key": "component",
+ "description": "Component key",
+ "required": true,
+ "internal": false,
+ "exampleValue": "my_project"
+ },
+ {
+ "key": "from",
+ "description": "Filter measures created after the given date (inclusive).
Either a date (server timezone) or datetime can be provided",
+ "required": false,
+ "internal": false,
+ "exampleValue": "2017-10-19 or 2017-10-19T13:00:00+0200"
+ },
+ {
+ "key": "metrics",
+ "description": "Comma-separated list of metric keys",
+ "required": true,
+ "internal": false,
+ "exampleValue": "ncloc,coverage,new_violations"
+ },
+ {
+ "key": "p",
+ "description": "1-based page number",
+ "required": false,
+ "internal": false,
+ "defaultValue": "1",
+ "exampleValue": "42",
+ "deprecatedKey": "pageIndex",
+ "deprecatedKeySince": "5.2"
+ },
+ {
+ "key": "ps",
+ "description": "Page size. Must be greater than 0 and less than 1000",
+ "required": false,
+ "internal": false,
+ "defaultValue": "100",
+ "exampleValue": "20",
+ "deprecatedKey": "pageSize",
+ "deprecatedKeySince": "5.2",
+ "maximumValue": 1000
+ },
+ {
+ "key": "to",
+ "description": "Filter measures created before the given date (inclusive).
Either a date (server timezone) or datetime can be provided",
+ "required": false,
+ "internal": false,
+ "exampleValue": "2017-10-19 or 2017-10-19T13:00:00+0200"
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "path": "api/metrics",
+ "since": "2.6",
+ "description": "Get information on automatic metrics, and manage custom metrics. See also api/custom_measures.",
+ "actions": [
+ {
+ "key": "create",
+ "description": "Create custom metric.
Requires 'Administer System' permission.",
+ "since": "5.2",
+ "internal": false,
+ "post": true,
+ "hasResponseExample": false,
+ "changelog": [],
+ "params": [
+ {
+ "key": "description",
+ "description": "Description",
+ "required": false,
+ "internal": false,
+ "exampleValue": "Size of the team",
+ "maximumLength": 255
+ },
+ {
+ "key": "domain",
+ "description": "Domain",
+ "required": false,
+ "internal": false,
+ "exampleValue": "Tests",
+ "maximumLength": 64
+ },
+ {
+ "key": "key",
+ "description": "Key",
+ "required": true,
+ "internal": false,
+ "exampleValue": "team_size",
+ "maximumLength": 64
+ },
+ {
+ "key": "name",
+ "description": "Name",
+ "required": true,
+ "internal": false,
+ "exampleValue": "Team Size",
+ "maximumLength": 64
+ },
+ {
+ "key": "type",
+ "description": "Metric type key",
+ "required": true,
+ "internal": false,
+ "exampleValue": "INT",
+ "possibleValues": [
+ "INT",
+ "FLOAT",
+ "PERCENT",
+ "BOOL",
+ "STRING",
+ "MILLISEC",
+ "DATA",
+ "LEVEL",
+ "DISTRIB",
+ "RATING",
+ "WORK_DUR"
+ ]
+ }
+ ]
+ },
+ {
+ "key": "delete",
+ "description": "Delete metrics and associated measures. Delete only custom metrics.
Ids or keys must be provided.
Requires 'Administer System' permission.",
+ "since": "5.2",
+ "internal": false,
+ "post": true,
+ "hasResponseExample": false,
+ "changelog": [],
+ "params": [
+ {
+ "key": "ids",
+ "description": "Metrics ids to delete.",
+ "required": false,
+ "internal": false,
+ "exampleValue": "5, 23, 42"
+ },
+ {
+ "key": "keys",
+ "description": "Metrics keys to delete",
+ "required": false,
+ "internal": false,
+ "exampleValue": "team_size, business_value"
+ }
+ ]
+ },
+ {
+ "key": "domains",
+ "description": "List all custom metric domains.",
+ "since": "5.2",
+ "internal": false,
+ "post": false,
+ "hasResponseExample": true,
+ "changelog": []
+ },
+ {
+ "key": "search",
+ "description": "Search for metrics",
+ "since": "5.2",
+ "internal": false,
+ "post": false,
+ "hasResponseExample": true,
+ "changelog": [],
+ "params": [
+ {
+ "key": "f",
+ "description": "Comma-separated list of the fields to be returned in response. All the fields are returned by default.",
+ "required": false,
+ "internal": false,
+ "possibleValues": [
+ "name",
+ "description",
+ "domain",
+ "direction",
+ "qualitative",
+ "hidden",
+ "custom",
+ "decimalScale"
+ ]
+ },
+ {
+ "key": "isCustom",
+ "description": "Choose custom metrics following 3 cases:
",
+ "required": false,
+ "internal": false,
+ "exampleValue": "true"
+ },
+ {
+ "key": "p",
+ "description": "1-based page number",
+ "required": false,
+ "internal": false,
+ "defaultValue": "1",
+ "exampleValue": "42",
+ "deprecatedKey": "pageIndex",
+ "deprecatedKeySince": "5.2"
+ },
+ {
+ "key": "ps",
+ "description": "Page size. Must be greater than 0 and less than 500",
+ "required": false,
+ "internal": false,
+ "defaultValue": "100",
+ "exampleValue": "20",
+ "deprecatedKey": "pageSize",
+ "deprecatedKeySince": "5.2",
+ "maximumValue": 500
+ }
+ ]
+ },
+ {
+ "key": "types",
+ "description": "List all available metric types.",
+ "since": "5.2",
+ "internal": false,
+ "post": false,
+ "hasResponseExample": true,
+ "changelog": []
+ },
+ {
+ "key": "update",
+ "description": "Update a custom metric.
Requires 'Administer System' permission.",
+ "since": "5.2",
+ "internal": false,
+ "post": true,
+ "hasResponseExample": false,
+ "changelog": [],
+ "params": [
+ {
+ "key": "description",
+ "description": "Description",
+ "required": false,
+ "internal": false,
+ "exampleValue": "Size of the team",
+ "maximumLength": 255
+ },
+ {
+ "key": "domain",
+ "description": "Domain",
+ "required": false,
+ "internal": false,
+ "exampleValue": "Tests",
+ "maximumLength": 64
+ },
+ {
+ "key": "id",
+ "description": "Id of the custom metric to update",
+ "required": true,
+ "internal": false,
+ "exampleValue": "42"
+ },
+ {
+ "key": "key",
+ "description": "Key",
+ "required": false,
+ "internal": false,
+ "exampleValue": "team_size",
+ "maximumLength": 64
+ },
+ {
+ "key": "name",
+ "description": "Name",
+ "required": false,
+ "internal": false,
+ "maximumLength": 64
+ },
+ {
+ "key": "type",
+ "description": "Metric type key",
+ "required": false,
+ "internal": false,
+ "exampleValue": "INT",
+ "possibleValues": [
+ "INT",
+ "FLOAT",
+ "PERCENT",
+ "BOOL",
+ "STRING",
+ "MILLISEC",
+ "DATA",
+ "LEVEL",
+ "DISTRIB",
+ "RATING",
+ "WORK_DUR"
+ ]
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "path": "api/navigation",
+ "since": "5.2",
+ "description": "Get information required to build navigation UI components",
+ "actions": [
+ {
+ "key": "component",
+ "description": "Get information concerning component navigation for the current user. Requires the 'Browse' permission on the component's project.",
+ "since": "5.2",
+ "internal": true,
+ "post": false,
+ "hasResponseExample": true,
+ "changelog": [
+ {
+ "description": "The 'visibility' field is added",
+ "version": "6.4"
+ }
+ ],
+ "params": [
+ {
+ "key": "branch",
+ "description": "Branch key",
+ "required": false,
+ "internal": true,
+ "exampleValue": "feature/my_branch"
+ },
+ {
+ "key": "component",
+ "description": "A component key.",
+ "required": false,
+ "internal": false,
+ "exampleValue": "my_project",
+ "deprecatedKey": "componentKey",
+ "deprecatedKeySince": "6.4"
+ }
+ ]
+ },
+ {
+ "key": "global",
+ "description": "Get information concerning global navigation for the current user.",
+ "since": "5.2",
+ "internal": true,
+ "post": false,
+ "hasResponseExample": true,
+ "changelog": []
+ },
+ {
+ "key": "organization",
+ "description": "Get information concerning organization navigation for the current user",
+ "since": "6.3",
+ "internal": true,
+ "post": false,
+ "hasResponseExample": true,
+ "changelog": [
+ {
+ "description": "The field 'projectVisibility' is added",
+ "version": "6.4"
+ }
+ ],
+ "params": [
+ {
+ "key": "organization",
+ "description": "the organization key",
+ "required": true,
+ "internal": false,
+ "exampleValue": "my-org"
+ }
+ ]
+ },
+ {
+ "key": "settings",
+ "description": "Get configuration information for the settings page:
",
+ "since": "5.2",
+ "internal": true,
+ "post": false,
+ "hasResponseExample": true,
+ "changelog": []
+ }
+ ]
+ },
+ {
+ "path": "api/notifications",
+ "since": "6.3",
+ "description": "Manage notifications of the authenticated user",
+ "actions": [
+ {
+ "key": "add",
+ "description": "Add a notification for the authenticated user.
Requires one of the following permissions:
",
+ "since": "6.3",
+ "internal": false,
+ "post": true,
+ "hasResponseExample": false,
+ "changelog": [],
+ "params": [
+ {
+ "key": "channel",
+ "description": "Channel through which the notification is sent. For example, notifications can be sent by email.",
+ "required": false,
+ "internal": false,
+ "defaultValue": "EmailNotificationChannel",
+ "possibleValues": [
+ "EmailNotificationChannel"
+ ]
+ },
+ {
+ "key": "login",
+ "description": "User login",
+ "since": "6.4",
+ "required": false,
+ "internal": false
+ },
+ {
+ "key": "project",
+ "description": "Project key",
+ "required": false,
+ "internal": false,
+ "exampleValue": "my_project"
+ },
+ {
+ "key": "type",
+ "description": "Notification type. Possible values are for:
",
+ "required": true,
+ "internal": false,
+ "exampleValue": "SQ-MyNewIssues"
+ }
+ ]
+ },
+ {
+ "key": "list",
+ "description": "List notifications of the authenticated user.
Requires one of the following permissions:
",
+ "since": "6.3",
+ "internal": false,
+ "post": false,
+ "hasResponseExample": true,
+ "changelog": [],
+ "params": [
+ {
+ "key": "login",
+ "description": "User login",
+ "since": "6.4",
+ "required": false,
+ "internal": false
+ }
+ ]
+ },
+ {
+ "key": "remove",
+ "description": "Remove a notification for the authenticated user.
Requires one of the following permissions:
",
+ "since": "6.3",
+ "internal": false,
+ "post": true,
+ "hasResponseExample": false,
+ "changelog": [],
+ "params": [
+ {
+ "key": "channel",
+ "description": "Channel through which the notification is sent. For example, notifications can be sent by email.",
+ "required": false,
+ "internal": false,
+ "defaultValue": "EmailNotificationChannel",
+ "possibleValues": [
+ "EmailNotificationChannel"
+ ]
+ },
+ {
+ "key": "login",
+ "description": "User login",
+ "since": "6.4",
+ "required": false,
+ "internal": false
+ },
+ {
+ "key": "project",
+ "description": "Project key",
+ "required": false,
+ "internal": false,
+ "exampleValue": "my_project"
+ },
+ {
+ "key": "type",
+ "description": "Notification type. Possible values are for:
",
+ "required": true,
+ "internal": false,
+ "exampleValue": "SQ-MyNewIssues"
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "path": "api/orchestrator",
+ "description": "Orchestrator web service",
+ "actions": [
+ {
+ "key": "reset",
+ "description": "Reset data",
+ "since": "Orchestrator 3.4",
+ "internal": true,
+ "post": true,
+ "hasResponseExample": false,
+ "changelog": []
+ }
+ ]
+ },
+ {
+ "path": "api/organizations",
+ "since": "6.2",
+ "description": "Manage organizations.",
+ "actions": [
+ {
+ "key": "add_member",
+ "description": "Add a user as a member of an organization.
Requires 'Administer System' permission on the specified organization.",
+ "since": "6.4",
+ "internal": true,
+ "post": true,
+ "hasResponseExample": true,
+ "changelog": [],
+ "params": [
+ {
+ "key": "login",
+ "description": "User login",
+ "required": true,
+ "internal": false,
+ "exampleValue": "ray.bradbury"
+ },
+ {
+ "key": "organization",
+ "description": "Organization key",
+ "required": true,
+ "internal": false,
+ "exampleValue": "my-org"
+ }
+ ]
+ },
+ {
+ "key": "create",
+ "description": "Create an organization.
Requires 'Administer System' permission unless any logged in user is allowed to create an organization (see appropriate setting). Organization support must be enabled.",
+ "since": "6.2",
+ "internal": true,
+ "post": true,
+ "hasResponseExample": true,
+ "changelog": [],
+ "params": [
+ {
+ "key": "avatar",
+ "description": "URL of the organization avatar.
It must be less than 256 chars long.",
+ "required": false,
+ "internal": false,
+ "exampleValue": "https://www.foo.com/foo.png",
+ "maximumLength": 256
+ },
+ {
+ "key": "description",
+ "description": "Description of the organization.
It must be less than 256 chars long.",
+ "required": false,
+ "internal": false,
+ "exampleValue": "The Foo company produces quality software for Bar.",
+ "maximumLength": 256
+ },
+ {
+ "key": "key",
+ "description": "Key of the organization.
The key is unique to the whole SonarQube.
When not specified, the key is computed from the name.
Otherwise, it must be between 2 and 32 chars long. All chars must be lower-case letters (a to z), digits or dash (but dash can neither be trailing nor heading)",
+ "required": false,
+ "internal": false,
+ "exampleValue": "foo-company",
+ "maximumLength": 32
+ },
+ {
+ "key": "name",
+ "description": "Name of the organization.
It must be between 2 and 64 chars longs.",
+ "required": true,
+ "internal": false,
+ "exampleValue": "Foo Company",
+ "maximumLength": 64
+ },
+ {
+ "key": "url",
+ "description": "URL of the organization.
It must be less than 256 chars long.",
+ "required": false,
+ "internal": false,
+ "exampleValue": "https://www.foo.com",
+ "maximumLength": 256
+ }
+ ]
+ },
+ {
+ "key": "delete",
+ "description": "Delete an organization.
Require 'Administer System' permission on the specified organization. Organization support must be enabled.",
+ "since": "6.2",
+ "internal": true,
+ "post": true,
+ "hasResponseExample": false,
+ "changelog": [],
+ "params": [
+ {
+ "key": "organization",
+ "description": "Organization key",
+ "required": true,
+ "internal": false,
+ "exampleValue": "foo-company",
+ "deprecatedKey": "key",
+ "deprecatedKeySince": "6.4"
+ }
+ ]
+ },
+ {
+ "key": "enable_support",
+ "description": "Enable support of organizations.
'Administer System' permission is required. The logged-in user will be flagged as root and will be able to manage organizations and other root users.",
+ "since": "6.3",
+ "internal": true,
+ "post": true,
+ "hasResponseExample": false,
+ "changelog": [
+ {
+ "description": "Create default 'Members' group",
+ "version": "6.4"
+ }
+ ]
+ },
+ {
+ "key": "remove_member",
+ "description": "Remove a member from an organization.
Requires 'Administer System' permission on the specified organization.",
+ "since": "6.4",
+ "internal": true,
+ "post": true,
+ "hasResponseExample": false,
+ "changelog": [],
+ "params": [
+ {
+ "key": "login",
+ "description": "User login",
+ "required": true,
+ "internal": false,
+ "exampleValue": "ray.bradbury"
+ },
+ {
+ "key": "organization",
+ "description": "Organization key",
+ "required": true,
+ "internal": false,
+ "exampleValue": "my-org"
+ }
+ ]
+ },
+ {
+ "key": "search",
+ "description": "Search for organizations",
+ "since": "6.2",
+ "internal": true,
+ "post": false,
+ "hasResponseExample": true,
+ "changelog": [
+ {
+ "description": "Paging fields have been added to the response",
+ "version": "6.4"
+ }
+ ],
+ "params": [
+ {
+ "key": "organizations",
+ "description": "Comma-separated list of organization keys",
+ "since": "6.3",
+ "required": false,
+ "internal": false,
+ "exampleValue": "my-org-1,foocorp"
+ },
+ {
+ "key": "p",
+ "description": "1-based page number",
+ "required": false,
+ "internal": false,
+ "defaultValue": "1",
+ "exampleValue": "42",
+ "deprecatedKey": "pageIndex",
+ "deprecatedKeySince": "5.2"
+ },
+ {
+ "key": "ps",
+ "description": "Page size. Must be greater than 0.",
+ "required": false,
+ "internal": false,
+ "defaultValue": "25",
+ "exampleValue": "20",
+ "deprecatedKey": "pageSize",
+ "deprecatedKeySince": "5.2"
+ }
+ ]
+ },
+ {
+ "key": "search_members",
+ "description": "Search members of an organization",
+ "since": "6.4",
+ "internal": true,
+ "post": false,
+ "hasResponseExample": true,
+ "changelog": [],
+ "params": [
+ {
+ "key": "organization",
+ "description": "Organization key",
+ "required": false,
+ "internal": true
+ },
+ {
+ "key": "p",
+ "description": "1-based page number",
+ "required": false,
+ "internal": false,
+ "defaultValue": "1",
+ "exampleValue": "42",
+ "deprecatedKey": "pageIndex",
+ "deprecatedKeySince": "5.2"
+ },
+ {
+ "key": "ps",
+ "description": "Page size. Must be greater than 0 and less than 500",
+ "required": false,
+ "internal": false,
+ "defaultValue": "50",
+ "exampleValue": "20",
+ "deprecatedKey": "pageSize",
+ "deprecatedKeySince": "5.2",
+ "maximumValue": 500
+ },
+ {
+ "key": "q",
+ "description": "Limit search to names or logins that contain the supplied string.",
+ "required": false,
+ "internal": false,
+ "exampleValue": "orwe"
+ },
+ {
+ "key": "selected",
+ "description": "Depending on the value, show only selected items (selected=selected) or deselected items (selected=deselected).",
+ "required": false,
+ "internal": true,
+ "defaultValue": "selected",
+ "possibleValues": [
+ "selected",
+ "deselected"
+ ]
+ }
+ ]
+ },
+ {
+ "key": "search_my_organizations",
+ "description": "List keys of the organizations for which the currently authenticated user has the System Administer permission for.",
+ "since": "6.3",
+ "internal": true,
+ "post": false,
+ "hasResponseExample": true,
+ "changelog": []
+ },
+ {
+ "key": "update",
+ "description": "Update an organization.
Require 'Administer System' permission. Organization support must be enabled.",
+ "since": "6.2",
+ "internal": true,
+ "post": true,
+ "hasResponseExample": false,
+ "changelog": [],
+ "params": [
+ {
+ "key": "avatar",
+ "description": "URL of the organization avatar.
It must be less than 256 chars long.",
+ "required": false,
+ "internal": false,
+ "exampleValue": "https://www.foo.com/foo.png",
+ "maximumLength": 256
+ },
+ {
+ "key": "description",
+ "description": "Description of the organization.
It must be less than 256 chars long.",
+ "required": false,
+ "internal": false,
+ "exampleValue": "The Foo company produces quality software for Bar.",
+ "maximumLength": 256
+ },
+ {
+ "key": "key",
+ "description": "Organization key",
+ "required": true,
+ "internal": false,
+ "exampleValue": "foo-company"
+ },
+ {
+ "key": "name",
+ "description": "Name of the organization.
It must be between 2 and 64 chars longs.",
+ "required": false,
+ "internal": false,
+ "exampleValue": "Foo Company",
+ "maximumLength": 64
+ },
+ {
+ "key": "url",
+ "description": "URL of the organization.
It must be less than 256 chars long.",
+ "required": false,
+ "internal": false,
+ "exampleValue": "https://www.foo.com",
+ "maximumLength": 256
+ }
+ ]
+ },
+ {
+ "key": "update_project_visibility",
+ "description": "Update the default visibility for new projects of the specified organization.",
+ "since": "6.4",
+ "internal": true,
+ "post": true,
+ "hasResponseExample": false,
+ "changelog": [],
+ "params": [
+ {
+ "key": "organization",
+ "description": "Organization key",
+ "required": true,
+ "internal": false,
+ "exampleValue": "foo-company"
+ },
+ {
+ "key": "projectVisibility",
+ "description": "Default visibility for projects",
+ "required": true,
+ "internal": false,
+ "possibleValues": [
+ "private",
+ "public"
+ ]
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "path": "api/permissions",
+ "since": "3.7",
+ "description": "Manage permission templates, and the granting and revoking of permissions at the global and project levels.",
+ "actions": [
+ {
+ "key": "add_group",
+ "description": "Add permission to a group.
This service defaults to global permissions, but can be limited to project permissions by providing project id or project key.
The group name or group id must be provided.
Requires one of the following permissions:
",
+ "since": "5.2",
+ "internal": false,
+ "post": true,
+ "hasResponseExample": false,
+ "changelog": [],
+ "params": [
+ {
+ "key": "groupId",
+ "description": "Group id",
+ "required": false,
+ "internal": false,
+ "exampleValue": "42"
+ },
+ {
+ "key": "groupName",
+ "description": "Group name or 'anyone' (case insensitive)",
+ "required": false,
+ "internal": false,
+ "exampleValue": "sonar-administrators"
+ },
+ {
+ "key": "organization",
+ "description": "Key of organization, used when group name is set",
+ "since": "6.2",
+ "required": false,
+ "internal": true,
+ "exampleValue": "my-org"
+ },
+ {
+ "key": "permission",
+ "description": "Permission
",
+ "required": true,
+ "internal": false
+ },
+ {
+ "key": "projectId",
+ "description": "Project id",
+ "required": false,
+ "internal": false,
+ "exampleValue": "ce4c03d6-430f-40a9-b777-ad877c00aa4d"
+ },
+ {
+ "key": "projectKey",
+ "description": "Project key",
+ "required": false,
+ "internal": false,
+ "exampleValue": "my_project"
+ }
+ ]
+ },
+ {
+ "key": "add_group_to_template",
+ "description": "Add a group to a permission template.
The group id or group name must be provided.
Requires the following permission: 'Administer System'.",
+ "since": "5.2",
+ "internal": false,
+ "post": true,
+ "hasResponseExample": false,
+ "changelog": [],
+ "params": [
+ {
+ "key": "groupId",
+ "description": "Group id",
+ "required": false,
+ "internal": false,
+ "exampleValue": "42"
+ },
+ {
+ "key": "groupName",
+ "description": "Group name or 'anyone' (case insensitive)",
+ "required": false,
+ "internal": false,
+ "exampleValue": "sonar-administrators"
+ },
+ {
+ "key": "organization",
+ "description": "Key of organization, used when group name is set",
+ "required": false,
+ "internal": true,
+ "exampleValue": "my-org"
+ },
+ {
+ "key": "permission",
+ "description": "Permission
",
+ "required": true,
+ "internal": false,
+ "possibleValues": [
+ "admin",
+ "codeviewer",
+ "issueadmin",
+ "scan",
+ "user"
+ ]
+ },
+ {
+ "key": "templateId",
+ "description": "Template id",
+ "required": false,
+ "internal": false,
+ "exampleValue": "AU-Tpxb--iU5OvuD2FLy"
+ },
+ {
+ "key": "templateName",
+ "description": "Template name",
+ "required": false,
+ "internal": false,
+ "exampleValue": "Default Permission Template for Projects"
+ }
+ ]
+ },
+ {
+ "key": "add_project_creator_to_template",
+ "description": "Add a project creator to a permission template.
Requires the following permission: 'Administer System'.",
+ "since": "6.0",
+ "internal": false,
+ "post": true,
+ "hasResponseExample": false,
+ "changelog": [],
+ "params": [
+ {
+ "key": "organization",
+ "description": "Key of organization, used when group name is set",
+ "required": false,
+ "internal": true,
+ "exampleValue": "my-org"
+ },
+ {
+ "key": "permission",
+ "description": "Permission
",
+ "required": true,
+ "internal": false,
+ "possibleValues": [
+ "admin",
+ "codeviewer",
+ "issueadmin",
+ "scan",
+ "user"
+ ]
+ },
+ {
+ "key": "templateId",
+ "description": "Template id",
+ "required": false,
+ "internal": false,
+ "exampleValue": "AU-Tpxb--iU5OvuD2FLy"
+ },
+ {
+ "key": "templateName",
+ "description": "Template name",
+ "required": false,
+ "internal": false,
+ "exampleValue": "Default Permission Template for Projects"
+ }
+ ]
+ },
+ {
+ "key": "add_user",
+ "description": "Add permission to a user.
This service defaults to global permissions, but can be limited to project permissions by providing project id or project key.
Requires one of the following permissions:
",
+ "since": "5.2",
+ "internal": false,
+ "post": true,
+ "hasResponseExample": false,
+ "changelog": [],
+ "params": [
+ {
+ "key": "login",
+ "description": "User login",
+ "required": true,
+ "internal": false,
+ "exampleValue": "g.hopper"
+ },
+ {
+ "key": "organization",
+ "description": "Key of organization, cannot be used at the same time with projectId and projectKey",
+ "since": "6.2",
+ "required": false,
+ "internal": true,
+ "exampleValue": "my-org"
+ },
+ {
+ "key": "permission",
+ "description": "Permission
",
+ "required": true,
+ "internal": false
+ },
+ {
+ "key": "projectId",
+ "description": "Project id",
+ "required": false,
+ "internal": false,
+ "exampleValue": "ce4c03d6-430f-40a9-b777-ad877c00aa4d"
+ },
+ {
+ "key": "projectKey",
+ "description": "Project key",
+ "required": false,
+ "internal": false,
+ "exampleValue": "my_project"
+ }
+ ]
+ },
+ {
+ "key": "add_user_to_template",
+ "description": "Add a user to a permission template.
Requires the following permission: 'Administer System'.",
+ "since": "5.2",
+ "internal": false,
+ "post": true,
+ "hasResponseExample": false,
+ "changelog": [],
+ "params": [
+ {
+ "key": "login",
+ "description": "User login",
+ "required": true,
+ "internal": false,
+ "exampleValue": "g.hopper"
+ },
+ {
+ "key": "organization",
+ "description": "Key of organization, used when group name is set",
+ "required": false,
+ "internal": true,
+ "exampleValue": "my-org"
+ },
+ {
+ "key": "permission",
+ "description": "Permission
",
+ "required": true,
+ "internal": false,
+ "possibleValues": [
+ "admin",
+ "codeviewer",
+ "issueadmin",
+ "scan",
+ "user"
+ ]
+ },
+ {
+ "key": "templateId",
+ "description": "Template id",
+ "required": false,
+ "internal": false,
+ "exampleValue": "AU-Tpxb--iU5OvuD2FLy"
+ },
+ {
+ "key": "templateName",
+ "description": "Template name",
+ "required": false,
+ "internal": false,
+ "exampleValue": "Default Permission Template for Projects"
+ }
+ ]
+ },
+ {
+ "key": "apply_template",
+ "description": "Apply a permission template to one project.
The project id or project key must be provided.
The template id or name must be provided.
Requires the following permission: 'Administer System'.",
+ "since": "5.2",
+ "internal": false,
+ "post": true,
+ "hasResponseExample": false,
+ "changelog": [],
+ "params": [
+ {
+ "key": "organization",
+ "description": "Key of organization, used when group name is set",
+ "required": false,
+ "internal": true,
+ "exampleValue": "my-org"
+ },
+ {
+ "key": "projectId",
+ "description": "Project id",
+ "required": false,
+ "internal": false,
+ "exampleValue": "ce4c03d6-430f-40a9-b777-ad877c00aa4d"
+ },
+ {
+ "key": "projectKey",
+ "description": "Project key",
+ "required": false,
+ "internal": false,
+ "exampleValue": "my_project"
+ },
+ {
+ "key": "templateId",
+ "description": "Template id",
+ "required": false,
+ "internal": false,
+ "exampleValue": "AU-Tpxb--iU5OvuD2FLy"
+ },
+ {
+ "key": "templateName",
+ "description": "Template name",
+ "required": false,
+ "internal": false,
+ "exampleValue": "Default Permission Template for Projects"
+ }
+ ]
+ },
+ {
+ "key": "bulk_apply_template",
+ "description": "Apply a permission template to several projects.
The template id or name must be provided.
Requires the following permission: 'Administer System'.",
+ "since": "5.5",
+ "internal": false,
+ "post": true,
+ "hasResponseExample": false,
+ "changelog": [],
+ "params": [
+ {
+ "key": "analyzedBefore",
+ "description": "Filter the projects for which last analysis is older than the given date (exclusive).
Either a date (server timezone) or datetime can be provided.",
+ "since": "6.6",
+ "required": false,
+ "internal": false,
+ "exampleValue": "2017-10-19 or 2017-10-19T13:00:00+0200"
+ },
+ {
+ "key": "onProvisionedOnly",
+ "description": "Filter the projects that are provisioned",
+ "since": "6.6",
+ "required": false,
+ "internal": false,
+ "defaultValue": "false",
+ "possibleValues": [
+ "true",
+ "false",
+ "yes",
+ "no"
+ ]
+ },
+ {
+ "key": "organization",
+ "description": "Key of organization, used when group name is set",
+ "required": false,
+ "internal": true,
+ "exampleValue": "my-org"
+ },
+ {
+ "key": "projects",
+ "description": "Comma-separated list of project keys",
+ "since": "6.6",
+ "required": false,
+ "internal": false,
+ "exampleValue": "my_project,another_project"
+ },
+ {
+ "key": "q",
+ "description": "Limit search to:
",
+ "required": false,
+ "internal": false,
+ "exampleValue": "apac"
+ },
+ {
+ "key": "qualifiers",
+ "description": "Comma-separated list of component qualifiers. Filter the results with the specified qualifiers. Possible values are:
",
+ "required": false,
+ "internal": false,
+ "defaultValue": "TRK",
+ "deprecatedKey": "qualifier",
+ "deprecatedKeySince": "6.6",
+ "possibleValues": [
+ "TRK"
+ ]
+ },
+ {
+ "key": "templateId",
+ "description": "Template id",
+ "required": false,
+ "internal": false,
+ "exampleValue": "AU-Tpxb--iU5OvuD2FLy"
+ },
+ {
+ "key": "templateName",
+ "description": "Template name",
+ "required": false,
+ "internal": false,
+ "exampleValue": "Default Permission Template for Projects"
+ },
+ {
+ "key": "visibility",
+ "description": "Filter the projects that should be visible to everyone (public), or only specific user/groups (private).
If no visibility is specified, the default project visibility of the organization will be used.",
+ "since": "6.6",
+ "required": false,
+ "internal": true,
+ "possibleValues": [
+ "private",
+ "public"
+ ]
+ }
+ ]
+ },
+ {
+ "key": "create_template",
+ "description": "Create a permission template.
Requires the following permission: 'Administer System'.",
+ "since": "5.2",
+ "internal": false,
+ "post": true,
+ "hasResponseExample": true,
+ "changelog": [],
+ "params": [
+ {
+ "key": "description",
+ "description": "Description",
+ "required": false,
+ "internal": false,
+ "exampleValue": "Permissions for all projects related to the financial service"
+ },
+ {
+ "key": "name",
+ "description": "Name",
+ "required": true,
+ "internal": false,
+ "exampleValue": "Financial Service Permissions"
+ },
+ {
+ "key": "organization",
+ "description": "Key of organization, used when group name is set",
+ "since": "6.2",
+ "required": false,
+ "internal": true,
+ "exampleValue": "my-org"
+ },
+ {
+ "key": "projectKeyPattern",
+ "description": "Project key pattern. Must be a valid Java regular expression",
+ "required": false,
+ "internal": false,
+ "exampleValue": ".*\\.finance\\..*"
+ }
+ ]
+ },
+ {
+ "key": "delete_template",
+ "description": "Delete a permission template.
Requires the following permission: 'Administer System'.",
+ "since": "5.2",
+ "internal": false,
+ "post": true,
+ "hasResponseExample": false,
+ "changelog": [],
+ "params": [
+ {
+ "key": "organization",
+ "description": "Key of organization, used when group name is set",
+ "required": false,
+ "internal": true,
+ "exampleValue": "my-org"
+ },
+ {
+ "key": "templateId",
+ "description": "Template id",
+ "required": false,
+ "internal": false,
+ "exampleValue": "AU-Tpxb--iU5OvuD2FLy"
+ },
+ {
+ "key": "templateName",
+ "description": "Template name",
+ "required": false,
+ "internal": false,
+ "exampleValue": "Default Permission Template for Projects"
+ }
+ ]
+ },
+ {
+ "key": "groups",
+ "description": "Limit search to group names that contain the supplied string. Must have at least 3 characters.
When this parameter is not set, only groups having at least one permission are returned.",
+ "since": "5.2",
+ "internal": true,
+ "post": false,
+ "hasResponseExample": true,
+ "changelog": [],
+ "params": [
+ {
+ "key": "organization",
+ "description": "Key of organization, used when group name is set",
+ "since": "6.2",
+ "required": false,
+ "internal": true,
+ "exampleValue": "my-org"
+ },
+ {
+ "key": "p",
+ "description": "1-based page number",
+ "required": false,
+ "internal": false,
+ "defaultValue": "1",
+ "exampleValue": "42",
+ "deprecatedKey": "pageIndex",
+ "deprecatedKeySince": "5.2"
+ },
+ {
+ "key": "permission",
+ "description": "Permission
",
+ "required": false,
+ "internal": false
+ },
+ {
+ "key": "projectId",
+ "description": "Project id",
+ "required": false,
+ "internal": false,
+ "exampleValue": "ce4c03d6-430f-40a9-b777-ad877c00aa4d"
+ },
+ {
+ "key": "projectKey",
+ "description": "Project key",
+ "required": false,
+ "internal": false,
+ "exampleValue": "my_project"
+ },
+ {
+ "key": "ps",
+ "description": "Page size. Must be greater than 0 and less than 100",
+ "required": false,
+ "internal": false,
+ "defaultValue": "20",
+ "exampleValue": "20",
+ "deprecatedKey": "pageSize",
+ "deprecatedKeySince": "5.2",
+ "maximumValue": 100
+ },
+ {
+ "key": "q",
+ "description": "Limit search to names that contain the supplied string.",
+ "required": false,
+ "internal": false,
+ "exampleValue": "sonar"
+ }
+ ]
+ },
+ {
+ "key": "remove_group",
+ "description": "Remove a permission from a group.
This service defaults to global permissions, but can be limited to project permissions by providing project id or project key.
The group id or group name must be provided, not both.
Requires one of the following permissions:
",
+ "since": "5.2",
+ "internal": false,
+ "post": true,
+ "hasResponseExample": false,
+ "changelog": [],
+ "params": [
+ {
+ "key": "groupId",
+ "description": "Group id",
+ "required": false,
+ "internal": false,
+ "exampleValue": "42"
+ },
+ {
+ "key": "groupName",
+ "description": "Group name or 'anyone' (case insensitive)",
+ "required": false,
+ "internal": false,
+ "exampleValue": "sonar-administrators"
+ },
+ {
+ "key": "organization",
+ "description": "Key of organization, used when group name is set",
+ "since": "6.2",
+ "required": false,
+ "internal": true,
+ "exampleValue": "my-org"
+ },
+ {
+ "key": "permission",
+ "description": "Permission
",
+ "required": true,
+ "internal": false
+ },
+ {
+ "key": "projectId",
+ "description": "Project id",
+ "required": false,
+ "internal": false,
+ "exampleValue": "ce4c03d6-430f-40a9-b777-ad877c00aa4d"
+ },
+ {
+ "key": "projectKey",
+ "description": "Project key",
+ "required": false,
+ "internal": false,
+ "exampleValue": "my_project"
+ }
+ ]
+ },
+ {
+ "key": "remove_group_from_template",
+ "description": "Remove a group from a permission template.
The group id or group name must be provided.
Requires the following permission: 'Administer System'.",
+ "since": "5.2",
+ "internal": false,
+ "post": true,
+ "hasResponseExample": false,
+ "changelog": [],
+ "params": [
+ {
+ "key": "groupId",
+ "description": "Group id",
+ "required": false,
+ "internal": false,
+ "exampleValue": "42"
+ },
+ {
+ "key": "groupName",
+ "description": "Group name or 'anyone' (case insensitive)",
+ "required": false,
+ "internal": false,
+ "exampleValue": "sonar-administrators"
+ },
+ {
+ "key": "organization",
+ "description": "Key of organization, used when group name is set",
+ "required": false,
+ "internal": true,
+ "exampleValue": "my-org"
+ },
+ {
+ "key": "permission",
+ "description": "Permission
",
+ "required": true,
+ "internal": false,
+ "possibleValues": [
+ "admin",
+ "codeviewer",
+ "issueadmin",
+ "scan",
+ "user"
+ ]
+ },
+ {
+ "key": "templateId",
+ "description": "Template id",
+ "required": false,
+ "internal": false,
+ "exampleValue": "AU-Tpxb--iU5OvuD2FLy"
+ },
+ {
+ "key": "templateName",
+ "description": "Template name",
+ "required": false,
+ "internal": false,
+ "exampleValue": "Default Permission Template for Projects"
+ }
+ ]
+ },
+ {
+ "key": "remove_project_creator_from_template",
+ "description": "Remove a project creator from a permission template.
Requires the following permission: 'Administer System'.",
+ "since": "6.0",
+ "internal": false,
+ "post": true,
+ "hasResponseExample": false,
+ "changelog": [],
+ "params": [
+ {
+ "key": "organization",
+ "description": "Key of organization, used when group name is set",
+ "required": false,
+ "internal": true,
+ "exampleValue": "my-org"
+ },
+ {
+ "key": "permission",
+ "description": "Permission
",
+ "required": true,
+ "internal": false,
+ "possibleValues": [
+ "admin",
+ "codeviewer",
+ "issueadmin",
+ "scan",
+ "user"
+ ]
+ },
+ {
+ "key": "templateId",
+ "description": "Template id",
+ "required": false,
+ "internal": false,
+ "exampleValue": "AU-Tpxb--iU5OvuD2FLy"
+ },
+ {
+ "key": "templateName",
+ "description": "Template name",
+ "required": false,
+ "internal": false,
+ "exampleValue": "Default Permission Template for Projects"
+ }
+ ]
+ },
+ {
+ "key": "remove_user",
+ "description": "Remove permission from a user.
This service defaults to global permissions, but can be limited to project permissions by providing project id or project key.
Requires one of the following permissions:
",
+ "since": "5.2",
+ "internal": false,
+ "post": true,
+ "hasResponseExample": false,
+ "changelog": [],
+ "params": [
+ {
+ "key": "login",
+ "description": "User login",
+ "required": true,
+ "internal": false,
+ "exampleValue": "g.hopper"
+ },
+ {
+ "key": "organization",
+ "description": "Key of organization, used when group name is set",
+ "since": "6.2",
+ "required": false,
+ "internal": true,
+ "exampleValue": "my-org"
+ },
+ {
+ "key": "permission",
+ "description": "Permission
",
+ "required": true,
+ "internal": false
+ },
+ {
+ "key": "projectId",
+ "description": "Project id",
+ "required": false,
+ "internal": false,
+ "exampleValue": "ce4c03d6-430f-40a9-b777-ad877c00aa4d"
+ },
+ {
+ "key": "projectKey",
+ "description": "Project key",
+ "required": false,
+ "internal": false,
+ "exampleValue": "my_project"
+ }
+ ]
+ },
+ {
+ "key": "remove_user_from_template",
+ "description": "Remove a user from a permission template.
Requires the following permission: 'Administer System'.",
+ "since": "5.2",
+ "internal": false,
+ "post": true,
+ "hasResponseExample": false,
+ "changelog": [],
+ "params": [
+ {
+ "key": "login",
+ "description": "User login",
+ "required": true,
+ "internal": false,
+ "exampleValue": "g.hopper"
+ },
+ {
+ "key": "organization",
+ "description": "Key of organization, used when group name is set",
+ "required": false,
+ "internal": true,
+ "exampleValue": "my-org"
+ },
+ {
+ "key": "permission",
+ "description": "Permission
",
+ "required": true,
+ "internal": false,
+ "possibleValues": [
+ "admin",
+ "codeviewer",
+ "issueadmin",
+ "scan",
+ "user"
+ ]
+ },
+ {
+ "key": "templateId",
+ "description": "Template id",
+ "required": false,
+ "internal": false,
+ "exampleValue": "AU-Tpxb--iU5OvuD2FLy"
+ },
+ {
+ "key": "templateName",
+ "description": "Template name",
+ "required": false,
+ "internal": false,
+ "exampleValue": "Default Permission Template for Projects"
+ }
+ ]
+ },
+ {
+ "key": "search_global_permissions",
+ "description": "List global permissions.
Requires the following permission: 'Administer System'",
+ "since": "5.2",
+ "deprecatedSince": "6.5",
+ "internal": false,
+ "post": false,
+ "hasResponseExample": true,
+ "changelog": [],
+ "params": [
+ {
+ "key": "organization",
+ "description": "Key of organization, used when group name is set",
+ "since": "6.2",
+ "required": false,
+ "internal": true,
+ "exampleValue": "my-org"
+ }
+ ]
+ },
+ {
+ "key": "search_project_permissions",
+ "description": "List project permissions. A project can be a technical project, a view or a developer.
Requires one of the following permissions:
",
+ "since": "5.2",
+ "deprecatedSince": "6.5",
+ "internal": false,
+ "post": false,
+ "hasResponseExample": true,
+ "changelog": [],
+ "params": [
+ {
+ "key": "p",
+ "description": "1-based page number",
+ "required": false,
+ "internal": false,
+ "defaultValue": "1",
+ "exampleValue": "42",
+ "deprecatedKey": "pageIndex",
+ "deprecatedKeySince": "5.2"
+ },
+ {
+ "key": "projectId",
+ "description": "Project id",
+ "required": false,
+ "internal": false,
+ "exampleValue": "ce4c03d6-430f-40a9-b777-ad877c00aa4d"
+ },
+ {
+ "key": "projectKey",
+ "description": "Project key",
+ "required": false,
+ "internal": false,
+ "exampleValue": "my_project"
+ },
+ {
+ "key": "ps",
+ "description": "Page size. Must be greater than 0.",
+ "required": false,
+ "internal": false,
+ "defaultValue": "25",
+ "exampleValue": "20",
+ "deprecatedKey": "pageSize",
+ "deprecatedKeySince": "5.2"
+ },
+ {
+ "key": "q",
+ "description": "Limit search to:
",
+ "required": false,
+ "internal": false,
+ "exampleValue": "apac"
+ },
+ {
+ "key": "qualifier",
+ "description": "Project qualifier. Filter the results with the specified qualifier. Possible values are:
",
+ "since": "5.3",
+ "required": false,
+ "internal": false,
+ "possibleValues": [
+ "TRK"
+ ]
+ }
+ ]
+ },
+ {
+ "key": "search_templates",
+ "description": "List permission templates.
Requires the following permission: 'Administer System'.",
+ "since": "5.2",
+ "internal": false,
+ "post": false,
+ "hasResponseExample": true,
+ "changelog": [],
+ "params": [
+ {
+ "key": "organization",
+ "description": "Key of organization, used when group name is set",
+ "since": "6.2",
+ "required": false,
+ "internal": true,
+ "exampleValue": "my-org"
+ },
+ {
+ "key": "q",
+ "description": "Limit search to permission template names that contain the supplied string.",
+ "required": false,
+ "internal": false,
+ "exampleValue": "defau"
+ }
+ ]
+ },
+ {
+ "key": "set_default_template",
+ "description": "Set a permission template as default.
Requires the following permission: 'Administer System'.",
+ "since": "5.2",
+ "internal": false,
+ "post": true,
+ "hasResponseExample": false,
+ "changelog": [],
+ "params": [
+ {
+ "key": "organization",
+ "description": "Key of organization, used when group name is set",
+ "required": false,
+ "internal": true,
+ "exampleValue": "my-org"
+ },
+ {
+ "key": "qualifier",
+ "description": "Project qualifier. Filter the results with the specified qualifier. Possible values are:
",
+ "required": false,
+ "internal": false,
+ "defaultValue": "TRK",
+ "possibleValues": [
+ "TRK"
+ ]
+ },
+ {
+ "key": "templateId",
+ "description": "Template id",
+ "required": false,
+ "internal": false,
+ "exampleValue": "AU-Tpxb--iU5OvuD2FLy"
+ },
+ {
+ "key": "templateName",
+ "description": "Template name",
+ "required": false,
+ "internal": false,
+ "exampleValue": "Default Permission Template for Projects"
+ }
+ ]
+ },
+ {
+ "key": "template_groups",
+ "description": "Lists the groups with their permission as individual groups rather than through user affiliation on the chosen template.
This service defaults to all groups, but can be limited to groups with a specific permission by providing the desired permission.
Requires the following permission: 'Administer System'.",
+ "since": "5.2",
+ "internal": true,
+ "post": false,
+ "hasResponseExample": true,
+ "changelog": [],
+ "params": [
+ {
+ "key": "organization",
+ "description": "Key of organization, used when group name is set",
+ "required": false,
+ "internal": true,
+ "exampleValue": "my-org"
+ },
+ {
+ "key": "p",
+ "description": "1-based page number",
+ "required": false,
+ "internal": false,
+ "defaultValue": "1",
+ "exampleValue": "42",
+ "deprecatedKey": "pageIndex",
+ "deprecatedKeySince": "5.2"
+ },
+ {
+ "key": "permission",
+ "description": "Permission
",
+ "required": true,
+ "internal": false,
+ "possibleValues": [
+ "admin",
+ "codeviewer",
+ "issueadmin",
+ "scan",
+ "user"
+ ]
+ },
+ {
+ "key": "ps",
+ "description": "Page size. Must be greater than 0 and less than 100",
+ "required": false,
+ "internal": false,
+ "defaultValue": "20",
+ "exampleValue": "20",
+ "deprecatedKey": "pageSize",
+ "deprecatedKeySince": "5.2",
+ "maximumValue": 100
+ },
+ {
+ "key": "q",
+ "description": "Limit search to group names that contain the supplied string. Must have at least 3 characters.
When this parameter is not set, only group having at least one permission are returned.",
+ "required": false,
+ "internal": false,
+ "exampleValue": "eri"
+ },
+ {
+ "key": "templateId",
+ "description": "Template id",
+ "required": false,
+ "internal": false,
+ "exampleValue": "AU-Tpxb--iU5OvuD2FLy"
+ },
+ {
+ "key": "templateName",
+ "description": "Template name",
+ "required": false,
+ "internal": false,
+ "exampleValue": "Default Permission Template for Projects"
+ }
+ ]
+ },
+ {
+ "key": "template_users",
+ "description": "Lists the users with their permission as individual users rather than through group affiliation on the chosen template.
This service defaults to all users, but can be limited to users with a specific permission by providing the desired permission.
Requires the following permission: 'Administer System'.",
+ "since": "5.2",
+ "internal": true,
+ "post": false,
+ "hasResponseExample": true,
+ "changelog": [],
+ "params": [
+ {
+ "key": "organization",
+ "description": "Key of organization, used when group name is set",
+ "required": false,
+ "internal": true,
+ "exampleValue": "my-org"
+ },
+ {
+ "key": "p",
+ "description": "1-based page number",
+ "required": false,
+ "internal": false,
+ "defaultValue": "1",
+ "exampleValue": "42",
+ "deprecatedKey": "pageIndex",
+ "deprecatedKeySince": "5.2"
+ },
+ {
+ "key": "permission",
+ "description": "Permission
",
+ "required": false,
+ "internal": false,
+ "possibleValues": [
+ "admin",
+ "codeviewer",
+ "issueadmin",
+ "scan",
+ "user"
+ ]
+ },
+ {
+ "key": "ps",
+ "description": "Page size. Must be greater than 0 and less than 100",
+ "required": false,
+ "internal": false,
+ "defaultValue": "20",
+ "exampleValue": "20",
+ "deprecatedKey": "pageSize",
+ "deprecatedKeySince": "5.2",
+ "maximumValue": 100
+ },
+ {
+ "key": "q",
+ "description": "Limit search to user names that contain the supplied string. Must have at least 3 characters.
When this parameter is not set, only users having at least one permission are returned.",
+ "required": false,
+ "internal": false,
+ "exampleValue": "eri"
+ },
+ {
+ "key": "templateId",
+ "description": "Template id",
+ "required": false,
+ "internal": false,
+ "exampleValue": "AU-Tpxb--iU5OvuD2FLy"
+ },
+ {
+ "key": "templateName",
+ "description": "Template name",
+ "required": false,
+ "internal": false,
+ "exampleValue": "Default Permission Template for Projects"
+ }
+ ]
+ },
+ {
+ "key": "update_template",
+ "description": "Update a permission template.
Requires the following permission: 'Administer System'.",
+ "since": "5.2",
+ "internal": false,
+ "post": true,
+ "hasResponseExample": true,
+ "changelog": [],
+ "params": [
+ {
+ "key": "description",
+ "description": "Description",
+ "required": false,
+ "internal": false,
+ "exampleValue": "Permissions for all projects related to the financial service"
+ },
+ {
+ "key": "id",
+ "description": "Id",
+ "required": true,
+ "internal": false,
+ "exampleValue": "af8cb8cc-1e78-4c4e-8c00-ee8e814009a5"
+ },
+ {
+ "key": "name",
+ "description": "Name",
+ "required": false,
+ "internal": false,
+ "exampleValue": "Financial Service Permissions"
+ },
+ {
+ "key": "projectKeyPattern",
+ "description": "Project key pattern. Must be a valid Java regular expression",
+ "required": false,
+ "internal": false,
+ "exampleValue": ".*\\.finance\\..*"
+ }
+ ]
+ },
+ {
+ "key": "users",
+ "description": "Lists the users with their permissions as individual users rather than through group affiliation.
This service defaults to global permissions, but can be limited to project permissions by providing project id or project key.
This service defaults to all users, but can be limited to users with a specific permission by providing the desired permission.
Requires one of the following permissions:
",
+ "since": "5.2",
+ "internal": true,
+ "post": false,
+ "hasResponseExample": true,
+ "changelog": [],
+ "params": [
+ {
+ "key": "organization",
+ "description": "Key of organization, used when group name is set",
+ "since": "6.2",
+ "required": false,
+ "internal": true,
+ "exampleValue": "my-org"
+ },
+ {
+ "key": "p",
+ "description": "1-based page number",
+ "required": false,
+ "internal": false,
+ "defaultValue": "1",
+ "exampleValue": "42",
+ "deprecatedKey": "pageIndex",
+ "deprecatedKeySince": "5.2"
+ },
+ {
+ "key": "permission",
+ "description": "Permission
",
+ "required": false,
+ "internal": false
+ },
+ {
+ "key": "projectId",
+ "description": "Project id",
+ "required": false,
+ "internal": false,
+ "exampleValue": "ce4c03d6-430f-40a9-b777-ad877c00aa4d"
+ },
+ {
+ "key": "projectKey",
+ "description": "Project key",
+ "required": false,
+ "internal": false,
+ "exampleValue": "my_project"
+ },
+ {
+ "key": "ps",
+ "description": "Page size. Must be greater than 0 and less than 100",
+ "required": false,
+ "internal": false,
+ "defaultValue": "20",
+ "exampleValue": "20",
+ "deprecatedKey": "pageSize",
+ "deprecatedKeySince": "5.2",
+ "maximumValue": 100
+ },
+ {
+ "key": "q",
+ "description": "Limit search to user names that contain the supplied string. Must have at least 3 characters.
When this parameter is not set, only users having at least one permission are returned.",
+ "required": false,
+ "internal": false,
+ "exampleValue": "eri"
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "path": "api/plugins",
+ "since": "5.2",
+ "description": "Manage the plugins on the server, including installing, uninstalling, and upgrading.",
+ "actions": [
+ {
+ "key": "available",
+ "description": "Get the list of all the plugins available for installation on the SonarQube instance, sorted by plugin name.
Plugin information is retrieved from Update Center. Date and time at which Update Center was last refreshed is provided in the response.
Update status values are:
Require 'Administer System' permission.",
+ "since": "5.2",
+ "internal": false,
+ "post": false,
+ "hasResponseExample": true,
+ "changelog": []
+ },
+ {
+ "key": "cancel_all",
+ "description": "Cancels any operation pending on any plugin (install, update or uninstall)
Requires user to be authenticated with Administer System permissions",
+ "since": "5.2",
+ "internal": false,
+ "post": true,
+ "hasResponseExample": false,
+ "changelog": []
+ },
+ {
+ "key": "install",
+ "description": "Installs the latest version of a plugin specified by its key.
Plugin information is retrieved from Update Center.
Requires user to be authenticated with Administer System permissions",
+ "since": "5.2",
+ "internal": false,
+ "post": true,
+ "hasResponseExample": false,
+ "changelog": [],
+ "params": [
+ {
+ "key": "key",
+ "description": "The key identifying the plugin to install",
+ "required": true,
+ "internal": false
+ }
+ ]
+ },
+ {
+ "key": "installed",
+ "description": "Get the list of all the plugins installed on the SonarQube instance, sorted by plugin name.",
+ "since": "5.2",
+ "internal": false,
+ "post": false,
+ "hasResponseExample": true,
+ "changelog": [
+ {
+ "description": "The 'filename' field is added",
+ "version": "6.6"
+ },
+ {
+ "description": "The 'fileHash' field is added",
+ "version": "6.6"
+ },
+ {
+ "description": "The 'sonarLintSupported' field is added",
+ "version": "6.6"
+ },
+ {
+ "description": "The 'updatedAt' field is added",
+ "version": "6.6"
+ }
+ ],
+ "params": [
+ {
+ "key": "f",
+ "description": "Comma-separated list of the additional fields to be returned in response. No additional field is returned by default. Possible values are:
Require 'Administer System' permission.",
+ "since": "5.2",
+ "internal": false,
+ "post": false,
+ "hasResponseExample": true,
+ "changelog": []
+ },
+ {
+ "key": "uninstall",
+ "description": "Uninstalls the plugin specified by its key.
Requires user to be authenticated with Administer System permissions.",
+ "since": "5.2",
+ "internal": false,
+ "post": true,
+ "hasResponseExample": false,
+ "changelog": [],
+ "params": [
+ {
+ "key": "key",
+ "description": "The key identifying the plugin to uninstall",
+ "required": true,
+ "internal": false
+ }
+ ]
+ },
+ {
+ "key": "update",
+ "description": "Updates a plugin specified by its key to the latest version compatible with the SonarQube instance.
Plugin information is retrieved from Update Center.
Requires user to be authenticated with Administer System permissions",
+ "since": "5.2",
+ "internal": false,
+ "post": true,
+ "hasResponseExample": false,
+ "changelog": [],
+ "params": [
+ {
+ "key": "key",
+ "description": "The key identifying the plugin to update",
+ "required": true,
+ "internal": false
+ }
+ ]
+ },
+ {
+ "key": "updates",
+ "description": "Lists plugins installed on the SonarQube instance for which at least one newer version is available, sorted by plugin name.
Each newer version is listed, ordered from the oldest to the newest, with its own update/compatibility status.
Plugin information is retrieved from Update Center. Date and time at which Update Center was last refreshed is provided in the response.
Update status values are: [COMPATIBLE, INCOMPATIBLE, REQUIRES_UPGRADE, DEPS_REQUIRE_UPGRADE].
Require 'Administer System' permission.",
+ "since": "5.2",
+ "internal": false,
+ "post": false,
+ "hasResponseExample": true,
+ "changelog": []
+ }
+ ]
+ },
+ {
+ "path": "api/profiles",
+ "since": "4.4",
+ "description": "Removed since 6.3, please use api/qualityprofiles instead",
+ "actions": [
+ {
+ "key": "index",
+ "description": "Get a profile.
The web service is removed and you're invited to use api/qualityprofiles/search instead",
+ "since": "3.3",
+ "deprecatedSince": "5.2",
+ "internal": false,
+ "post": false,
+ "hasResponseExample": true,
+ "changelog": []
+ },
+ {
+ "key": "list",
+ "description": "Get a list of profiles.
The web service is removed and you're invited to use api/qualityprofiles/search instead",
+ "since": "3.3",
+ "deprecatedSince": "5.2",
+ "internal": false,
+ "post": false,
+ "hasResponseExample": true,
+ "changelog": []
+ }
+ ]
+ },
+ {
+ "path": "api/project_analyses",
+ "since": "6.3",
+ "description": "Manage project analyses.",
+ "actions": [
+ {
+ "key": "create_event",
+ "description": "Create a project analysis event.
Only event of category 'VERSION' and 'OTHER' can be created.
Requires one of the following permissions:
",
+ "since": "6.3",
+ "internal": false,
+ "post": true,
+ "hasResponseExample": true,
+ "changelog": [],
+ "params": [
+ {
+ "key": "analysis",
+ "description": "Analysis key",
+ "required": true,
+ "internal": false,
+ "exampleValue": "AU-Tpxb--iU5OvuD2FLy"
+ },
+ {
+ "key": "category",
+ "description": "Category",
+ "required": false,
+ "internal": false,
+ "defaultValue": "OTHER",
+ "possibleValues": [
+ "VERSION",
+ "OTHER"
+ ]
+ },
+ {
+ "key": "name",
+ "description": "Name",
+ "required": true,
+ "internal": false,
+ "exampleValue": "5.6",
+ "maximumLength": 400
+ }
+ ]
+ },
+ {
+ "key": "delete",
+ "description": "Delete a project analysis.
Requires one of the following permissions:
",
+ "since": "6.3",
+ "internal": false,
+ "post": true,
+ "hasResponseExample": false,
+ "changelog": [],
+ "params": [
+ {
+ "key": "analysis",
+ "description": "Analysis key",
+ "required": true,
+ "internal": false,
+ "exampleValue": "AU-TpxcA-iU5OvuD2FL1"
+ }
+ ]
+ },
+ {
+ "key": "delete_event",
+ "description": "Delete a project analysis event.
Only event of category 'VERSION' and 'OTHER' can be deleted.
Requires one of the following permissions:
",
+ "since": "6.3",
+ "internal": false,
+ "post": true,
+ "hasResponseExample": false,
+ "changelog": [],
+ "params": [
+ {
+ "key": "event",
+ "description": "Event key",
+ "required": true,
+ "internal": false,
+ "exampleValue": "AU-TpxcA-iU5OvuD2FLz"
+ }
+ ]
+ },
+ {
+ "key": "search",
+ "description": "Search a project analyses and attached events.
Requires the following permission: 'Browse' on the specified project",
+ "since": "6.3",
+ "internal": false,
+ "post": false,
+ "hasResponseExample": true,
+ "changelog": [],
+ "params": [
+ {
+ "key": "branch",
+ "description": "Branch key",
+ "since": "6.6",
+ "required": false,
+ "internal": true,
+ "exampleValue": "feature/my_branch"
+ },
+ {
+ "key": "category",
+ "description": "Event category. Filter analyses that have at least one event of the category specified.",
+ "required": false,
+ "internal": false,
+ "exampleValue": "OTHER",
+ "possibleValues": [
+ "VERSION",
+ "OTHER",
+ "QUALITY_PROFILE",
+ "QUALITY_GATE"
+ ]
+ },
+ {
+ "key": "from",
+ "description": "Filter analyses created after the given date (inclusive).
Either a date (server timezone) or datetime can be provided",
+ "since": "6.5",
+ "required": false,
+ "internal": false,
+ "exampleValue": "2013-05-01"
+ },
+ {
+ "key": "p",
+ "description": "1-based page number",
+ "required": false,
+ "internal": false,
+ "defaultValue": "1",
+ "exampleValue": "42",
+ "deprecatedKey": "pageIndex",
+ "deprecatedKeySince": "5.2"
+ },
+ {
+ "key": "project",
+ "description": "Project key",
+ "required": true,
+ "internal": false,
+ "exampleValue": "my_project"
+ },
+ {
+ "key": "ps",
+ "description": "Page size. Must be greater than 0 and less than 500",
+ "required": false,
+ "internal": false,
+ "defaultValue": "100",
+ "exampleValue": "20",
+ "deprecatedKey": "pageSize",
+ "deprecatedKeySince": "5.2",
+ "maximumValue": 500
+ },
+ {
+ "key": "to",
+ "description": "Filter analyses created before the given date (inclusive).
Either a date (server timezone) or datetime can be provided",
+ "since": "6.5",
+ "required": false,
+ "internal": false,
+ "exampleValue": "2017-10-19 or 2017-10-19T13:00:00+0200"
+ }
+ ]
+ },
+ {
+ "key": "update_event",
+ "description": "Update a project analysis event.
Only events of category 'VERSION' and 'OTHER' can be updated.
Requires one of the following permissions:
",
+ "since": "6.3",
+ "internal": false,
+ "post": true,
+ "hasResponseExample": true,
+ "changelog": [],
+ "params": [
+ {
+ "key": "event",
+ "description": "Event key",
+ "required": true,
+ "internal": false,
+ "exampleValue": "AU-TpxcA-iU5OvuD2FL5"
+ },
+ {
+ "key": "name",
+ "description": "New name",
+ "required": false,
+ "internal": false,
+ "exampleValue": "5.6",
+ "maximumLength": 400
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "path": "api/project_branches",
+ "since": "6.6",
+ "description": "Manage branch (only available when the Branch plugin is installed)",
+ "actions": [
+ {
+ "key": "delete",
+ "description": "Delete a non-main branch of a project.
Requires 'Administer' rights on the specified project.",
+ "since": "6.6",
+ "internal": false,
+ "post": true,
+ "hasResponseExample": true,
+ "changelog": [],
+ "params": [
+ {
+ "key": "branch",
+ "description": "Name of the branch",
+ "required": true,
+ "internal": false,
+ "exampleValue": "branch1"
+ },
+ {
+ "key": "project",
+ "description": "Project key",
+ "required": true,
+ "internal": false,
+ "exampleValue": "my_project"
+ }
+ ]
+ },
+ {
+ "key": "list",
+ "description": "List the branches of a project.
Requires 'Administer' rights on the specified project.",
+ "since": "6.6",
+ "internal": false,
+ "post": false,
+ "hasResponseExample": true,
+ "changelog": [],
+ "params": [
+ {
+ "key": "project",
+ "description": "Project key",
+ "required": true,
+ "internal": false,
+ "exampleValue": "my_project"
+ }
+ ]
+ },
+ {
+ "key": "rename",
+ "description": "Rename the main branch of a project.
Requires 'Administer' permission on the specified project.",
+ "since": "6.6",
+ "internal": false,
+ "post": true,
+ "hasResponseExample": false,
+ "changelog": [],
+ "params": [
+ {
+ "key": "name",
+ "description": "New name of the main branch",
+ "required": true,
+ "internal": false,
+ "exampleValue": "branch1",
+ "maximumLength": 255
+ },
+ {
+ "key": "project",
+ "description": "Project key",
+ "required": true,
+ "internal": false,
+ "exampleValue": "my_project"
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "path": "api/project_links",
+ "since": "6.1",
+ "description": "Manage projects links.",
+ "actions": [
+ {
+ "key": "create",
+ "description": "Create a new project link.
Requires 'Administer' permission on the specified project, or global 'Administer' permission.",
+ "since": "6.1",
+ "internal": false,
+ "post": true,
+ "hasResponseExample": true,
+ "changelog": [],
+ "params": [
+ {
+ "key": "name",
+ "description": "Link name",
+ "required": true,
+ "internal": false,
+ "exampleValue": "Custom",
+ "maximumLength": 128
+ },
+ {
+ "key": "projectId",
+ "description": "Project id",
+ "required": false,
+ "internal": false,
+ "exampleValue": "AU-Tpxb--iU5OvuD2FLy"
+ },
+ {
+ "key": "projectKey",
+ "description": "Project key",
+ "required": false,
+ "internal": false,
+ "exampleValue": "my_project"
+ },
+ {
+ "key": "url",
+ "description": "Link url",
+ "required": true,
+ "internal": false,
+ "exampleValue": "http://example.com",
+ "maximumLength": 2048
+ }
+ ]
+ },
+ {
+ "key": "delete",
+ "description": "Delete existing project link.
Requires 'Administer' permission on the specified project, or global 'Administer' permission.",
+ "since": "6.1",
+ "internal": false,
+ "post": true,
+ "hasResponseExample": false,
+ "changelog": [],
+ "params": [
+ {
+ "key": "id",
+ "description": "Link id",
+ "required": true,
+ "internal": false,
+ "exampleValue": "17"
+ }
+ ]
+ },
+ {
+ "key": "search",
+ "description": "List links of a project.
The 'projectId' or 'projectKey' must be provided.
Requires one of the following permissions:
",
+ "since": "6.1",
+ "internal": false,
+ "post": false,
+ "hasResponseExample": true,
+ "changelog": [],
+ "params": [
+ {
+ "key": "projectId",
+ "description": "Project Id",
+ "required": false,
+ "internal": false,
+ "exampleValue": "AU-Tpxb--iU5OvuD2FLy"
+ },
+ {
+ "key": "projectKey",
+ "description": "Project Key",
+ "required": false,
+ "internal": false,
+ "exampleValue": "my_project"
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "path": "api/project_tags",
+ "since": "6.4",
+ "description": "Manage project tags",
+ "actions": [
+ {
+ "key": "search",
+ "description": "Search tags",
+ "since": "6.4",
+ "internal": false,
+ "post": false,
+ "hasResponseExample": true,
+ "changelog": [],
+ "params": [
+ {
+ "key": "ps",
+ "description": "Page size. Must be greater than 0 and less than 100",
+ "required": false,
+ "internal": false,
+ "defaultValue": "10",
+ "exampleValue": "20",
+ "deprecatedKey": "pageSize",
+ "deprecatedKeySince": "5.2",
+ "maximumValue": 100
+ },
+ {
+ "key": "q",
+ "description": "Limit search to tags that contain the supplied string.",
+ "required": false,
+ "internal": false,
+ "exampleValue": "off"
+ }
+ ]
+ },
+ {
+ "key": "set",
+ "description": "Set tags on a project.
Requires the following permission: 'Administer' rights on the specified project",
+ "since": "6.4",
+ "internal": false,
+ "post": true,
+ "hasResponseExample": false,
+ "changelog": [],
+ "params": [
+ {
+ "key": "project",
+ "description": "Project key",
+ "required": true,
+ "internal": false,
+ "exampleValue": "my_project"
+ },
+ {
+ "key": "tags",
+ "description": "Comma-separated list of tags",
+ "required": true,
+ "internal": false,
+ "exampleValue": "finance, offshore"
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "path": "api/projects",
+ "since": "2.10",
+ "description": "Manage project existence.",
+ "actions": [
+ {
+ "key": "bulk_delete",
+ "description": "Delete one or several projects.
Requires 'Administer System' permission.",
+ "since": "5.2",
+ "internal": false,
+ "post": true,
+ "hasResponseExample": false,
+ "changelog": [],
+ "params": [
+ {
+ "key": "analyzedBefore",
+ "description": "Filter the projects for which last analysis is older than the given date (exclusive).
Either a date (server timezone) or datetime can be provided.",
+ "since": "6.6",
+ "required": false,
+ "internal": false,
+ "exampleValue": "2017-10-19 or 2017-10-19T13:00:00+0200"
+ },
+ {
+ "key": "onProvisionedOnly",
+ "description": "Filter the projects that are provisioned",
+ "since": "6.6",
+ "required": false,
+ "internal": false,
+ "defaultValue": "false",
+ "possibleValues": [
+ "true",
+ "false",
+ "yes",
+ "no"
+ ]
+ },
+ {
+ "key": "organization",
+ "description": "The key of the organization",
+ "since": "6.3",
+ "required": false,
+ "internal": true
+ },
+ {
+ "key": "projectIds",
+ "description": "Comma-separated list of project ids",
+ "required": false,
+ "internal": false,
+ "exampleValue": "AU-Tpxb--iU5OvuD2FLy,AU-TpxcA-iU5OvuD2FLz",
+ "deprecatedSince": "6.4",
+ "deprecatedKey": "ids",
+ "deprecatedKeySince": "6.4"
+ },
+ {
+ "key": "projects",
+ "description": "Comma-separated list of project keys",
+ "required": false,
+ "internal": false,
+ "exampleValue": "my_project,another_project",
+ "deprecatedKey": "keys",
+ "deprecatedKeySince": "6.4"
+ },
+ {
+ "key": "q",
+ "description": "Limit to:
",
+ "required": false,
+ "internal": false,
+ "exampleValue": "sonar"
+ },
+ {
+ "key": "qualifiers",
+ "description": "Comma-separated list of component qualifiers. Filter the results with the specified qualifiers",
+ "required": false,
+ "internal": false,
+ "defaultValue": "TRK",
+ "possibleValues": [
+ "TRK",
+ "VW",
+ "APP"
+ ]
+ },
+ {
+ "key": "visibility",
+ "description": "Filter the projects that should be visible to everyone (public), or only specific user/groups (private).
If no visibility is specified, the default project visibility of the organization will be used.",
+ "since": "6.4",
+ "required": false,
+ "internal": true,
+ "possibleValues": [
+ "private",
+ "public"
+ ]
+ }
+ ]
+ },
+ {
+ "key": "bulk_update_key",
+ "description": "Bulk update a project or module key and all its sub-components keys. The bulk update allows to replace a part of the current key by another string on the current project and all its sub-modules.
It's possible to simulate the bulk update by setting the parameter 'dryRun' at true. No key is updated with a dry run.
Ex: to rename a project with key 'my_project' to 'my_new_project' and all its sub-components keys, call the WS with parameters:
Either 'projectId' or 'project' must be provided.
Requires one of the following permissions:
",
+ "since": "6.1",
+ "internal": false,
+ "post": true,
+ "hasResponseExample": true,
+ "changelog": [
+ {
+ "description": "Moved from api/components/bulk_update_key to api/projects/bulk_update_key",
+ "version": "6.4"
+ }
+ ],
+ "params": [
+ {
+ "key": "dryRun",
+ "description": "Simulate bulk update. No component key is updated.",
+ "required": false,
+ "internal": false,
+ "defaultValue": "false",
+ "possibleValues": [
+ "true",
+ "false",
+ "yes",
+ "no"
+ ]
+ },
+ {
+ "key": "from",
+ "description": "String to match in components keys",
+ "required": true,
+ "internal": false,
+ "exampleValue": "_old"
+ },
+ {
+ "key": "project",
+ "description": "Project or module key",
+ "required": false,
+ "internal": false,
+ "exampleValue": "my_old_project",
+ "deprecatedKey": "key",
+ "deprecatedKeySince": "6.4"
+ },
+ {
+ "key": "projectId",
+ "description": "Project or module ID",
+ "required": false,
+ "internal": false,
+ "exampleValue": "AU-Tpxb--iU5OvuD2FLy",
+ "deprecatedSince": "6.4",
+ "deprecatedKey": "id",
+ "deprecatedKeySince": "6.4"
+ },
+ {
+ "key": "to",
+ "description": "String replacement in components keys",
+ "required": true,
+ "internal": false,
+ "exampleValue": "_new"
+ }
+ ]
+ },
+ {
+ "key": "create",
+ "description": "Create a project.
Requires 'Create Projects' permission",
+ "since": "4.0",
+ "internal": false,
+ "post": true,
+ "hasResponseExample": true,
+ "changelog": [
+ {
+ "description": "The response format has been updated and does not contain the database ID anymore",
+ "version": "6.3"
+ },
+ {
+ "description": "The 'key' parameter has been renamed 'project'",
+ "version": "6.3"
+ }
+ ],
+ "params": [
+ {
+ "key": "branch",
+ "description": "SCM Branch of the project. The key of the project will become key:branch, for instance 'SonarQube:branch-5.0'",
+ "required": false,
+ "internal": false,
+ "exampleValue": "branch-5.0"
+ },
+ {
+ "key": "name",
+ "description": "Name of the project",
+ "required": true,
+ "internal": false,
+ "exampleValue": "SonarQube",
+ "maximumLength": 2000
+ },
+ {
+ "key": "organization",
+ "description": "The key of the organization",
+ "since": "6.3",
+ "required": false,
+ "internal": true
+ },
+ {
+ "key": "project",
+ "description": "Key of the project",
+ "required": true,
+ "internal": false,
+ "exampleValue": "my_project",
+ "deprecatedKey": "key",
+ "deprecatedKeySince": "6.3",
+ "maximumLength": 400
+ },
+ {
+ "key": "visibility",
+ "description": "Whether the created project should be visible to everyone, or only specific user/groups.
If no visibility is specified, the default project visibility of the organization will be used.",
+ "since": "6.4",
+ "required": false,
+ "internal": true,
+ "possibleValues": [
+ "private",
+ "public"
+ ]
+ }
+ ]
+ },
+ {
+ "key": "delete",
+ "description": "Delete a project.
Requires 'Administer System' permission or 'Administer' permission on the project.",
+ "since": "5.2",
+ "internal": false,
+ "post": true,
+ "hasResponseExample": false,
+ "changelog": [],
+ "params": [
+ {
+ "key": "project",
+ "description": "Project key",
+ "required": false,
+ "internal": false,
+ "exampleValue": "my_project",
+ "deprecatedKey": "key",
+ "deprecatedKeySince": "6.4"
+ },
+ {
+ "key": "projectId",
+ "description": "Project ID",
+ "required": false,
+ "internal": false,
+ "exampleValue": "ce4c03d6-430f-40a9-b777-ad877c00aa4d",
+ "deprecatedSince": "6.4",
+ "deprecatedKey": "id",
+ "deprecatedKeySince": "6.4"
+ }
+ ]
+ },
+ {
+ "key": "ghosts",
+ "description": "List ghost projects.
With the current architecture, it's no more possible to have invisible ghost projects. Therefore, the web service is deprecated.
Requires 'Administer System' permission.",
+ "since": "5.2",
+ "deprecatedSince": "6.6",
+ "internal": false,
+ "post": false,
+ "hasResponseExample": true,
+ "changelog": [
+ {
+ "description": "The 'uuid' field is deprecated in the response",
+ "version": "6.4"
+ }
+ ],
+ "params": [
+ {
+ "key": "f",
+ "description": "Comma-separated list of the fields to be returned in response. All the fields are returned by default.",
+ "required": false,
+ "internal": false,
+ "possibleValues": [
+ "name",
+ "creationDate",
+ "visibility",
+ "uuid",
+ "key"
+ ]
+ },
+ {
+ "key": "organization",
+ "description": "Organization key",
+ "since": "6.3",
+ "required": false,
+ "internal": true
+ },
+ {
+ "key": "p",
+ "description": "1-based page number",
+ "required": false,
+ "internal": false,
+ "defaultValue": "1",
+ "exampleValue": "42",
+ "deprecatedKey": "pageIndex",
+ "deprecatedKeySince": "5.2"
+ },
+ {
+ "key": "ps",
+ "description": "Page size. Must be greater than 0 and less than 500",
+ "required": false,
+ "internal": false,
+ "defaultValue": "100",
+ "exampleValue": "20",
+ "deprecatedKey": "pageSize",
+ "deprecatedKeySince": "5.2",
+ "maximumValue": 500
+ },
+ {
+ "key": "q",
+ "description": "Limit search to names or keys that contain the supplied string.",
+ "required": false,
+ "internal": false,
+ "exampleValue": "sonar"
+ }
+ ]
+ },
+ {
+ "key": "index",
+ "description": "This web service is deprecated, please use api/components/search instead",
+ "since": "2.10",
+ "deprecatedSince": "6.3",
+ "internal": false,
+ "post": false,
+ "hasResponseExample": true,
+ "changelog": [
+ {
+ "description": "The parameters 'desc', 'views', 'libs' and 'versions' have no effect.",
+ "version": "6.3"
+ }
+ ],
+ "params": [
+ {
+ "key": "desc",
+ "description": "Since 6.3, this parameter has no effect",
+ "required": false,
+ "internal": false,
+ "deprecatedSince": "6.3"
+ },
+ {
+ "key": "format",
+ "description": "Only json response format is available",
+ "required": false,
+ "internal": false,
+ "possibleValues": [
+ "json"
+ ]
+ },
+ {
+ "key": "libs",
+ "description": "Since 6.3, this parameter has no effect",
+ "required": false,
+ "internal": false,
+ "deprecatedSince": "6.3"
+ },
+ {
+ "key": "project",
+ "description": "key or ID of the project",
+ "required": false,
+ "internal": false,
+ "exampleValue": "my_project",
+ "deprecatedKey": "key",
+ "deprecatedKeySince": "6.4"
+ },
+ {
+ "key": "search",
+ "description": "Substring of project name, case insensitive. Ignored if the parameter key is set",
+ "required": false,
+ "internal": false,
+ "exampleValue": "Sonar"
+ },
+ {
+ "key": "subprojects",
+ "description": "Load sub-projects. Ignored if the parameter key is set",
+ "required": false,
+ "internal": false,
+ "defaultValue": "false",
+ "possibleValues": [
+ "true",
+ "false",
+ "yes",
+ "no"
+ ]
+ },
+ {
+ "key": "versions",
+ "description": "Since 6.3, this parameter has no effect",
+ "required": false,
+ "internal": false,
+ "deprecatedSince": "6.3"
+ },
+ {
+ "key": "views",
+ "description": "Since 6.3, this parameter has no effect",
+ "required": false,
+ "internal": false,
+ "deprecatedSince": "6.3"
+ }
+ ]
+ },
+ {
+ "key": "provisioned",
+ "description": "Get the list of provisioned projects.
Web service is deprecated. Use api/projects/search instead, with onProvisionedOnly=true.
Require 'Create Projects' permission.",
+ "since": "5.2",
+ "deprecatedSince": "6.6",
+ "internal": false,
+ "post": false,
+ "hasResponseExample": true,
+ "changelog": [
+ {
+ "description": "The 'uuid' field is deprecated in the response",
+ "version": "6.4"
+ },
+ {
+ "description": "Paging response fields is now in a Paging object",
+ "version": "6.4"
+ }
+ ],
+ "params": [
+ {
+ "key": "f",
+ "description": "Comma-separated list of the fields to be returned in response. All the fields are returned by default.",
+ "required": false,
+ "internal": false,
+ "possibleValues": [
+ "name",
+ "creationDate",
+ "visibility",
+ "uuid",
+ "key"
+ ]
+ },
+ {
+ "key": "organization",
+ "description": "The key of the organization",
+ "since": "6.3",
+ "required": false,
+ "internal": true
+ },
+ {
+ "key": "p",
+ "description": "1-based page number",
+ "required": false,
+ "internal": false,
+ "defaultValue": "1",
+ "exampleValue": "42",
+ "deprecatedKey": "pageIndex",
+ "deprecatedKeySince": "5.2"
+ },
+ {
+ "key": "ps",
+ "description": "Page size. Must be greater than 0 and less than 500",
+ "required": false,
+ "internal": false,
+ "defaultValue": "100",
+ "exampleValue": "20",
+ "deprecatedKey": "pageSize",
+ "deprecatedKeySince": "5.2",
+ "maximumValue": 500
+ },
+ {
+ "key": "q",
+ "description": "Limit search to names or keys that contain the supplied string.",
+ "required": false,
+ "internal": false,
+ "exampleValue": "sonar"
+ }
+ ]
+ },
+ {
+ "key": "search",
+ "description": "Search for projects or views to administrate them.
Requires 'System Administrator' permission",
+ "since": "6.3",
+ "internal": false,
+ "post": false,
+ "hasResponseExample": true,
+ "changelog": [
+ {
+ "description": "The 'uuid' field is deprecated in the response",
+ "version": "6.4"
+ }
+ ],
+ "params": [
+ {
+ "key": "analyzedBefore",
+ "description": "Filter the projects for which last analysis is older than the given date (exclusive).
Either a date (server timezone) or datetime can be provided.",
+ "since": "6.6",
+ "required": false,
+ "internal": false,
+ "exampleValue": "2017-10-19 or 2017-10-19T13:00:00+0200"
+ },
+ {
+ "key": "onProvisionedOnly",
+ "description": "Filter the projects that are provisioned",
+ "since": "6.6",
+ "required": false,
+ "internal": false,
+ "defaultValue": "false",
+ "possibleValues": [
+ "true",
+ "false",
+ "yes",
+ "no"
+ ]
+ },
+ {
+ "key": "organization",
+ "description": "The key of the organization",
+ "since": "6.3",
+ "required": false,
+ "internal": true
+ },
+ {
+ "key": "p",
+ "description": "1-based page number",
+ "required": false,
+ "internal": false,
+ "defaultValue": "1",
+ "exampleValue": "42",
+ "deprecatedKey": "pageIndex",
+ "deprecatedKeySince": "5.2"
+ },
+ {
+ "key": "projectIds",
+ "description": "Comma-separated list of project ids",
+ "since": "6.6",
+ "required": false,
+ "internal": false,
+ "exampleValue": "AU-Tpxb--iU5OvuD2FLy,AU-TpxcA-iU5OvuD2FLz",
+ "deprecatedSince": "6.6"
+ },
+ {
+ "key": "projects",
+ "description": "Comma-separated list of project keys",
+ "since": "6.6",
+ "required": false,
+ "internal": false,
+ "exampleValue": "my_project,another_project"
+ },
+ {
+ "key": "ps",
+ "description": "Page size. Must be greater than 0 and less than 500",
+ "required": false,
+ "internal": false,
+ "defaultValue": "100",
+ "exampleValue": "20",
+ "deprecatedKey": "pageSize",
+ "deprecatedKeySince": "5.2",
+ "maximumValue": 500
+ },
+ {
+ "key": "q",
+ "description": "Limit search to:
",
+ "required": false,
+ "internal": false,
+ "exampleValue": "sonar"
+ },
+ {
+ "key": "qualifiers",
+ "description": "Comma-separated list of component qualifiers. Filter the results with the specified qualifiers",
+ "required": false,
+ "internal": false,
+ "defaultValue": "TRK",
+ "possibleValues": [
+ "TRK",
+ "VW",
+ "APP"
+ ]
+ },
+ {
+ "key": "visibility",
+ "description": "Filter the projects that should be visible to everyone (public), or only specific user/groups (private).
If no visibility is specified, the default project visibility of the organization will be used.",
+ "since": "6.4",
+ "required": false,
+ "internal": true,
+ "possibleValues": [
+ "private",
+ "public"
+ ]
+ }
+ ]
+ },
+ {
+ "key": "search_my_projects",
+ "description": "Return list of projects for which the current user has 'Administer' permission.",
+ "since": "6.0",
+ "internal": true,
+ "post": false,
+ "hasResponseExample": true,
+ "changelog": [
+ {
+ "description": "The 'id' field is deprecated in the response",
+ "version": "6.4"
+ }
+ ],
+ "params": [
+ {
+ "key": "p",
+ "description": "1-based page number",
+ "required": false,
+ "internal": false,
+ "defaultValue": "1",
+ "exampleValue": "42",
+ "deprecatedKey": "pageIndex",
+ "deprecatedKeySince": "5.2"
+ },
+ {
+ "key": "ps",
+ "description": "Page size. Must be greater than 0 and less than 500",
+ "required": false,
+ "internal": false,
+ "defaultValue": "100",
+ "exampleValue": "20",
+ "deprecatedKey": "pageSize",
+ "deprecatedKeySince": "5.2",
+ "maximumValue": 500
+ }
+ ]
+ },
+ {
+ "key": "update_key",
+ "description": "Update a project or module key and all its sub-components keys.
Either 'from' or 'projectId' must be provided.
Requires one of the following permissions:
",
+ "since": "6.1",
+ "internal": false,
+ "post": true,
+ "hasResponseExample": false,
+ "changelog": [
+ {
+ "description": "Move from api/components/update_key to api/projects/update_key",
+ "version": "6.4"
+ }
+ ],
+ "params": [
+ {
+ "key": "from",
+ "description": "Project or module key",
+ "required": false,
+ "internal": false,
+ "exampleValue": "my_old_project",
+ "deprecatedKey": "key",
+ "deprecatedKeySince": "6.4"
+ },
+ {
+ "key": "projectId",
+ "description": "Project or module id",
+ "required": false,
+ "internal": false,
+ "exampleValue": "AU-Tpxb--iU5OvuD2FLy",
+ "deprecatedSince": "6.4",
+ "deprecatedKey": "id",
+ "deprecatedKeySince": "6.4"
+ },
+ {
+ "key": "to",
+ "description": "New component key",
+ "required": true,
+ "internal": false,
+ "exampleValue": "my_new_project",
+ "deprecatedKey": "newKey",
+ "deprecatedKeySince": "6.4"
+ }
+ ]
+ },
+ {
+ "key": "update_visibility",
+ "description": "Updates visibility of a project.
Requires 'Project administer' permission on the specified project",
+ "since": "6.4",
+ "internal": false,
+ "post": true,
+ "hasResponseExample": false,
+ "changelog": [],
+ "params": [
+ {
+ "key": "project",
+ "description": "Project key",
+ "required": true,
+ "internal": false,
+ "exampleValue": "my_project"
+ },
+ {
+ "key": "visibility",
+ "description": "New visibility",
+ "required": true,
+ "internal": false,
+ "possibleValues": [
+ "private",
+ "public"
+ ]
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "path": "api/properties",
+ "since": "2.6",
+ "description": "This web service is deprecated, please use api/settings instead.",
+ "actions": [
+ {
+ "key": "index",
+ "description": "This web service is deprecated, please use api/settings/values instead.",
+ "since": "2.6",
+ "deprecatedSince": "6.3",
+ "internal": false,
+ "post": false,
+ "hasResponseExample": true,
+ "changelog": [],
+ "params": [
+ {
+ "key": "format",
+ "description": "Only json response format is available",
+ "required": false,
+ "internal": false,
+ "possibleValues": [
+ "json"
+ ]
+ },
+ {
+ "key": "id",
+ "description": "Setting key",
+ "required": false,
+ "internal": false,
+ "exampleValue": "sonar.test.inclusions"
+ },
+ {
+ "key": "resource",
+ "description": "Component key or database id",
+ "required": false,
+ "internal": false,
+ "exampleValue": "my_project"
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "path": "api/qualitygates",
+ "since": "4.3",
+ "description": "Manage quality gates, including conditions and project association.",
+ "actions": [
+ {
+ "key": "app",
+ "description": "Get initialization items for the admin UI. For internal use",
+ "since": "4.3",
+ "internal": true,
+ "post": false,
+ "hasResponseExample": true,
+ "changelog": []
+ },
+ {
+ "key": "copy",
+ "description": "Copy a Quality Gate.
Requires the 'Administer Quality Gates' permission.",
+ "since": "4.3",
+ "internal": false,
+ "post": true,
+ "hasResponseExample": false,
+ "changelog": [],
+ "params": [
+ {
+ "key": "id",
+ "description": "The ID of the source quality gate",
+ "required": true,
+ "internal": false,
+ "exampleValue": "1"
+ },
+ {
+ "key": "name",
+ "description": "The name of the quality gate to create",
+ "required": true,
+ "internal": false,
+ "exampleValue": "My Quality Gate"
+ }
+ ]
+ },
+ {
+ "key": "create",
+ "description": "Create a Quality Gate.
Requires the 'Administer Quality Gates' permission.",
+ "since": "4.3",
+ "internal": false,
+ "post": true,
+ "hasResponseExample": false,
+ "changelog": [],
+ "params": [
+ {
+ "key": "name",
+ "description": "The name of the quality gate to create",
+ "required": true,
+ "internal": false,
+ "exampleValue": "My Quality Gate",
+ "maximumLength": 100
+ }
+ ]
+ },
+ {
+ "key": "create_condition",
+ "description": "Add a new condition to a quality gate.
Requires the 'Administer Quality Gates' permission.",
+ "since": "4.3",
+ "internal": false,
+ "post": true,
+ "hasResponseExample": false,
+ "changelog": [],
+ "params": [
+ {
+ "key": "error",
+ "description": "Condition error threshold",
+ "required": false,
+ "internal": false,
+ "exampleValue": "10",
+ "maximumLength": 64
+ },
+ {
+ "key": "gateId",
+ "description": "ID of the quality gate",
+ "required": true,
+ "internal": false,
+ "exampleValue": "1"
+ },
+ {
+ "key": "metric",
+ "description": "Condition metric",
+ "required": true,
+ "internal": false,
+ "exampleValue": "blocker_violations"
+ },
+ {
+ "key": "op",
+ "description": "Condition operator:
Requires the 'Administer Quality Gates' permission.",
+ "since": "4.3",
+ "internal": false,
+ "post": true,
+ "hasResponseExample": false,
+ "changelog": [],
+ "params": [
+ {
+ "key": "id",
+ "description": "Condition ID",
+ "required": true,
+ "internal": false,
+ "exampleValue": "2"
+ }
+ ]
+ },
+ {
+ "key": "deselect",
+ "description": "Remove the association of a project from a quality gate.
Requires the 'Administer Quality Gates' permission.",
+ "since": "4.3",
+ "internal": false,
+ "post": true,
+ "hasResponseExample": false,
+ "changelog": [
+ {
+ "description": "The parameter 'gateId' was removed",
+ "version": "6.6"
+ }
+ ],
+ "params": [
+ {
+ "key": "projectId",
+ "description": "Project id",
+ "required": false,
+ "internal": false,
+ "exampleValue": "AU-Tpxb--iU5OvuD2FLy",
+ "deprecatedSince": "6.1"
+ },
+ {
+ "key": "projectKey",
+ "description": "Project key",
+ "since": "6.1",
+ "required": false,
+ "internal": false,
+ "exampleValue": "my_project"
+ }
+ ]
+ },
+ {
+ "key": "destroy",
+ "description": "Delete a Quality Gate.
Requires the 'Administer Quality Gates' permission.",
+ "since": "4.3",
+ "internal": false,
+ "post": true,
+ "hasResponseExample": false,
+ "changelog": [],
+ "params": [
+ {
+ "key": "id",
+ "description": "ID of the quality gate to delete",
+ "required": true,
+ "internal": false,
+ "exampleValue": "1"
+ }
+ ]
+ },
+ {
+ "key": "get_by_project",
+ "description": "Get the quality gate of a project.
Requires one of the following permissions:
",
+ "since": "6.1",
+ "internal": false,
+ "post": false,
+ "hasResponseExample": true,
+ "changelog": [
+ {
+ "description": "The parameter 'projectId' has been removed",
+ "version": "6.6"
+ },
+ {
+ "description": "The parameter 'projectKey' has been renamed to 'project'",
+ "version": "6.6"
+ },
+ {
+ "description": "This webservice is now part of the public API",
+ "version": "6.6"
+ }
+ ],
+ "params": [
+ {
+ "key": "project",
+ "description": "Project key",
+ "required": true,
+ "internal": false,
+ "exampleValue": "my_project"
+ }
+ ]
+ },
+ {
+ "key": "list",
+ "description": "Get a list of quality gates",
+ "since": "4.3",
+ "internal": false,
+ "post": false,
+ "hasResponseExample": true,
+ "changelog": []
+ },
+ {
+ "key": "project_status",
+ "description": "Get the quality gate status of a project or a Compute Engine task.
Either 'analysisId', 'projectId' or 'projectKey' must be provided
The different statuses returned are: OK, WARN, ERROR, NONE. The NONE status is returned when there is no quality gate associated with the analysis.
Returns an HTTP code 404 if the analysis associated with the task is not found or does not exist.
Requires one of the following permissions:
",
+ "since": "5.3",
+ "internal": false,
+ "post": false,
+ "hasResponseExample": true,
+ "changelog": [
+ {
+ "description": "The field 'ignoredConditions' is added to the response",
+ "version": "6.4"
+ }
+ ],
+ "params": [
+ {
+ "key": "analysisId",
+ "description": "Analysis id",
+ "required": false,
+ "internal": false,
+ "exampleValue": "AU-TpxcA-iU5OvuD2FL1"
+ },
+ {
+ "key": "projectId",
+ "description": "Project id",
+ "since": "5.4",
+ "required": false,
+ "internal": false,
+ "exampleValue": "AU-Tpxb--iU5OvuD2FLy"
+ },
+ {
+ "key": "projectKey",
+ "description": "Project key",
+ "since": "5.4",
+ "required": false,
+ "internal": false,
+ "exampleValue": "my_project"
+ }
+ ]
+ },
+ {
+ "key": "rename",
+ "description": "Rename a Quality Gate.
Requires the 'Administer Quality Gates' permission.",
+ "since": "4.3",
+ "internal": false,
+ "post": true,
+ "hasResponseExample": false,
+ "changelog": [],
+ "params": [
+ {
+ "key": "id",
+ "description": "ID of the quality gate to rename",
+ "required": true,
+ "internal": false,
+ "exampleValue": "1"
+ },
+ {
+ "key": "name",
+ "description": "New name of the quality gate",
+ "required": true,
+ "internal": false,
+ "exampleValue": "My Quality Gate",
+ "maximumLength": 100
+ }
+ ]
+ },
+ {
+ "key": "search",
+ "description": "Search for projects associated (or not) to a quality gate.
Only authorized projects for current user will be returned.",
+ "since": "4.3",
+ "internal": false,
+ "post": false,
+ "hasResponseExample": true,
+ "changelog": [],
+ "params": [
+ {
+ "key": "gateId",
+ "description": "Quality Gate ID",
+ "required": true,
+ "internal": false,
+ "exampleValue": "1"
+ },
+ {
+ "key": "page",
+ "description": "Page number",
+ "required": false,
+ "internal": false,
+ "defaultValue": "1",
+ "exampleValue": "2"
+ },
+ {
+ "key": "pageSize",
+ "description": "Page size",
+ "required": false,
+ "internal": false,
+ "exampleValue": "10"
+ },
+ {
+ "key": "query",
+ "description": "To search for projects containing this string. If this parameter is set, \"selected\" is set to \"all\".",
+ "required": false,
+ "internal": false,
+ "exampleValue": "abc"
+ },
+ {
+ "key": "selected",
+ "description": "Depending on the value, show only selected items (selected=selected), deselected items (selected=deselected), or all items with their selection status (selected=all).",
+ "required": false,
+ "internal": false,
+ "defaultValue": "selected",
+ "possibleValues": [
+ "all",
+ "deselected",
+ "selected"
+ ]
+ }
+ ]
+ },
+ {
+ "key": "select",
+ "description": "Associate a project to a quality gate.
The 'projectId' or 'projectKey' must be provided.
Project id as a numeric value is deprecated since 6.1. Please use the id similar to 'AU-TpxcA-iU5OvuD2FLz'.
Requires the 'Administer Quality Gates' permission.",
+ "since": "4.3",
+ "internal": false,
+ "post": true,
+ "hasResponseExample": false,
+ "changelog": [],
+ "params": [
+ {
+ "key": "gateId",
+ "description": "Quality gate id",
+ "required": true,
+ "internal": false,
+ "exampleValue": "1"
+ },
+ {
+ "key": "projectId",
+ "description": "Project id. Project id as an numeric value is deprecated since 6.1",
+ "required": false,
+ "internal": false,
+ "exampleValue": "AU-Tpxb--iU5OvuD2FLy"
+ },
+ {
+ "key": "projectKey",
+ "description": "Project key",
+ "since": "6.1",
+ "required": false,
+ "internal": false,
+ "exampleValue": "my_project"
+ }
+ ]
+ },
+ {
+ "key": "set_as_default",
+ "description": "Set a quality gate as the default quality gate.
Requires the 'Administer Quality Gates' permission.",
+ "since": "4.3",
+ "internal": false,
+ "post": true,
+ "hasResponseExample": false,
+ "changelog": [],
+ "params": [
+ {
+ "key": "id",
+ "description": "ID of the quality gate to set as default",
+ "required": true,
+ "internal": false,
+ "exampleValue": "1"
+ }
+ ]
+ },
+ {
+ "key": "show",
+ "description": "Display the details of a quality gate",
+ "since": "4.3",
+ "internal": false,
+ "post": false,
+ "hasResponseExample": true,
+ "changelog": [],
+ "params": [
+ {
+ "key": "id",
+ "description": "ID of the quality gate. Either id or name must be set",
+ "required": false,
+ "internal": false,
+ "exampleValue": "1"
+ },
+ {
+ "key": "name",
+ "description": "Name of the quality gate. Either id or name must be set",
+ "required": false,
+ "internal": false,
+ "exampleValue": "My Quality Gate"
+ }
+ ]
+ },
+ {
+ "key": "unset_default",
+ "description": "Unset a quality gate as the default quality gate.
Requires the 'Administer Quality Gates' permission.",
+ "since": "4.3",
+ "internal": false,
+ "post": true,
+ "hasResponseExample": false,
+ "changelog": [],
+ "params": [
+ {
+ "key": "id",
+ "description": "ID of the quality gate to unset as default",
+ "required": true,
+ "internal": false,
+ "exampleValue": "1"
+ }
+ ]
+ },
+ {
+ "key": "update_condition",
+ "description": "Update a condition attached to a quality gate.
Requires the 'Administer Quality Gates' permission.",
+ "since": "4.3",
+ "internal": false,
+ "post": true,
+ "hasResponseExample": false,
+ "changelog": [],
+ "params": [
+ {
+ "key": "error",
+ "description": "Condition error threshold",
+ "required": false,
+ "internal": false,
+ "exampleValue": "10",
+ "maximumLength": 64
+ },
+ {
+ "key": "id",
+ "description": "Condition ID",
+ "required": true,
+ "internal": false,
+ "exampleValue": "10"
+ },
+ {
+ "key": "metric",
+ "description": "Condition metric",
+ "required": true,
+ "internal": false,
+ "exampleValue": "blocker_violations"
+ },
+ {
+ "key": "op",
+ "description": "Condition operator:
Requires one of the following permissions:
",
+ "since": "4.4",
+ "internal": false,
+ "post": true,
+ "hasResponseExample": false,
+ "changelog": [],
+ "params": [
+ {
+ "key": "key",
+ "description": "Quality Profile key. Can be obtained through api/qualityprofiles/search
",
+ "required": true,
+ "internal": false,
+ "exampleValue": "AU-Tpxb--iU5OvuD2FLy",
+ "deprecatedKey": "profile_key",
+ "deprecatedKeySince": "6.5"
+ },
+ {
+ "key": "params",
+ "description": "Parameters as semi-colon list of key=value
. Ignored if parameter reset is true.",
+ "required": false,
+ "internal": false,
+ "exampleValue": "params=key1=v1;key2=v2"
+ },
+ {
+ "key": "reset",
+ "description": "Reset severity and parameters of activated rule. Set the values defined on parent profile or from rule default values.",
+ "required": false,
+ "internal": false,
+ "possibleValues": [
+ "true",
+ "false",
+ "yes",
+ "no"
+ ]
+ },
+ {
+ "key": "rule",
+ "description": "Rule key",
+ "required": true,
+ "internal": false,
+ "exampleValue": "squid:AvoidCycles",
+ "deprecatedKey": "rule_key",
+ "deprecatedKeySince": "6.5"
+ },
+ {
+ "key": "severity",
+ "description": "Severity. Ignored if parameter reset is true.",
+ "required": false,
+ "internal": false,
+ "possibleValues": [
+ "INFO",
+ "MINOR",
+ "MAJOR",
+ "CRITICAL",
+ "BLOCKER"
+ ]
+ }
+ ]
+ },
+ {
+ "key": "activate_rules",
+ "description": "Bulk-activate rules on one quality profile.
Requires one of the following permissions:
",
+ "since": "4.4",
+ "internal": false,
+ "post": true,
+ "hasResponseExample": false,
+ "changelog": [],
+ "params": [
+ {
+ "key": "activation",
+ "description": "Filter rules that are activated or deactivated on the selected Quality profile. Ignored if the parameter 'qprofile' is not set.",
+ "required": false,
+ "internal": false,
+ "possibleValues": [
+ "true",
+ "false",
+ "yes",
+ "no"
+ ]
+ },
+ {
+ "key": "active_severities",
+ "description": "Comma-separated list of activation severities, i.e the severity of rules in Quality profiles.",
+ "required": false,
+ "internal": false,
+ "exampleValue": "CRITICAL,BLOCKER",
+ "possibleValues": [
+ "INFO",
+ "MINOR",
+ "MAJOR",
+ "CRITICAL",
+ "BLOCKER"
+ ]
+ },
+ {
+ "key": "asc",
+ "description": "Ascending sort",
+ "required": false,
+ "internal": false,
+ "defaultValue": "true",
+ "possibleValues": [
+ "true",
+ "false",
+ "yes",
+ "no"
+ ]
+ },
+ {
+ "key": "available_since",
+ "description": "Filters rules added since date. Format is yyyy-MM-dd",
+ "required": false,
+ "internal": false,
+ "exampleValue": "2014-06-22"
+ },
+ {
+ "key": "compareToProfile",
+ "description": "Quality profile key to filter rules that are activated. Meant to compare easily to profile set in 'qprofile'",
+ "since": "6.5",
+ "required": false,
+ "internal": true,
+ "exampleValue": "AU-TpxcA-iU5OvuD2FLz"
+ },
+ {
+ "key": "inheritance",
+ "description": "Comma-separated list of values of inheritance for a rule within a quality profile. Used only if the parameter 'activation' is set.",
+ "required": false,
+ "internal": false,
+ "exampleValue": "INHERITED,OVERRIDES",
+ "possibleValues": [
+ "NONE",
+ "INHERITED",
+ "OVERRIDES"
+ ]
+ },
+ {
+ "key": "is_template",
+ "description": "Filter template rules",
+ "required": false,
+ "internal": false,
+ "possibleValues": [
+ "true",
+ "false",
+ "yes",
+ "no"
+ ]
+ },
+ {
+ "key": "languages",
+ "description": "Comma-separated list of languages",
+ "required": false,
+ "internal": false,
+ "exampleValue": "java,js"
+ },
+ {
+ "key": "organization",
+ "description": "Organization key",
+ "since": "6.4",
+ "required": false,
+ "internal": true,
+ "exampleValue": "my-org"
+ },
+ {
+ "key": "q",
+ "description": "UTF-8 search query",
+ "required": false,
+ "internal": false,
+ "exampleValue": "xpath"
+ },
+ {
+ "key": "qprofile",
+ "description": "Quality profile key to filter on. Used only if the parameter 'activation' is set.",
+ "required": false,
+ "internal": false,
+ "exampleValue": "AU-Tpxb--iU5OvuD2FLy"
+ },
+ {
+ "key": "repositories",
+ "description": "Comma-separated list of repositories",
+ "required": false,
+ "internal": false,
+ "exampleValue": "checkstyle,findbugs"
+ },
+ {
+ "key": "rule_key",
+ "description": "Key of rule to search for",
+ "required": false,
+ "internal": false,
+ "exampleValue": "squid:S001"
+ },
+ {
+ "key": "s",
+ "description": "Sort field",
+ "required": false,
+ "internal": false,
+ "exampleValue": "name",
+ "possibleValues": [
+ "name",
+ "updatedAt",
+ "createdAt",
+ "key"
+ ]
+ },
+ {
+ "key": "severities",
+ "description": "Comma-separated list of default severities. Not the same than severity of rules in Quality profiles.",
+ "required": false,
+ "internal": false,
+ "exampleValue": "CRITICAL,BLOCKER",
+ "possibleValues": [
+ "INFO",
+ "MINOR",
+ "MAJOR",
+ "CRITICAL",
+ "BLOCKER"
+ ]
+ },
+ {
+ "key": "statuses",
+ "description": "Comma-separated list of status codes",
+ "required": false,
+ "internal": false,
+ "exampleValue": "READY",
+ "possibleValues": [
+ "BETA",
+ "DEPRECATED",
+ "READY",
+ "REMOVED"
+ ]
+ },
+ {
+ "key": "tags",
+ "description": "Comma-separated list of tags. Returned rules match any of the tags (OR operator)",
+ "required": false,
+ "internal": false,
+ "exampleValue": "security,java8"
+ },
+ {
+ "key": "targetKey",
+ "description": "Quality Profile key on which the rule activation is done. To retrieve a quality profile key please see api/qualityprofiles/search
",
+ "required": true,
+ "internal": false,
+ "exampleValue": "AU-TpxcA-iU5OvuD2FL0",
+ "deprecatedKey": "profile_key",
+ "deprecatedKeySince": "6.5"
+ },
+ {
+ "key": "targetSeverity",
+ "description": "Severity to set on the activated rules",
+ "required": false,
+ "internal": false,
+ "deprecatedKey": "activation_severity",
+ "deprecatedKeySince": "6.5",
+ "possibleValues": [
+ "INFO",
+ "MINOR",
+ "MAJOR",
+ "CRITICAL",
+ "BLOCKER"
+ ]
+ },
+ {
+ "key": "template_key",
+ "description": "Key of the template rule to filter on. Used to search for the custom rules based on this template.",
+ "required": false,
+ "internal": false,
+ "exampleValue": "java:S001"
+ },
+ {
+ "key": "types",
+ "description": "Comma-separated list of types. Returned rules match any of the tags (OR operator)",
+ "since": "5.5",
+ "required": false,
+ "internal": false,
+ "exampleValue": "BUG",
+ "possibleValues": [
+ "CODE_SMELL",
+ "BUG",
+ "VULNERABILITY"
+ ]
+ }
+ ]
+ },
+ {
+ "key": "add_group",
+ "description": "Allow a group to edit a Quality Profile.
Requires one of the following permissions:
",
+ "since": "6.6",
+ "internal": true,
+ "post": true,
+ "hasResponseExample": false,
+ "changelog": [],
+ "params": [
+ {
+ "key": "group",
+ "description": "Group name",
+ "required": true,
+ "internal": false,
+ "exampleValue": "sonar-administrators"
+ },
+ {
+ "key": "language",
+ "description": "Quality profile language",
+ "required": true,
+ "internal": false
+ },
+ {
+ "key": "organization",
+ "description": "Organization key. If no organization is provided, the default organization is used.",
+ "required": false,
+ "internal": true,
+ "exampleValue": "my-org"
+ },
+ {
+ "key": "qualityProfile",
+ "description": "Quality Profile name",
+ "required": true,
+ "internal": false,
+ "exampleValue": "Recommended quality profile"
+ }
+ ]
+ },
+ {
+ "key": "add_project",
+ "description": "Associate a project with a quality profile.
Requires one of the following permissions:
",
+ "since": "5.2",
+ "internal": false,
+ "post": true,
+ "hasResponseExample": false,
+ "changelog": [],
+ "params": [
+ {
+ "key": "key",
+ "description": "Quality profile key",
+ "required": false,
+ "internal": false,
+ "exampleValue": "AU-Tpxb--iU5OvuD2FLy",
+ "deprecatedSince": "6.6",
+ "deprecatedKey": "profileKey",
+ "deprecatedKeySince": "6.5"
+ },
+ {
+ "key": "language",
+ "description": "Quality profile language. If this parameter is set, 'key' must not be set and 'language' must be set to disambiguate.",
+ "required": false,
+ "internal": false
+ },
+ {
+ "key": "organization",
+ "description": "Organization key. If no organization is provided, the default organization is used.",
+ "since": "6.4",
+ "required": false,
+ "internal": true,
+ "exampleValue": "my-org"
+ },
+ {
+ "key": "project",
+ "description": "Project key",
+ "required": false,
+ "internal": false,
+ "exampleValue": "my_project",
+ "deprecatedKey": "projectKey",
+ "deprecatedKeySince": "6.5"
+ },
+ {
+ "key": "projectUuid",
+ "description": "Project ID. Either this parameter or 'project' must be set.",
+ "required": false,
+ "internal": false,
+ "exampleValue": "AU-TpxcA-iU5OvuD2FL5",
+ "deprecatedSince": "6.5"
+ },
+ {
+ "key": "qualityProfile",
+ "description": "Quality profile name. If this parameter is set, 'key' must not be set and 'language' must be set to disambiguate.",
+ "required": false,
+ "internal": false,
+ "exampleValue": "Sonar way",
+ "deprecatedKey": "profileName",
+ "deprecatedKeySince": "6.6"
+ }
+ ]
+ },
+ {
+ "key": "add_user",
+ "description": "Allow a user to edit a Quality Profile.
Requires one of the following permissions:
",
+ "since": "6.6",
+ "internal": true,
+ "post": true,
+ "hasResponseExample": false,
+ "changelog": [],
+ "params": [
+ {
+ "key": "language",
+ "description": "Quality profile language",
+ "required": true,
+ "internal": false
+ },
+ {
+ "key": "login",
+ "description": "User login",
+ "required": true,
+ "internal": false,
+ "exampleValue": "john.doe"
+ },
+ {
+ "key": "organization",
+ "description": "Organization key. If no organization is provided, the default organization is used.",
+ "required": false,
+ "internal": true,
+ "exampleValue": "my-org"
+ },
+ {
+ "key": "qualityProfile",
+ "description": "Quality Profile name",
+ "required": true,
+ "internal": false,
+ "exampleValue": "Recommended quality profile"
+ }
+ ]
+ },
+ {
+ "key": "backup",
+ "description": "Backup a quality profile in XML form. The exported profile can be restored through api/qualityprofiles/restore.",
+ "since": "5.2",
+ "internal": false,
+ "post": false,
+ "hasResponseExample": true,
+ "changelog": [],
+ "params": [
+ {
+ "key": "key",
+ "description": "Quality profile key",
+ "required": false,
+ "internal": false,
+ "exampleValue": "AU-Tpxb--iU5OvuD2FLy",
+ "deprecatedSince": "6.6",
+ "deprecatedKey": "profileKey",
+ "deprecatedKeySince": "6.5"
+ },
+ {
+ "key": "language",
+ "description": "Quality profile language. If this parameter is set, 'key' must not be set and 'language' must be set to disambiguate.",
+ "required": false,
+ "internal": false
+ },
+ {
+ "key": "organization",
+ "description": "Organization key. If no organization is provided, the default organization is used.",
+ "since": "6.4",
+ "required": false,
+ "internal": true,
+ "exampleValue": "my-org"
+ },
+ {
+ "key": "qualityProfile",
+ "description": "Quality profile name. If this parameter is set, 'key' must not be set and 'language' must be set to disambiguate.",
+ "required": false,
+ "internal": false,
+ "exampleValue": "Sonar way",
+ "deprecatedKey": "profileName",
+ "deprecatedKeySince": "6.6"
+ }
+ ]
+ },
+ {
+ "key": "change_parent",
+ "description": "Change a quality profile's parent.
Requires one of the following permissions:
",
+ "since": "5.2",
+ "internal": false,
+ "post": true,
+ "hasResponseExample": false,
+ "changelog": [],
+ "params": [
+ {
+ "key": "key",
+ "description": "Quality profile key",
+ "required": false,
+ "internal": false,
+ "exampleValue": "AU-Tpxb--iU5OvuD2FLy",
+ "deprecatedSince": "6.6",
+ "deprecatedKey": "profileKey",
+ "deprecatedKeySince": "6.5"
+ },
+ {
+ "key": "language",
+ "description": "Quality profile language. If this parameter is set, 'key' must not be set and 'language' must be set to disambiguate.",
+ "required": false,
+ "internal": false
+ },
+ {
+ "key": "organization",
+ "description": "Organization key. If no organization is provided, the default organization is used.",
+ "since": "6.4",
+ "required": false,
+ "internal": true,
+ "exampleValue": "my-org"
+ },
+ {
+ "key": "parentKey",
+ "description": "New parent profile key.
If no profile is provided, the inheritance link with current parent profile (if any) is broken, which deactivates all rules which come from the parent and are not overridden.",
+ "required": false,
+ "internal": false,
+ "exampleValue": "AU-TpxcA-iU5OvuD2FLz",
+ "deprecatedSince": "6.6"
+ },
+ {
+ "key": "parentQualityProfile",
+ "description": "Quality profile name. If this parameter is set, 'parentKey' must not be set and 'language' must be set to disambiguate.",
+ "required": false,
+ "internal": false,
+ "exampleValue": "Sonar way"
+ },
+ {
+ "key": "qualityProfile",
+ "description": "Quality profile name. If this parameter is set, 'key' must not be set and 'language' must be set to disambiguate.",
+ "required": false,
+ "internal": false,
+ "exampleValue": "Sonar way",
+ "deprecatedKey": "profileName",
+ "deprecatedKeySince": "6.6"
+ }
+ ]
+ },
+ {
+ "key": "changelog",
+ "description": "Get the history of changes on a quality profile: rule activation/deactivation, change in parameters/severity. Events are ordered by date in descending order (most recent first).",
+ "since": "5.2",
+ "internal": false,
+ "post": false,
+ "hasResponseExample": true,
+ "changelog": [],
+ "params": [
+ {
+ "key": "key",
+ "description": "Quality profile key",
+ "required": false,
+ "internal": false,
+ "exampleValue": "AU-Tpxb--iU5OvuD2FLy",
+ "deprecatedSince": "6.6",
+ "deprecatedKey": "profileKey",
+ "deprecatedKeySince": "6.5"
+ },
+ {
+ "key": "language",
+ "description": "Quality profile language. If this parameter is set, 'key' must not be set and 'language' must be set to disambiguate.",
+ "required": false,
+ "internal": false
+ },
+ {
+ "key": "organization",
+ "description": "Organization key. If no organization is provided, the default organization is used.",
+ "since": "6.4",
+ "required": false,
+ "internal": true,
+ "exampleValue": "my-org"
+ },
+ {
+ "key": "p",
+ "description": "1-based page number",
+ "required": false,
+ "internal": false,
+ "defaultValue": "1",
+ "exampleValue": "42",
+ "deprecatedKey": "pageIndex",
+ "deprecatedKeySince": "5.2"
+ },
+ {
+ "key": "ps",
+ "description": "Page size. Must be greater than 0 and less than 500",
+ "required": false,
+ "internal": false,
+ "defaultValue": "50",
+ "exampleValue": "20",
+ "deprecatedKey": "pageSize",
+ "deprecatedKeySince": "5.2",
+ "maximumValue": 500
+ },
+ {
+ "key": "qualityProfile",
+ "description": "Quality profile name. If this parameter is set, 'key' must not be set and 'language' must be set to disambiguate.",
+ "required": false,
+ "internal": false,
+ "exampleValue": "Sonar way",
+ "deprecatedKey": "profileName",
+ "deprecatedKeySince": "6.6"
+ },
+ {
+ "key": "since",
+ "description": "Start date for the changelog.
Either a date (server timezone) or datetime can be provided.",
+ "required": false,
+ "internal": false,
+ "exampleValue": "2017-10-19 or 2017-10-19T13:00:00+0200"
+ },
+ {
+ "key": "to",
+ "description": "End date for the changelog.
Either a date (server timezone) or datetime can be provided.",
+ "required": false,
+ "internal": false,
+ "exampleValue": "2017-10-19 or 2017-10-19T13:00:00+0200"
+ }
+ ]
+ },
+ {
+ "key": "compare",
+ "description": "Compare two quality profiles.",
+ "since": "5.2",
+ "internal": true,
+ "post": false,
+ "hasResponseExample": true,
+ "changelog": [],
+ "params": [
+ {
+ "key": "leftKey",
+ "description": "Profile key.",
+ "required": true,
+ "internal": false,
+ "exampleValue": "AU-Tpxb--iU5OvuD2FLy"
+ },
+ {
+ "key": "rightKey",
+ "description": "Another profile key.",
+ "required": true,
+ "internal": false,
+ "exampleValue": "AU-TpxcA-iU5OvuD2FLz"
+ }
+ ]
+ },
+ {
+ "key": "copy",
+ "description": "Copy a quality profile.
Requires to be logged in and the 'Administer Quality Profiles' permission.",
+ "since": "5.2",
+ "internal": false,
+ "post": true,
+ "hasResponseExample": false,
+ "changelog": [],
+ "params": [
+ {
+ "key": "fromKey",
+ "description": "Quality profile key",
+ "required": true,
+ "internal": false,
+ "exampleValue": "AU-Tpxb--iU5OvuD2FLy"
+ },
+ {
+ "key": "toName",
+ "description": "Name for the new quality profile.",
+ "required": true,
+ "internal": false,
+ "exampleValue": "My Sonar way"
+ }
+ ]
+ },
+ {
+ "key": "create",
+ "description": "Create a quality profile.
Requires to be logged in and the 'Administer Quality Profiles' permission.",
+ "since": "5.2",
+ "internal": false,
+ "post": true,
+ "hasResponseExample": true,
+ "changelog": [],
+ "params": [
+ {
+ "key": "language",
+ "description": "Quality profile language",
+ "required": true,
+ "internal": false,
+ "exampleValue": "js"
+ },
+ {
+ "key": "name",
+ "description": "Quality profile name",
+ "required": true,
+ "internal": false,
+ "exampleValue": "My Sonar way",
+ "deprecatedKey": "profileName",
+ "deprecatedKeySince": "6.6",
+ "maximumLength": 100
+ },
+ {
+ "key": "organization",
+ "description": "Organization key. If no organization is provided, the default organization is used.",
+ "since": "6.4",
+ "required": false,
+ "internal": true,
+ "exampleValue": "my-org"
+ }
+ ]
+ },
+ {
+ "key": "deactivate_rule",
+ "description": "Deactivate a rule on a quality profile.
Requires one of the following permissions:
",
+ "since": "4.4",
+ "internal": false,
+ "post": true,
+ "hasResponseExample": false,
+ "changelog": [],
+ "params": [
+ {
+ "key": "key",
+ "description": "Quality Profile key. Can be obtained through api/qualityprofiles/search
",
+ "required": true,
+ "internal": false,
+ "exampleValue": "AU-Tpxb--iU5OvuD2FLy",
+ "deprecatedKey": "profile_key",
+ "deprecatedKeySince": "6.5"
+ },
+ {
+ "key": "rule",
+ "description": "Rule key",
+ "required": true,
+ "internal": false,
+ "exampleValue": "squid:AvoidCycles",
+ "deprecatedKey": "rule_key",
+ "deprecatedKeySince": "6.5"
+ }
+ ]
+ },
+ {
+ "key": "deactivate_rules",
+ "description": "Bulk deactivate rules on Quality profiles.
Requires one of the following permissions:
",
+ "since": "4.4",
+ "internal": false,
+ "post": true,
+ "hasResponseExample": false,
+ "changelog": [],
+ "params": [
+ {
+ "key": "activation",
+ "description": "Filter rules that are activated or deactivated on the selected Quality profile. Ignored if the parameter 'qprofile' is not set.",
+ "required": false,
+ "internal": false,
+ "possibleValues": [
+ "true",
+ "false",
+ "yes",
+ "no"
+ ]
+ },
+ {
+ "key": "active_severities",
+ "description": "Comma-separated list of activation severities, i.e the severity of rules in Quality profiles.",
+ "required": false,
+ "internal": false,
+ "exampleValue": "CRITICAL,BLOCKER",
+ "possibleValues": [
+ "INFO",
+ "MINOR",
+ "MAJOR",
+ "CRITICAL",
+ "BLOCKER"
+ ]
+ },
+ {
+ "key": "asc",
+ "description": "Ascending sort",
+ "required": false,
+ "internal": false,
+ "defaultValue": "true",
+ "possibleValues": [
+ "true",
+ "false",
+ "yes",
+ "no"
+ ]
+ },
+ {
+ "key": "available_since",
+ "description": "Filters rules added since date. Format is yyyy-MM-dd",
+ "required": false,
+ "internal": false,
+ "exampleValue": "2014-06-22"
+ },
+ {
+ "key": "compareToProfile",
+ "description": "Quality profile key to filter rules that are activated. Meant to compare easily to profile set in 'qprofile'",
+ "since": "6.5",
+ "required": false,
+ "internal": true,
+ "exampleValue": "AU-TpxcA-iU5OvuD2FLz"
+ },
+ {
+ "key": "inheritance",
+ "description": "Comma-separated list of values of inheritance for a rule within a quality profile. Used only if the parameter 'activation' is set.",
+ "required": false,
+ "internal": false,
+ "exampleValue": "INHERITED,OVERRIDES",
+ "possibleValues": [
+ "NONE",
+ "INHERITED",
+ "OVERRIDES"
+ ]
+ },
+ {
+ "key": "is_template",
+ "description": "Filter template rules",
+ "required": false,
+ "internal": false,
+ "possibleValues": [
+ "true",
+ "false",
+ "yes",
+ "no"
+ ]
+ },
+ {
+ "key": "languages",
+ "description": "Comma-separated list of languages",
+ "required": false,
+ "internal": false,
+ "exampleValue": "java,js"
+ },
+ {
+ "key": "organization",
+ "description": "Organization key",
+ "since": "6.4",
+ "required": false,
+ "internal": true,
+ "exampleValue": "my-org"
+ },
+ {
+ "key": "q",
+ "description": "UTF-8 search query",
+ "required": false,
+ "internal": false,
+ "exampleValue": "xpath"
+ },
+ {
+ "key": "qprofile",
+ "description": "Quality profile key to filter on. Used only if the parameter 'activation' is set.",
+ "required": false,
+ "internal": false,
+ "exampleValue": "AU-Tpxb--iU5OvuD2FLy"
+ },
+ {
+ "key": "repositories",
+ "description": "Comma-separated list of repositories",
+ "required": false,
+ "internal": false,
+ "exampleValue": "checkstyle,findbugs"
+ },
+ {
+ "key": "rule_key",
+ "description": "Key of rule to search for",
+ "required": false,
+ "internal": false,
+ "exampleValue": "squid:S001"
+ },
+ {
+ "key": "s",
+ "description": "Sort field",
+ "required": false,
+ "internal": false,
+ "exampleValue": "name",
+ "possibleValues": [
+ "name",
+ "updatedAt",
+ "createdAt",
+ "key"
+ ]
+ },
+ {
+ "key": "severities",
+ "description": "Comma-separated list of default severities. Not the same than severity of rules in Quality profiles.",
+ "required": false,
+ "internal": false,
+ "exampleValue": "CRITICAL,BLOCKER",
+ "possibleValues": [
+ "INFO",
+ "MINOR",
+ "MAJOR",
+ "CRITICAL",
+ "BLOCKER"
+ ]
+ },
+ {
+ "key": "statuses",
+ "description": "Comma-separated list of status codes",
+ "required": false,
+ "internal": false,
+ "exampleValue": "READY",
+ "possibleValues": [
+ "BETA",
+ "DEPRECATED",
+ "READY",
+ "REMOVED"
+ ]
+ },
+ {
+ "key": "tags",
+ "description": "Comma-separated list of tags. Returned rules match any of the tags (OR operator)",
+ "required": false,
+ "internal": false,
+ "exampleValue": "security,java8"
+ },
+ {
+ "key": "targetKey",
+ "description": "Quality Profile key on which the rule deactivation is done. To retrieve a profile key please see api/qualityprofiles/search
",
+ "required": true,
+ "internal": false,
+ "exampleValue": "AU-TpxcA-iU5OvuD2FL1",
+ "deprecatedKey": "profile_key",
+ "deprecatedKeySince": "6.5"
+ },
+ {
+ "key": "template_key",
+ "description": "Key of the template rule to filter on. Used to search for the custom rules based on this template.",
+ "required": false,
+ "internal": false,
+ "exampleValue": "java:S001"
+ },
+ {
+ "key": "types",
+ "description": "Comma-separated list of types. Returned rules match any of the tags (OR operator)",
+ "since": "5.5",
+ "required": false,
+ "internal": false,
+ "exampleValue": "BUG",
+ "possibleValues": [
+ "CODE_SMELL",
+ "BUG",
+ "VULNERABILITY"
+ ]
+ }
+ ]
+ },
+ {
+ "key": "delete",
+ "description": "Delete a quality profile and all its descendants. The default quality profile cannot be deleted.
Requires one of the following permissions:
",
+ "since": "5.2",
+ "internal": false,
+ "post": true,
+ "hasResponseExample": false,
+ "changelog": [],
+ "params": [
+ {
+ "key": "key",
+ "description": "Quality profile key",
+ "required": false,
+ "internal": false,
+ "exampleValue": "AU-Tpxb--iU5OvuD2FLy",
+ "deprecatedSince": "6.6",
+ "deprecatedKey": "profileKey",
+ "deprecatedKeySince": "6.5"
+ },
+ {
+ "key": "language",
+ "description": "Quality profile language. If this parameter is set, 'key' must not be set and 'language' must be set to disambiguate.",
+ "required": false,
+ "internal": false
+ },
+ {
+ "key": "organization",
+ "description": "Organization key. If no organization is provided, the default organization is used.",
+ "since": "6.4",
+ "required": false,
+ "internal": true,
+ "exampleValue": "my-org"
+ },
+ {
+ "key": "qualityProfile",
+ "description": "Quality profile name. If this parameter is set, 'key' must not be set and 'language' must be set to disambiguate.",
+ "required": false,
+ "internal": false,
+ "exampleValue": "Sonar way",
+ "deprecatedKey": "profileName",
+ "deprecatedKeySince": "6.6"
+ }
+ ]
+ },
+ {
+ "key": "export",
+ "description": "Export a quality profile.",
+ "since": "5.2",
+ "internal": false,
+ "post": false,
+ "hasResponseExample": true,
+ "changelog": [],
+ "params": [
+ {
+ "key": "key",
+ "description": "Quality profile key",
+ "since": "6.5",
+ "required": false,
+ "internal": false,
+ "exampleValue": "AU-Tpxb--iU5OvuD2FLy",
+ "deprecatedSince": "6.6"
+ },
+ {
+ "key": "language",
+ "description": "Quality profile language. If this parameter is set, 'key' must not be set.",
+ "required": false,
+ "internal": false,
+ "exampleValue": ""
+ },
+ {
+ "key": "organization",
+ "description": "Organization key. If no organization is provided, the default organization is used.",
+ "since": "6.4",
+ "required": false,
+ "internal": true,
+ "exampleValue": "my-org"
+ },
+ {
+ "key": "qualityProfile",
+ "description": "Quality profile name to export. If left empty, the default profile for the language is exported. If this parameter is set, 'key' must not be set.",
+ "required": false,
+ "internal": false,
+ "exampleValue": "My Sonar way",
+ "deprecatedKey": "profileName",
+ "deprecatedKeySince": "6.6"
+ }
+ ]
+ },
+ {
+ "key": "exporters",
+ "description": "Lists available profile export formats.",
+ "since": "5.2",
+ "internal": false,
+ "post": false,
+ "hasResponseExample": true,
+ "changelog": []
+ },
+ {
+ "key": "importers",
+ "description": "List supported importers.",
+ "since": "5.2",
+ "internal": false,
+ "post": false,
+ "hasResponseExample": true,
+ "changelog": []
+ },
+ {
+ "key": "inheritance",
+ "description": "Show a quality profile's ancestors and children.",
+ "since": "5.2",
+ "internal": false,
+ "post": false,
+ "hasResponseExample": true,
+ "changelog": [],
+ "params": [
+ {
+ "key": "key",
+ "description": "Quality profile key",
+ "required": false,
+ "internal": false,
+ "exampleValue": "AU-Tpxb--iU5OvuD2FLy",
+ "deprecatedSince": "6.6",
+ "deprecatedKey": "profileKey",
+ "deprecatedKeySince": "6.5"
+ },
+ {
+ "key": "language",
+ "description": "Quality profile language. If this parameter is set, 'key' must not be set and 'language' must be set to disambiguate.",
+ "required": false,
+ "internal": false
+ },
+ {
+ "key": "organization",
+ "description": "Organization key. If no organization is provided, the default organization is used.",
+ "since": "6.4",
+ "required": false,
+ "internal": true,
+ "exampleValue": "my-org"
+ },
+ {
+ "key": "qualityProfile",
+ "description": "Quality profile name. If this parameter is set, 'key' must not be set and 'language' must be set to disambiguate.",
+ "required": false,
+ "internal": false,
+ "exampleValue": "Sonar way",
+ "deprecatedKey": "profileName",
+ "deprecatedKeySince": "6.6"
+ }
+ ]
+ },
+ {
+ "key": "projects",
+ "description": "List projects with their association status regarding a quality profile",
+ "since": "5.2",
+ "internal": false,
+ "post": false,
+ "hasResponseExample": true,
+ "changelog": [
+ {
+ "description": "'id' response field is deprecated",
+ "version": "6.5"
+ },
+ {
+ "description": "'uuid' response field is deprecated and replaced by 'id'",
+ "version": "6.0"
+ },
+ {
+ "description": "'key' response field has been added to return the project key",
+ "version": "6.0"
+ }
+ ],
+ "params": [
+ {
+ "key": "key",
+ "description": "Quality profile key",
+ "required": true,
+ "internal": false,
+ "exampleValue": "AU-Tpxb--iU5OvuD2FLy"
+ },
+ {
+ "key": "p",
+ "description": "1-based page number",
+ "required": false,
+ "internal": false,
+ "defaultValue": "1",
+ "exampleValue": "42",
+ "deprecatedKey": "page",
+ "deprecatedKeySince": "6.5"
+ },
+ {
+ "key": "ps",
+ "description": "Page size. Must be greater than 0 and less than 500",
+ "required": false,
+ "internal": false,
+ "defaultValue": "100",
+ "exampleValue": "20",
+ "deprecatedKey": "pageSize",
+ "deprecatedKeySince": "5.2",
+ "maximumValue": 500
+ },
+ {
+ "key": "q",
+ "description": "Limit search to projects that contain the supplied string.",
+ "required": false,
+ "internal": false,
+ "exampleValue": "sonar",
+ "deprecatedKey": "query",
+ "deprecatedKeySince": "6.5"
+ },
+ {
+ "key": "selected",
+ "description": "Depending on the value, show only selected items (selected=selected), deselected items (selected=deselected), or all items with their selection status (selected=all).",
+ "required": false,
+ "internal": false,
+ "defaultValue": "selected",
+ "possibleValues": [
+ "all",
+ "deselected",
+ "selected"
+ ]
+ }
+ ]
+ },
+ {
+ "key": "remove_group",
+ "description": "Remove the ability from a group to edit a Quality Profile.
Requires one of the following permissions:
",
+ "since": "6.6",
+ "internal": true,
+ "post": true,
+ "hasResponseExample": false,
+ "changelog": [],
+ "params": [
+ {
+ "key": "group",
+ "description": "Group name",
+ "required": true,
+ "internal": false,
+ "exampleValue": "sonar-administrators"
+ },
+ {
+ "key": "language",
+ "description": "Quality profile language",
+ "required": true,
+ "internal": false
+ },
+ {
+ "key": "organization",
+ "description": "Organization key. If no organization is provided, the default organization is used.",
+ "required": false,
+ "internal": true,
+ "exampleValue": "my-org"
+ },
+ {
+ "key": "qualityProfile",
+ "description": "Quality Profile name",
+ "required": true,
+ "internal": false,
+ "exampleValue": "Recommended quality profile"
+ }
+ ]
+ },
+ {
+ "key": "remove_project",
+ "description": "Remove a project's association with a quality profile.
Requires one of the following permissions:
",
+ "since": "5.2",
+ "internal": false,
+ "post": true,
+ "hasResponseExample": false,
+ "changelog": [],
+ "params": [
+ {
+ "key": "key",
+ "description": "Quality profile key",
+ "required": false,
+ "internal": false,
+ "exampleValue": "AU-Tpxb--iU5OvuD2FLy",
+ "deprecatedSince": "6.6",
+ "deprecatedKey": "profileKey",
+ "deprecatedKeySince": "6.5"
+ },
+ {
+ "key": "language",
+ "description": "Quality profile language. If this parameter is set, 'key' must not be set and 'language' must be set to disambiguate.",
+ "required": false,
+ "internal": false
+ },
+ {
+ "key": "organization",
+ "description": "Organization key. If no organization is provided, the default organization is used.",
+ "since": "6.4",
+ "required": false,
+ "internal": true,
+ "exampleValue": "my-org"
+ },
+ {
+ "key": "project",
+ "description": "Project key",
+ "required": false,
+ "internal": false,
+ "exampleValue": "my_project",
+ "deprecatedKey": "projectKey",
+ "deprecatedKeySince": "6.5"
+ },
+ {
+ "key": "projectUuid",
+ "description": "Project ID. Either this parameter, or 'project' must be set.",
+ "required": false,
+ "internal": false,
+ "exampleValue": "AU-TpxcB-iU5OvuD2FL6",
+ "deprecatedSince": "6.5"
+ },
+ {
+ "key": "qualityProfile",
+ "description": "Quality profile name. If this parameter is set, 'key' must not be set and 'language' must be set to disambiguate.",
+ "required": false,
+ "internal": false,
+ "exampleValue": "Sonar way",
+ "deprecatedKey": "profileName",
+ "deprecatedKeySince": "6.6"
+ }
+ ]
+ },
+ {
+ "key": "remove_user",
+ "description": "Remove the ability from a user to edit a Quality Profile.
Requires one of the following permissions:
",
+ "since": "6.6",
+ "internal": true,
+ "post": true,
+ "hasResponseExample": false,
+ "changelog": [],
+ "params": [
+ {
+ "key": "language",
+ "description": "Quality profile language",
+ "required": true,
+ "internal": false
+ },
+ {
+ "key": "login",
+ "description": "User login",
+ "required": true,
+ "internal": false,
+ "exampleValue": "john.doe"
+ },
+ {
+ "key": "organization",
+ "description": "Organization key. If no organization is provided, the default organization is used.",
+ "required": false,
+ "internal": true,
+ "exampleValue": "my-org"
+ },
+ {
+ "key": "qualityProfile",
+ "description": "Quality Profile name",
+ "required": true,
+ "internal": false,
+ "exampleValue": "Recommended quality profile"
+ }
+ ]
+ },
+ {
+ "key": "rename",
+ "description": "Rename a quality profile.
Requires one of the following permissions:
",
+ "since": "5.2",
+ "internal": false,
+ "post": true,
+ "hasResponseExample": false,
+ "changelog": [],
+ "params": [
+ {
+ "key": "key",
+ "description": "Quality profile key",
+ "required": true,
+ "internal": false,
+ "exampleValue": "AU-Tpxb--iU5OvuD2FLy"
+ },
+ {
+ "key": "name",
+ "description": "New quality profile name",
+ "required": true,
+ "internal": false,
+ "exampleValue": "My Sonar way",
+ "maximumLength": 100
+ }
+ ]
+ },
+ {
+ "key": "restore",
+ "description": "Restore a quality profile using an XML file. The restored profile name is taken from the backup file, so if a profile with the same name and language already exists, it will be overwritten.
Requires to be logged in and the 'Administer Quality Profiles' permission.",
+ "since": "5.2",
+ "internal": false,
+ "post": true,
+ "hasResponseExample": false,
+ "changelog": [],
+ "params": [
+ {
+ "key": "backup",
+ "description": "A profile backup file in XML format, as generated by api/qualityprofiles/backup or the former api/profiles/backup.",
+ "required": true,
+ "internal": false
+ },
+ {
+ "key": "organization",
+ "description": "Organization key. If no organization is provided, the default organization is used.",
+ "since": "6.4",
+ "required": false,
+ "internal": true,
+ "exampleValue": "my-org"
+ }
+ ]
+ },
+ {
+ "key": "restore_built_in",
+ "description": "This web service has no effect since 6.4. It's no more possible to restore built-in quality profiles because they are automatically updated and read only. Returns HTTP code 410.",
+ "since": "4.4",
+ "deprecatedSince": "6.4",
+ "internal": false,
+ "post": true,
+ "hasResponseExample": false,
+ "changelog": []
+ },
+ {
+ "key": "search",
+ "description": "Search quality profiles",
+ "since": "5.2",
+ "internal": false,
+ "post": false,
+ "hasResponseExample": true,
+ "changelog": [
+ {
+ "description": "The parameters 'defaults', 'project' and 'language' can be combined without any constraint",
+ "version": "6.5"
+ }
+ ],
+ "params": [
+ {
+ "key": "defaults",
+ "description": "If set to true, return only the quality profiles marked as default for each language",
+ "required": false,
+ "internal": false,
+ "defaultValue": "false",
+ "possibleValues": [
+ "true",
+ "false",
+ "yes",
+ "no"
+ ]
+ },
+ {
+ "key": "language",
+ "description": "Language key. If provided, only profiles for the given language are returned.",
+ "required": false,
+ "internal": false
+ },
+ {
+ "key": "organization",
+ "description": "Organization key. If no organization is provided, the default organization is used.",
+ "since": "6.4",
+ "required": false,
+ "internal": true,
+ "exampleValue": "my-org"
+ },
+ {
+ "key": "project",
+ "description": "Project key",
+ "required": false,
+ "internal": false,
+ "exampleValue": "my_project",
+ "deprecatedKey": "projectKey",
+ "deprecatedKeySince": "6.5"
+ },
+ {
+ "key": "qualityProfile",
+ "description": "Quality profile name",
+ "required": false,
+ "internal": false,
+ "exampleValue": "SonarQube Way",
+ "deprecatedKey": "profileName",
+ "deprecatedKeySince": "6.6"
+ }
+ ]
+ },
+ {
+ "key": "search_groups",
+ "description": "List the groups that are allowed to edit a Quality Profile.
Requires one of the following permissions:
",
+ "since": "6.6",
+ "internal": true,
+ "post": false,
+ "hasResponseExample": true,
+ "changelog": [],
+ "params": [
+ {
+ "key": "language",
+ "description": "Quality profile language",
+ "required": true,
+ "internal": false
+ },
+ {
+ "key": "organization",
+ "description": "Organization key. If no organization is provided, the default organization is used.",
+ "required": false,
+ "internal": true,
+ "exampleValue": "my-org"
+ },
+ {
+ "key": "p",
+ "description": "1-based page number",
+ "required": false,
+ "internal": false,
+ "defaultValue": "1",
+ "exampleValue": "42",
+ "deprecatedKey": "pageIndex",
+ "deprecatedKeySince": "5.2"
+ },
+ {
+ "key": "ps",
+ "description": "Page size. Must be greater than 0.",
+ "required": false,
+ "internal": false,
+ "defaultValue": "25",
+ "exampleValue": "20",
+ "deprecatedKey": "pageSize",
+ "deprecatedKeySince": "5.2"
+ },
+ {
+ "key": "q",
+ "description": "Limit search to group names that contain the supplied string.",
+ "required": false,
+ "internal": false,
+ "exampleValue": "sonar"
+ },
+ {
+ "key": "qualityProfile",
+ "description": "Quality Profile name",
+ "required": true,
+ "internal": false,
+ "exampleValue": "Recommended quality profile"
+ },
+ {
+ "key": "selected",
+ "description": "Depending on the value, show only selected items (selected=selected), deselected items (selected=deselected), or all items with their selection status (selected=all).",
+ "required": false,
+ "internal": false,
+ "defaultValue": "selected",
+ "possibleValues": [
+ "all",
+ "deselected",
+ "selected"
+ ]
+ }
+ ]
+ },
+ {
+ "key": "search_users",
+ "description": "List the users that are allowed to edit a Quality Profile.
Requires one of the following permissions:
",
+ "since": "6.6",
+ "internal": true,
+ "post": false,
+ "hasResponseExample": true,
+ "changelog": [],
+ "params": [
+ {
+ "key": "language",
+ "description": "Quality profile language",
+ "required": true,
+ "internal": false
+ },
+ {
+ "key": "organization",
+ "description": "Organization key. If no organization is provided, the default organization is used.",
+ "required": false,
+ "internal": true,
+ "exampleValue": "my-org"
+ },
+ {
+ "key": "p",
+ "description": "1-based page number",
+ "required": false,
+ "internal": false,
+ "defaultValue": "1",
+ "exampleValue": "42",
+ "deprecatedKey": "pageIndex",
+ "deprecatedKeySince": "5.2"
+ },
+ {
+ "key": "ps",
+ "description": "Page size. Must be greater than 0.",
+ "required": false,
+ "internal": false,
+ "defaultValue": "25",
+ "exampleValue": "20",
+ "deprecatedKey": "pageSize",
+ "deprecatedKeySince": "5.2"
+ },
+ {
+ "key": "q",
+ "description": "Limit search to names or logins that contain the supplied string.",
+ "required": false,
+ "internal": false,
+ "exampleValue": "freddy"
+ },
+ {
+ "key": "qualityProfile",
+ "description": "Quality Profile name",
+ "required": true,
+ "internal": false,
+ "exampleValue": "Recommended quality profile"
+ },
+ {
+ "key": "selected",
+ "description": "Depending on the value, show only selected items (selected=selected), deselected items (selected=deselected), or all items with their selection status (selected=all).",
+ "required": false,
+ "internal": false,
+ "defaultValue": "selected",
+ "possibleValues": [
+ "all",
+ "deselected",
+ "selected"
+ ]
+ }
+ ]
+ },
+ {
+ "key": "set_default",
+ "description": "Select the default profile for a given language.
Requires to be logged in and the 'Administer Quality Profiles' permission.",
+ "since": "5.2",
+ "internal": false,
+ "post": true,
+ "hasResponseExample": false,
+ "changelog": [],
+ "params": [
+ {
+ "key": "key",
+ "description": "Quality profile key",
+ "required": false,
+ "internal": false,
+ "exampleValue": "AU-Tpxb--iU5OvuD2FLy",
+ "deprecatedSince": "6.6",
+ "deprecatedKey": "profileKey",
+ "deprecatedKeySince": "6.5"
+ },
+ {
+ "key": "language",
+ "description": "Quality profile language. If this parameter is set, 'key' must not be set and 'language' must be set to disambiguate.",
+ "required": false,
+ "internal": false
+ },
+ {
+ "key": "organization",
+ "description": "Organization key. If no organization is provided, the default organization is used.",
+ "since": "6.4",
+ "required": false,
+ "internal": true,
+ "exampleValue": "my-org"
+ },
+ {
+ "key": "qualityProfile",
+ "description": "Quality profile name. If this parameter is set, 'key' must not be set and 'language' must be set to disambiguate.",
+ "required": false,
+ "internal": false,
+ "exampleValue": "Sonar way",
+ "deprecatedKey": "profileName",
+ "deprecatedKeySince": "6.6"
+ }
+ ]
+ },
+ {
+ "key": "show",
+ "description": "Show a quality profile",
+ "since": "6.5",
+ "internal": true,
+ "post": false,
+ "hasResponseExample": true,
+ "changelog": [],
+ "params": [
+ {
+ "key": "compareToSonarWay",
+ "description": "Add the number of missing rules from the related Sonar way profile in the response",
+ "required": false,
+ "internal": true,
+ "defaultValue": "false",
+ "possibleValues": [
+ "true",
+ "false",
+ "yes",
+ "no"
+ ]
+ },
+ {
+ "key": "key",
+ "description": "Quality profile key",
+ "required": true,
+ "internal": false,
+ "exampleValue": "AU-Tpxb--iU5OvuD2FLy",
+ "deprecatedKey": "profile",
+ "deprecatedKeySince": "6.6"
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "path": "api/resources",
+ "since": "2.10",
+ "description": "Removed since 6.3, please use api/components and api/measures instead",
+ "actions": [
+ {
+ "key": "index",
+ "description": "The web service is removed and you're invited to use the alternatives:
",
+ "since": "2.10",
+ "deprecatedSince": "5.4",
+ "internal": false,
+ "post": false,
+ "hasResponseExample": true,
+ "changelog": []
+ }
+ ]
+ },
+ {
+ "path": "api/roots",
+ "since": "6.2",
+ "description": "Manage root users",
+ "actions": [
+ {
+ "key": "search",
+ "description": "Search for root users.
Requires to be root.",
+ "since": "6.2",
+ "internal": true,
+ "post": false,
+ "hasResponseExample": true,
+ "changelog": []
+ },
+ {
+ "key": "set_root",
+ "description": "Make the specified user root.
Requires to be root.",
+ "since": "6.2",
+ "internal": true,
+ "post": true,
+ "hasResponseExample": false,
+ "changelog": [],
+ "params": [
+ {
+ "key": "login",
+ "description": "A user login",
+ "since": "6.2",
+ "required": true,
+ "internal": false,
+ "exampleValue": "admin"
+ }
+ ]
+ },
+ {
+ "key": "unset_root",
+ "description": "Make the specified user not root.
Requires to be root.",
+ "since": "6.2",
+ "internal": true,
+ "post": true,
+ "hasResponseExample": false,
+ "changelog": [],
+ "params": [
+ {
+ "key": "login",
+ "description": "A user login",
+ "since": "6.2",
+ "required": true,
+ "internal": false,
+ "exampleValue": "admin"
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "path": "api/rules",
+ "description": "Get and update some details of automatic rules, and manage custom rules.",
+ "actions": [
+ {
+ "key": "app",
+ "description": "Get data required for rendering the page 'Coding Rules'.",
+ "since": "4.5",
+ "internal": true,
+ "post": false,
+ "hasResponseExample": true,
+ "changelog": [],
+ "params": [
+ {
+ "key": "organization",
+ "description": "Organization key",
+ "since": "6.4",
+ "required": false,
+ "internal": true,
+ "exampleValue": "my-org"
+ }
+ ]
+ },
+ {
+ "key": "create",
+ "description": "Create a custom rule.
Requires the 'Administer Quality Profiles' permission",
+ "since": "4.4",
+ "internal": false,
+ "post": true,
+ "hasResponseExample": false,
+ "changelog": [
+ {
+ "description": "Creating manual rule is not more possible",
+ "version": "5.5"
+ }
+ ],
+ "params": [
+ {
+ "key": "custom_key",
+ "description": "Key of the custom rule",
+ "required": true,
+ "internal": false,
+ "exampleValue": "Todo_should_not_be_used",
+ "maximumLength": 200
+ },
+ {
+ "key": "manual_key",
+ "description": "Manual rules are no more supported. This parameter is ignored",
+ "required": false,
+ "internal": false,
+ "exampleValue": "Error_handling",
+ "deprecatedSince": "5.5"
+ },
+ {
+ "key": "markdown_description",
+ "description": "Rule description",
+ "required": true,
+ "internal": false,
+ "exampleValue": "Description of my custom rule"
+ },
+ {
+ "key": "name",
+ "description": "Rule name",
+ "required": true,
+ "internal": false,
+ "exampleValue": "My custom rule",
+ "maximumLength": 200
+ },
+ {
+ "key": "params",
+ "description": "Parameters as semi-colon list of
Requires the 'Administer Quality Profiles' permission",
+ "since": "4.4",
+ "internal": false,
+ "post": true,
+ "hasResponseExample": false,
+ "changelog": [],
+ "params": [
+ {
+ "key": "key",
+ "description": "Rule key",
+ "required": true,
+ "internal": false,
+ "exampleValue": "squid:XPath_1402065390816"
+ }
+ ]
+ },
+ {
+ "key": "list",
+ "description": "List rules, excluding the manual rules and the rules with status REMOVED. JSON format is not supported for response.",
+ "since": "5.2",
+ "internal": true,
+ "post": false,
+ "hasResponseExample": true,
+ "changelog": []
+ },
+ {
+ "key": "repositories",
+ "description": "List available rule repositories",
+ "since": "4.5",
+ "internal": false,
+ "post": false,
+ "hasResponseExample": true,
+ "changelog": [],
+ "params": [
+ {
+ "key": "language",
+ "description": "A language key; if provided, only repositories for the given language will be returned",
+ "required": false,
+ "internal": false,
+ "exampleValue": "java"
+ },
+ {
+ "key": "q",
+ "description": "A pattern to match repository keys/names against",
+ "required": false,
+ "internal": false,
+ "exampleValue": "squid"
+ }
+ ]
+ },
+ {
+ "key": "search",
+ "description": "Search for a collection of relevant rules matching a specified query.
Since 5.5, following fields in the response have been deprecated :
",
+ "since": "4.4",
+ "internal": false,
+ "post": false,
+ "hasResponseExample": true,
+ "changelog": [],
+ "params": [
+ {
+ "key": "activation",
+ "description": "Filter rules that are activated or deactivated on the selected Quality profile. Ignored if the parameter 'qprofile' is not set.",
+ "required": false,
+ "internal": false,
+ "possibleValues": [
+ "true",
+ "false",
+ "yes",
+ "no"
+ ]
+ },
+ {
+ "key": "active_severities",
+ "description": "Comma-separated list of activation severities, i.e the severity of rules in Quality profiles.",
+ "required": false,
+ "internal": false,
+ "exampleValue": "CRITICAL,BLOCKER",
+ "possibleValues": [
+ "INFO",
+ "MINOR",
+ "MAJOR",
+ "CRITICAL",
+ "BLOCKER"
+ ]
+ },
+ {
+ "key": "asc",
+ "description": "Ascending sort",
+ "required": false,
+ "internal": false,
+ "defaultValue": "true",
+ "possibleValues": [
+ "true",
+ "false",
+ "yes",
+ "no"
+ ]
+ },
+ {
+ "key": "available_since",
+ "description": "Filters rules added since date. Format is yyyy-MM-dd",
+ "required": false,
+ "internal": false,
+ "exampleValue": "2014-06-22"
+ },
+ {
+ "key": "compareToProfile",
+ "description": "Quality profile key to filter rules that are activated. Meant to compare easily to profile set in 'qprofile'",
+ "since": "6.5",
+ "required": false,
+ "internal": true,
+ "exampleValue": "AU-TpxcA-iU5OvuD2FLz"
+ },
+ {
+ "key": "f",
+ "description": "Comma-separated list of the fields to be returned in response. All the fields are returned by default, except actives.Since 5.5, following fields have been deprecated :
",
+ "required": false,
+ "internal": false,
+ "exampleValue": "repo,name",
+ "possibleValues": [
+ "actives",
+ "createdAt",
+ "debtOverloaded",
+ "debtRemFn",
+ "defaultDebtRemFn",
+ "defaultRemFn",
+ "effortToFixDescription",
+ "gapDescription",
+ "htmlDesc",
+ "htmlNote",
+ "internalKey",
+ "isTemplate",
+ "lang",
+ "langName",
+ "mdDesc",
+ "mdNote",
+ "name",
+ "noteLogin",
+ "params",
+ "remFn",
+ "remFnOverloaded",
+ "repo",
+ "severity",
+ "status",
+ "sysTags",
+ "tags",
+ "templateKey"
+ ]
+ },
+ {
+ "key": "facets",
+ "description": "Comma-separated list of the facets to be computed. No facet is computed by default.",
+ "required": false,
+ "internal": false,
+ "exampleValue": "languages,repositories",
+ "possibleValues": [
+ "languages",
+ "repositories",
+ "tags",
+ "severities",
+ "active_severities",
+ "statuses",
+ "types",
+ "true"
+ ]
+ },
+ {
+ "key": "inheritance",
+ "description": "Comma-separated list of values of inheritance for a rule within a quality profile. Used only if the parameter 'activation' is set.",
+ "required": false,
+ "internal": false,
+ "exampleValue": "INHERITED,OVERRIDES",
+ "possibleValues": [
+ "NONE",
+ "INHERITED",
+ "OVERRIDES"
+ ]
+ },
+ {
+ "key": "is_template",
+ "description": "Filter template rules",
+ "required": false,
+ "internal": false,
+ "possibleValues": [
+ "true",
+ "false",
+ "yes",
+ "no"
+ ]
+ },
+ {
+ "key": "languages",
+ "description": "Comma-separated list of languages",
+ "required": false,
+ "internal": false,
+ "exampleValue": "java,js"
+ },
+ {
+ "key": "organization",
+ "description": "Organization key",
+ "since": "6.4",
+ "required": false,
+ "internal": true,
+ "exampleValue": "my-org"
+ },
+ {
+ "key": "p",
+ "description": "1-based page number",
+ "required": false,
+ "internal": false,
+ "defaultValue": "1",
+ "exampleValue": "42",
+ "deprecatedKey": "pageIndex",
+ "deprecatedKeySince": "5.2"
+ },
+ {
+ "key": "ps",
+ "description": "Page size. Must be greater than 0 and less than 500",
+ "required": false,
+ "internal": false,
+ "defaultValue": "100",
+ "exampleValue": "20",
+ "deprecatedKey": "pageSize",
+ "deprecatedKeySince": "5.2",
+ "maximumValue": 500
+ },
+ {
+ "key": "q",
+ "description": "UTF-8 search query",
+ "required": false,
+ "internal": false,
+ "exampleValue": "xpath"
+ },
+ {
+ "key": "qprofile",
+ "description": "Quality profile key to filter on. Used only if the parameter 'activation' is set.",
+ "required": false,
+ "internal": false,
+ "exampleValue": "AU-Tpxb--iU5OvuD2FLy"
+ },
+ {
+ "key": "repositories",
+ "description": "Comma-separated list of repositories",
+ "required": false,
+ "internal": false,
+ "exampleValue": "checkstyle,findbugs"
+ },
+ {
+ "key": "rule_key",
+ "description": "Key of rule to search for",
+ "required": false,
+ "internal": false,
+ "exampleValue": "squid:S001"
+ },
+ {
+ "key": "s",
+ "description": "Sort field",
+ "required": false,
+ "internal": false,
+ "exampleValue": "name",
+ "possibleValues": [
+ "name",
+ "updatedAt",
+ "createdAt",
+ "key"
+ ]
+ },
+ {
+ "key": "severities",
+ "description": "Comma-separated list of default severities. Not the same than severity of rules in Quality profiles.",
+ "required": false,
+ "internal": false,
+ "exampleValue": "CRITICAL,BLOCKER",
+ "possibleValues": [
+ "INFO",
+ "MINOR",
+ "MAJOR",
+ "CRITICAL",
+ "BLOCKER"
+ ]
+ },
+ {
+ "key": "statuses",
+ "description": "Comma-separated list of status codes",
+ "required": false,
+ "internal": false,
+ "exampleValue": "READY",
+ "possibleValues": [
+ "BETA",
+ "DEPRECATED",
+ "READY",
+ "REMOVED"
+ ]
+ },
+ {
+ "key": "tags",
+ "description": "Comma-separated list of tags. Returned rules match any of the tags (OR operator)",
+ "required": false,
+ "internal": false,
+ "exampleValue": "security,java8"
+ },
+ {
+ "key": "template_key",
+ "description": "Key of the template rule to filter on. Used to search for the custom rules based on this template.",
+ "required": false,
+ "internal": false,
+ "exampleValue": "java:S001"
+ },
+ {
+ "key": "types",
+ "description": "Comma-separated list of types. Returned rules match any of the tags (OR operator)",
+ "since": "5.5",
+ "required": false,
+ "internal": false,
+ "exampleValue": "BUG",
+ "possibleValues": [
+ "CODE_SMELL",
+ "BUG",
+ "VULNERABILITY"
+ ]
+ }
+ ]
+ },
+ {
+ "key": "show",
+ "description": "Get detailed information about a rule
Since 5.5, following fields in the response have been deprecated :
",
+ "since": "4.2",
+ "internal": false,
+ "post": false,
+ "hasResponseExample": true,
+ "changelog": [],
+ "params": [
+ {
+ "key": "actives",
+ "description": "Show rule's activations for all profiles (\"active rules\")",
+ "required": false,
+ "internal": false,
+ "defaultValue": "false",
+ "possibleValues": [
+ "true",
+ "false",
+ "yes",
+ "no"
+ ]
+ },
+ {
+ "key": "key",
+ "description": "Rule key",
+ "required": true,
+ "internal": false,
+ "exampleValue": "javascript:EmptyBlock"
+ },
+ {
+ "key": "organization",
+ "description": "Organization key",
+ "since": "6.4",
+ "required": false,
+ "internal": true,
+ "exampleValue": "my-org"
+ }
+ ]
+ },
+ {
+ "key": "tags",
+ "description": "List rule tags",
+ "since": "4.4",
+ "internal": false,
+ "post": false,
+ "hasResponseExample": true,
+ "changelog": [],
+ "params": [
+ {
+ "key": "organization",
+ "description": "Organization key",
+ "since": "6.4",
+ "required": false,
+ "internal": true,
+ "exampleValue": "my-org"
+ },
+ {
+ "key": "ps",
+ "description": "Page size. Must be greater than 0 and less than 100",
+ "required": false,
+ "internal": false,
+ "defaultValue": "10",
+ "exampleValue": "20",
+ "deprecatedKey": "pageSize",
+ "deprecatedKeySince": "5.2",
+ "maximumValue": 100
+ },
+ {
+ "key": "q",
+ "description": "Limit search to tags that contain the supplied string.",
+ "required": false,
+ "internal": false,
+ "exampleValue": "misra"
+ }
+ ]
+ },
+ {
+ "key": "update",
+ "description": "Update an existing rule.
Requires the 'Administer Quality Profiles' permission",
+ "since": "4.4",
+ "internal": false,
+ "post": true,
+ "hasResponseExample": false,
+ "changelog": [],
+ "params": [
+ {
+ "key": "debt_remediation_fn_offset",
+ "required": false,
+ "internal": false,
+ "deprecatedSince": "5.5"
+ },
+ {
+ "key": "debt_remediation_fn_type",
+ "required": false,
+ "internal": false,
+ "deprecatedSince": "5.5",
+ "possibleValues": [
+ "LINEAR",
+ "LINEAR_OFFSET",
+ "CONSTANT_ISSUE"
+ ]
+ },
+ {
+ "key": "debt_remediation_fy_coeff",
+ "required": false,
+ "internal": false,
+ "deprecatedSince": "5.5"
+ },
+ {
+ "key": "debt_sub_characteristic",
+ "description": "Debt characteristics are no more supported. This parameter is ignored.",
+ "required": false,
+ "internal": false,
+ "deprecatedSince": "5.5"
+ },
+ {
+ "key": "key",
+ "description": "Key of the rule to update",
+ "required": true,
+ "internal": false,
+ "exampleValue": "javascript:NullCheck",
+ "maximumLength": 200
+ },
+ {
+ "key": "markdown_description",
+ "description": "Rule description (mandatory for custom rule and manual rule)",
+ "required": false,
+ "internal": false,
+ "exampleValue": "Description of my custom rule"
+ },
+ {
+ "key": "markdown_note",
+ "description": "Optional note in markdown format. Use empty value to remove current note. Note is not changedif the parameter is not set.",
+ "required": false,
+ "internal": false,
+ "exampleValue": "my *note*"
+ },
+ {
+ "key": "name",
+ "description": "Rule name (mandatory for custom rule)",
+ "required": false,
+ "internal": false,
+ "exampleValue": "My custom rule",
+ "maximumLength": 200
+ },
+ {
+ "key": "organization",
+ "description": "Organization key",
+ "since": "6.4",
+ "required": false,
+ "internal": true,
+ "exampleValue": "my-org"
+ },
+ {
+ "key": "params",
+ "description": "Parameters as semi-colon list of
Requires the 'Administer System' permission.",
+ "since": "6.1",
+ "internal": true,
+ "post": false,
+ "hasResponseExample": true,
+ "changelog": []
+ },
+ {
+ "key": "encrypt",
+ "description": "Encrypt a setting value.
Requires 'Administer System' permission.",
+ "since": "6.1",
+ "internal": true,
+ "post": false,
+ "hasResponseExample": true,
+ "changelog": [],
+ "params": [
+ {
+ "key": "value",
+ "description": "Setting value to encrypt",
+ "required": true,
+ "internal": false,
+ "exampleValue": "my value"
+ }
+ ]
+ },
+ {
+ "key": "generate_secret_key",
+ "description": "Generate a secret key.
Requires the 'Administer System' permission",
+ "since": "6.1",
+ "internal": true,
+ "post": false,
+ "hasResponseExample": true,
+ "changelog": []
+ },
+ {
+ "key": "list_definitions",
+ "description": "List settings definitions.
Requires 'Browse' permission when a component is specified
",
+ "since": "6.3",
+ "internal": false,
+ "post": false,
+ "hasResponseExample": true,
+ "changelog": [],
+ "params": [
+ {
+ "key": "branch",
+ "description": "Branch key. Only available on following settings : sonar.leak.period",
+ "since": "6.6",
+ "required": false,
+ "internal": true,
+ "exampleValue": "feature/my_branch"
+ },
+ {
+ "key": "component",
+ "description": "Component key",
+ "required": false,
+ "internal": false,
+ "exampleValue": "my_project"
+ }
+ ]
+ },
+ {
+ "key": "reset",
+ "description": "Remove a setting value.
Requires one of the following permissions:
",
+ "since": "6.1",
+ "internal": false,
+ "post": true,
+ "hasResponseExample": false,
+ "changelog": [],
+ "params": [
+ {
+ "key": "branch",
+ "description": "Branch key",
+ "since": "6.6",
+ "required": false,
+ "internal": true,
+ "exampleValue": "feature/my_branch"
+ },
+ {
+ "key": "component",
+ "description": "Component key",
+ "required": false,
+ "internal": false,
+ "exampleValue": "my_project",
+ "deprecatedKey": "componentKey",
+ "deprecatedKeySince": "6.3"
+ },
+ {
+ "key": "keys",
+ "description": "Setting keys",
+ "required": true,
+ "internal": false,
+ "exampleValue": "sonar.links.scm,sonar.debt.hoursInDay"
+ }
+ ]
+ },
+ {
+ "key": "set",
+ "description": "Update a setting value.
Either 'value' or 'values' must be provided.
Requires one of the following permissions:
",
+ "since": "6.1",
+ "internal": false,
+ "post": true,
+ "hasResponseExample": false,
+ "changelog": [],
+ "params": [
+ {
+ "key": "branch",
+ "description": "Branch key. Only available on following settings : sonar.leak.period",
+ "since": "6.6",
+ "required": false,
+ "internal": true,
+ "exampleValue": "feature/my_branch"
+ },
+ {
+ "key": "component",
+ "description": "Component key",
+ "required": false,
+ "internal": false,
+ "exampleValue": "my_project",
+ "deprecatedKey": "componentKey",
+ "deprecatedKeySince": "6.3"
+ },
+ {
+ "key": "fieldValues",
+ "description": "Setting field values. To set several values, the parameter must be called once for each value.",
+ "required": false,
+ "internal": false,
+ "exampleValue": "fieldValues={\"firstField\":\"first value\", \"secondField\":\"second value\", \"thirdField\":\"third value\"}"
+ },
+ {
+ "key": "key",
+ "description": "Setting key",
+ "required": true,
+ "internal": false,
+ "exampleValue": "sonar.links.scm"
+ },
+ {
+ "key": "value",
+ "description": "Setting value. To reset a value, please use the reset web service.",
+ "required": false,
+ "internal": false,
+ "exampleValue": "git@github.com:SonarSource/sonarqube.git",
+ "maximumLength": 4000
+ },
+ {
+ "key": "values",
+ "description": "Setting multi value. To set several values, the parameter must be called once for each value.",
+ "required": false,
+ "internal": false,
+ "exampleValue": "values=firstValue&values=secondValue&values=thirdValue"
+ }
+ ]
+ },
+ {
+ "key": "values",
+ "description": "List settings values.
If no value has been set for a setting, then the default value is returned.
Requires 'Browse' permission when a component is specified
",
+ "since": "6.3",
+ "internal": false,
+ "post": false,
+ "hasResponseExample": true,
+ "changelog": [],
+ "params": [
+ {
+ "key": "branch",
+ "description": "Branch key",
+ "since": "6.6",
+ "required": false,
+ "internal": true,
+ "exampleValue": "feature/my_branch"
+ },
+ {
+ "key": "component",
+ "description": "Component key",
+ "required": false,
+ "internal": false,
+ "exampleValue": "my_project"
+ },
+ {
+ "key": "keys",
+ "description": "List of setting keys",
+ "required": false,
+ "internal": false,
+ "exampleValue": "sonar.test.inclusions,sonar.dbcleaner.cleanDirectory"
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "path": "api/sources",
+ "since": "4.2",
+ "description": "Get details on source files. See also api/tests.",
+ "actions": [
+ {
+ "key": "hash",
+ "description": "Show line line hashes for a given file. Require See Source Code permission on file's project
",
+ "since": "5.0",
+ "internal": true,
+ "post": false,
+ "hasResponseExample": true,
+ "changelog": [],
+ "params": [
+ {
+ "key": "key",
+ "description": "File key",
+ "required": true,
+ "internal": false,
+ "exampleValue": "my_project:/src/foo/Bar.php"
+ }
+ ]
+ },
+ {
+ "key": "index",
+ "description": "Get source code as line number / text pairs. Require See Source Code permission on file",
+ "since": "5.0",
+ "internal": true,
+ "post": false,
+ "hasResponseExample": true,
+ "changelog": [],
+ "params": [
+ {
+ "key": "from",
+ "description": "First line",
+ "required": false,
+ "internal": false,
+ "defaultValue": "1"
+ },
+ {
+ "key": "resource",
+ "description": "File key",
+ "required": true,
+ "internal": false,
+ "exampleValue": "my_project:/src/foo/Bar.php"
+ },
+ {
+ "key": "to",
+ "description": "Last line (excluded). If not specified, all lines are returned until end of file",
+ "required": false,
+ "internal": false
+ }
+ ]
+ },
+ {
+ "key": "lines",
+ "description": "Show source code with line oriented info. Require See Source Code permission on file's project
Each element of the result array is an object which contains:
",
+ "since": "5.0",
+ "internal": true,
+ "post": false,
+ "hasResponseExample": true,
+ "changelog": [
+ {
+ "description": "fields \"branch\" added",
+ "version": "6.6"
+ },
+ {
+ "description": "fields \"utLineHits\", \"utConditions\" and \"utCoveredConditions\" has been renamed \"lineHits\", \"conditions\" and \"coveredConditions\"",
+ "version": "6.2"
+ },
+ {
+ "description": "fields \"itLineHits\", \"itConditions\" and \"itCoveredConditions\" are no more returned",
+ "version": "6.2"
+ }
+ ],
+ "params": [
+ {
+ "key": "branch",
+ "description": "Branch key",
+ "required": false,
+ "internal": true,
+ "exampleValue": "feature/my_branch"
+ },
+ {
+ "key": "from",
+ "description": "First line to return. Starts from 1",
+ "required": false,
+ "internal": false,
+ "defaultValue": "1",
+ "exampleValue": "10"
+ },
+ {
+ "key": "key",
+ "description": "File key. Mandatory if param 'uuid' is not set. Available since 5.2",
+ "required": false,
+ "internal": false,
+ "exampleValue": "my_project:/src/foo/Bar.php"
+ },
+ {
+ "key": "to",
+ "description": "Optional last line to return (inclusive). It must be greater than or equal to parameter 'from'. If unset, then all the lines greater than or equal to 'from' are returned.",
+ "required": false,
+ "internal": false,
+ "exampleValue": "20"
+ },
+ {
+ "key": "uuid",
+ "description": "File uuid. Mandatory if param 'key' is not set",
+ "required": false,
+ "internal": false,
+ "exampleValue": "f333aab4-7e3a-4d70-87e1-f4c491f05e5c"
+ }
+ ]
+ },
+ {
+ "key": "raw",
+ "description": "Get source code as raw text. Require 'See Source Code' permission on file",
+ "since": "5.0",
+ "internal": false,
+ "post": false,
+ "hasResponseExample": true,
+ "changelog": [],
+ "params": [
+ {
+ "key": "branch",
+ "description": "Branch key",
+ "required": false,
+ "internal": true,
+ "exampleValue": "feature/my_branch"
+ },
+ {
+ "key": "key",
+ "description": "File key",
+ "required": true,
+ "internal": false,
+ "exampleValue": "my_project:src/foo/Bar.php"
+ }
+ ]
+ },
+ {
+ "key": "scm",
+ "description": "Get SCM information of source files. Require See Source Code permission on file's project
Each element of the result array is composed of:
",
+ "since": "4.4",
+ "internal": false,
+ "post": false,
+ "hasResponseExample": true,
+ "changelog": [],
+ "params": [
+ {
+ "key": "commits_by_line",
+ "description": "Group lines by SCM commit if value is false, else display commits for each line, even if two consecutive lines relate to the same commit.",
+ "required": false,
+ "internal": false,
+ "defaultValue": "false",
+ "possibleValues": [
+ "true",
+ "false",
+ "yes",
+ "no"
+ ]
+ },
+ {
+ "key": "from",
+ "description": "First line to return. Starts at 1",
+ "required": false,
+ "internal": false,
+ "defaultValue": "1",
+ "exampleValue": "10"
+ },
+ {
+ "key": "key",
+ "description": "File key",
+ "required": true,
+ "internal": false,
+ "exampleValue": "my_project:/src/foo/Bar.php"
+ },
+ {
+ "key": "to",
+ "description": "Last line to return (inclusive)",
+ "required": false,
+ "internal": false,
+ "exampleValue": "20"
+ }
+ ]
+ },
+ {
+ "key": "show",
+ "description": "Get source code. Require See Source Code permission on file's project
Each element of the result array is composed of:
",
+ "since": "4.4",
+ "internal": false,
+ "post": false,
+ "hasResponseExample": true,
+ "changelog": [],
+ "params": [
+ {
+ "key": "from",
+ "description": "First line to return. Starts at 1",
+ "required": false,
+ "internal": false,
+ "defaultValue": "1",
+ "exampleValue": "10"
+ },
+ {
+ "key": "key",
+ "description": "File key",
+ "required": true,
+ "internal": false,
+ "exampleValue": "my_project:/src/foo/Bar.php"
+ },
+ {
+ "key": "to",
+ "description": "Last line to return (inclusive)",
+ "required": false,
+ "internal": false,
+ "exampleValue": "20"
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "path": "api/system",
+ "description": "Get system details, and perform some management actions, such as restarting, and initiating a database migration (as part of a system upgrade).",
+ "actions": [
+ {
+ "key": "change_log_level",
+ "description": "Temporarily changes level of logs. New level is not persistent and is lost when restarting server. Requires system administration permission.",
+ "since": "5.2",
+ "internal": false,
+ "post": true,
+ "hasResponseExample": false,
+ "changelog": [],
+ "params": [
+ {
+ "key": "level",
+ "description": "The new level. Be cautious: DEBUG, and even more TRACE, may have performance impacts.",
+ "required": true,
+ "internal": false,
+ "possibleValues": [
+ "TRACE",
+ "DEBUG",
+ "INFO"
+ ]
+ }
+ ]
+ },
+ {
+ "key": "db_migration_status",
+ "description": "Display the database migration status of SonarQube.
State values are:
",
+ "since": "5.2",
+ "internal": false,
+ "post": false,
+ "hasResponseExample": true,
+ "changelog": []
+ },
+ {
+ "key": "health",
+ "description": "Provide health status of SonarQube.
status: the running status