GitHub Instances API

The Instances API from GitHub — 1 operation(s) for instances.

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

OpenAPI Specification

github-instances-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  version: 1.1.4
  title: github-repos-api Instances API
  description: 'Use the REST API to create, manage and control the workflow of public and

    private GitHub repositories.'
  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
servers:
- url: '{protocol}://{hostname}'
  variables:
    hostname:
      description: Self-hosted Enterprise Server hostname
      default: api.github.com
    protocol:
      description: Self-hosted Enterprise Server protocol
      default: https
tags:
- name: Instances
paths:
  /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/instances:
    get:
      summary: GitHub List Instances of Code Scanning Alert
      description: 'Lists all instances of the specified code scanning alert.


        OAuth app tokens and personal access tokens (classic) need the `security_events` scope to use this endpoint with private or public repositories, or the `public_repo` scope to use this endpoint with only public repositories.'
      tags:
      - Instances
      operationId: listInstancesOfCodeScanningAlert
      externalDocs:
        description: API method documentation
        url: https://docs.github.com/enterprise-server@3.9/rest/code-scanning/code-scanning#list-instances-of-a-code-scanning-alert
      parameters:
      - $ref: '#/components/parameters/owner'
      - $ref: '#/components/parameters/repo'
      - $ref: '#/components/parameters/alert-number'
      - $ref: '#/components/parameters/page'
      - $ref: '#/components/parameters/per-page'
      - $ref: '#/components/parameters/git-ref'
      - in: header
        name: Authorization
        schema:
          type: string
        example: example_value
      - in: header
        name: X-GitHub-Api-Version
        schema:
          type: string
          default: '2022-11-28'
        example: example_value
      - in: header
        name: Accept
        schema:
          type: string
          default: application/vnd.github+json
        example: example_value
      responses:
        '200':
          description: Response
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/code-scanning-alert-instance'
              examples:
                default:
                  $ref: '#/components/examples/code-scanning-alert-instances'
        '403':
          $ref: '#/components/responses/code_scanning_forbidden_read'
        '404':
          $ref: '#/components/responses/not_found'
        '503':
          $ref: '#/components/responses/service_unavailable'
      x-github:
        githubCloudOnly: false
        enabledForGitHubApps: true
        category: code-scanning
        subcategory: code-scanning
      security:
      - bearerHttpAuthentication: []
      x-microcks-operation:
        delay: 0
        dispatcher: FALLBACK
components:
  schemas:
    code-scanning-ref:
      type: string
      description: 'The Git reference, formatted as `refs/pull/<number>/merge`, `refs/pull/<number>/head`,

        `refs/heads/<branch name>` or simply `<branch name>`.'
    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-state:
      type: string
      description: State of a code scanning alert.
      enum:
      - open
      - dismissed
      - fixed
    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
          example: abc123def456789012345678901234567890
        message:
          type: object
          properties:
            text:
              type: string
        location:
          $ref: '#/components/schemas/code-scanning-alert-location'
        html_url:
          type: string
          example: https://api.github.com/repos/octocat/Hello-World
        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-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.
    basic-error:
      title: Basic Error
      description: Basic Error
      type: object
      properties:
        message:
          type: string
          example: Example body text
        documentation_url:
          type: string
          example: https://api.github.com/repos/octocat/Hello-World
        url:
          type: string
          example: https://api.github.com/repos/octocat/Hello-World
        status:
          type: string
          example: open
    alert-number:
      type: integer
      description: The security alert number.
      readOnly: true
    code-scanning-alert-location:
      type: object
      description: Describe a region within a file for the alert.
      properties:
        path:
          type: string
          example: src/index.js
        start_line:
          type: integer
          example: 42
        end_line:
          type: integer
          example: 42
        start_column:
          type: integer
          example: 42
        end_column:
          type: integer
          example: 42
    code-scanning-alert-classification:
      type: string
      description: classification of the file. For example to identify it as generated.
      enum:
      - source
      - generated
      - test
      - library
    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.
  parameters:
    alert-number:
      name: alert_number
      in: path
      description: The number that identifies an alert. You can find this at the end of the URL for a code scanning alert within GitHub, and in the `number` field in the response from the `GET /repos/{owner}/{repo}/code-scanning/alerts` operation.
      required: true
      schema:
        $ref: '#/components/schemas/alert-number'
    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/enterprise-server@3.9/rest/using-the-rest-api/using-pagination-in-the-rest-api)."
      in: query
      schema:
        type: integer
        default: 30
    page:
      name: page
      description: The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/enterprise-server@3.9/rest/using-the-rest-api/using-pagination-in-the-rest-api)."
      in: query
      schema:
        type: integer
        default: 1
    git-ref:
      name: ref
      description: The Git reference for the results you want to list. The `ref` for a branch can be formatted either as `refs/heads/<branch name>` or simply `<branch name>`. To reference a pull request use `refs/pull/<number>/merge`.
      in: query
      required: false
      schema:
        $ref: '#/components/schemas/code-scanning-ref'
    owner:
      name: owner
      description: The account owner of the repository. The name is not case sensitive.
      in: path
      required: true
      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
  examples:
    code-scanning-alert-instances:
      value:
      - ref: refs/heads/main
        analysis_key: .github/workflows/codeql-analysis.yml:CodeQL-Build
        environment: ''
        category: .github/workflows/codeql-analysis.yml:CodeQL-Build
        state: open
        fixed_at: '2020-02-14T12:29:18Z'
        commit_sha: 39406e42cb832f683daa691dd652a8dc36ee8930
        message:
          text: This path depends on a user-provided value.
        location:
          path: lib/ab12-gen.js
          start_line: 917
          end_line: 917
          start_column: 7
          end_column: 18
        classifications:
        - library
      - ref: refs/pull/3740/merge
        analysis_key: .github/workflows/codeql-analysis.yml:CodeQL-Build
        environment: ''
        category: .github/workflows/codeql-analysis.yml:CodeQL-Build
        state: fixed
        fixed_at: '2020-02-14T12:29:18Z'
        commit_sha: b09da05606e27f463a2b49287684b4ae777092f2
        message:
          text: This suffix check is missing a length comparison to correctly handle lastIndexOf returning -1.
        location:
          path: app/script.js
          start_line: 2
          end_line: 2
          start_column: 10
          end_column: 50
        classifications:
        - source
  responses:
    service_unavailable:
      description: Service unavailable
      content:
        application/json:
          schema:
            type: object
            properties:
              code:
                type: string
              message:
                type: string
              documentation_url:
                type: string
    not_found:
      description: Resource not found
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/basic-error'
    code_scanning_forbidden_read:
      description: Response if GitHub Advanced Security is not enabled for this repository
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/basic-error'
  securitySchemes:
    bearerHttpAuthentication:
      description: Bearer Token
      type: http
      scheme: Bearer
externalDocs:
  description: GitHub Enterprise Developer Docs
  url: https://docs.github.com/enterprise-server@3.9/rest/