Skip to content

User Profile

Users have a profile with optional fields for display name, major, graduation year, and interests. The profile is created automatically on first authentication. Users update their own profile only.

GET /users/me returns the authenticated user’s profile including all fields and their selected interests.

PATCH /users/me accepts partial updates to: displayName, major, gradYear, interests. Other fields (id, email, clerkId, createdAt) are immutable via this endpoint.

Interests are an array of category strings selected by the user. They are used as explicit signals by the recommendation model.

GIVEN user A is authenticated
WHEN user A sends GET /users/me
THEN the response contains user A's id, email, displayName, major, gradYear, interests, createdAt, updatedAt
GIVEN user A is authenticated
WHEN user A sends PATCH /users/me with { "displayName": "Brutus" }
THEN user A's displayName is "Brutus"
AND updatedAt is refreshed
GIVEN user A is authenticated
WHEN user A sends PATCH /users/me with { "interests": ["music", "sports", "tech"] }
THEN user A's interests are ["music", "sports", "tech"]

S-USER-4: Partial update preserves other fields

Section titled “S-USER-4: Partial update preserves other fields”
GIVEN user A has displayName "Brutus" and major "CS"
WHEN user A sends PATCH /users/me with { "major": "ECE" }
THEN user A's major is "ECE"
AND user A's displayName is still "Brutus"
GIVEN user A is authenticated
WHEN user A sends PATCH /users/me with { "email": "new@osu.edu" }
THEN the email field is ignored
AND user A's email is unchanged