---
title: "Create a label"
method: POST
path: "/repos/{owner}/{repo}/labels"
tags: ["issues"]
---

# Create a label

`POST /repos/{owner}/{repo}/labels`

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](http://www.color-hex.com/).

## Path parameters

- `owner` string, required
- `repo` string, required

## Request body

- object
  - `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:](https://github.githubassets.com/images/icons/emoji/unicode/1f353.png ":strawberry:"). For a full list of available emoji and codes, see "[Emoji cheat sheet](https://github.com/ikatyang/emoji-cheat-sheet)."
  - `color` string — The [hexadecimal color code](http://www.color-hex.com/) for the label, without the leading `#`.
  - `description` string — A short description of the label. Must be 100 characters or fewer.

## Response `201`

Response

- Label — Color-coded labels help you categorize and filter your issues (just like labels in Gmail).
  - `id` integer, required — Unique identifier for the label.
  - `node_id` string, required
  - `url` string, uri, required — URL for the label
  - `name` string, required — The name of the label.
  - `description` string, nullable, required — Optional description of the label, such as its purpose.
  - `color` string, required — 6-character hex code, without the leading #, identifying the color
  - `default` boolean, required — Whether this label comes by default in a new repository.

## Other responses

- `404` — Resource not found
- `422` — Validation failed, or the endpoint has been spammed.

---

[API](https://skmtc.net/github/apis/rest-api.md) · [All operations](https://skmtc.net/github/apis/rest-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/github/rest-api/versions/80850db290cd/schema)
