Skip to content

Update a label

PATCH
/repos/{owner}/{repo}/labels/{name}

Updates a label using the given label name.

API method documentation

owner
required
string

The account owner of the repository. The name is not case sensitive.

repo
required
string

The name of the repository without the .git extension. The name is not case sensitive.

name
required
string
Media type application/json
object
new_name

The new name of the label. Emoji can be added to label names, using either native emoji or colon-style markup. For example, typing :strawberry: will render the emoji :strawberry:. For a full list of available emoji and codes, see “Emoji cheat sheet.”

string
color

The hexadecimal color code for the label, without the leading #.

string
description

A short description of the label. Must be 100 characters or fewer.

string
Examples
Example default
{
"new_name": "bug :bug:",
"description": "Small bug fix required",
"color": "b01f26"
}

Response

Media type application/json
Label

Color-coded labels help you categorize and filter your issues (just like labels in Gmail).

object
id
required

Unique identifier for the label.

integer format: int64
node_id
required
string
url
required

URL for the label

string format: uri
name
required

The name of the label.

string
description
required

Optional description of the label, such as its purpose.

string
nullable
color
required

6-character hex code, without the leading #, identifying the color

string
default
required

Whether this label comes by default in a new repository.

boolean
Examples
Example default
{
"id": 208045946,
"node_id": "MDU6TGFiZWwyMDgwNDU5NDY=",
"url": "https://api.github.com/repos/octocat/Hello-World/labels/bug%20:bug:",
"name": "bug :bug:",
"description": "Small bug fix required",
"color": "b01f26",
"default": true
}