The Like endpoint records a positive interaction between the authenticated user and a specific attraction, then immediately updates the user’s preference profile vectors to move them closer to the liked attraction. The update is performed inside a database transaction with a row-level lock on the user’s profile, ensuring concurrent requests cannot corrupt the vector state. The operation is intentionally idempotent-safe — if the same attraction has already been liked, the endpoint returns a 400 error rather than silently re-applying the learning-rate update, which would skew the profile. Once a like is recorded, the attraction is excluded from all future calls to the List Recommendations endpoint for that user.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/viet2811/uk-travel-recommendation/llms.txt
Use this file to discover all available pages before exploring further.
Endpoint
| Field | Value |
|---|---|
| Method | POST |
| Path | /api/recommendations/like/{id} |
| Auth | Bearer token required |
Path Parameters
The unique identifier of the attraction to like. This matches the
id field returned by the List Recommendations and Search endpoints.Example: /api/recommendations/like/tower-of-londonRequest Body
This endpoint does not require a request body.Profile Vector Update
When a like is successfully recorded, the user’s preference profile is updated using the following learning rates:| Vector Component | Update Rule | Learning Rate |
|---|---|---|
labelMHE | Additive — profile.labelMHE += item.labelMHE * MHE_ALPHA | MHE_ALPHA = 0.2 |
labelEmbed | Weighted blend — profile.labelEmbed = (0.85 * profile.labelEmbed) + (0.15 * item.labelEmbed) | LABEL_EMBED_ALPHA = 0.15 |
summaryEmbed | Weighted blend — profile.summaryEmbed = (0.9 * profile.summaryEmbed) + (0.1 * item.summaryEmbed) | SUMMARY_EMBED_ALPHA = 0.1 |
Response
200 OK — Like recorded successfully
Confirmation string. Always
"Preference updated" on success.The
id of the attraction that was liked, echoed back in the response.400 Bad Request — Already liked
Returned when aUserInteraction record with liked=True already exists for this user and attraction pair.
Error message. Always
"Already liked" when this specific condition is triggered.