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

# Create a label

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

## Path parameters

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

## Request body

- object
  - `name` string, required
  - `color` string, required — Hex color code with leading #

## Response `201`

Created

- Label
  - `id` integer
  - `name` string
  - `color` string
  - `url` string

## Other responses

- `404` — Resource not found.
- `422` — Validation error.

---

[API](https://skmtc.net/gogs/apis/gogs-api.md) · [All operations](https://skmtc.net/gogs/apis/gogs-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/gogs/gogs-api/revisions/87e2da32266c/schema)
