Posts
Headers
The following headers need to be sent with any request
| Name | Value |
|---|---|
| Content-Type | application/json |
| Cookies | username & token |
Retrieving
GET /post/<id>
Retrieving data about an existing post
Response
- 200
- 400
{
"status": "success",
"data": <PostData>
}
{
"error": "Invalid request"
}
PostData example
{
"post": {
"id": "5243923bc30a49a8de72",
"content": "== We would love to do game events!\r\nNightlight wants to host events for users to gather on and play together. Which game would you want this to be?\r\n-= You can also comment down other games if they're not listed!",
"type": "poll", // poll | regular | repost
"category": "gaming",
"dateAdded": "2 months ago",
"dateAddedRaw": "2026-02-27 18:14:45",
"files": [],
"fileName": "",
"isAuthor": true,
"likes": 8,
"commentCount": 4,
"views": null,
"hasLiked": false,
"hasReposted": false,
"showViews": false,
"pinned": false,
"provider": "nightlight",
"visibility": 0,
"hasBookmarked": false
},
"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",
"subscription": null
},
// if the post has any modules like posts, those are added here
"poll": {
"id": 52,
"expires": "2026-03-01 11:00:00",
"options": [
{
"id": 128,
"content": "Minecraft (Java)",
"votes": 10,
"hasVoted": false
},
{
"id": 129,
"content": "Deadlock",
"votes": 1,
"hasVoted": false
},
{
"id": 130,
"content": "Rocket League",
"votes": 1,
"hasVoted": false
},
{
"id": 131,
"content": "Fortnite",
"votes": 1,
"hasVoted": false
},
{
"id": 132,
"content": "VRChat",
"votes": 5,
"hasVoted": false
}
]
},
"comments": [?CommentData], //top comment for the post
"me": {
"isModerator": false
}
}
note
hasLiked, hasReposted and hasBookmarked are all related to the user requesting the data
Creating
POST /post
Creates a new post under the current user
Body
Must be sent as FormData
| Name | Type | Description |
|---|---|---|
content | string | Description of the post |
category | number | Category of the post |
visibility | int (0-2) | Visibility of the post |
views | int (0-2) | Views visibility of the post |
?files | File | Media file(s) for the post |
?poll | PollData | Makes this post type poll and adds the specified options |
Response
- Success
- Error
{
"status": "success",
"message": "Post has been successfully uploaded.",
"data": <PostData>
}
{
"status": "error",
"message": "Error message here"
}
Polls
Polls are a type of posts which include votable options on them.
PollData
Data for polls contain 2 keys - expires and options
| Name | Type | Description |
|---|---|---|
expires | DateTime | The date of expiry of this poll |
options | string[] | Votable options for this poll |
Options
Each option is a simple string
Updating
POST /post/<id>
Updates an existing post
Body
| Name | Type | Description |
|---|---|---|
content | string | Updated post description |
pinned | int (0-1) | Whether the post will be pinned |
category | string | Update post category |
Response
- Success
- Error
{
"status": "success",
"message": "Post has been successfully updated.",
"data": <PostData>
}
{
"status": "error",
"message": "Error message here"
}
Deleting
DELETE /post/<id>
Deletes a post and its data
Response
- 200
- 400
{
"status": "success",
"message": "Post has been deleted"
}
{
"status": "error",
"message": "Error message here"
}