SonarQube Users API

User account management

Documentation

Specifications

Schemas & Data

Other Resources

OpenAPI Specification

sonarqube-users-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: SonarQube Web Users API
  description: The SonarQube Web API provides HTTP endpoints for programmatic interaction with SonarQube Server. It enables management of projects, quality gates, issues, rules, users, groups, permissions, and CI/CD integrations. The API uses token-based authentication and follows REST conventions. It powers the SonarQube web UI and is used for CI/CD integration, custom tooling, and third-party plugin development.
  version: 10.0.0
  contact:
    name: SonarSource
    url: https://community.sonarsource.com/
  license:
    name: GNU Lesser General Public License v3.0
    url: https://www.gnu.org/licenses/lgpl-3.0.html
servers:
- url: https://{sonarqubeHost}/api
  description: SonarQube Server
  variables:
    sonarqubeHost:
      default: sonarqube.example.com
      description: Hostname of your SonarQube instance
tags:
- name: Users
  description: User account management
paths:
  /users/search:
    get:
      operationId: searchUsers
      summary: Search Users
      description: Search for users in the SonarQube instance. Supports filtering by login, name, and group membership. Requires Administer System permission.
      tags:
      - Users
      parameters:
      - name: q
        in: query
        description: Search query to filter by login or name
        schema:
          type: string
      - name: p
        in: query
        description: Page number
        schema:
          type: integer
          default: 1
      - name: ps
        in: query
        description: Page size
        schema:
          type: integer
          default: 50
      security:
      - basicAuth: []
      - bearerAuth: []
      responses:
        '200':
          description: Successfully retrieved users
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UserSearchResponse'
        '401':
          description: Unauthorized
        '403':
          description: Forbidden - Insufficient permissions
components:
  schemas:
    User:
      type: object
      properties:
        login:
          type: string
          description: User login (unique identifier)
        name:
          type: string
          description: Display name
        active:
          type: boolean
          description: Whether the account is active
        email:
          type: string
          description: Email address
        local:
          type: boolean
          description: Whether this is a local (non-LDAP/SSO) account
        externalIdentity:
          type: string
          description: Identity for external authentication providers
        externalProvider:
          type: string
          description: Authentication provider name
        groups:
          type: array
          items:
            type: string
    UserSearchResponse:
      type: object
      properties:
        paging:
          $ref: '#/components/schemas/Paging'
        users:
          type: array
          items:
            $ref: '#/components/schemas/User'
    Paging:
      type: object
      properties:
        pageIndex:
          type: integer
          description: Current page number
        pageSize:
          type: integer
          description: Number of items per page
        total:
          type: integer
          description: Total number of items
  securitySchemes:
    basicAuth:
      type: http
      scheme: basic
      description: Basic authentication using a user token as the username and an empty password. Generate tokens in User > My Account > Security.
    bearerAuth:
      type: http
      scheme: bearer
      description: Bearer token authentication using a SonarQube user token.