Labels
List all labels for this repository
GET /repos/:owner/:repo/labels
Response
[
{
"url": "https://api.github.com/repos/octocat/Hello-World/labels/bug",
"name": "bug",
"color": "f29513"
}
]
Get a single label
GET /repos/:owner/:repo/labels/:name
Response
{
"url": "https://api.github.com/repos/octocat/Hello-World/labels/bug",
"name": "bug",
"color": "f29513"
}
Create a label
POST /repos/:owner/:repo/labels
Parameters
Name |
Type |
Description |
name |
string |
Required. The name of the label. |
color |
string |
Required. A 6 character hex code, without the leading # , identifying the color. |
{
"name": "bug",
"color": "f29513"
}
Response
{
"url": "https://api.github.com/repos/octocat/Hello-World/labels/bug",
"name": "bug",
"color": "f29513"
}
Update a label
PATCH /repos/:owner/:repo/labels/:name
Parameters
Name |
Type |
Description |
name |
string |
Required. The name of the label. |
color |
string |
Required. A 6 character hex code, without the leading # , identifying the color. |
{
"name": "bug",
"color": "f29513"
}
Response
{
"url": "https://api.github.com/repos/octocat/Hello-World/labels/bug",
"name": "bug",
"color": "f29513"
}
Delete a label
DELETE /repos/:owner/:repo/labels/:name
Response
List labels on an issue
GET /repos/:owner/:repo/issues/:number/labels
Response
[
{
"url": "https://api.github.com/repos/octocat/Hello-World/labels/bug",
"name": "bug",
"color": "f29513"
}
]
Add labels to an issue
POST /repos/:owner/:repo/issues/:number/labels
[
"Label1",
"Label2"
]
Response
[
{
"url": "https://api.github.com/repos/octocat/Hello-World/labels/bug",
"name": "bug",
"color": "f29513"
}
]
Remove a label from an issue
DELETE /repos/:owner/:repo/issues/:number/labels/:name
Response
Replace all labels for an issue
PUT /repos/:owner/:repo/issues/:number/labels
[
"Label1",
"Label2"
]
Sending an empty array ([]
) will remove all Labels from the Issue.
Response
[
{
"url": "https://api.github.com/repos/octocat/Hello-World/labels/bug",
"name": "bug",
"color": "f29513"
}
]
Remove all labels from an issue
DELETE /repos/:owner/:repo/issues/:number/labels
Response
Get labels for every issue in a milestone
GET /repos/:owner/:repo/milestones/:number/labels
Response
[
{
"url": "https://api.github.com/repos/octocat/Hello-World/labels/bug",
"name": "bug",
"color": "f29513"
}
]