GET
/repos/{owner}/{repo}/code-scanning/alerts/{alert_number}Get a code scanning alert
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.
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.
200Response
numberintegerrequired
The security alert number.
created_atstringrequired
The time that the alert was created in ISO 8601 format: `YYYY-MM-DDTHH:MM:SSZ`.
updated_atstringoptional
The time that the alert was last updated in ISO 8601 format: `YYYY-MM-DDTHH:MM:SSZ`.
urlstringrequired
The REST API URL of the alert resource.
html_urlstringrequired
The GitHub URL of the alert resource.
instances_urlstringrequired
The REST API URL for fetching the list of instances for an alert.
statestringrequired
State of a code scanning alert.
fixed_atstringoptional
The time that the alert was no longer detected and was considered fixed in ISO 8601 format: `YYYY-MM-DDTHH:MM:SSZ`.
dismissed_byobjectrequired
A GitHub user.
dismissed_atstringrequired
The time that the alert was dismissed in ISO 8601 format: `YYYY-MM-DDTHH:MM:SSZ`.
dismissed_reasonstringrequired
**Required when the state is dismissed.** The reason for dismissing or closing the alert.
dismissed_commentstringoptional
The dismissal comment associated with the dismissal of the alert.
ruleobjectrequired
toolobjectrequired
most_recent_instanceobjectrequired
dismissal_approved_byobjectoptional
A GitHub user.
assigneesarray<SimpleUser>optional
linked_pull_requestsarray<PullRequestSimple>optional
Pull requests linked to this alert.
304Not modified
403Response if GitHub Advanced Security is not enabled for this repository
messagestringoptional
documentation_urlstringoptional
urlstringoptional
statusstringoptional
404Resource not found
messagestringoptional
documentation_urlstringoptional
urlstringoptional
statusstringoptional
503Service unavailable
codestringoptional
messagestringoptional
documentation_urlstringoptional
Error handling
A 403 is returned: Response if GitHub Advanced Security is not enabled for this repository. A 404 is returned: Resource not found. A 503 is returned: Service unavailable.