Skip to main content

Posts

Headers

The following headers need to be sent with any request

NameValue
Content-Typeapplication/json
Cookiesusername & token

Retrieving

GET /post/<id>

Retrieving data about an existing post

Response

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

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&#039;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

NameTypeDescription
contentstringDescription of the post
categorynumberCategory of the post
visibilityint (0-2)Visibility of the post
viewsint (0-2)Views visibility of the post
?filesFileMedia file(s) for the post
?pollPollDataMakes this post type poll and adds the specified options

Response

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

Polls

Polls are a type of posts which include votable options on them.

PollData

Data for polls contain 2 keys - expires and options

NameTypeDescription
expiresDateTimeThe date of expiry of this poll
optionsstring[]Votable options for this poll

Options

Each option is a simple string

Updating

POST /post/<id>

Updates an existing post

Body

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

Response

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

Deleting

DELETE /post/<id>

Deletes a post and its data

Response

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