Create a label
Creates a label for the specified repository with the given name and color. The name and color parameters are required. The color must be a valid hexadecimal color code.
Parameters
Section titled “ Parameters ”Path Parameters
Section titled “ Path Parameters ”The account owner of the repository. The name is not case sensitive.
The name of the repository without the .git extension. The name is not case sensitive.
Request Body required
Section titled “ Request Body required ”object
The 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
. For a full list of available emoji and codes, see “Emoji cheat sheet.”
The hexadecimal color code for the label, without the leading #.
A short description of the label. Must be 100 characters or fewer.
Examples
{ "name": "bug", "description": "Something isn't working", "color": "f29513"}Responses
Section titled “ Responses ”Response
Color-coded labels help you categorize and filter your issues (just like labels in Gmail).
object
Unique identifier for the label.
URL for the label
The name of the label.
Optional description of the label, such as its purpose.
6-character hex code, without the leading #, identifying the color
Whether this label comes by default in a new repository.
Examples
{ "id": 208045946, "node_id": "MDU6TGFiZWwyMDgwNDU5NDY=", "url": "https://api.github.com/repos/octocat/Hello-World/labels/bug", "name": "bug", "description": "Something isn't working", "color": "f29513", "default": true}Headers
Section titled “ Headers ”Example
https://api.github.com/repos/octocat/Hello-World/labels/bugResource not found
Basic Error
object
Example generated
{ "message": "example", "documentation_url": "example", "url": "example", "status": "example"}Validation failed, or the endpoint has been spammed.
Validation Error
object
object
Example generated
{ "message": "example", "documentation_url": "example", "errors": [ { "resource": "example", "field": "example", "message": "example", "code": "example", "index": 1, "value": [ "example" ] } ]}