Overview
The User Profile API allows you to retrieve and update user profile information including display name, email, and avatar settings.Authentication
All user profile endpoints require authentication via Supabase Auth. Users can only access and modify their own profile information.Authentication is handled through HTTP-only cookies. Ensure the user is logged in before making these requests.
Get Current User
/api/auth/me
Retrieves the current authenticated user’s profile information.
Response
The user profile object
Example Response
Error Responses
Error message describing what went wrong
Get Full User Details
/api/auth/user
Retrieves detailed user information including username and profile data.
Response
Unique user identifier (UUID)
User’s email address
User’s full display name
User’s unique username if set
URL to user’s profile picture
Example Response
Get Display Name
/api/auth/display-name
Retrieves the user’s display name and first name for personalization.
Response
User’s full display name
User’s first name extracted from full name
User’s email address
Example Response
Update Display Name
/api/auth/display-name
Updates the user’s display name in both the profiles and users tables.
Request Body
The user’s new full name (first and last name)
Example Request
Response
Indicates whether the update was successful
The updated display name
The extracted first name
Example Response
Error Responses
400 Bad RequestGet User Stats
/api/dashboard/stats
Retrieves comprehensive user statistics including XP, level, streaks, and performance metrics.
Query Parameters
The user ID to fetch statistics for
Response
User’s total accumulated experience points
User’s current level (defaults to 1)
Current consecutive days of activity
Longest streak ever achieved
ISO timestamp of last activity
Average score across all quizzes and flashcards (0-100)
Total number of quizzes completed
Total number of flashcard sessions completed
Number of study sessions in the past 7 days