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

List labels for a repository

Lists all labels configured for a repository. Use page and per_page to paginate the results; per_page can be at most 100.

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

4 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.
per_pageintegeroptional
The number of labels to return per page. Defaults to 30 when omitted and must not exceed 100.
Default:30
pageintegeroptional
The page number to retrieve. Defaults to 1 when omitted.
Default:1

2 status codes
200Returns an array of label objects containing each label's identifier, URL, name, description, color, default status, and archive information.
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.
404Returned when the repository cannot be found.
messagestringoptional
documentation_urlstringoptional
urlstringoptional
statusstringoptional

Error handling

A 404 is returned when the repository cannot be found. owner and repo must identify the repository whose labels you want to list. per_page must not exceed 100.