Skip to content

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.

API method documentation

owner
required
string

The account owner of the repository. The name is not case sensitive.

repo
required
string

The name of the repository without the .git extension. The name is not case sensitive.

sarif_id
required
string

The SARIF ID obtained after uploading.

Response

Media type application/json
object
processing_status

pending files have not yet been processed, while complete means results from the SARIF have been stored. failed files have either not been processed at all, or could only be partially processed.

string
Allowed values: pending complete failed
analyses_url

The REST API URL for getting the analyses associated with the upload.

string format: uri
nullable
errors

Any errors that ocurred during processing of the delivery.

Array<string>
nullable
Examples
Example default

Default response

{
"processing_status": "complete",
"analyses_url": "https://api.github.com/repos/octocat/hello-world/code-scanning/analyses?sarif_id=47177e22-5596-11eb-80a1-c1e54ef945c6"
}

Response if GitHub Advanced Security is not enabled for this repository

Media type application/json
Basic Error

Basic Error

object
message
string
documentation_url
string
url
string
status
string
Example generated
{
"message": "example",
"documentation_url": "example",
"url": "example",
"status": "example"
}

Not Found if the sarif id does not match any upload

Service unavailable

Media type application/json
object
code
string
message
string
documentation_url
string
Example generated
{
"code": "example",
"message": "example",
"documentation_url": "example"
}