Add a comment to an issue
POST
/repos/{owner}/{repo}/issues/{index}/comments
const url = 'https://gitea.example.com/api/v1/repos/example/example/issues/1/comments';const options = { method: 'POST', headers: {Authorization: 'Basic <credentials>', 'Content-Type': 'application/json'}, body: '{"body":"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.example.com/api/v1/repos/example/example/issues/1/comments \ --header 'Authorization: Basic <credentials>' \ --header 'Content-Type: application/json' \ --data '{ "body": "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
CreateIssueCommentOption options for creating a comment on an issue
object
body
required
string
Examplegenerated
{ "body": "example"}Responses
Section titled “Responses”Comment
Media typeapplication/json
Comment represents a comment on a commit or issue
object
assets
Array<object>
Attachment a generic attachment
object
browser_download_url
string
created_at
string format: date-time
download_count
integer format: int64
id
integer format: int64
name
string
size
integer format: int64
uuid
string
body
string
created_at
string format: date-time
html_url
string
id
integer format: int64
issue_url
string
original_author
string
original_author_id
integer format: int64
pull_request_url
string
updated_at
string format: date-time
user
User represents a user
object
active
Is user active
boolean
avatar_url
URL to the user’s avatar
string
created
string format: date-time
description
The user’s description
string
email
string format: email
followers_count
User counts
integer format: int64
following_count
integer format: int64
full_name
The user’s full name
string
id
The user’s id
integer format: int64
is_admin
Is the user an administrator
boolean
language
User locale
string
last_login
string format: date-time
location
The user’s location
string
login
The user’s username
string
login_name
The user’s authentication sign-in name.
string
prohibit_login
Is user login prohibited
boolean
restricted
Is user restricted
boolean
starred_repos_count
integer format: int64
visibility
User visibility level option: public, limited, private
string
website
The user’s website
string
Example
{ "user": { "login_name": "empty" }}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