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

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

# code-scanning-alert-items

## 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:
    alert-number:
      type: integer
      description: The security alert number.
      readOnly: true
    alert-created-at:
      type: string
      description: "The time that the alert was created in ISO 8601 format:
        `YYYY-MM-DDTHH:MM:SSZ`."
      format: date-time
      readOnly: true
    alert-url:
      type: string
      description: The REST API URL of the alert resource.
      format: uri
      readOnly: true
    alert-html-url:
      type: string
      description: The GitHub URL of the alert resource.
      format: uri
      readOnly: true
    alert-instances-url:
      type: string
      description: The REST API URL for fetching the list of instances for an alert.
      format: uri
      readOnly: true
    code-scanning-alert-state:
      type: string
      description: State of a code scanning alert.
      enum:
        - open
        - closed
        - dismissed
        - fixed
    nullable-simple-user:
      title: Simple User
      description: Simple User
      type: object
      properties:
        name:
          nullable: true
          type: string
        email:
          nullable: true
          type: string
        login:
          type: string
          example: octocat
        id:
          type: integer
          example: 1
        node_id:
          type: string
          example: MDQ6VXNlcjE=
        avatar_url:
          type: string
          format: uri
          example: https://github.com/images/error/octocat_happy.gif
        gravatar_id:
          type: string
          example: 41d064eb2195891e12d0413f63227ea7
          nullable: true
        url:
          type: string
          format: uri
          example: https://api.github.com/users/octocat
        html_url:
          type: string
          format: uri
          example: https://github.com/octocat
        followers_url:
          type: string
          format: uri
          example: https://api.github.com/users/octocat/followers
        following_url:
          type: string
          example: https://api.github.com/users/octocat/following{/other_user}
        gists_url:
          type: string
          example: https://api.github.com/users/octocat/gists{/gist_id}
        starred_url:
          type: string
          example: https://api.github.com/users/octocat/starred{/owner}{/repo}
        subscriptions_url:
          type: string
          format: uri
          example: https://api.github.com/users/octocat/subscriptions
        organizations_url:
          type: string
          format: uri
          example: https://api.github.com/users/octocat/orgs
        repos_url:
          type: string
          format: uri
          example: https://api.github.com/users/octocat/repos
        events_url:
          type: string
          example: https://api.github.com/users/octocat/events{/privacy}
        received_events_url:
          type: string
          format: uri
          example: https://api.github.com/users/octocat/received_events
        type:
          type: string
          example: User
        site_admin:
          type: boolean
        starred_at:
          type: string
          example: '"2020-07-09T00:17:55Z"'
      required:
        - avatar_url
        - events_url
        - followers_url
        - following_url
        - gists_url
        - gravatar_id
        - html_url
        - id
        - node_id
        - login
        - organizations_url
        - received_events_url
        - repos_url
        - site_admin
        - starred_url
        - subscriptions_url
        - type
        - url
      nullable: true
    code-scanning-alert-dismissed-at:
      type: string
      description: "The time that the alert was dismissed in ISO 8601 format:
        `YYYY-MM-DDTHH:MM:SSZ`."
      format: date-time
      readOnly: true
      nullable: true
    code-scanning-alert-dismissed-reason:
      type: string
      description: "**Required when the state is dismissed.** The reason for
        dismissing or closing the alert. Can be one of: `false positive`, `won't
        fix`, and `used in tests`."
      nullable: true
      enum:
        - null
        - false positive
        - won't fix
        - used in tests
    code-scanning-alert-rule-summary:
      type: object
      properties:
        id:
          nullable: true
          type: string
          description: A unique identifier for the rule used to detect the alert.
        name:
          type: string
          description: The name of the rule used to detect the alert.
        severity:
          nullable: true
          type: string
          description: The severity of the alert.
          enum:
            - none
            - note
            - warning
            - error
        description:
          type: string
          description: A short description of the rule used to detect the alert.
    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-alert-instance:
      type: object
      properties:
        ref:
          $ref: "#/components/schemas/code-scanning-ref"
        analysis_key:
          $ref: "#/components/schemas/code-scanning-analysis-analysis-key"
        environment:
          $ref: "#/components/schemas/code-scanning-alert-environment"
        category:
          $ref: "#/components/schemas/code-scanning-analysis-category"
        state:
          $ref: "#/components/schemas/code-scanning-alert-state"
        commit_sha:
          type: string
        message:
          type: object
          properties:
            text:
              type: string
        location:
          $ref: "#/components/schemas/code-scanning-alert-location"
        html_url:
          type: string
        classifications:
          type: array
          description: >-
            Classifications that have been applied to the file that triggered
            the alert.

            For example identifying it as documentation, or a generated file.
          items:
            $ref: "#/components/schemas/code-scanning-alert-classification"
    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-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-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-alert-environment:
      type: string
      description: Identifies the variable values associated with the environment in
        which the analysis that generated this alert instance was performed,
        such as the language that was analyzed.
    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-alert-location:
      type: object
      description: Describe a region within a file for the alert.
      properties:
        path:
          type: string
        start_line:
          type: integer
        end_line:
          type: integer
        start_column:
          type: integer
        end_column:
          type: integer
    code-scanning-alert-classification:
      type: string
      description: A classification of the file. For example to identify it as generated.
      nullable: true
      enum:
        - source
        - generated
        - test
        - library
    code-scanning-alert-items:
      type: object
      properties:
        number:
          $ref: "#/components/schemas/alert-number"
        created_at:
          $ref: "#/components/schemas/alert-created-at"
        url:
          $ref: "#/components/schemas/alert-url"
        html_url:
          $ref: "#/components/schemas/alert-html-url"
        instances_url:
          $ref: "#/components/schemas/alert-instances-url"
        state:
          $ref: "#/components/schemas/code-scanning-alert-state"
        dismissed_by:
          $ref: "#/components/schemas/nullable-simple-user"
        dismissed_at:
          $ref: "#/components/schemas/code-scanning-alert-dismissed-at"
        dismissed_reason:
          $ref: "#/components/schemas/code-scanning-alert-dismissed-reason"
        rule:
          $ref: "#/components/schemas/code-scanning-alert-rule-summary"
        tool:
          $ref: "#/components/schemas/code-scanning-analysis-tool"
        most_recent_instance:
          $ref: "#/components/schemas/code-scanning-alert-instance"
      required:
        - number
        - created_at
        - url
        - html_url
        - instances_url
        - state
        - dismissed_by
        - dismissed_at
        - dismissed_reason
        - rule
        - tool
        - most_recent_instance
```
