REST API endpoints for code scanning

Use the REST API to retrieve and update code scanning alerts from a repository.

About code scanning

You can retrieve and update code scanning alerts from a repository. You can use the endpoints to create automated reports for the code scanning alerts in an organization or upload analysis results generated using offline code scanning tools. For more information, see Find and fix code vulnerabilities.

Note

Most endpoints use Authorization: Bearer <YOUR-TOKEN> and Accept: application/vnd.github+json headers, plus X-GitHub-Api-Version: 2026-03-10. Curl examples below omit these standard headers for brevity.

Get the AI Scan setting for an organization

GET /orgs/{org}/code-scanning/ai-scan

Gets the AI Scan setting stored on an organization.
The response reports the value stored on the organization. Organization respects enterprise policy.
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 admin:org, repo, or write:org scope to use this endpoint. Organization owners can use admin:org or repo; security managers need write:org.

Parameters

Headers

Path and query parameters

HTTP response status codes

Code examples

Example

Request:

curl -L \
  -X GET \
  https://api.github.com/orgs/ORG/code-scanning/ai-scan

Response schema (Status: 200):

Update the AI Scan setting for an organization

PATCH /orgs/{org}/code-scanning/ai-scan

Updates the AI Scan setting stored on an organization.
The organization respects the enterprise policy, so enabling is rejected when the enterprise disallows AI Scan.
OAuth app tokens and personal access tokens (classic) need the admin:org, repo, or write:org scope to use this endpoint. Organization owners can use admin:org or repo; security managers need write:org.

Parameters

Headers

Path and query parameters

Body parameters

HTTP response status codes

Code examples

Example

Request:

curl -L \
  -X PATCH \
  https://api.github.com/orgs/ORG/code-scanning/ai-scan \
  -d '{
  "pr_scan": "enabled"
}'

Response schema (Status: 200):

Same response schema as Get the AI Scan setting for an organization.

List code scanning alerts for an organization

GET /orgs/{org}/code-scanning/alerts

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."
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 repos cope to use this endpoint with private or public repositories, or the public_repo scope to use this endpoint with only public repositories.

Parameters

Headers

Path and query parameters

HTTP response status codes

Code examples

Example

Request:

curl -L \
  -X GET \
  https://api.github.com/orgs/ORG/code-scanning/alerts

Response schema (Status: 200):

Array of objects:

Get AI Scan enablement for a repository

GET /repos/{owner}/{repo}/code-scanning/ai-scan

Gets whether AI Scan is enabled for a repository.
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.

Parameters

Headers

Path and query parameters

HTTP response status codes

Code examples

Example

Request:

curl -L \
  -X GET \
  https://api.github.com/repos/OWNER/REPO/code-scanning/ai-scan

Response schema (Status: 200):

Same response schema as Get the AI Scan setting for an organization.

Update AI Scan enablement for a repository

PATCH /repos/{owner}/{repo}/code-scanning/ai-scan

Updates whether AI Scan is enabled for a repository.
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.

Parameters

Headers

Path and query parameters

Body parameters

HTTP response status codes

Code examples

Enable AI Scan

Request:

curl -L \
  -X PATCH \
  https://api.github.com/repos/OWNER/REPO/code-scanning/ai-scan \
  -d '{
  "pr_scan": "enabled"
}'

Response schema (Status: 200):

Same response schema as Get the AI Scan setting for an organization.

List code scanning alerts for a repository

GET /repos/{owner}/{repo}/code-scanning/alerts

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.

Parameters

Headers

Path and query parameters

HTTP response status codes

Code examples

Example

Request:

curl -L \
  -X GET \
  https://api.github.com/repos/OWNER/REPO/code-scanning/alerts

Response schema (Status: 200):

Array of objects:

Get a code scanning alert

GET /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}

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.

Parameters

Headers

Path and query parameters

HTTP response status codes

Code examples

Example

Request:

curl -L \
  -X GET \
  https://api.github.com/repos/OWNER/REPO/code-scanning/alerts/ALERT_NUMBER

Response schema (Status: 200):

Update a code scanning alert

PATCH /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}

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.

Parameters

Headers

Path and query parameters

Body parameters

HTTP response status codes

Code examples

Example

Request:

curl -L \
  -X PATCH \
  https://api.github.com/repos/OWNER/REPO/code-scanning/alerts/ALERT_NUMBER \
  -d '{
  "state": "dismissed",
  "dismissed_reason": "false positive",
  "dismissed_comment": "This alert is not actually correct, because there'\''s a sanitizer included in the library.",
  "create_request": true
}'

Response schema (Status: 200):

Same response schema as Get a code scanning alert.

Get the status of an autofix for a code scanning alert

GET /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/autofix

Gets the status and description of an autofix for a code scanning alert on the repository's default branch.
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.

Parameters

Headers

Path and query parameters

HTTP response status codes

Code examples

Example

Request:

curl -L \
  -X GET \
  https://api.github.com/repos/OWNER/REPO/code-scanning/alerts/ALERT_NUMBER/autofix

Response schema (Status: 200):

Create an autofix for a code scanning alert

POST /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/autofix

Creates an autofix for a code scanning alert from the repository's default branch.
If a new autofix is to be created as a result of this request or is currently being generated, then this endpoint will return a 202 Accepted response.
If an autofix already exists for a given alert, then this endpoint will return a 200 OK response.
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.

Parameters

Headers

Path and query parameters

HTTP response status codes

Code examples

Example 1: Status Code 200

Request:

curl -L \
  -X POST \
  https://api.github.com/repos/OWNER/REPO/code-scanning/alerts/ALERT_NUMBER/autofix

Response schema (Status: 200):

Same response schema as Get the status of an autofix for a code scanning alert.

Example 2: Status Code 202

Request:

curl -L \
  -X POST \
  https://api.github.com/repos/OWNER/REPO/code-scanning/alerts/ALERT_NUMBER/autofix

Response schema (Status: 202):

Same response schema as Get the status of an autofix for a code scanning alert.

Commit an autofix for a code scanning alert

POST /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/autofix/commits

Commits an autofix for a code scanning alert from the repository's default branch.
If an autofix is committed as a result of this request, then this endpoint will return a 201 Created response.
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.

Parameters

Headers

Path and query parameters

Body parameters

HTTP response status codes

Code examples

Example

Request:

curl -L \
  -X POST \
  https://api.github.com/repos/OWNER/REPO/code-scanning/alerts/ALERT_NUMBER/autofix/commits \
  -d '{
  "target_ref": "refs/heads/fix-bug",
  "message": "Let'\''s fix this 🪲!"
}'

Response schema (Status: 201):

List instances of a code scanning alert

GET /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/instances

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.

Parameters

Headers

Path and query parameters

HTTP response status codes

Code examples

Example

Request:

curl -L \
  -X GET \
  https://api.github.com/repos/OWNER/REPO/code-scanning/alerts/ALERT_NUMBER/instances

Response schema (Status: 200):

Array of objects:

List code scanning analyses for a repository

GET /repos/{owner}/{repo}/code-scanning/analyses

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.
Warning

Closing down notice: The tool_name field is closing down 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.

Parameters

Headers

Path and query parameters

HTTP response status codes

Code examples

Example

Request:

curl -L \
  -X GET \
  https://api.github.com/repos/OWNER/REPO/code-scanning/analyses

Response schema (Status: 200):

Array of objects:

Get a code scanning analysis for a repository

GET /repos/{owner}/{repo}/code-scanning/analyses/{analysis_id}

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."

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. 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.

Parameters

Headers

Path and query parameters

HTTP response status codes

Code examples

Example 1: Status Code 200

Request:

curl -L \
  -X GET \
  https://api.github.com/repos/OWNER/REPO/code-scanning/analyses/ANALYSIS_ID

Response schema (Status: 200):

Example 2: Status Code 200

Request:

curl -L \
  -X GET \
  https://api.github.com/repos/OWNER/REPO/code-scanning/analyses/ANALYSIS_ID \
  -H "Accept: application/sarif+json"

Response schema (Status: 200):

object, additional properties allowed

Delete a code scanning analysis from a repository

DELETE /repos/{owner}/{repo}/code-scanning/analyses/{analysis_id}

Deletes a specified code scanning analysis from a repository.
You can delete one analysis at a time.
To delete a series of analyses, start with the most recent analysis and work backwards.
Conceptually, the process is similar to the undo function in a text editor.
When you list the analyses for a repository,
one or more will be identified as deletable in the response:
"deletable": true

An analysis is deletable when it's the most recent in a set of analyses.
Typically, a repository will have multiple sets of analyses
for each enabled code scanning tool,
where a set is determined by a unique combination of analysis values:

ref
tool
category

If you attempt to delete an analysis that is not the most recent in a set,
you'll get a 400 response with the message:
Analysis specified is not deletable.

The response from a successful DELETE operation provides you with
two alternative URLs for deleting the next analysis in the set:
next_analysis_url and confirm_delete_url.
Use the next_analysis_url URL if you want to avoid accidentally deleting the final analysis
in a set. This is a useful option if you want to preserve at least one analysis
for the specified tool in your repository.
Use the confirm_delete_url URL if you are content to remove all analyses for a tool.
When you delete the last analysis in a set, the value of next_analysis_url and confirm_delete_url
in the 200 response is null.
As an example of the deletion process,
let's imagine that you added a workflow that configured a particular code scanning tool
to analyze the code in a repository. This tool has added 15 analyses:
10 on the default branch, and another 5 on a topic branch.
You therefore have two separate sets of analyses for this tool.
You've now decided that you want to remove all of the analyses for the tool.
To do this you must make 15 separate deletion requests.
To start, you must find an analysis that's identified as deletable.
Each set of analyses always has one that's identified as deletable.
Having found the deletable analysis for one of the two sets,
delete this analysis and then continue deleting the next analysis in the set until they're all deleted.
Then repeat the process for the second set.
The procedure therefore consists of a nested loop:
Outer loop:

List the analyses for the repository, filtered by tool.

Parse this list to find a deletable analysis. If found:
Inner loop:

Delete the identified analysis.
Parse the response for the value of confirm_delete_url and, if found, use this in the next iteration.

The 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.
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.

Parameters

Headers

Path and query parameters

HTTP response status codes

Code examples

Example

Request:

curl -L \
  -X DELETE \
  https://api.github.com/repos/OWNER/REPO/code-scanning/analyses/ANALYSIS_ID

Response schema (Status: 200):

List CodeQL databases for a repository

GET /repos/{owner}/{repo}/code-scanning/codeql/databases

Lists the CodeQL databases that are available in a repository.
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.

Parameters

Headers

Path and query parameters

HTTP response status codes

Code examples

Example

Request:

curl -L \
  -X GET \
  https://api.github.com/repos/OWNER/REPO/code-scanning/codeql/databases

Response schema (Status: 200):

Array of CodeQL Database:

Get a CodeQL database for a repository

GET /repos/{owner}/{repo}/code-scanning/codeql/databases/{language}

Gets a CodeQL database for a language in a repository.
By default this endpoint returns JSON metadata about the CodeQL database. To
download the CodeQL database binary content, set the Accept header of the request
to application/zip, and make sure
your HTTP client is configured to follow redirects or use the Location header
to make a second request to get the redirect URL.
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.

Parameters

Headers

Path and query parameters

HTTP response status codes

Code examples

Example

Request:

curl -L \
  -X GET \
  https://api.github.com/repos/OWNER/REPO/code-scanning/codeql/databases/LANGUAGE

Response schema (Status: 200):

Delete a CodeQL database

DELETE /repos/{owner}/{repo}/code-scanning/codeql/databases/{language}

Deletes a CodeQL database for a language in a repository.
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.

Parameters

Headers

Path and query parameters

HTTP response status codes

Code examples

Example

Request:

curl -L \
  -X DELETE \
  https://api.github.com/repos/OWNER/REPO/code-scanning/codeql/databases/LANGUAGE

Response schema (Status: 204):

Create a CodeQL variant analysis

POST /repos/{owner}/{repo}/code-scanning/codeql/variant-analyses

Creates a new CodeQL variant analysis, which will run a CodeQL query against one or more repositories.
Get started by learning more about running CodeQL queries at scale with Multi-Repository Variant Analysis.
Use the owner and repo parameters in the URL to specify the controller repository that
will be used for running GitHub Actions workflows and storing the results of the CodeQL variant analysis.
OAuth app tokens and personal access tokens (classic) need the repo scope to use this endpoint.

Parameters

Headers

Path and query parameters

Body parameters

HTTP response status codes

Code examples

Using the "repositories" field. "query_pack" is abridged for brevity.

Request:

curl -L \
  -X POST \
  https://api.github.com/repos/OWNER/REPO/code-scanning/codeql/variant-analyses \
  -d '{
  "language": "csharp",
  "query_pack": "aGVsbG8=",
  "repositories": [
    "octocat/Hello-World",
    "octocat/example"
  ]
}'

Response schema (Status: 201):

Using the "repository_owners" field. "query_pack" is abridged.

Request:

curl -L \
  -X POST \
  https://api.github.com/repos/OWNER/REPO/code-scanning/codeql/variant-analyses \
  -d '{
  "language": "csharp",
  "query_pack": "aGVsbG8=",
  "repository_owners": [
    "octocat"
  ]
}'

Response schema (Status: 201):

Using the "repository_lists" field. "query_pack" is abridged.

Request:

curl -L \
  -X POST \
  https://api.github.com/repos/OWNER/REPO/code-scanning/codeql/variant-analyses \
  -d '{
  "language": "csharp",
  "query_pack": "aGVsbG8=",
  "repository_lists": [
    "top-100-csharp"
  ]
}'

Response schema (Status: 201):

Get the summary of a CodeQL variant analysis

GET /repos/{owner}/{repo}/code-scanning/codeql/variant-analyses/{codeql_variant_analysis_id}

Gets the summary of a CodeQL variant analysis.
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.

Parameters

Headers

Path and query parameters

HTTP response status codes

Code examples

Example

Request:

curl -L \
  -X GET \
  https://api.github.com/repos/OWNER/REPO/code-scanning/codeql/variant-analyses/CODEQL_VARIANT_ANALYSIS_ID

Response schema (Status: 200):

Same response schema as Create a CodeQL variant analysis.

Get the analysis status of a repository in a CodeQL variant analysis

GET /repos/{owner}/{repo}/code-scanning/codeql/variant-analyses/{codeql_variant_analysis_id}/repos/{repo_owner}/{repo_name}

Gets the analysis status of a repository in a CodeQL variant analysis.
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.

Parameters

Headers

Path and query parameters

HTTP response status codes

Code examples

Example

Request:

curl -L \
  -X GET \
  https://api.github.com/repos/OWNER/REPO/code-scanning/codeql/variant-analyses/CODEQL_VARIANT_ANALYSIS_ID/repos/REPO_OWNER/REPO_NAME

Response schema (Status: 200):

Get a code scanning default setup configuration

GET /repos/{owner}/{repo}/code-scanning/default-setup

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.

Parameters

Headers

Path and query parameters

HTTP response status codes

Code examples

Example

Request:

curl -L \
  -X GET \
  https://api.github.com/repos/OWNER/REPO/code-scanning/default-setup

Response schema (Status: 200):

Update a code scanning default setup configuration

PATCH /repos/{owner}/{repo}/code-scanning/default-setup

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.

Parameters

Headers

Path and query parameters

Body parameters

HTTP response status codes

Code examples

Example

Request:

curl -L \
  -X PATCH \
  https://api.github.com/repos/OWNER/REPO/code-scanning/default-setup \
  -d '{
  "state": "configured",
  "threat_model": "remote_and_local"
}'

Response schema (Status: 202):

Upload an analysis as SARIF data

POST /repos/{owner}/{repo}/code-scanning/sarifs

Uploads SARIF data containing the results of a code scanning analysis to make the results available in a repository. For troubleshooting information, see "Troubleshooting SARIF uploads."
There are two places where you can upload code scanning results.

If you upload to a pull request, for example --ref refs/pull/42/merge or --ref refs/pull/42/head, then the results appear as alerts in a pull request check. For more information, see "Triaging code scanning alerts in pull requests."
If you upload to a branch, for example --ref refs/heads/my-branch, then the results appear in the Security tab for your repository. For more information, see "Managing code scanning alerts for your repository."

You must compress the SARIF-formatted analysis data that you want to upload, using gzip, and then encode it as a Base64 format string. For example:
gzip -c analysis-data.sarif | base64 -w0

SARIF upload supports a maximum number of entries per the following data objects, and an analysis will be rejected if any of these objects is above its maximum value. For some objects, there are additional values over which the entries will be ignored while keeping the most important entries whenever applicable.
To get the most out of your analysis when it includes data above the supported limits, try to optimize the analysis configuration. For example, for the CodeQL tool, identify and remove the most noisy queries. For more information, see "SARIF results exceed one or more limits."

SARIF dataMaximum valuesAdditional limitsRuns per file20Results per run25,000Only the top 5,000 results will be included, prioritized by severity.Rules per run25,000Tool extensions per run100Thread Flow Locations per result10,000Only the top 1,000 Thread Flow Locations will be included, using prioritization.Location per result1,000Only 100 locations will be included.Tags per rule20Only 10 tags will be included.
The 202 Accepted response includes an id value.
You can use this ID to check the status of the upload by using it in the /sarifs/{sarif_id} endpoint.
For more information, see "Get information about a SARIF upload."
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.
This endpoint is limited to 1,000 requests per hour for each user or app installation calling it.

Parameters

Headers

Path and query parameters

Body parameters

HTTP response status codes

Code examples

Example

Request:

curl -L \
  -X POST \
  https://api.github.com/repos/OWNER/REPO/code-scanning/sarifs \
  -d '{
  "commit_sha": "4b6472266afd7b471e86085a6659e8c7f2b119da",
  "ref": "refs/heads/master",
  "sarif": "H4sICMLGdF4AA2V4YW1wbGUuc2FyaWYAvVjdbts2FL7PUxDCijaA/CM7iRNfLkPXYgHSNstumlzQ0pHFVCI1korjFgH2ONtr7Ul2KFmy/mOn6QIkjsjDw0/nfN85NL8dEGL9pNwAImqRObECrWM1H40kXQ2XTAfJIlEgXcE1cD10RTQSVDE10K4aKSqZP1AxuKOIKg1ydJU60jSfSh8Hk6EzHA/vlOCWbfa7B6kYPpj90rlsWCZcmbHP5Bs+4oAWIjQD2SMOeJLh2vIQDnIaQerqXHjw8YIgxohybxAyDsS4cAPKsp03K4RcUs6+Up2D+JXpd8mibKIQN9fM/aMCdbyBujGSSQgVxJtx5qX2d2qUcIweQhEuDQf3GBO6CKHkogx/N3MVCKl/AeVKFuf4y5ubsMGDTj1ep+5I7sgmLIpxtU38hLtmMRGSuCFVyip5eKzs5ydh+LztVL6f2m6oih1BkYiuyQIIJWodxVpERPj4sEiWBNNH8EWT0DMG8EAjzKVHXCrB4FkPu/F64NMk1OeC+2yZSNoBOoR7CC0EzYWGbm+xFDFIzbI011+cLjfZtyJkmMZfumAh02uL3NpV2y+MZ6RAjxibyKrNxxJcVjANSb4eBGwZ1M0KsuyR2poLr5rMl8vaDSeVn6eTWEO2j2xIEcmhwlTKNOi4GMOI8gfuZYkvJ7b4v5Tiumyz7RnHeodFzpS8ASIZCH/AYdWi2z3sG8JtFxJ6fF9yR9CdifBr9Pd6d5V2+zbJKjjCFGGmsHuYFy2ytJq9tUxcLSRSQecppOGKrpUxYfxefMEFK+wOGa4hudQByBVT0L+EKtyACxnRsABhEx1QjVDs1KNI9MbpnhqfE45B6FJvu3hRu5VRU9MhZLmK7fqkKyQSTHNoyMqUFMqXCV3CwAeqEwmVokraK8IuBaGvHjQ0gMYrKjnjyw7uk9uD8tgmsBbFMPnU1bV2ZhkJNkuolUiWys3UPWzs5aaIUz9TBe8zMb+6+nT+6fLy91dlE3xzeDDT4zYszb0bW6NjJd0Rvn2EnLvWLFSdKPpBzInzfRgu8ETyMcH8nIfMnJCeC2PyfTA+UKngcnGH7Hw2hGkVQs5YlIRCtdWZYQ4/73es2JlxkfViOEIhoWJq5Oo6UBBfiKIqFBWhiE3jJGbFwVoxBHTRSuIS67sMeplei24X20shLjG+8gqbKC/bESiNMC+wd5q5id0yeS7CJEqXzmrTWNq3k05l84P6f4/bEmXFJjI0fIt1BGQssUnUDkBYeVhE5TqPnMH3jqogDcP0zKcTgLPTMSzOjhbjuVOmW23l1fYNStulfo6sXlFsGLhbDy5RECPRYGCTgOj2bd4nUQEivEd0H7KKYxqnEhFohuur3a3UPskbH/+Yg0+M5P2MHRJu3ziHh3Z2NCrWt3XF1rWTw8Ne/pfbWYXnDSE0SNZQQt1i18q7te2vOhu7ehWuvVyeu0wbLZi24mhoo6aOOTltzG/lgdVvVoXQq5V+pewkFIzL8fjEcadT55jOjpzFzHuOTtDNrMkJPMVQDd7F09RID72O/UPZ0tmctqZ7kWX6EmSZnDpP8GU67SXM8XE3YSrxbKsx6UReZ4y6n/FVZfJjs9Z7stma75W5yQtkzjk5eSJxk1lv4o7+j8TlhaJ2lsKWZO6lruDPBLib3x5ZN/KGWzZ+pn///evv7OOf4iIBv3oY9L/l1wiJ9p0Tc+F1zZnOE9NxXWEus6IQhr5pMfoqxi8WPsuu0azsns4UC6WzNzHIzbeEx4P/AJ3SefgcFAAA"
}'

Response schema (Status: 202):

Get information about a SARIF upload

GET /repos/{owner}/{repo}/code-scanning/sarifs/{sarif_id}

Gets information about a SARIF upload, including the status and the URL of the analysis that was uploaded so that you can retrieve details of the analysis. For more information, see "Get a code scanning analysis for a repository."
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.

Parameters

Headers

Path and query parameters

HTTP response status codes

Code examples

Example

Request:

curl -L \
  -X GET \
  https://api.github.com/repos/OWNER/REPO/code-scanning/sarifs/SARIF_ID

Response schema (Status: 200):