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.

Toggles the favorite state of an entity for the given user. If no matching favorite exists for the (userId, targetId, targetType) combination, the server creates and returns a new UserFavorite record. If a matching record already exists, it is deleted and the response body is null. This toggle design lets clients call the same endpoint for both save and unsave actions without needing to track state themselves.
This endpoint is publicly accessible. No Authorization header is required.

Request

POST https://finkiopendesk-be.onrender.com/api/favorites/{userId}/set
Content-Type: application/json

Path parameters

userId
string
required
The identifier of the user for whom the favorite is being toggled. Must match the user’s UUID stored in the system (e.g., a1b2c3d4-e5f6-7890-abcd-ef1234567890).

Request body

targetId
string
required
Identifier of the entity to favorite or unfavorite — for example, a subject code ("OS") or a profession identifier ("SE").
targetType
string
required
Category of the target entity. Accepted values are:
  • "subject" — a course or subject offered at FCSE.
  • "profession" — a profession or career track.
  • "channel" — a discussion channel.

Response

When a favorite is created, returns the new UserFavorite object with HTTP 200 OK. When a favorite is removed, returns null with HTTP 200 OK.
userFavoriteId
string
Unique identifier for the newly created favorite record (UUID v4). Present only when a record was created.
userId
string
UUID of the user who owns this favorite.
targetId
string
Identifier of the favorited entity, echoed from the request body.
targetType
string
Type of the favorited entity, echoed from the request body.
targetName
string
Display name of the favorited entity, resolved at request time. This is a transient field not stored in the database; it may be null.
The uniqueness constraint on (userId, targetId, targetType) means a user cannot have duplicate favorites for the same entity. Calling this endpoint twice in succession with the same body first adds, then removes the record.

Example — adding a favorite

curl -X POST \
  "https://finkiopendesk-be.onrender.com/api/favorites/a1b2c3d4-e5f6-7890-abcd-ef1234567890/set" \
  -H "Content-Type: application/json" \
  -d '{"targetId": "OS", "targetType": "subject"}'

Example — removing a favorite

Calling the endpoint again with the same body removes the existing record.
curl -X POST \
  "https://finkiopendesk-be.onrender.com/api/favorites/a1b2c3d4-e5f6-7890-abcd-ef1234567890/set" \
  -H "Content-Type: application/json" \
  -d '{"targetId": "OS", "targetType": "subject"}'

Build docs developers (and LLMs) love