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, their selected interests, and their persisted app role.

PATCH /users/me accepts partial updates to: displayName, major, gradYear, interests. Other fields (id, email, clerkId, role, 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
AND the response contains user A's role
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
GIVEN user A is authenticated with role USER
WHEN user A sends PATCH /users/me with { "role": "ADMIN" }
THEN the role field is ignored
AND user A's role remains USER

See test-cases/users/profile.md for the full test case registry (TC-USER-001 through TC-USER-010), including automated API tests and manual UI verification cases.