Search + K

Command Palette

Search for a command to run...

Sign In

Add labels to an issue

POST /repos/{owner}/{repo}/issues/{issue_number}/labels
Copy endpoint
https://api.github.com

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

Parameters

path Path Parameters

Name Type
owner required

The account owner of the repository. The name is not case sensitive.

string
repo required

The name of the repository without the .git extension. The name is not case sensitive.

string
issue_number required

The number that identifies the issue.

number

Request Body

application/json
{ labels?: string[]; } | { labels?: { name: string; }[]; } | string[] | { name: string; }[] | string

Responses

200 application/json

Response

interface Label {
id: number;
node_id: string;
url: string;
name: string;
description: string | null;
color: string;
default: boolean;
}
[]

Redirects

301 application/json

Moved permanently

interface BasicError {
message?: string;
documentation_url?: string;
url?: string;
status?: string;
}

Client Errors

404 application/json

Resource not found

interface BasicError {
message?: string;
documentation_url?: string;
url?: string;
status?: string;
}
410 application/json

Gone

interface BasicError {
message?: string;
documentation_url?: string;
url?: string;
status?: string;
}
422 application/json

Validation failed, or the endpoint has been spammed.

interface ValidationError {
message: string;
documentation_url: string;
errors?: {
resource?: string;
field?: string;
message?: string;
code: string;
index?: number;
value?: string[] | string | number | null;
}
[]
;
}