Skip to main content

Overview

User endpoints handle profile viewing, social interactions, and account settings. All endpoints require authentication unless otherwise noted.

Get User Profile

Retrieve detailed information about a user by username.

Request

GET /user/{username}
username
string
required
The username of the user to retrieve
Valid session cookie

Response

username
string
The user’s display name
id
string
User record ID
description
object
User’s profile description
  • id: Description record ID
  • text: Description text content
  • updated: Last update timestamp
permissionLevel
number
User permission level (1-5)
followerCount
number
Number of followers
followingCount
number
Number of users being followed
friendCount
number
Number of friends
follower
boolean
True if the current user follows this user
following
boolean
True if this user follows the current user
friends
boolean
True if users are friends
incomingRequest
boolean
True if this user has sent a friend request to the current user
outgoingRequest
boolean
True if the current user has sent a friend request to this user
places
array
Array of user’s places/games:
  • id: Place ID
  • name: Place name
  • likeCount: Number of likes
  • dislikeCount: Number of dislikes
  • playerCount: Current player count
posts
array
User’s posts:
  • id: Post ID
  • created: Creation timestamp
  • content: Array of content versions
  • visibility: Post visibility setting
groups
array
Groups the user is a member of
groupsOwned
array
Groups owned by the user

Errors

  • 404 Not Found: User does not exist
  • 302 Redirect: Not authenticated (redirects to /login)
Source: Site/src/routes/(main)/user/[username]/+page.server.ts:56-65

Update Profile Settings

Update the current user’s profile information.

Request

POST /settings?/profile
Content-Type: application/x-www-form-urlencoded
Valid session cookie
description
string
Profile description (max 1000 characters)
theme
string
required
Theme name from available themes in configuration

Response

message
string
“Profile updated successfully!”

Errors

theme
string
“must be a valid theme” - Invalid theme selection
Source: Site/src/routes/(main)/settings/+page.server.ts:42-56

Change Password

Update the current user’s password.

Request

POST /settings?/password
Content-Type: application/x-www-form-urlencoded
Valid session cookie
cpassword
string
required
Current password for verification
npassword
string
required
New password (minimum 1 character)
cnpassword
string
required
Confirm new password (must match npassword)

Response

message
string
“Password updated successfully!”

Validation Errors

cpassword
string
“Incorrect password” - Current password verification failed
cnpassword
string
“Passwords do not match” - New password and confirmation don’t match
npassword
string
“New password cannot be the same as the current password”
Source: Site/src/routes/(main)/settings/+page.server.ts:57-87

Update User Styling

Set custom CSS for the user’s profile.

Request

POST /settings?/styling
Content-Type: application/x-www-form-urlencoded
Valid session cookie
css
string
Custom CSS (max 10,000 characters)

Response

message
string
“Styling updated successfully!”
Source: Site/src/routes/(main)/settings/+page.server.ts:107-118

Social Interactions

Manage user relationships including following, friends, and friend requests.

Follow User

POST /user/{username}?/follow
username
string
required
Username to follow
Creates a follow relationship and sends a notification. Source: Site/src/routes/(main)/user/[username]/+page.server.ts:129-136

Unfollow User

POST /user/{username}?/unfollow
username
string
required
Username to unfollow
Removes the follow relationship. Source: Site/src/routes/(main)/user/[username]/+page.server.ts:137-140

Send Friend Request

POST /user/{username}?/request
username
string
required
Username to send friend request to
Creates a friend request notification. If the target user already sent a request, automatically accepts it. Errors:
  • 400 Bad Request: “Already friends” - Users are already friends
Source: Site/src/routes/(main)/user/[username]/+page.server.ts:145-165

Cancel Friend Request

POST /user/{username}?/cancel
username
string
required
Username of pending request to cancel
Cancels an outgoing friend request. Source: Site/src/routes/(main)/user/[username]/+page.server.ts:167-170

Accept Friend Request

POST /user/{username}?/accept
username
string
required
Username to accept friend request from
Accepts an incoming friend request and creates a bidirectional friendship. Errors:
  • 400 Bad Request: “No friend request to accept”
Source: Site/src/routes/(main)/user/[username]/+page.server.ts:175-182

Decline Friend Request

POST /user/{username}?/decline
username
string
required
Username to decline friend request from
Declines an incoming friend request. Source: Site/src/routes/(main)/user/[username]/+page.server.ts:171-174

Unfriend User

POST /user/{username}?/unfriend
username
string
required
Username to unfriend
Removes the friendship relationship. Source: Site/src/routes/(main)/user/[username]/+page.server.ts:141-144

Rerender Avatar (Admin)

Request a re-render of a user’s avatar. Requires administrator privileges.

Request

POST /user/{username}?/rerender
username
string
required
Username to rerender avatar for
Valid session cookie with permission level 5

Response

avatarBody
string
URL to updated body avatar with cache-busting parameter
avatar
string
URL to updated avatar with cache-busting parameter

Errors

  • 403 Forbidden: Insufficient permissions
  • 404 Not Found: User does not exist
  • 500 Internal Server Error: “Failed to request render”
Source: Site/src/routes/(main)/user/[username]/+page.server.ts:112-127

Build docs developers (and LLMs) love