Sample - GitHub REST API
GET/repos/{owner}/{repo}/code-quality/findings

List code quality findings for a repository

Lists code quality findings 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.

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

7 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.
per_pageintegeroptional
The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)."
Default:30
directionstringoptional
The direction to sort the results by.
Allowed:ascdescDefault:desc
beforestringoptional
A cursor, as given in the [Link header](https://docs.github.com/rest/guides/using-pagination-in-the-rest-api#using-link-headers). If specified, the query only searches for results before this cursor. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)."
afterstringoptional
A cursor, as given in the [Link header](https://docs.github.com/rest/guides/using-pagination-in-the-rest-api#using-link-headers). If specified, the query only searches for results after this cursor. For more information, see "[Using pagination in the REST API](https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api)."
statestringoptional
If specified, only code quality findings with this state will be returned.
Allowed:opendismissed

4 status codes
200Response
numberintegerrequired
The finding number.
statestringrequired
State of the code quality finding.
Allowed:opendismissed
urlstringrequired
The REST API URL of the code quality finding resource.
ruleobjectrequired
Code quality rule
locationobjectrequired
Code quality file location
messageobjectrequired
Code quality finding message
created_atstringoptional
The time the code quality finding was created.
403Response if the user is not authorized to access Code quality 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 the user is not authorized to access Code quality for this repository. A 404 is returned: Resource not found. A 503 is returned: Service unavailable.