Skip to main content

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.

This endpoint completely zeroes out the authenticated user’s UserProfile, reverting all three preference vectors to their registration-time defaults. It is useful when a user wants to restart their recommendation journey from scratch — for example, after a significant change in interests or when onboarding onto a shared device. Internally it calls Django’s update_or_create on UserProfile, so it is safe to call even if the profile record was somehow missing. The operation is idempotent: calling it multiple times produces the same result. No request body is needed, and the only required credential is a valid Bearer access token.

Endpoint

MethodPOST
Path/api/user/reset/
Auth requiredYes — Authorization: Bearer <access_token>
Content-Typeapplication/json (body not required)

What is reset

Calling this endpoint sets the following fields on the authenticated user’s UserProfile to their zero-initialised defaults:
FieldTypeReset value
labelMHE9-element float array[0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0]
labelEmbed384-element float array384 × 0.0
summaryEmbed384-element float array384 × 0.0
These are the same values written during registration. After a reset, the recommendation engine will revert to neutral / generic results until Set Preferences is called again.
Interaction history is preserved. This endpoint resets the preference vectors only — it does not delete any UserInteraction records (likes, dislikes, or bulk-like events). Those records remain in the database. However, because the preference vector is zeroed, the recommendation engine will treat the user as if they have no stated preferences and will return results from a neutral baseline until new preferences are submitted via Set Preferences.

Request Body

No request body is required. The endpoint identifies the user from the JWT access token in the Authorization header.

Responses

200 OK

Returned when the UserProfile is successfully reset.
message
string
A confirmation string. Value is always "user profile is reset.".
200 OK
{
  "message": "user profile is reset."
}

401 Unauthorized

Returned when the Authorization header is absent, the access token is missing, or the token has expired.
401 Unauthorized
{
  "detail": "Authentication credentials were not provided."
}
After receiving a 200 response, direct the user to the preferences onboarding flow — call Set Preferences with a fresh set of preferences and labels before fetching recommendations. Fetching recommendations immediately after a reset will work but will return generic, non-personalised results.

Examples

curl --request POST \
  --url http://localhost:8000/api/user/reset/ \
  --header 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...' \
  --header 'Content-Type: application/json'

Typical use cases

  • User requests a fresh start — A settings screen “Reset my preferences” action calls this endpoint, then navigates the user back to the onboarding preference selector.
  • Testing & development — Quickly wipe a test account’s preference vectors without deleting and re-registering the account.
  • Profile corruption recovery — If a UserProfile record is detected to be in an inconsistent state, this endpoint provides a guaranteed-clean reset via update_or_create.

Build docs developers (and LLMs) love