---
title: "Add labels to an issue"
method: POST
path: "/repos/{owner}/{repo}/issues/{issue_number}/labels"
tags: ["issues"]
---

# Add labels to an issue

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

Adds labels to an issue. If you provide an empty array of labels, all labels are removed from the issue.

## Path parameters

- `owner` string, required
- `repo` string, required
- `issue_number` integer, required

## Request body

- union
  - object
    - `labels` string[] — The names of the labels to add to the issue's existing labels. You can pass an empty array to remove all labels. Alternatively, you can pass a single label as a `string` or an `array` of labels directly, but GitHub recommends passing an object with the `labels` key. You can also replace all of the labels for an issue. For more information, see "[Set labels for an issue](https://docs.github.com/enterprise-server@3.5/rest/issues/labels#set-labels-for-an-issue)."
  - string[]
  - object
    - `labels` object[]
      - `name` string, required
  - object[]
    - `name` string, required
  - string

## Response `200`

Response

- Label[]
  - `id` integer, required
  - `node_id` string, required
  - `url` string, uri, required — URL for the label
  - `name` string, required — The name of the label.
  - `description` string, nullable, required
  - `color` string, required — 6-character hex code, without the leading #, identifying the color
  - `default` boolean, required

## Other responses

- `301` — Moved permanently
- `404` — Resource not found
- `410` — Gone
- `422` — Validation failed, or the endpoint has been spammed.

---

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