GitHub Code Quality API

Insights into reliability, maintainability, and efficiency of your codebase.

Business capability
Software Quality Engineering BC-4200.50

Operations 4

GET /repos/{owner}/{repo}/code-quality/findings List code quality findings for a repository #
GET /repos/{owner}/{repo}/code-quality/findings/{finding_number} Get a code quality finding #
GET /repos/{owner}/{repo}/code-quality/setup Get a code quality setup configuration #
PATCH /repos/{owner}/{repo}/code-quality/setup Update a code quality setup configuration #

Documentation

📖
Documentation
https://docs.github.com/en/rest/apps
📖
Documentation
https://docs.github.com/en/rest/codes-of-conduct/codes-of-conduct
📖
Documentation
https://docs.github.com/en/rest/emojis
📖
Documentation
https://docs.github.com/en/rest/gitignore
📖
Documentation
https://docs.github.com/en/rest/apps/installations
📖
Documentation
https://docs.github.com/en/rest/enterprise-admin
📖
Documentation
https://docs.github.com/en/rest/activity/events
📖
Documentation
https://docs.github.com/en/rest/orgs
📖
Documentation
https://docs.github.com/en/rest/rate-limit
📖
Documentation
https://docs.github.com/en/enterprise-cloud@latest/rest/scim
📖
Documentation
https://docs.github.com/en/rest/using-the-rest-api/getting-started-with-the-rest-api
📖
Documentation
https://docs.github.com/en/rest/teams
📖
Documentation
https://docs.github.com/en/rest/meta/meta
📖
Documentation
https://docs.github.com/en/rest/actions
📖
Documentation
https://docs.github.com/en/rest/branches
📖
Documentation
https://docs.github.com/en/rest/code-scanning
📖
Documentation
https://docs.github.com/en/rest/collaborators
📖
Documentation
https://docs.github.com/en/rest/dependabot
📖
Documentation
https://docs.github.com/en/rest/webhooks
📖
Documentation
https://docs.github.com/en/rest/pulls
📖
Documentation
https://docs.github.com/en/rest/git/tags
📖
Documentation
https://docs.github.com/en/rest/repos/autolinks
📖
Documentation
https://docs.github.com/en/rest/collaborators/invitations

Specifications

Other Resources

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/github:github-code-quality-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

github-code-quality-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  version: 1.1.4
  title: GitHub v3 REST Code Quality API
  description: GitHub's v3 REST API.
  license:
    name: MIT
    url: https://spdx.org/licenses/MIT
  termsOfService: https://docs.github.com/articles/github-terms-of-service
  contact:
    name: Support
    url: https://support.github.com/contact?tags=dotcom-rest-api
  x-github-plan: api.github.com
servers:
- url: https://api.github.com
tags:
- name: code-quality
  description: Insights into reliability, maintainability, and efficiency of your codebase.
paths:
  /repos/{owner}/{repo}/code-quality/findings:
    get:
      summary: List code quality findings for a repository
      description: 'Lists code quality findings for a repository.


        OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint with private or public repositories, or the `public_repo` scope to use this endpoint with only public repositories.'
      tags:
      - code-quality
      operationId: code-quality/list-findings-for-repo
      externalDocs:
        description: API method documentation
        url: https://docs.github.com/rest/code-quality/code-quality#list-code-quality-findings-for-a-repository
      parameters:
      - $ref: '#/components/parameters/owner'
      - $ref: '#/components/parameters/repo'
      - $ref: '#/components/parameters/per-page'
      - $ref: '#/components/parameters/direction'
      - $ref: '#/components/parameters/pagination-before'
      - $ref: '#/components/parameters/pagination-after'
      - name: state
        description: If specified, only code quality findings with this state will be returned.
        in: query
        required: false
        schema:
          type: string
          enum:
          - open
          - dismissed
      responses:
        '200':
          description: Response
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/code-quality-finding'
              examples:
                default:
                  $ref: '#/components/examples/code-quality-finding-items'
        '403':
          $ref: '#/components/responses/code_quality_forbidden_read'
        '404':
          $ref: '#/components/responses/not_found'
        '503':
          $ref: '#/components/responses/service_unavailable'
      x-github:
        githubCloudOnly: false
        enabledForGitHubApps: true
        category: code-quality
        subcategory: code-quality
  /repos/{owner}/{repo}/code-quality/findings/{finding_number}:
    get:
      summary: Get a code quality finding
      description: 'Gets a single code quality finding.


        OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint with private or public repositories, or the `public_repo` scope to use this endpoint with only public repositories.'
      tags:
      - code-quality
      operationId: code-quality/get-finding
      externalDocs:
        description: API method documentation
        url: https://docs.github.com/rest/code-quality/code-quality#get-a-code-quality-finding
      parameters:
      - $ref: '#/components/parameters/owner'
      - $ref: '#/components/parameters/repo'
      - $ref: '#/components/parameters/code-quality-finding-number'
      responses:
        '200':
          description: Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/code-quality-finding'
              examples:
                default:
                  $ref: '#/components/examples/code-quality-finding'
        '403':
          $ref: '#/components/responses/code_quality_forbidden_read'
        '404':
          $ref: '#/components/responses/not_found'
        '503':
          $ref: '#/components/responses/service_unavailable'
      x-github:
        githubCloudOnly: false
        enabledForGitHubApps: true
        category: code-quality
        subcategory: code-quality
  /repos/{owner}/{repo}/code-quality/setup:
    get:
      summary: Get a code quality setup configuration
      description: 'Gets a code quality setup configuration.


        OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint with private or public repositories, or the `public_repo` scope to use this endpoint with only public repositories.'
      tags:
      - code-quality
      operationId: code-quality/get-setup
      externalDocs:
        description: API method documentation
        url: https://docs.github.com/rest/code-quality/code-quality#get-a-code-quality-setup-configuration
      parameters:
      - $ref: '#/components/parameters/owner'
      - $ref: '#/components/parameters/repo'
      responses:
        '200':
          description: Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/code-quality-setup'
              examples:
                default:
                  $ref: '#/components/examples/code-quality-setup'
        '403':
          $ref: '#/components/responses/code_quality_forbidden_read'
        '404':
          $ref: '#/components/responses/not_found'
        '503':
          $ref: '#/components/responses/service_unavailable'
      x-github:
        githubCloudOnly: false
        enabledForGitHubApps: true
        category: code-quality
        subcategory: code-quality
    patch:
      summary: Update a code quality setup configuration
      description: 'Updates a code quality setup configuration.


        OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint with private or public repositories, or the `public_repo` scope to use this endpoint with only public repositories.'
      tags:
      - code-quality
      operationId: code-quality/update-setup
      externalDocs:
        description: API method documentation
        url: https://docs.github.com/rest/code-quality/code-quality#update-a-code-quality-setup-configuration
      parameters:
      - $ref: '#/components/parameters/owner'
      - $ref: '#/components/parameters/repo'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/code-quality-setup-update'
            examples:
              default:
                $ref: '#/components/examples/code-quality-setup-update'
      responses:
        '200':
          description: Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/empty-object'
              examples:
                default:
                  value: null
        '202':
          description: Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/code-quality-setup-update-response'
              examples:
                default:
                  $ref: '#/components/examples/code-quality-setup-update-response'
        '403':
          $ref: '#/components/responses/code_quality_forbidden_write'
        '404':
          $ref: '#/components/responses/not_found'
        '409':
          $ref: '#/components/responses/code_quality_conflict'
        '422':
          $ref: '#/components/responses/code_quality_invalid_state'
        '503':
          $ref: '#/components/responses/service_unavailable'
      x-github:
        githubCloudOnly: false
        enabledForGitHubApps: true
        category: code-quality
        subcategory: code-quality
components:
  parameters:
    pagination-before:
      name: before
      description: A cursor, as given in the [Link header](https://docs.github.com/rest/guides/using-pagination-in-the-rest-api#using-link-headers). If specified, the query only searches for results before this cursor. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)."
      in: query
      required: false
      schema:
        type: string
    per-page:
      name: per_page
      description: The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)."
      in: query
      schema:
        type: integer
        default: 30
    direction:
      name: direction
      description: The direction to sort the results by.
      in: query
      required: false
      schema:
        type: string
        enum:
        - asc
        - desc
        default: desc
    code-quality-finding-number:
      name: finding_number
      in: path
      description: The number that identifies a finding.
      required: true
      schema:
        type: integer
    owner:
      name: owner
      description: The account owner of the repository. The name is not case sensitive.
      in: path
      required: true
      schema:
        type: string
    pagination-after:
      name: after
      description: A cursor, as given in the [Link header](https://docs.github.com/rest/guides/using-pagination-in-the-rest-api#using-link-headers). If specified, the query only searches for results after this cursor. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)."
      in: query
      required: false
      schema:
        type: string
    repo:
      name: repo
      description: The name of the repository without the `.git` extension. The name is not case sensitive.
      in: path
      required: true
      schema:
        type: string
  responses:
    code_quality_forbidden_read:
      description: Response if the user is not authorized to access Code quality for this repository.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/basic-error'
    not_found:
      description: Resource not found
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/basic-error'
    code_quality_forbidden_write:
      description: Response if the repository is archived or if Code quality is not enabled for this repository
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/basic-error'
    code_quality_conflict:
      description: Response if there is already a code quality setup configuration update in progress
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/basic-error'
    service_unavailable:
      description: Service unavailable
      content:
        application/json:
          schema:
            type: object
            properties:
              code:
                type: string
              message:
                type: string
              documentation_url:
                type: string
    code_quality_invalid_state:
      description: Response if the configuration change cannot be made
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/basic-error'
  schemas:
    basic-error:
      title: Basic Error
      description: Basic Error
      type: object
      properties:
        message:
          type: string
        documentation_url:
          type: string
        url:
          type: string
        status:
          type: string
    empty-object:
      title: Empty Object
      description: An object without any properties.
      type: object
      properties: {}
      additionalProperties: false
    code-quality-finding:
      description: Code quality finding
      type: object
      properties:
        number:
          description: The finding number.
          type: integer
        state:
          description: State of the code quality finding.
          type: string
          enum:
          - open
          - dismissed
        url:
          description: The REST API URL of the code quality finding resource.
          type: string
          format: uri
        rule:
          $ref: '#/components/schemas/code-quality-finding-rule'
        location:
          $ref: '#/components/schemas/code-quality-finding-location'
        message:
          $ref: '#/components/schemas/code-quality-finding-message'
        created_at:
          description: The time the code quality finding was created.
          type: string
          format: date-time
      required:
      - number
      - state
      - url
      - rule
      - location
      - message
    code-quality-setup-update:
      description: Configuration for code quality setup.
      type: object
      properties:
        state:
          description: The desired state of code quality setup.
          type: string
          enum:
          - configured
          - not-configured
        runner_type:
          description: Runner type to be used.
          type: string
          enum:
          - standard
          - labeled
        runner_label:
          description: Runner label to be used if the runner type is labeled.
          type:
          - string
          - 'null'
          examples:
          - code-scanning
        languages:
          description: Languages to be analyzed.
          type: array
          items:
            type: string
            enum:
            - csharp
            - go
            - java-kotlin
            - javascript-typescript
            - python
            - ruby
        ai_findings_option:
          description: Whether AI findings run for Code Quality on this repository.
          type: string
          enum:
          - disabled
          - on_push
      anyOf:
      - required:
        - state
      - required:
        - runner_type
      - required:
        - runner_label
      - required:
        - languages
      - required:
        - ai_findings_option
      additionalProperties: false
    code-quality-finding-rule:
      description: Code quality rule
      type: object
      properties:
        id:
          description: A unique identifier for the rule used to detect the finding.
          type: string
        title:
          description: The name of the rule used to detect the finding.
          type: string
        description:
          description: A short description of the rule used to detect the finding.
          type: string
        help:
          description: A detailed description of the rule used to detect the finding.
          type: string
        severity:
          description: The severity of the rule used to detect the finding.
          type: string
          enum:
          - error
          - warning
          - note
          - none
        category:
          description: The category of the rule used to detect the finding.
          type: string
          enum:
          - none
          - maintainability
          - reliability
      required:
      - id
      - title
      - description
      - severity
      - category
    code-quality-finding-message:
      description: Code quality finding message
      type: object
      properties:
        text:
          description: The message text of the code quality finding.
          type: string
        markdown:
          description: The message text of the code quality finding in markdown format.
          type: string
      required:
      - text
      - markdown
    code-quality-setup-update-response:
      description: 'You can use `run_url` to track the status of the run. This includes a property status and conclusion.

        You should not rely on this always being an actions workflow run object.'
      type: object
      properties:
        run_id:
          description: ID of the corresponding run.
          type: integer
        run_url:
          description: URL of the corresponding run.
          type: string
    code-quality-finding-location:
      description: Code quality file location
      type: object
      properties:
        path:
          description: The file path where the finding was detected.
          type: string
        start_line:
          description: The line number where the finding starts.
          type: integer
        start_column:
          description: The column number where the finding starts.
          type: integer
        end_line:
          description: The line number where the finding ends.
          type: integer
        end_column:
          description: The column number where the finding ends.
          type: integer
      required:
      - path
    code-quality-setup:
      description: Configuration for code quality setup.
      type: object
      properties:
        state:
          description: Code quality setup has been configured or not.
          type: string
          enum:
          - configured
          - not-configured
        languages:
          description: Languages to be analyzed.
          type: array
          items:
            type: string
            enum:
            - csharp
            - go
            - java-kotlin
            - javascript-typescript
            - python
            - ruby
            - rust
        runner_type:
          description: Runner type to be used.
          type:
          - string
          - 'null'
          enum:
          - standard
          - labeled
          - null
        runner_label:
          description: Runner label to be used if the runner type is labeled.
          type:
          - string
          - 'null'
          examples:
          - code-scanning
        updated_at:
          description: Timestamp of latest configuration update.
          type:
          - string
          - 'null'
          format: date-time
          examples:
          - '2023-12-06T14:20:20.000Z'
        schedule:
          description: The frequency of the periodic analysis.
          type:
          - string
          - 'null'
          enum:
          - weekly
          - null
        ai_findings_option:
          description: The AI findings configuration for the repository.
          type:
          - string
          - 'null'
          enum:
          - disabled
          - on_push
          - null
  examples:
    code-quality-setup:
      value:
        state: configured
        languages:
        - javascript-typescript
        - python
        runner_type: standard
        runner_label: null
        updated_at: '2023-01-01T00:00:00Z'
        schedule: weekly
        ai_findings_option: on_push
    code-quality-finding-items:
      value:
      - number: 42
        state: open
        url: https://api.github.com/repos/octocat/hello-world/code-quality/findings/42
        rule:
          id: java/useless-null-check
          title: Useless null check
          description: Checking whether an expression is null when that expression cannot possibly be null is useless.
          severity: warning
          category: maintainability
        location:
          path: java/UselessNullCheck.java
          start_line: 9
          start_column: 4
          end_line: 9
          end_column: 18
        message:
          text: This check is useless. o cannot be null at this check, since it is guarded by instanceof.
          markdown: This check is useless. [o](java/UselessNullCheck.java#L9C4-L9C18) cannot be null at this check, since it is guarded by [...instanceof...](java/UselessNullCheck.java#L7C13-L7C25).
        created_at: '2026-01-23T12:34:56Z'
    code-quality-setup-update-response:
      value:
        run_id: 42
        run_url: https://api.github.com/repos/octocat/hello-world/actions/runs/42
    code-quality-finding:
      value:
        number: 42
        state: open
        url: https://api.github.com/repos/octocat/hello-world/code-quality/findings/42
        rule:
          id: java/useless-null-check
          title: Useless null check
          description: Checking whether an expression is null when that expression cannot possibly be null is useless.
          help: '# Useless null check

            Sometimes you can guarantee that a particular variable will never be null. For example when that variable has just been assigned a newly created object or is the exception caught by a `catch` clause. A null check on such a variable is ...'
          severity: warning
          category: maintainability
        location:
          path: java/UselessNullCheck.java
          start_line: 9
          start_column: 4
          end_line: 9
          end_column: 18
        message:
          text: This check is useless. o cannot be null at this check, since it is guarded by instanceof.
          markdown: This check is useless. [o](java/UselessNullCheck.java#L9C4-L9C18) cannot be null at this check, since it is guarded by [...instanceof...](java/UselessNullCheck.java#L7C13-L7C25).
        created_at: '2026-01-23T12:34:56Z'
    code-quality-setup-update:
      value:
        state: configured
        languages:
        - javascript-typescript
        - python
        - ruby
externalDocs:
  description: GitHub v3 REST API
  url: https://docs.github.com/rest/