Skip to content
lstahlman edited this page Jul 20, 2016 · 3 revisions

Labels

List labels for a repository

GET /repos/:owner/:repo/issues
Response
Status: 200 OK
Content-Type: application/json
[
  {
    "id": 5,
    "name": "Feature Request",
    "color": "#0052cc"
  },
  {
    "id": 6,
    "name": "Help Wanted",
    "color": "#006b75"
  }
]

Get a single label

GET /repos/:owner/:repo/issues/:index
Response
Status: 200 OK
Content-Type: application/json
{
  "id": 6,
  "name": "Help Wanted",
  "color": "#006b75"
}

Create a label

Only users with write access to a repository can create an issue.

POST /repos/:owner/:repo/labels
Parameters
Name Type Description
name string Required The name of the label
color string Required The label color as a hex value e.g, #006b75
Example
{
  "name": "Help Wanted",
  "color": "#006b75"
}
Response
Status: 201 Created
Content-Type: application/json
{
  "id": 6,
  "name": "Help Wanted",
  "color": "#006b75"
}

Edit a label

Issue owners and users with write access can edit an issue.

PATCH /repos/:owner/:repo/labels/:index
Parameters
Name Type Description
name string The name of the label
color string The label color as a hex value e.g, #006b75

If a parameter is empty, that part of the label will remain unchanged

Example
{
  "name": "Help Wanted",
  "color": "#006b75"
}
Response
Status: 200 OK
Content-Type: application/json
{
  "id": 6,
  "name": "Help Wanted",
  "color": "#006b75"
}

Delete a label

Only users with write access to a repository can delete labels.

DELETE /repos/:owner/:repo/labels/:id
Response
Status: 204 No Content
Clone this wiki locally