Skip to main content

Comments

Headers

The following headers need to be sent with any request

NameValue
Content-Typeapplication/json
Cookiesusername & token

Retrieving

GET /comment/<id>

Retrieving data about an existing comment

Response

{
"status": "success",
"data": <CommentData>
}

CommentData example

{
"comment": {
"id": "70c9ddb9b6d669e12649",
"content": "it up to 5 most recent conversations!",
"dateAdded": "4 days ago",
"dateAddedShort": "4d",
"dateAddedRaw": "2026-04-16 06:38:01",
"file": [],
"isAuthor": false,
"likes": 1,
"hasLiked": false,
"likedByAuthor": false,
"pinned": false,
"threads": 1, // index of the current comment in the comment thread
"replyTo": "4db843edac83bcb9f872"
},
"post": {
"id": "3f8dea09138f4a682f34",
"author": "nightlight"
},
"author": {
"username": "nightlight",
"displayName": "Nightlight",
"picture": "https://cdn.night-light.cz/uploads/nightlight/profilePicture.gif?reload=2025-04-0116:07:47",
"banner": "https://cdn.night-light.cz/uploads/nightlight/profileBanner.gif?reload=2025-04-0116:07:47",
"verified": true,
"decoration": "none",
"title": "none"
}
}
note

hasLiked and isAuthor are all related to the user requesting the data

Creating

POST /comment

Adds a new comment under the current user

Body

Must be sent as FormData

NameTypeDescription
contentstringDescription of the comment
postintID of the originating post
?replyTointID of the comment this comment will reply to (if any)
?fileFileMedia file for the comment

Response

{
"status": "success",
"message": "Comment has been successfully uploaded.",
"data": <CommentData>
}

Updating

POST /comment/<id>

Updates an existing comment

Body

NameTypeDescription
contentstringUpdated comment description
pinnedint (0-1)Whether the comment will be pinned
categorystringUpdate comment category

Response

{
"status": "success",
"message": "Comment has been successfully updated.",
"data": <CommentData>
}

Deleting

DELETE /comment/<id>

Deletes a comment and its data

Response

{
"status": "success",
"message": "Comment has been deleted"
}