跳转到内容
Try Gitea Cloud ☁️ for 30 days → Accelerate your Development & Deploys!
Support
This is the documentation of 21.11.0, which is no longer the latest release. See the latest release.

Add a label to an issue

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

List of label IDs

Array<integer>
Examplegenerated
{
"labels": [
1
]
}

LabelList

Media typeapplication/json
Array<object>

Label a label to an issue or a pr

object
color
string
description
string
exclusive
boolean
id
integer format: int64
is_archived
boolean
name
string
url
string
Example
[
{
"color": "00aabb",
"exclusive": false,
"is_archived": false
}
]

APIForbiddenError is a forbidden error response

Media typeapplication/json
message
string
url
string

APINotFound is a not found empty response

Media typeapplication/json