Skip to content
lstahlman edited this page Jul 20, 2016 · 1 revision

Issue Labels

List labels for an issue

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

Add one or more labels to an issue

Only users with write access to a repository can add labels to issues.

POST /repos/:owner/:repo/issues/:index/labels
Parameters
Name Type Description
labels int array Required Array of label IDs
Example
{
  "labels": [1,6]
}
Response
Status: 200 OK
Content-Type: application/json
[
  {
    "id": 1,
    "name": "Bug",
    "color": "#e11d21"
  },
  {
    "id": 5,
    "name": "Feature Request",
    "color": "#0052cc"
  },
  {
    "id": 6,
    "name": "Help Wanted",
    "color": "#006b75"
  }
]

Replace all labels on an issue with one or more labels

Only users with write access to a repository can replace labels on an issue.

PATCH /repos/:owner/:repo/issues/:index/labels
Parameters

Same as adding labels to an issue

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

Remove labels on an issue

Only users with write access to a repository can remove labels on an issue.

DELETE /repos/:owner/:repo/issues/:index/labels/:id
Parameters

Same as adding labels to an issue.

Response
Status: 204 No Content

Remove all labels on an issue

Only users with write access to a repository can remove labels on an issue.

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