---
title: "code-scanning-analysis"
url: "https://kiwi.arashsheyda.me/apis/git-hub-v3-rest-api-1/versions/4cb06d26-20a0-409c-8492-8406889b7eb4/schemas/code-scanning-analysis"
---

> Full API specification: https://kiwi.arashsheyda.me/apis/git-hub-v3-rest-api-1/versions/4cb06d26-20a0-409c-8492-8406889b7eb4.md

# code-scanning-analysis

## OpenAPI definition

```yaml
openapi: 3.0.3
info:
  title: GitHub v3 REST API
  version: 1.1.4
servers:
  - url: "{protocol}://{hostname}/api/v3"
    variables:
      hostname:
        description: Self-hosted Enterprise Server or Enterprise Cloud hostname
        default: HOSTNAME
      protocol:
        description: Self-hosted Enterprise Server or Enterprise Cloud protocol
        default: http
components:
  schemas:
    code-scanning-ref:
      type: string
      description: |-
        The full Git reference, formatted as `refs/heads/<branch name>`,
        `refs/pull/<number>/merge`, or `refs/pull/<number>/head`.
    code-scanning-analysis-commit-sha:
      description: The SHA of the commit to which the analysis you are uploading relates.
      type: string
      minLength: 40
      maxLength: 40
      pattern: ^[0-9a-fA-F]+$
    code-scanning-analysis-analysis-key:
      type: string
      description: Identifies the configuration under which the analysis was executed.
        For example, in GitHub Actions this includes the workflow filename and
        job name.
    code-scanning-analysis-environment:
      type: string
      description: Identifies the variable values associated with the environment in
        which this analysis was performed.
    code-scanning-analysis-category:
      type: string
      description: Identifies the configuration under which the analysis was executed.
        Used to distinguish between multiple analyses for the same tool and
        commit, but performed on different languages or different parts of the
        code.
    code-scanning-analysis-created-at:
      type: string
      description: "The time that the analysis was created in ISO 8601 format:
        `YYYY-MM-DDTHH:MM:SSZ`."
      format: date-time
      readOnly: true
    code-scanning-analysis-url:
      type: string
      description: The REST API URL of the analysis resource.
      format: uri
      readOnly: true
    code-scanning-analysis-sarif-id:
      type: string
      description: An identifier for the upload.
      example: 6c81cd8e-b078-4ac3-a3be-1dad7dbd0b53
    code-scanning-analysis-tool:
      type: object
      properties:
        name:
          $ref: "#/components/schemas/code-scanning-analysis-tool-name"
        version:
          $ref: "#/components/schemas/code-scanning-analysis-tool-version"
        guid:
          $ref: "#/components/schemas/code-scanning-analysis-tool-guid"
    code-scanning-analysis-tool-name:
      type: string
      description: The name of the tool used to generate the code scanning analysis.
    code-scanning-analysis-tool-version:
      nullable: true
      type: string
      description: The version of the tool used to generate the code scanning analysis.
    code-scanning-analysis-tool-guid:
      nullable: true
      type: string
      description: The GUID of the tool used to generate the code scanning analysis,
        if provided in the uploaded SARIF data.
    code-scanning-analysis:
      type: object
      properties:
        ref:
          $ref: "#/components/schemas/code-scanning-ref"
        commit_sha:
          $ref: "#/components/schemas/code-scanning-analysis-commit-sha"
        analysis_key:
          $ref: "#/components/schemas/code-scanning-analysis-analysis-key"
        environment:
          $ref: "#/components/schemas/code-scanning-analysis-environment"
        category:
          $ref: "#/components/schemas/code-scanning-analysis-category"
        error:
          type: string
          example: error reading field xyz
        created_at:
          $ref: "#/components/schemas/code-scanning-analysis-created-at"
        results_count:
          type: integer
          description: The total number of results in the analysis.
        rules_count:
          type: integer
          description: The total number of rules used in the analysis.
        id:
          type: integer
          description: Unique identifier for this analysis.
        url:
          $ref: "#/components/schemas/code-scanning-analysis-url"
        sarif_id:
          $ref: "#/components/schemas/code-scanning-analysis-sarif-id"
        tool:
          $ref: "#/components/schemas/code-scanning-analysis-tool"
        deletable:
          type: boolean
        warning:
          type: string
          description: Warning generated when processing the analysis
          example: 123 results were ignored
        tool_name:
          type: string
      required:
        - ref
        - commit_sha
        - analysis_key
        - environment
        - error
        - created_at
        - results_count
        - rules_count
        - id
        - url
        - sarif_id
        - tool
        - deletable
        - warning
```
