Sample - GitHub REST API
GET/repos/{owner}/{repo}/issues/{issue_number}/labels

List labels for an issue

Lists the labels assigned to a specific issue in a repository. Use owner, repo, and issue_number to identify the issue, then use pagination parameters when the issue has many labels. Use page and per_page to paginate the results.

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

5 parameters
ownerstringrequired
The account owner of the repository; the name is not case sensitive.
repostringrequired
The repository name without the `.git` extension; the name is not case sensitive.
issue_numberintegerrequired
The integer identifying the issue whose labels you want to retrieve.
per_pageintegeroptional
The number of results per page. Defaults to 30 when omitted.
Default:30
pageintegeroptional
The page number to fetch. Defaults to 1 when omitted.
Default:1

4 status codes
200Returns an array of label objects assigned to the issue, including each label's name, description, color, and archive state.
idintegerrequired
Unique identifier for the label.
node_idstringrequired
urlstringrequired
URL for the label
namestringrequired
The name of the label.
descriptionstringrequired
Optional description of the label, such as its purpose.
colorstringrequired
6-character hex code, without the leading #, identifying the color
defaultbooleanrequired
Whether this label comes by default in a new repository.
archived_atstringrequired
Timestamp indicating when the label was archived, or `null` if it has not been archived.
archived_byobjectrequired
The user who archived the label, or `null` if it has not been archived.
301Returned when the repository or issue URL has moved permanently.
messagestringoptional
documentation_urlstringoptional
urlstringoptional
statusstringoptional
404Returned when the specified repository or issue cannot be found.
messagestringoptional
documentation_urlstringoptional
urlstringoptional
statusstringoptional
410Returned when the endpoint is no longer available.
messagestringoptional
documentation_urlstringoptional
urlstringoptional
statusstringoptional

Error handling

A 404 is returned when the specified repository or issue cannot be found. A 410 is returned when the endpoint is no longer available. owner, repo, and issue_number must identify the issue whose labels you want to list.