Sample - GitHub REST API
GET/repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/autofix

Get the status of an autofix for a code scanning alert

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.

  • RetriesRetries up to 2×, 500ms backoff, 30s timeout.

3 parameters
ownerstringrequired
The account owner of the repository. The name is not case sensitive.
repostringrequired
The name of the repository without the `.git` extension. The name is not case sensitive.
alert_numberintegerrequired
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.

5 status codes
200Response
statusstringrequired
The status of an autofix.
Allowed:pendingerrorsuccessoutdated
descriptionstringrequired
The description of an autofix.
started_atstringrequired
The start time of an autofix in ISO 8601 format: `YYYY-MM-DDTHH:MM:SSZ`.
400Bad Request
messagestringoptional
documentation_urlstringoptional
urlstringoptional
statusstringoptional
403Response if GitHub Advanced Security is not enabled for this repository
messagestringoptional
documentation_urlstringoptional
urlstringoptional
statusstringoptional
404Resource not found
messagestringoptional
documentation_urlstringoptional
urlstringoptional
statusstringoptional
500Internal Error
messagestringoptional
documentation_urlstringoptional
urlstringoptional
statusstringoptional

Error handling

A 400 is returned: Bad Request. A 403 is returned: Response if GitHub Advanced Security is not enabled for this repository. A 404 is returned: Resource not found. A 500 is returned: Internal Error.