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.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 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 — theuserId 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
Bearer token obtained after authentication. Format:
Bearer <token>.Request body
The unique identifier of the subject being voted on.
The unique identifier of the profession under which this vote is being cast. Votes are always profession-scoped.
The vote value. Must be
1 (upvote) or -1 (downvote).Response
| Status | Condition | Body |
|---|---|---|
200 OK | Vote was created or updated. | VoteDto object (see below) |
204 No Content | The incoming vote matched an existing record for this user — the vote was toggled off (deleted). | Empty body |
200 response fields
UUID of the newly persisted vote record, generated by the server.
ID of the subject that was voted on, echoed from the request.
ID of the profession context, echoed from the request.
The vote value that was persisted:
1 or -1.