Add a label to an issue
POST
/repos/{owner}/{repo}/issues/{index}/labels
const url = 'https://gitea.com/api/v1/repos/example/example/issues/1/labels';const options = { method: 'POST', headers: {Authorization: 'Basic <credentials>', 'Content-Type': 'application/json'}, body: '{"labels":["example"]}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}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" ] }'Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”owner
required
string
Owner of the repo
repo
required
string
Name of the repo
index
required
integer format: int64
Index of the issue
Request Body
Section titled “Request Body”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" ]}Responses
Section titled “Responses”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
Headers
Section titled “Headers”message
string
url
string
APINotFound is a not found empty response
Media typeapplication/json