The Bulk Like endpoint is designed for the onboarding flow, where a new user indicates attractions they have already visited before they start swiping on the Discovery screen. Rather than calling the single Like endpoint repeatedly, the client sends a single list of attraction IDs and the server processes them all atomically — summing the MHE category vectors and averaging the embedding vectors across every new attraction in the batch, then applying one combined update to the user’s preference profile. This batched averaging prevents the early interactions of an active onboarding user from over-fitting the profile toward a single attraction type.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/bulk/ |
| Auth | Bearer token required |
Request Body
An array of attraction ID strings to like in bulk. Each string must match the
id field of an existing attraction (as returned by the Search or List Recommendations endpoints).Attractions that the user has already interacted with (liked or disliked) are silently skipped. If all provided IDs have already been interacted with, the endpoint returns a 400 error.Example: ["tower-of-london", "edinburgh-castle", "st-fagans"]Profile Update Logic
The bulk like update differs from the single like update in how it aggregates multiple attractions:- Collect new attractions — For each ID, a
UserInteractionrecord is created withliked=True. Only newly created interactions contribute to the profile update; IDs the user already interacted with are skipped. - Sum MHE vectors — The
labelMHEvectors of all new attractions are summed together. - Average embedding vectors — The
labelEmbedandsummaryEmbedvectors are averaged across all new attractions. - Initialisation path — When
isInitialising=True(the user has no prior interactions at all before this bulk call), the MHE update uses a factor of(1 - MHE_ALPHA)=0.8instead of the standardMHE_ALPHA = 0.2:profile.labelMHE += avgMHE * 0.8. Within this path, if the profile embeddings are still zero-filled (emptyEmbedding=True), the averaged embedding vectors are written directly as the initial profile embeddings. Otherwise, a higher blending alpha of0.6is used:profile.labelEmbed = (0.6 * avgLabelEmbed) + (0.4 * profile.labelEmbed). - Standard path — When prior interactions exist, the profile is updated via the same
_update_profilemethod used by the single Like endpoint (MHE_ALPHA = 0.2, LABEL_EMBED_ALPHA = 0.15, SUMMARY_EMBED_ALPHA = 0.1). - Delta computation — The
profile_delta(cosine distance before vs. after) is computed and stored on the last attraction’s interaction record only.
Response
200 OK — Bulk like recorded successfully
Confirmation string. Always
"Preferences updated" on success.400 Bad Request — All attractions already added
Returned when every ID in theids array corresponds to an attraction the user has already interacted with, leaving no new attractions to process.
Error message.
"Attraction already added" indicates all provided IDs were pre-existing interactions.