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.

Students on FinkiOpenDesk can upvote or downvote any subject within the context of a specific profession, expressing how relevant they found that subject for that career path. Votes are scoped to the combination of user, subject, and profession — the same subject can be voted on independently under different professions. This endpoint handles both creating a new vote and toggling an existing one off.
This endpoint requires authentication. Include a valid Bearer token issued by the platform’s OAuth2/JWT provider in every request.
Toggle behavior: If you POST the same subjectId, professionId, and vote value that is already recorded for the authenticated user, the existing vote is deleted and the endpoint returns 204 No Content with no body. This allows the UI to implement a single-click toggle without needing a separate delete call.

POST /api/subjects/vote

Casts a vote on behalf of the authenticated user. The user identity is extracted from the JWT token — the userId is not part of the request body.
Although votes are read from /api/votes, they are written through SubjectController at /api/subjects/vote. This design keeps the mutation path co-located with subject-related operations.

Request headers

Authorization
string
required
Bearer token obtained after authentication. Format: Bearer <token>.

Request body

subjectId
string
required
The unique identifier of the subject being voted on.
professionId
string
required
The unique identifier of the profession under which this vote is being cast. Votes are always profession-scoped.
vote
number
required
The vote value. Must be 1 (upvote) or -1 (downvote).

Response

StatusConditionBody
200 OKVote was created or updated.VoteDto object (see below)
204 No ContentThe incoming vote matched an existing record for this user — the vote was toggled off (deleted).Empty body

200 response fields

voteId
string
required
UUID of the newly persisted vote record, generated by the server.
subjectId
string
required
ID of the subject that was voted on, echoed from the request.
professionId
string
required
ID of the profession context, echoed from the request.
vote
number
required
The vote value that was persisted: 1 or -1.

Examples

curl --request POST \
  --url https://finkiopendesk.onrender.com/api/subjects/vote \
  --header "Authorization: Bearer <your_token>" \
  --header "Content-Type: application/json" \
  --data '{
    "subjectId": "alg-101",
    "professionId": "sw-engineer",
    "vote": 1
  }'

Build docs developers (and LLMs) love