SonarSource project_branches API

Manage branch (only available when the Branch plugin is installed)

Operations 3

POST /api/project_branches/delete Delete a non-main branch of a project. Requires 'Administer' rights on the specified project. #
GET /api/project_branches/list List the branches of a project. The statistics are the overall counts on long branches, and the count of issues detec... #
POST /api/project_branches/rename Rename the main branch of a project. Requires 'Administer' permission on the specified project. #

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/sonarsource-project-branches-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Discovery needs no key. Ratings and market analysis are Pro.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

sonarsource-project-branches-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: SonarQube Cloud Web authentication Project Branches API
  version: v1
  description: The SonarQube Cloud Web API, derived faithfully from the machine-readable service catalog the instance publishes at /api/webservices/list.
  x-derived-from: https://sonarcloud.io/api/webservices/list
  contact:
    name: SonarSource
    url: https://community.sonarsource.com/
servers:
- url: https://sonarcloud.io
security:
- bearerToken: []
- basicToken: []
tags:
- name: project_branches
  description: Manage branch (only available when the Branch plugin is installed)
paths:
  /api/project_branches/delete:
    post:
      operationId: projectBranchesDelete
      summary: Delete a non-main branch of a project. Requires 'Administer' rights on the specified project.
      description: Delete a non-main branch of a project. Requires 'Administer' rights on the specified project.
      tags:
      - project_branches
      parameters:
      - name: branch
        in: query
        description: Name of the branch
        required: true
        schema:
          type: string
        example: branch1
      - name: project
        in: query
        description: Project key
        required: true
        schema:
          type: string
        example: my_project
      responses:
        '200':
          description: OK
        '400':
          description: Bad Request
        '401':
          description: Unauthorized - authentication required
        '403':
          description: Insufficient privileges
        '404':
          description: Not Found
  /api/project_branches/list:
    get:
      operationId: projectBranchesList
      summary: List the branches of a project. The statistics are the overall counts on long branches, and the count of issues detec...
      description: List the branches of a project. The statistics are the overall counts on long branches, and the count of issues detected on the changed code on short branches, and are only provided if the project parameter is specified. If the project parameter is specified, requires the user to have 'Browse' or 'Execute analysis' rights on that project. Otherwise, only returns branches from projects on which this user has 'Browse' or 'Execute analysis' rights.
      tags:
      - project_branches
      parameters:
      - name: branchIds
        in: query
        description: List of up to 50 branch IDs - required unless project key is provided
        required: false
        schema:
          type: string
        example: uuid1,uuid2,uuid3
      - name: project
        in: query
        description: Project key - required unless branchIds is provided
        required: false
        schema:
          type: string
        example: my_project
      responses:
        '200':
          description: OK
        '400':
          description: Bad Request
        '401':
          description: Unauthorized - authentication required
        '403':
          description: Insufficient privileges
        '404':
          description: Not Found
  /api/project_branches/rename:
    post:
      operationId: projectBranchesRename
      summary: Rename the main branch of a project. Requires 'Administer' permission on the specified project.
      description: Rename the main branch of a project. Requires 'Administer' permission on the specified project.
      tags:
      - project_branches
      parameters:
      - name: name
        in: query
        description: New name of the main branch
        required: true
        schema:
          type: string
          maxLength: 255
        example: branch1
      - name: project
        in: query
        description: Project key
        required: true
        schema:
          type: string
        example: my_project
      responses:
        '200':
          description: OK
        '400':
          description: Bad Request
        '401':
          description: Unauthorized - authentication required
        '403':
          description: Insufficient privileges
        '404':
          description: Not Found
components:
  securitySchemes:
    bearerToken:
      type: http
      scheme: bearer
      description: User token as Bearer token.
    basicToken:
      type: http
      scheme: basic
      description: User token as HTTP Basic username with empty password.