APIs.io Engineering Platform Code-Scanning API

Retrieve code scanning alerts from a repository.

Documentation

Specifications

Other Resources

🔗
PostmanCollection
https://api-evangelist.postman.co/workspace/APIs.io-Engineering-Platform/fe320942-e505-4ee8-8b7c-d72eae00d93f/collection/35240-1ab188a6-cc1f-490d-9413-9c6da20918d0?action=share&creator=35240
🔗
PostmanCapability
https://api-evangelist.postman.co/workspace/APIs.io-Engineering-Platform/fe320942-e505-4ee8-8b7c-d72eae00d93f/collection/35240-0e94f581-cbc1-48e0-b594-1f6b3d07a328?action=share&creator=35240
🔗
PostmanCapability
https://api-evangelist.postman.co/workspace/APIs.io-Engineering-Platform/fe320942-e505-4ee8-8b7c-d72eae00d93f/collection/35240-4517d93a-e7f7-4dc2-b572-06762bbe14de?action=share&creator=35240
🔗
PostmanCollection
https://api-evangelist.postman.co/workspace/APIs.io-Engineering-Platform/fe320942-e505-4ee8-8b7c-d72eae00d93f/collection/35240-88f9ddbb-3115-47dc-b6e5-7fc6f1d2a190?action=share&creator=35240
🔗
PostmanCapability
https://api-evangelist.postman.co/workspace/APIs.io-Engineering-Platform/fe320942-e505-4ee8-8b7c-d72eae00d93f/collection/35240-3a12caae-4945-4df4-8ab9-bb6219ba7a9f?action=share&creator=35240
🔗
PostmanCapability
https://api-evangelist.postman.co/workspace/APIs.io-Engineering-Platform/fe320942-e505-4ee8-8b7c-d72eae00d93f/collection/35240-863b18f0-c2f2-4e32-a5fa-0d1e6ccf77a9?action=share&creator=35240
🔗
PostmanCapability
https://api-evangelist.postman.co/workspace/APIs.io-Engineering-Platform/fe320942-e505-4ee8-8b7c-d72eae00d93f/collection/35240-189876d1-f207-49a2-a4bc-5c67ae78cd19?action=share&creator=35240
🔗
PostmanCapability
https://api-evangelist.postman.co/workspace/APIs.io-Engineering-Platform/fe320942-e505-4ee8-8b7c-d72eae00d93f/collection/35240-c1e74fd9-3f84-4d95-943d-d645d6cb82f7?action=share&creator=35240
🔗
PostmanCapability
https://api-evangelist.postman.co/workspace/APIs.io-Engineering-Platform/fe320942-e505-4ee8-8b7c-d72eae00d93f/collection/35240-b002164d-6e8a-4b6d-b409-4929476e7818?action=share&creator=35240
🔗
PostmanCollection
https://api-evangelist.postman.co/workspace/APIs.io-Engineering-Platform/fe320942-e505-4ee8-8b7c-d72eae00d93f/collection/35240-508660fd-30b8-4c9c-aede-8edbac8a514d?action=share&creator=35240
🔗
PostmanCapability
https://api-evangelist.postman.co/workspace/APIs.io-Engineering-Platform/fe320942-e505-4ee8-8b7c-d72eae00d93f/collection/35240-da35e0ba-f1a9-42fe-a77a-56ff0a47e341?action=share&creator=35240
🔗
PostmanCapability
https://api-evangelist.postman.co/workspace/APIs.io-Engineering-Platform/fe320942-e505-4ee8-8b7c-d72eae00d93f/collection/35240-1d4df7d0-9c92-4fa8-946f-2110c2b3b48d?action=share&creator=35240
🔗
PostmanCapability
https://api-evangelist.postman.co/workspace/APIs.io-Engineering-Platform/fe320942-e505-4ee8-8b7c-d72eae00d93f/collection/35240-2af6f54f-d259-46c0-8f86-78856f5885cd?action=share&creator=35240
🔗
PostmanCapability
https://api-evangelist.postman.co/workspace/APIs.io-Engineering-Platform/fe320942-e505-4ee8-8b7c-d72eae00d93f/collection/35240-cc203f31-e7f6-42ec-ad34-c5c4cde58904?action=share&creator=35240
🔗
PostmanCapability
https://api-evangelist.postman.co/workspace/APIs.io-Engineering-Platform/fe320942-e505-4ee8-8b7c-d72eae00d93f/collection/35240-f19285da-48dd-4691-bbdf-f7d6bec157a3?action=share&creator=35240
🔗
PostmanCollection
https://api-evangelist.postman.co/workspace/APIs.io-Engineering-Platform/fe320942-e505-4ee8-8b7c-d72eae00d93f/collection/35240-aa69cacc-4bbf-4724-a1d4-78cdad57fee8?action=share&creator=35240
🔗
PostmanCollection
https://api-evangelist.postman.co/workspace/APIs.io-Engineering-Platform/fe320942-e505-4ee8-8b7c-d72eae00d93f/collection/35240-a5858f86-04d3-4e15-ae11-b42c7516688b?action=share&creator=35240
🔗
PostmanCollection
https://api-evangelist.postman.co/workspace/APIs.io-Engineering-Platform/fe320942-e505-4ee8-8b7c-d72eae00d93f/collection/35240-c2052341-766c-43c7-b1dc-ed4985e4606b?action=share&creator=35240
🔗
PostmanCollection
https://api-evangelist.postman.co/workspace/APIs.io-Engineering-Platform/fe320942-e505-4ee8-8b7c-d72eae00d93f/collection/35240-aa777c90-8271-4809-8eac-3ec39a9a899c?action=share&creator=35240
🔗
PostmanCollection
https://api-evangelist.postman.co/workspace/APIs.io-Engineering-Platform/fe320942-e505-4ee8-8b7c-d72eae00d93f/collection/35240-4d5957dc-df05-4216-a5fc-d46b3ba811d8?action=share&creator=35240
🔗
PostmanCollection
https://api-evangelist.postman.co/workspace/APIs.io-Engineering-Platform/fe320942-e505-4ee8-8b7c-d72eae00d93f/collection/35240-28d97617-fdba-46a5-ac3e-40f3d2e0fa57?action=share&creator=35240
🔗
PostmanCollection
https://api-evangelist.postman.co/workspace/APIs.io-Engineering-Platform/fe320942-e505-4ee8-8b7c-d72eae00d93f/collection/35240-7429b451-d812-4abc-b497-b763372cf5c5?action=share&creator=35240
🔗
PostmanCapability
https://api-evangelist.postman.co/workspace/APIs.io-Engineering-Platform/fe320942-e505-4ee8-8b7c-d72eae00d93f/collection/35240-b0eafdd0-adaa-48a2-a855-6a31beb86d83?action=share&creator=35240
🔗
PostmanCapability
https://api-evangelist.postman.co/workspace/APIs.io-Engineering-Platform/fe320942-e505-4ee8-8b7c-d72eae00d93f/collection/35240-209f34ef-13c1-400c-bca8-fcddb304aff5?action=share&creator=35240
🔗
PostmanCapability
https://api-evangelist.postman.co/workspace/APIs.io-Engineering-Platform/fe320942-e505-4ee8-8b7c-d72eae00d93f/collection/35240-fb2bbbb8-d4cc-48b1-a660-c8e158bfbbea?action=share&creator=35240

OpenAPI Specification

engineering-platform-code-scanning-api-openapi.yml Raw ↑
openapi: 3.0.0
info:
  version: "1.0.0"
  x-release: v4
  title: APIs.io Engineering Platform Amazon API Gateway 2014 11 13 Code-Scanning API
  description: <fullname>Amazon API Gateway</fullname> <p>Amazon API Gateway helps developers deliver robust, secure, and scalable mobile and web application back ends. API Gateway allows developers to securely connect mobile and web applications to APIs that run on AWS Lambda, Amazon EC2, or other publicly addressable web services that are hosted outside of AWS.</p>
  x-logo:
    url: https://api.apis.guru/v2/cache/logo/https_twitter.com_awscloud_profile_image.png
    backgroundColor: '#FFFFFF'
  termsOfService: https://aws.amazon.com/service-terms/
  contact:
    name: Mike Ralphson
    email: mike.ralphson@gmail.com
    url: https://github.com/mermade/aws2openapi
    x-twitter: PermittedSoc
  license:
    name: Apache 2.0 License
    url: http://www.apache.org/licenses/
  x-providerName: amazonaws.com
  x-serviceName: apigateway
  x-origin:
  - contentType: application/json
    url: https://raw.githubusercontent.com/aws/aws-sdk-js/master/apis/apigateway-2015-07-09.normal.json
    converter:
      url: https://github.com/mermade/aws2openapi
    x-apisguru-driver: external
  x-apiClientRegistration:
    url: https://portal.aws.amazon.com/gp/aws/developer/registration/index.html?nc2=h_ct
  x-apisguru-categories:
  - cloud
  x-preferred: true
servers:
- url: http://apigateway.{region}.amazonaws.com
  variables:
    region:
      description: The AWS region
      enum:
      - us-east-1
      - us-east-2
      - us-west-1
      - us-west-2
      - us-gov-west-1
      - us-gov-east-1
      - ca-central-1
      - eu-north-1
      - eu-west-1
      - eu-west-2
      - eu-west-3
      - eu-central-1
      - eu-south-1
      - af-south-1
      - ap-northeast-1
      - ap-northeast-2
      - ap-northeast-3
      - ap-southeast-1
      - ap-southeast-2
      - ap-east-1
      - ap-south-1
      - sa-east-1
      - me-south-1
      default: us-east-1
  description: The Amazon API Gateway multi-region endpoint
- url: https://apigateway.{region}.amazonaws.com
  variables:
    region:
      description: The AWS region
      enum:
      - us-east-1
      - us-east-2
      - us-west-1
      - us-west-2
      - us-gov-west-1
      - us-gov-east-1
      - ca-central-1
      - eu-north-1
      - eu-west-1
      - eu-west-2
      - eu-west-3
      - eu-central-1
      - eu-south-1
      - af-south-1
      - ap-northeast-1
      - ap-northeast-2
      - ap-northeast-3
      - ap-southeast-1
      - ap-southeast-2
      - ap-east-1
      - ap-south-1
      - sa-east-1
      - me-south-1
      default: us-east-1
  description: The Amazon API Gateway multi-region endpoint
- url: http://apigateway.{region}.amazonaws.com.cn
  variables:
    region:
      description: The AWS region
      enum:
      - cn-north-1
      - cn-northwest-1
      default: cn-north-1
  description: The Amazon API Gateway endpoint for China (Beijing) and China (Ningxia)
- url: https://apigateway.{region}.amazonaws.com.cn
  variables:
    region:
      description: The AWS region
      enum:
      - cn-north-1
      - cn-northwest-1
      default: cn-north-1
  description: The Amazon API Gateway endpoint for China (Beijing) and China (Ningxia)
security:
- hmac: []
tags:
- name: Code-Scanning
  description: Retrieve code scanning alerts from a repository.
paths:
  /enterprises/{enterprise}/code-scanning/alerts:
    get:
      summary: APIs.io Engineering Platform List code scanning alerts for an enterprise
      description: 'Lists code scanning alerts for the default branch for all eligible repositories in an enterprise. Eligible repositories are repositories that are owned by organizations that you own or for which you are a security manager. For more information, see "[Managing security managers in your organization](https://docs.github.com/enterprise-server@3.9/organizations/managing-peoples-access-to-your-organization-with-roles/managing-security-managers-in-your-organization)."


        The authenticated user must be a member of the enterprise to use this endpoint.


        OAuth app tokens and personal access tokens (classic) need the `security_events` or `repo` scope to use this endpoint.'
      tags:
      - Code-Scanning
      operationId: code-scanning/list-alerts-for-enterprise
      externalDocs:
        description: API method documentation
        url: https://docs.github.com/enterprise-server@3.9/rest/code-scanning/code-scanning#list-code-scanning-alerts-for-an-enterprise
      parameters:
      - $ref: '#/components/parameters/enterprise'
      - $ref: '#/components/parameters/tool-name'
      - $ref: '#/components/parameters/tool-guid'
      - $ref: '#/components/parameters/pagination-before'
      - $ref: '#/components/parameters/pagination-after'
      - $ref: '#/components/parameters/page'
      - $ref: '#/components/parameters/per-page'
      - $ref: '#/components/parameters/direction'
      - name: state
        description: If specified, only code scanning alerts with this state will be returned.
        in: query
        required: false
        schema:
          $ref: '#/components/schemas/code-scanning-alert-state-query'
      - name: sort
        description: The property by which to sort the results.
        in: query
        required: false
        schema:
          type: string
          enum:
          - created
          - updated
          default: created
      responses:
        '200':
          description: Response
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/code-scanning-organization-alert-items'
              examples:
                default:
                  $ref: '#/components/examples/code-scanning-organization-alert-items'
          headers:
            Link:
              $ref: '#/components/headers/link'
        '404':
          $ref: '#/components/responses/not_found'
        '503':
          $ref: '#/components/responses/service_unavailable'
      x-github:
        githubCloudOnly: true
        enabledForGitHubApps: false
        previews: []
        category: code-scanning
        subcategory: code-scanning
  /orgs/{org}/code-scanning/alerts:
    get:
      summary: APIs.io Engineering Platform List code scanning alerts for an organization
      description: 'Lists code scanning alerts for the default branch for all eligible repositories in an organization. Eligible repositories are repositories that are owned by organizations that you own or for which you are a security manager. For more information, see "[Managing security managers in your organization](https://docs.github.com/enterprise-server@3.9/organizations/managing-peoples-access-to-your-organization-with-roles/managing-security-managers-in-your-organization)."


        The authenticated user must be an owner or security manager for the organization to use this endpoint.


        OAuth app tokens and personal access tokens (classic) need the `security_events` or `repo`s cope to use this endpoint with private or public repositories, or the `public_repo` scope to use this endpoint with only public repositories.'
      tags:
      - Code-Scanning
      operationId: code-scanning/list-alerts-for-org
      externalDocs:
        description: API method documentation
        url: https://docs.github.com/enterprise-server@3.9/rest/code-scanning/code-scanning#list-code-scanning-alerts-for-an-organization
      parameters:
      - $ref: '#/components/parameters/org'
      - $ref: '#/components/parameters/tool-name'
      - $ref: '#/components/parameters/tool-guid'
      - $ref: '#/components/parameters/pagination-before'
      - $ref: '#/components/parameters/pagination-after'
      - $ref: '#/components/parameters/page'
      - $ref: '#/components/parameters/per-page'
      - $ref: '#/components/parameters/direction'
      - name: state
        description: If specified, only code scanning alerts with this state will be returned.
        in: query
        required: false
        schema:
          $ref: '#/components/schemas/code-scanning-alert-state-query'
      - name: sort
        description: The property by which to sort the results.
        in: query
        required: false
        schema:
          type: string
          enum:
          - created
          - updated
          default: created
      - name: severity
        description: If specified, only code scanning alerts with this severity will be returned.
        in: query
        required: false
        schema:
          $ref: '#/components/schemas/code-scanning-alert-severity'
      responses:
        '200':
          description: Response
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/code-scanning-organization-alert-items'
              examples:
                default:
                  $ref: '#/components/examples/code-scanning-organization-alert-items'
          headers:
            Link:
              $ref: '#/components/headers/link'
        '404':
          $ref: '#/components/responses/not_found'
        '503':
          $ref: '#/components/responses/service_unavailable'
      x-github:
        githubCloudOnly: false
        enabledForGitHubApps: true
        category: code-scanning
        subcategory: code-scanning
  /repos/{owner}/{repo}/code-scanning/alerts:
    get:
      summary: APIs.io Engineering Platform List code scanning alerts for a repository
      description: 'Lists code scanning alerts.


        The response includes a `most_recent_instance` object.

        This provides details of the most recent instance of this alert

        for the default branch (or for the specified Git reference if you used `ref` in the request).


        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:
      - Code-Scanning
      operationId: code-scanning/list-alerts-for-repo
      externalDocs:
        description: API method documentation
        url: https://docs.github.com/enterprise-server@3.9/rest/code-scanning/code-scanning#list-code-scanning-alerts-for-a-repository
      parameters:
      - $ref: '#/components/parameters/owner'
      - $ref: '#/components/parameters/repo'
      - $ref: '#/components/parameters/tool-name'
      - $ref: '#/components/parameters/tool-guid'
      - $ref: '#/components/parameters/page'
      - $ref: '#/components/parameters/per-page'
      - $ref: '#/components/parameters/git-ref'
      - $ref: '#/components/parameters/direction'
      - name: sort
        description: The property by which to sort the results.
        in: query
        required: false
        schema:
          type: string
          enum:
          - created
          - updated
          default: created
      - name: state
        description: If specified, only code scanning alerts with this state will be returned.
        in: query
        required: false
        schema:
          $ref: '#/components/schemas/code-scanning-alert-state-query'
      - name: severity
        description: If specified, only code scanning alerts with this severity will be returned.
        in: query
        required: false
        schema:
          $ref: '#/components/schemas/code-scanning-alert-severity'
      responses:
        '200':
          description: Response
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/code-scanning-alert-items'
              examples:
                default:
                  $ref: '#/components/examples/code-scanning-alert-items'
        '304':
          $ref: '#/components/responses/not_modified'
        '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
  /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}:
    get:
      summary: APIs.io Engineering Platform Get a code scanning alert
      description: 'Gets a single 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:
      - Code-Scanning
      operationId: code-scanning/get-alert
      externalDocs:
        description: API method documentation
        url: https://docs.github.com/enterprise-server@3.9/rest/code-scanning/code-scanning#get-a-code-scanning-alert
      parameters:
      - $ref: '#/components/parameters/owner'
      - $ref: '#/components/parameters/repo'
      - $ref: '#/components/parameters/alert-number'
      responses:
        '200':
          description: Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/code-scanning-alert'
              examples:
                default:
                  $ref: '#/components/examples/code-scanning-alert'
        '304':
          $ref: '#/components/responses/not_modified'
        '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
    patch:
      summary: APIs.io Engineering Platform Update a code scanning alert
      description: 'Updates the status of a single 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.'
      operationId: code-scanning/update-alert
      tags:
      - Code-Scanning
      externalDocs:
        description: API method documentation
        url: https://docs.github.com/enterprise-server@3.9/rest/code-scanning/code-scanning#update-a-code-scanning-alert
      parameters:
      - $ref: '#/components/parameters/owner'
      - $ref: '#/components/parameters/repo'
      - $ref: '#/components/parameters/alert-number'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                state:
                  $ref: '#/components/schemas/code-scanning-alert-set-state'
                dismissed_reason:
                  $ref: '#/components/schemas/code-scanning-alert-dismissed-reason'
                dismissed_comment:
                  $ref: '#/components/schemas/code-scanning-alert-dismissed-comment'
              required:
              - state
            examples:
              default:
                value:
                  state: dismissed
                  dismissed_reason: false positive
                  dismissed_comment: This alert is not actually correct, because there's a sanitizer included in the library.
      responses:
        '200':
          description: Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/code-scanning-alert'
              examples:
                default:
                  $ref: '#/components/examples/code-scanning-alert-dismissed'
        '403':
          $ref: '#/components/responses/code_scanning_forbidden_write'
        '404':
          $ref: '#/components/responses/not_found'
        '503':
          $ref: '#/components/responses/service_unavailable'
      x-github:
        enabledForGitHubApps: true
        githubCloudOnly: false
        category: code-scanning
        subcategory: code-scanning
  /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/instances:
    get:
      summary: APIs.io Engineering Platform List instances of a 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:
      - Code-Scanning
      operationId: code-scanning/list-alert-instances
      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'
      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
  /repos/{owner}/{repo}/code-scanning/analyses:
    get:
      summary: APIs.io Engineering Platform List code scanning analyses for a repository
      description: 'Lists the details of all code scanning analyses for a repository,

        starting with the most recent.

        The response is paginated and you can use the `page` and `per_page` parameters

        to list the analyses you''re interested in.

        By default 30 analyses are listed per page.


        The `rules_count` field in the response give the number of rules

        that were run in the analysis.

        For very old analyses this data is not available,

        and `0` is returned in this field.


        **Deprecation notice**:

        The `tool_name` field is deprecated and will, in future, not be included in the response for this endpoint. The example response reflects this change. The tool name can now be found inside the `tool` field.


        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.'
      operationId: code-scanning/list-recent-analyses
      tags:
      - Code-Scanning
      externalDocs:
        description: API method documentation
        url: https://docs.github.com/enterprise-server@3.9/rest/code-scanning/code-scanning#list-code-scanning-analyses-for-a-repository
      parameters:
      - $ref: '#/components/parameters/owner'
      - $ref: '#/components/parameters/repo'
      - $ref: '#/components/parameters/tool-name'
      - $ref: '#/components/parameters/tool-guid'
      - $ref: '#/components/parameters/page'
      - $ref: '#/components/parameters/per-page'
      - name: ref
        in: query
        description: The Git reference for the analyses 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`.
        required: false
        schema:
          $ref: '#/components/schemas/code-scanning-ref'
      - name: sarif_id
        in: query
        description: Filter analyses belonging to the same SARIF upload.
        required: false
        schema:
          $ref: '#/components/schemas/code-scanning-analysis-sarif-id'
      - $ref: '#/components/parameters/direction'
      - name: sort
        description: The property by which to sort the results.
        in: query
        required: false
        schema:
          type: string
          enum:
          - created
          default: created
      responses:
        '200':
          description: Response
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/code-scanning-analysis'
              examples:
                default:
                  $ref: '#/components/examples/code-scanning-analysis-items'
        '403':
          $ref: '#/components/responses/code_scanning_forbidden_read'
        '404':
          $ref: '#/components/responses/not_found'
        '503':
          $ref: '#/components/responses/service_unavailable'
      x-github:
        enabledForGitHubApps: true
        githubCloudOnly: false
        category: code-scanning
        subcategory: code-scanning
  /repos/{owner}/{repo}/code-scanning/analyses/{analysis_id}:
    get:
      summary: APIs.io Engineering Platform Get a code scanning analysis for a repository
      description: 'Gets a specified code scanning analysis for a repository.


        The default JSON response contains fields that describe the analysis.

        This includes the Git reference and commit SHA to which the analysis relates,

        the datetime of the analysis, the name of the code scanning tool,

        and the number of alerts.


        The `rules_count` field in the default response give the number of rules

        that were run in the analysis.

        For very old analyses this data is not available,

        and `0` is returned in this field.


        This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/enterprise-server@3.9/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."


        - **`application/sarif+json`**: Instead of returning a summary of the analysis, this endpoint returns a subset of the analysis data that was uploaded. The data is formatted as [SARIF version 2.1.0](https://docs.oasis-open.org/sarif/sarif/v2.1.0/cs01/sarif-v2.1.0-cs01.html). It also returns additional data such as the `github/alertNumber` and `github/alertUrl` properties.


        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.'
      operationId: code-scanning/get-analysis
      tags:
      - Code-Scanning
      externalDocs:
        description: API method documentation
        url: https://docs.github.com/enterprise-server@3.9/rest/code-scanning/code-scanning#get-a-code-scanning-analysis-for-a-repository
      parameters:
      - $ref: '#/components/parameters/owner'
      - $ref: '#/components/parameters/repo'
      - name: analysis_id
        in: path
        description: The ID of the analysis, as returned from the `GET /repos/{owner}/{repo}/code-scanning/analyses` operation.
        required: true
        schema:
          type: integer
      responses:
        '200':
          description: Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/code-scanning-analysis'
              examples:
                response:
                  $ref: '#/components/examples/code-scanning-analysis-default'
            application/json+sarif:
              schema:
                type: object
                additionalProperties: true
              examples:
                response:
                  $ref: '#/components/examples/code-scanning-analysis-sarif'
        '403':
          $ref: '#/components/responses/code_scanning_forbidden_read'
        '404':
          $ref: '#/components/responses/not_found'
        '503':
          $ref: '#/components/responses/service_unavailable'
      x-github:
        enabledForGitHubApps: true
        githubCloudOnly: false
        category: code-scanning
        subcategory: code-scanning
    delete:
      summary: APIs.io Engineering Platform Delete a code scanning analysis from a repository
      description: "Deletes a specified code scanning analysis from a repository.\n\nYou can delete one analysis at a time.\nTo delete a series of analyses, start with the most recent analysis and work backwards.\nConceptually, the process is similar to the undo function in a text editor.\n\nWhen you list the analyses for a repository,\none or more will be identified as deletable in the response:\n\n```\n\"deletable\": true\n```\n\nAn analysis is deletable when it's the most recent in a set of analyses.\nTypically, a repository will have multiple sets of analyses\nfor each enabled code scanning tool,\nwhere a set is determined by a unique combination of analysis values:\n\n* `ref`\n* `tool`\n* `category`\n\nIf you attempt to delete an analysis that is not the most recent in a set,\nyou'll get a 400 response with the message:\n\n```\nAnalysis specified is not deletable.\n```\n\nThe response from a successful `DELETE` operation provides you with\ntwo alternative URLs for deleting the next analysis in the set:\n`next_analysis_url` and `confirm_delete_url`.\nUse the `next_analysis_url` URL if you want to avoid accidentally deleting the final analysis\nin a set. This is a useful option if you want to preserve at least one analysis\nfor the specified tool in your repository.\nUse the `confirm_delete_url` URL if you are content to remove all analyses for a tool.\nWhen you delete the last analysis in a set, the value of `next_analysis_url` and `confirm_delete_url`\nin the 200 response is `null`.\n\nAs an example of the deletion process,\nlet's imagine that you added a workflow that configured a particular code scanning tool\nto analyze the code in a repository. This tool has added 15 analyses:\n10 on the default branch, and another 5 on a topic branch.\nYou therefore have two separate sets of analyses for this tool.\nYou've now decided that you want to remove all of the analyses for the tool.\nTo do this you must make 15 separate deletion requests.\nTo start, you must find an analysis that's identified as deletable.\nEach set of analyses always has one that's identified as deletable.\nHaving found the deletable analysis for one of the two sets,\ndelete this analysis and then continue deleting the next analysis in the set until they're all deleted.\nThen repeat the process for the second set.\nThe procedure therefore consists of a nested loop:\n\n**Outer loop**:\n* List the analyses for the repository, filtered by tool.\n* Parse this list to find a deletable analysis. If found:\n\n  **Inner loop**:\n  * Delete the identified analysis.\n  * Parse the response for the value of `confirm_delete_url` and, if found, use this in the next iteration.\n\nThe above process assumes that you want to remove all trace of the tool's analyses from the GitHub user interface, for the specified repository, and it therefore uses the `confirm_delete_url` value. Alternatively, you could use the `next_analysis_url` value, which would leave the last analysis in each set undeleted to avoid removing a tool's analysis entirely.\n\nOAuth 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."
      operationId: code-scanning/delete-analysis
      tags:
      - Code-Scanning
      externalDocs:
        description: API method documentation
        url: https://docs.github.com/enterprise-server@3.9/rest/code-scanning/code-scanning#delete-a-code-scanning-analysis-from-a-repository
      parameters:
      - $ref: '#/components/parameters/owner'
      - $ref: '#/components/parameters/repo'
      - name: analysis_id
        in: path
        description: The ID of the analysis, as returned from the `GET /repos/{owner}/{repo}/code-scanning/analyses` operation.
        required: true
        schema:
          type: integer
      - name: confirm_delete
        in: query
        description: 'Allow deletion if the specified analysis is the last in a set. If you attempt to delete the final analysis in a set without setting this parameter to `true`, you''ll get a 400 response with the message: `Analysis is last of its type and deletion may result in the loss of historical alert data. Please specify confirm_delete.`'
        required: false
        schema:
          type: string
          nullable: true
      responses:
        '200':
          description: Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/code-scanning-analysis-deletion'
              examples:
                default-response:
                  $ref: '#/components/examples/code-scanning-analysis-deletion'
        '400':
          $ref: '#/components/responses/bad_request'
        '403':
          $ref: '#/components/responses/code_scanning_forbidden_write'
        '404':
          $ref: '#/components/responses/not_found'
        '503':
          $ref: '#/components/responses/service_unavailable'
      x-github:
        enabledForGitHubApps: true
        githubCloudOnly: false
        category: code-scanning
        subcategory: code-scanning
  /repos/{owner}/{repo}/code-scanning/default-setup:
    get:
      summary: APIs.io Engineering Platform Get a code scanning default setup configuration
      description: 'Gets a code scanning default 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-Scanning
      operationId: code-scanning/get-default-setup
      externalDocs:
        description: API method documentation
        url: https://docs.github.com/enterprise-server@3.9/rest/code-scanning/code-scanning#get-a-code-scanning-default-setup-configuration
      parameters:
      - $ref: '#/components/parameters/owner'
      - $ref: '#/components/parameters/repo'
      responses:
        '200':
          description: Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/code-scanning-default-setup'
              examples:
                default:
                  $ref: '#/components/examples/code-scanning-default-setup'
        '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
    patch:
      summary: APIs.io Engineering Platform Update a code scanning default setup configuration
      description: 'Updates a code scanning default 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-Scanning
      operationId: code-scanning/update-default-setup
      externalDocs:
        description: API method documentation
        url: https://docs.github.com/enterprise-server@3.9/rest/code-scanning/code-scanning#update-a-code-scanning-default-setup-configuration
      parameters:
      - $ref: '#/components/parameters/owner'
      - $ref: '#/components/parameters/repo'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/code-scanning-default-setup-update'
            examples:
              default:
                $ref: '#/components/examples/code-scanning-default-setup-update'
      responses

# --- truncated at 32 KB (115 KB total) ---
# Full source: https://raw.githubusercontent.com/api-evangelist/apis-io-engineering-platform/refs/heads/main/openapi/engineering-platform-code-scanning-api-openapi.yml