Create Reply
Authentication
This endpoint requires user authentication.Path Parameters
The unique identifier of the post to reply to
Request Body
Reply content (1-3000 characters, will be trimmed)
Response
Indicates whether the reply was created successfully
The newly created reply object
Error message if success is false
Code Examples
Response Example
Success
Post Not Found
Missing Content
Toggle Reply Upvote
Authentication
This endpoint requires user authentication.Path Parameters
The unique identifier of the post
The unique identifier of the reply
Response
Indicates whether the operation was successful
Updated upvote count
New upvote status (true if upvoted, false if removed)
Error message if success is false
Code Examples
Response Example
Upvoted
Removed Upvote
Reply Not Found
Accept Answer
Authentication
This endpoint requires user authentication. Only the post author can accept answers.Path Parameters
The unique identifier of the post
The unique identifier of the reply to accept
Response
Indicates whether the operation was successful
New acceptance status (true if accepted)
Whether the post is now marked as resolved
Error message if success is false
Code Examples
Response Example
Answer Accepted
Not Post Author
Reply Not Found
Behavior Notes
Reply Creation
- Reply content is limited to 3000 characters and will be trimmed
- Creating a reply increments the post’s
replyCount - The reply author’s name and image are automatically fetched from the user profile
Upvoting Replies
- Upvoting is a toggle action - calling the endpoint again removes the upvote
- Users can upvote their own replies
- The response includes the updated upvote count and the user’s new upvote status
Accepting Answers
- Only the post author can accept answers
- Only one reply can be accepted at a time per post
- Accepting a reply automatically marks the post as resolved
- Calling the endpoint on an already-accepted reply unaccepts it (toggles)
- When a reply is accepted, all other replies on that post are automatically unaccepted
- Accepted answers appear first when retrieving replies (sorted by
isAcceptedAnswer: truefirst)
Reply Sorting
When fetching a post with replies (viaGET /api/community/posts/:postId):
- Accepted answer appears first (if any)
- Other replies sorted by creation date (oldest first)
Permissions
| Action | Requirement |
|---|---|
| Create Reply | Authenticated user |
| Upvote Reply | Authenticated user |
| Accept Answer | Post author only |
Error Responses
All endpoints return consistent error formats:Authentication Required
Not Authorized
Server Error