How AI is applied across API Evangelist and APIs.io. Read my AI disclosure →
API Evangelist API Evangelist
Discovery
Learnings
Guidance
Toolbox
Alignment
API Evangelist LLC

GitHub Code-Scanning API

Retrieve code scanning alerts from a repository.

GitHub Code-Scanning API is one of 129 APIs that GitHub publishes on the APIs.io network, described by a machine-readable OpenAPI specification and an AsyncAPI event-driven specification.

This API exposes 6 JSON Schema definitions.

Tagged areas include Code Scanning. The published artifact set on APIs.io includes an OpenAPI specification, API documentation, an AsyncAPI specification, an API reference, and 6 JSON Schemas.

This API exposes 26 operations across 19 paths, and defines 106 schemas. It is described by OpenAPI 3.2.0, at version 1.1.4.

Requests are made against 2 base URLs: https://api.github.com, {protocol}://{hostname}/api/v3.

26 operations 19 paths 106 schemas 2 DELETE16 GET4 PATCH4 POST

Metadata

The identity and technical contract details declared by the specification.

Specification
OpenAPI 3.2.0
API Version
1.1.4
Base URL
https://api.github.com
Contact
License
Terms of Service
Resource Areas
1

Paths & Operations 26

Across 19 paths, the API surfaces 26 operations — 2 DELETE, 16 GET, 4 PATCH, 4 POST. Each is listed below with its method, path, parameters, and response codes.

code-scanning 26

Retrieve code scanning alerts from a repository.

GET
/orgs/{org}/code-scanning/ai-scan
Get the AI Scan setting for an organization
code-scanning/get-ai-scan-enablement-for-org 1 param → 200403404
PATCH
/orgs/{org}/code-scanning/ai-scan
Update the AI Scan setting for an organization
code-scanning/update-ai-scan-enablement-for-org 1 param body → 200403404422
GET
/orgs/{org}/code-scanning/alerts
List code scanning alerts for an organization
code-scanning/list-alerts-for-org 12 params → 200404503
GET
/repos/{owner}/{repo}/code-scanning/ai-scan
Get AI Scan enablement for a repository
code-scanning/get-ai-scan-enablement 2 params → 200403404
PATCH
/repos/{owner}/{repo}/code-scanning/ai-scan
Update AI Scan enablement for a repository
code-scanning/update-ai-scan-enablement 2 params body → 200403404422
GET
/repos/{owner}/{repo}/code-scanning/alerts
List code scanning alerts for a repository
code-scanning/list-alerts-for-repo 15 params → 200304403404503
GET
/repos/{owner}/{repo}/code-scanning/alerts/{alert_number}
Get a code scanning alert
code-scanning/get-alert 3 params → 200304403404503
PATCH
/repos/{owner}/{repo}/code-scanning/alerts/{alert_number}
Update a code scanning alert
code-scanning/update-alert 3 params body → 200400403404503
GET
/repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/autofix
Get the status of an autofix for a code scanning alert
code-scanning/get-autofix 3 params → 200400403404500
POST
/repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/autofix
Create an autofix for a code scanning alert
code-scanning/create-autofix 3 params → 200202400403404422500
POST
/repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/autofix/commits
Commit an autofix for a code scanning alert
code-scanning/commit-autofix 3 params body → 201400403404422503
GET
/repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/instances
List instances of a code scanning alert
code-scanning/list-alert-instances 7 params → 200403404503
GET
/repos/{owner}/{repo}/code-scanning/analyses
List code scanning analyses for a repository
code-scanning/list-recent-analyses 11 params → 200403404503
GET
/repos/{owner}/{repo}/code-scanning/analyses/{analysis_id}
Get a code scanning analysis for a repository
code-scanning/get-analysis 3 params → 200403404422503
DELETE
/repos/{owner}/{repo}/code-scanning/analyses/{analysis_id}
Delete a code scanning analysis from a repository
code-scanning/delete-analysis 4 params → 200400403404503
GET
/repos/{owner}/{repo}/code-scanning/codeql/databases
List CodeQL databases for a repository
code-scanning/list-codeql-databases 2 params → 200403404503
GET
/repos/{owner}/{repo}/code-scanning/codeql/databases/{language}
Get a CodeQL database for a repository
code-scanning/get-codeql-database 3 params → 200302403404503
DELETE
/repos/{owner}/{repo}/code-scanning/codeql/databases/{language}
Delete a CodeQL database
code-scanning/delete-codeql-database 3 params → 204403404503
POST
/repos/{owner}/{repo}/code-scanning/codeql/variant-analyses
Create a CodeQL variant analysis
code-scanning/create-variant-analysis 2 params body → 201404422503
GET
/repos/{owner}/{repo}/code-scanning/codeql/variant-analyses/{codeql_variant_analysis_id}
Get the summary of a CodeQL variant analysis
code-scanning/get-variant-analysis 3 params → 200404503
GET
/repos/{owner}/{repo}/code-scanning/codeql/variant-analyses/{codeql_variant_analysis_id}/repos/{repo_owner}/{repo_name}
Get the analysis status of a repository in a CodeQL variant analysis
code-scanning/get-variant-analysis-repo-task 5 params → 200404503
GET
/repos/{owner}/{repo}/code-scanning/default-setup
Get a code scanning default setup configuration
code-scanning/get-default-setup 2 params → 200403404503
PATCH
/repos/{owner}/{repo}/code-scanning/default-setup
Update a code scanning default setup configuration
code-scanning/update-default-setup 2 params body → 200202403404409422503
POST
/repos/{owner}/{repo}/code-scanning/sarifs
Upload an analysis as SARIF data
code-scanning/upload-sarif 2 params body → 202400403404413503
GET
/repos/{owner}/{repo}/code-scanning/sarifs/{sarif_id}
Get information about a SARIF upload
code-scanning/get-sarif 3 params → 200403404503
GET
/enterprises/{enterprise}/code-scanning/alerts
GitHub List Code Scanning Alerts for an Enterprise
code-scanning/list-alerts-for-enterprise 10 params → 200404503

Schemas 106

The contract defines 106 schemas that model the data the API accepts and returns. The most detailed are repository (98 properties), simple-repository_2 (46 properties), simple-repository (46 properties), pull-request-simple (37 properties). Each schema is shown below with its type and property counts.

code-scanning-autofix-status
string
The status of an autofix.
code-scanning-alert-rule
object
9 properties
code-scanning-variant-analysis-skipped-repo-group
object
2 properties 2 required
code-scanning-alert-assignees
array
The list of users to assign to the code scanning alert. An empty array unassigns all previous assignees from the alert.
basic-error
object
Basic Error
4 properties
code-scanning-autofix
object
3 properties 3 required
code-scanning-analysis-tool-version
stringnull
The version of the tool used to generate the code scanning analysis.
code-scanning-alert-dismissed-reason
stringnull
Required when the state is dismissed. The reason for dismissing or closing the alert.
code-scanning-codeql-database
object
A CodeQL database.
10 properties 9 required
milestone
object
A collection of related issues and pull requests.
16 properties 16 required
author-association
string
How the author is associated with the repository.
code-scanning-analysis-url
string
The REST API URL of the analysis resource.
code-scanning-alert-set-state
string
Sets the state of the code scanning alert. You must provide dismissedreason when you set the state to dismissed.
team-simple
object
Groups of organization members that gives permissions on specified repositories.
16 properties 11 required
code-scanning-variant-analysis
object
A run of a CodeQL query against one or more repositories.
13 properties 6 required
code-scanning-analysis-deletion
object
Successful deletion of a code scanning analysis
2 properties 2 required
team
object
Groups of organization members that gives permissions on specified repositories.
18 properties 12 required
code-scanning-alert-instance
object
10 properties
code-scanning-analysis-tool-name
string
The name of the tool used to generate the code scanning analysis.
repository
object
A repository on GitHub.
98 properties 73 required
code-scanning-alert-state
stringnull
State of a code scanning alert.
alert-number
integer
The security alert number.
code-scanning-alert-create-request
boolean
If true, attempt to create an alert dismissal request.
code-scanning-analysis-sarif-id
string
An identifier for the upload.
code-scanning-variant-analysis-repo-task
object
8 properties 2 required
code-scanning-ai-scan-org-enablement-update
object
The AI Scan organization setting to apply
1 property
code-scanning-ai-scan-enablement
object
AI Scan enablement for a repository.
1 property 1 required
code-scanning-alert-items
object
17 properties 12 required
alert-created-at
string
The time that the alert was created in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ.
alert-updated-at
string
The time that the alert was last updated in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ.
alert-instances-url
string
The REST API URL for fetching the list of instances for an alert.
code-scanning-ref
string
The Git reference, formatted as refs/pull/ /merge, refs/pull/ /head, refs/heads/ or simply .
code-scanning-analysis-sarif-file
string
A Base64 string representing the SARIF file to upload. You must first compress your SARIF file using [gzip](http://www.gnu.org/software/gzip/manual/gzip.html)…
simple-repository
object
A GitHub repository.
46 properties 46 required
code-scanning-autofix-description
stringnull
The description of an autofix.
pull-request-simple
object
Pull Request Simple
37 properties 31 required
code-scanning-ai-scan-enablement-update
object
AI Scan enablement update for a repository.
1 property
alert-url
string
The REST API URL of the alert resource.
pull-request-stack
objectnull
The stack information associated with a pull request.
5 properties 1 required
code-scanning-analysis
object
15 properties 14 required
code-scanning-ai-scan-org-settings
object
The AI Scan organization setting
1 property 1 required
code-scanning-analysis-category
string
Identifies the configuration under which the analysis was executed. Used to distinguish between multiple analyses for the same tool and commit, but performed o…
code-scanning-default-setup-update-response
object
You can use runurl 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…
2 properties
code-scanning-sarifs-status
object
3 properties
validation-error
object
Validation Error
3 properties 2 required
auto-merge
objectnull
The status of auto merging a pull request.
4 properties 4 required
code-scanning-alert-instance-list
object
10 properties
code-scanning-analysis-environment
string
Identifies the variable values associated with the environment in which this analysis was performed.
code-scanning-ref-full
string
The full Git reference, formatted as refs/heads/ , refs/tags/ , refs/pull/ /merge, or refs/pull/ /head.
empty-object
object
An object without any properties.
code-scanning-sarifs-receipt
object
2 properties
code-scanning-alert-instance-state
stringnull
State of a code scanning alert instance.
scim-error
object
Scim Error
6 properties
code-scanning-analysis-tool-guid
stringnull
The GUID of the tool used to generate the code scanning analysis, if provided in the uploaded SARIF data.
code-scanning-autofix-commits
objectnull
Commit an autofix for a code scanning alert
2 properties
simple-user
object
A GitHub user.
22 properties 18 required
code-scanning-analysis-analysis-key
string
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-query
string
State of a code scanning alert.
code-scanning-variant-analysis-status
string
The new status of the CodeQL variant analysis repository task.
code-scanning-alert-location
object
Describe a region within a file for the alert.
5 properties
code-scanning-autofix-started-at
string
The start time of an autofix in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ.
code-scanning-default-setup
object
Configuration for code scanning default setup.
8 properties
code-scanning-alert-rule-summary
object
9 properties
alert-dismissed-at
stringnull
The time that the alert was dismissed in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ.
alert-html-url
string
The GitHub URL of the alert resource.
alert-fixed-at
stringnull
The time that the alert was no longer detected and was considered fixed in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ.
code-scanning-analysis-commit-sha
string
The SHA of the commit to which the analysis you are uploading relates.
link
object
Hypermedia Link
1 property 1 required
code-scanning-alert-environment
string
Identifies the variable values associated with the environment in which the analysis that generated this alert instance was performed, such as the language tha…
code-scanning-analysis-tool
object
3 properties
code-scanning-default-setup-update
object
Configuration for code scanning default setup.
6 properties
code-scanning-organization-alert-items
object
18 properties 13 required
code-scanning-alert-dismissed-comment
stringnull
The dismissal comment associated with the dismissal of the alert.
code-scanning-analysis-created-at
string
The time that the analysis was created in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ.
license-simple
object
License Simple
6 properties 5 required
code-scanning-alert
object
18 properties 12 required
code-scanning-variant-analysis-language
string
The language targeted by the CodeQL query
code-scanning-autofix-commits-response
object
2 properties
code-scanning-alert-classification
stringnull
A classification of the file. For example to identify it as generated.
code-scanning-variant-analysis-repository
object
Repository Identifier
6 properties 6 required
code-scanning-alert-severity
string
Severity of a code scanning alert.
code-scanning-alert-rule_2
object
9 properties
basic-error_2
object
Basic Error
4 properties
code-scanning-alert-dismissed-reason_2
stringnull
Required when the state is dismissed. The reason for dismissing or closing the alert.
code-scanning-analysis-deletion_2
object
Successful deletion of a code scanning analysis
2 properties 2 required
code-scanning-alert-instance_2
object
10 properties
code-scanning-alert-state_2
string
State of a code scanning alert.
code-scanning-analysis-sarif-id_2
string
An identifier for the upload.
code-scanning-alert-items_2
object
15 properties 12 required
code-scanning-analysis-sarif-file_2
string
A Base64 string representing the SARIF file to upload. You must first compress your SARIF file using [gzip](http://www.gnu.org/software/gzip/manual/gzip.html)…
simple-repository_2
object
A GitHub repository.
46 properties 46 required
code-scanning-analysis_2
object
15 properties 14 required
code-scanning-default-setup-update-response_2
object
You can use runurl 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…
2 properties
code-scanning-sarifs-status_2
object
3 properties
code-scanning-ref-full_2
string
The full Git reference, formatted as refs/heads/ , refs/tags/ , refs/pull/ /merge, or refs/pull/ /head.
code-scanning-sarifs-receipt_2
object
2 properties
scim-error_2
object
Scim Error
6 properties
nullable-simple-user
objectnull
A GitHub user.
21 properties 18 required
simple-user_2
object
A GitHub user.
21 properties 18 required
code-scanning-alert-location_2
object
Describe a region within a file for the alert.
5 properties
code-scanning-alert-rule-summary_2
object
6 properties
code-scanning-default-setup_2
object
Configuration for code scanning default setup.
4 properties
code-scanning-analysis-commit-sha_2
string
The SHA of the commit to which the analysis you are uploading relates.
code-scanning-default-setup-update_2
object
Configuration for code scanning default setup.
2 properties 1 required
code-scanning-organization-alert-items_2
object
16 properties 13 required
code-scanning-alert_2
object
15 properties 12 required

Specification

The full machine-readable OpenAPI contract behind this narrative.

Source

github-code-scanning-api-openapi.yml Raw ↑

Other APIs GitHub publishes across the network.

GitHub Gists API
GitHub Issues API
GitHub Licenses API
GitHub Markdown API
GitHub Meta API
GitHub Projects API
GitHub Repos API
GitHub Search API
GitHub User API
GitHub Deployments API
GitHub Releases API
GitHub Pages API
Where this information came from

This is an independent, third-party profile of GitHub Code-Scanning API, published by API Evangelist. We do not operate, host, resell, or support these APIs, and we are not affiliated with or endorsed by the company unless stated above. Everything here is built from publicly available information — the company's own site, developer portal, documentation, public repositories, and the specifications it publishes for public use. Nothing is obtained by breaching a system, defeating an access control, or using credentials.

The Kin Score and Agent Readiness rating are independently calculated assessments of a company's public API artifacts, scored against a published rubric. They are not certifications, endorsements, security assessments, or audits.

Corrections, re-scores, and removal are free — no partnership or purchase required, and you do not need to justify the request. A removed company is recorded as unrated, never scored zero for having asked. Acknowledgement within one business day; removal within two.

info@apievangelist.com · Read the full data-sourcing policy →
On a security or compliance team? Put security in the subject line and you will get a person, not a form — we will tell you exactly which public URLs this profile was built from.