Profile API Documentation

These routes handle user profile management, notifications, vault operations, and user settings.

Overview

Base Path: /profile


Endpoints

1. GET /profile/notifications

Get all notifications for the authenticated user.

Authentication: Required

Response

Returns an array of notification objects.

Array<{
    title: string;
    message: string;
    date: number;
}>;

Success Response (200):

[
    {
        "title": "Welcome",
        "message": "Welcome to Casino!",
        "date": 1703001234567
    }
]

Error Responses:

  • 401 Unauthorized: User is not authenticated

  • 400 Bad Request: User not found

  • 500 Internal Server Error: Server error


2. DELETE /profile/notifications

Clear all notifications for the authenticated user.

Authentication: Required

Response

Success Response (200):

Error Responses:

  • 401 Unauthorized: User is not authenticated

  • 400 Bad Request: User not found

  • 500 Internal Server Error: Server error


3. GET /profile/user/:id

Get public user data by Steam ID.

Authentication: Not required (public endpoint)

Parameters

  • id (path parameter): Steam ID of the user

Response

Success Response (200):

Error Responses:

  • 404 Not Found: User not found

  • 500 Internal Server Error: Server error


4. POST /profile/vault/lock

Lock coins in the vault with a deadline. This moves coins from the user's balance to their vault balance and sets a lock deadline.

Authentication: Required

Request Body

  • amount (number, required): Amount of coins to lock (must be positive)

  • deadline (number, required): Unix timestamp in milliseconds when the vault will unlock (must be in the future)

Response

Success Response (200):

Error Responses:

  • 401 Unauthorized: User is not authenticated

  • 400 Bad Request: Invalid parameters

  • 500 Internal Server Error: Server error


5. POST /profile/vault/unlock

Unlock coins from the vault. This moves coins from the vault balance back to the user's regular balance.

Authentication: Required

Request Body

No body required.

Response

Success Response (200):

Error Responses:

  • 401 Unauthorized: User is not authenticated

  • 400 Bad Request: Cannot unlock vault

  • 500 Internal Server Error: Server error


6. PUT /profile/trade-url

Set or update the user's Steam trade URL.

Authentication: Required

Request Body

  • url (string, required): Steam trade URL (must start with https://steamcommunity.com/tradeoffer/new/?partner)

Response

Success Response (200):

Error Responses:

  • 401 Unauthorized: User is not authenticated

  • 400 Bad Request: Invalid trade URL

  • 500 Internal Server Error: Server error


7. PUT /profile/email

Update the user's email address.

Authentication: Required

Status: Not implemented (returns 501)

Request Body

Response

Error Response (501):


Usage Examples

Frontend Integration

Get Notifications

Clear Notifications

Get Public User

Lock Coins in Vault

Unlock Coins from Vault

Set Trade URL


Notes

  • The vault feature allows users to lock their coins for a specified period, preventing them from being used until the deadline passes.

  • The email update feature is currently disabled and will return a 501 status code.

  • Timestamps are in Unix milliseconds format.

Last updated