Skip to main content

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 a 401 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 CodeDescription
200Request successful
400Invalid parameters or request body
401Unauthorized - authentication required
404Resource not found
500Internal 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 user
  • answers - Answers/messages posted by the user
  • debates - Debates initiated by the user
  • likes - Questions and answers the user has liked
  • favorites - Questions and answers the user has favorited

Build docs developers (and LLMs) love