Skip to main content

Create comment for issue

Create a new comment on an existing issue. POST /api/comments/issue Authentication: Required

Parameters

issueId
number
required
The ID of the issue to comment on
body
string
required
The content of the comment

Response

Returns the created comment object.
id
number
Unique identifier for the comment
authorId
string
User ID of the comment author
authorUsername
string
Username of the comment author
body
string
The content of the comment
issueId
number
ID of the issue this comment belongs to (null if on pull request)
pullRequestId
number
ID of the pull request this comment belongs to (null if on issue)
createdAt
timestamp
Timestamp when the comment was created (milliseconds)
updatedAt
timestamp
Timestamp when the comment was last updated (milliseconds)

Example request

curl -X POST https://your-gitflare-instance.com/api/comments/issue \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -d '{
    "issueId": 1,
    "body": "I agree, dark mode would be a great addition to this project!"
  }'

Example response

{
  "id": 42,
  "authorId": "user_456",
  "authorUsername": "johnsmith",
  "body": "I agree, dark mode would be a great addition to this project!",
  "issueId": 1,
  "pullRequestId": null,
  "createdAt": 1709568000000,
  "updatedAt": 1709568000000
}

Error responses

  • 401 Unauthorized: You must be logged in to create a comment
  • 400 Bad Request: Invalid issue ID or missing comment body

Build docs developers (and LLMs) love