Skip to main content

Get Post

GET /post/:postId​

Description​

Fetches a single post by its MongoDB post ID. The response respects the post owner's visibility rules because it is built through the same visibility pipeline used elsewhere in the API.

Request Parameters​

Requires Authentication: true​

PATH PARAMS​

NameTypeRequiredDescription
postIdstringYesMongoDB post ID.

Usage Example​

await axios.get("https://api.daykeeper.app/post/66cbbea31e854f3d7995c1f0", {
headers: {
Authorization: `Bearer ${accessToken}`,
},
})

Success Response​

{
"message": "post fetched successfully",
"data": {
"_id": "66cbbea31e854f3d7995c1f0",
"data": "My first post here",
"privacy": "public",
"status": "public"
}
}

Error Response​

CodeDescription
401Missing or invalid access token
401Invalid post ID
404Post not found
500Server error