Create a label

Note: You can add or edit descriptions in labels. See the blog post for full details. To access this feature during the preview period, you must provide a custom media type in the Accept header:

application/vnd.github.symmetra-preview+json

Warning: The API may change without advance notice during the preview period. Preview features are not supported for production use. If you experience any issues, contact your GitHub Enterprise site administrator.

POST /repos/:owner/:repo/labels

Parameters

Name Type Description
name string Required. 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 :strawberry:. For a full list of available emoji and codes, see emoji-cheat-sheet.com.
color string Required. The hexadecimal color code for the label, without the leading #.
description string A short description of the label.

Example

{
  "name": "bug",
  "description": "Something isn't working",
  "color": "f29513"
}

Response

Status: 201 Created
Location: https://api.github.com/repos/octocat/Hello-World/labels/bug
{
  "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
}