Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/Daniel-Stojanovski/finkiopendesk/llms.txt

Use this file to discover all available pages before exploring further.

This endpoint creates a new comment and associates it with a subject discussion, a profession discussion, or a channel depending on which target ID you supply in the request body. Authentication is required — the server extracts the author’s user ID from the JWT rather than accepting it as a body field. After the comment is saved, the server fires a notification to other participants already active in the same discussion.

POST /api/comments/create

This endpoint requires authentication. Include a valid Authorization: Bearer <token> header obtained from the auth flow.
After a comment is saved, NotificationService.sendNotification is called synchronously. Other participants in the same discussion will receive a notification event. This does not affect the HTTP response — you will always receive the saved comment in the 200 OK body.

Headers

Authorization
string
required
Bearer token issued by the authentication server. Format: Bearer <jwt>. The server reads the sub claim to identify the comment author.

Request body

type
string
required
Semantic classification of the comment. Must be one of:
  • COMMENT — a general remark
  • REPLY — a direct reply to another comment; supply parentId alongside this type
  • QUESTION — a question directed at other participants
  • IMPORTANT — flagged as important by the author
content
string
required
The text body of the comment. Must be non-empty.
subjectId
string
ID of the subject whose discussion this comment should be attached to. Provide exactly one of subjectId, professionId, or channelId.
professionId
string
ID of the profession whose discussion this comment should be attached to. Provide exactly one of subjectId, professionId, or channelId.
channelId
string
ID of the channel this comment should be posted in. Provide exactly one of subjectId, professionId, or channelId.
parentId
string
ID of the parent comment when creating a reply (type: "REPLY"). Omit or set to null for top-level comments.

Response

Returns 200 OK with the created CommentDto.
commentId
string
required
Auto-generated UUID assigned to the newly created comment.
type
string
required
The comment type as submitted.
content
string
required
The text body as submitted.
subjectId
string
ID of the subject discussion this comment is attached to. null if posted to a profession discussion or channel.
professionId
string
ID of the profession discussion this comment is attached to. null if posted to a subject discussion or channel.
channelId
string
ID of the channel this comment is attached to. null if posted to a subject or profession discussion.
parentId
string
ID of the parent comment if this is a reply. null for top-level comments.
user
object
required
The resolved author of the comment, populated from the JWT subject claim.
curl -X POST https://finkiopendesk.onrender.com/api/comments/create \
  -H "Authorization: Bearer <your-jwt-token>" \
  -H "Content-Type: application/json" \
  -d '{
    "type": "QUESTION",
    "content": "Are there any past exam papers available for this subject?",
    "subjectId": "subject-abc123"
  }'

Build docs developers (and LLMs) love