Skip to content
Try Gitea Cloud ☁️ for 30 days → Accelerate your Development & Deploys!
This is the documentation of the next version, still under development. See the latest release.

Add a label to an issue

POST
/repos/{owner}/{repo}/issues/{index}/labels
curl --request POST \
--url https://gitea.com/api/v1/repos/example/example/issues/1/labels \
--header 'Authorization: Basic <credentials>' \
--header 'Content-Type: application/json' \
--data '{ "labels": [ "example" ] }'
owner
required
string

Owner of the repo

repo
required
string

Name of the repo

index
required
integer format: int64

Index of the issue

Media typeapplication/json

IssueLabelsOption a collection of labels

object
labels

Labels can be a list of integers representing label IDs or a list of strings representing label names

Array
Examplegenerated
{
"labels": [
"example"
]
}

LabelList

Media typeapplication/json
Array<object>

Label a label to an issue or a pr

object
color
string
description

Description provides additional context about the label’s purpose

string
exclusive
boolean
id

ID is the unique identifier for the label

integer format: int64
is_archived
boolean
name

Name is the display name of the label

string
url

URL is the API endpoint for accessing this label

string format: uri
Example
[
{
"color": "00aabb",
"exclusive": false,
"is_archived": false
}
]

APIForbiddenError is a forbidden error response

message
string
url
string

APINotFound is a not found empty response