Introduction
The User Profile API allows you to retrieve and update user profile information, track user activity across the platform, and manage user-generated content.Available Endpoints
Get Current User Profile
Retrieve or update the authenticated user’s profile information
Get User Activity
Fetch questions, answers, debates, likes, and favorites for the authenticated user
Manage Favorites
Add or remove questions and answers from favorites
Manage Likes
Upvote or downvote questions and answers
Authentication
All User Profile API endpoints require authentication using NextAuth session tokens. Unauthenticated requests will receive a401 Unauthorized response.
Make sure to include valid session credentials in your requests. The API uses
getServerSession from NextAuth to verify user identity.Common Response Codes
| Status Code | Description |
|---|---|
200 | Request successful |
400 | Invalid parameters or request body |
401 | Unauthorized - authentication required |
404 | Resource not found |
500 | Internal server error |
Data Models
UserProfile
User profile information includes:- userId: Unique identifier for the user
- displayName: User’s display name (1-40 characters)
- avatarUrl: URL to user’s avatar image
- bio: User biography (max 200 characters)
- coverUrl: URL to profile cover image
- provider: Authentication provider (secondme, github, google)
- customized: Whether the profile has been customized by the user
Activity Types
The activity endpoint supports the following types:questions- Questions created by the useranswers- Answers/messages posted by the userdebates- Debates initiated by the userlikes- Questions and answers the user has likedfavorites- Questions and answers the user has favorited