Skip to main content
The Users page at Admin > Users lists every registered account on the platform. You can search, create, edit, and delete users directly from this interface.

Viewing users

The user list displays the following fields for each account:
FieldDescription
usernameThe user’s display name
phonePhone number on the profile
level_idThe VIP level currently assigned to the user
wallet_balanceCurrent spendable balance
profitAccumulated commission profit
roleEither user or admin
referral_codeThe user’s unique referral code
Use the search bar to filter by username, phone number, or referral code.

Creating a user

You can create a user directly from the admin dashboard using the Create User form, which calls POST /api/admin/create-user with the Supabase service-role key. Required fields:
  • email — the user’s login email
  • password — initial password
  • username — unique display name
Optional fields:
  • phone — phone number
  • role'user' (default) or 'admin'
  • wallet_balance — starting balance (defaults to 45; if set to 45 or 25 it is recorded as a welcome bonus)
  • level_id — starting VIP level (defaults to 1)
  • referral_code — custom referral code; auto-generated as SM + 6 random characters if omitted
  • referred_by_code — referral code of the user who referred this account
The API creates the Supabase auth user, upserts a profiles row, inserts a referral_codes entry, and optionally logs a welcome-bonus deposit transaction.
POST /api/admin/create-user
Content-Type: application/json

{
  "email": "[email protected]",
  "password": "SecurePass123",
  "username": "jane_doe",
  "phone": "+1-555-0100",
  "role": "user",
  "wallet_balance": 45,
  "level_id": 1,
  "referral_code": "JANE01",
  "referred_by_code": "FRIEND99"
}
A successful response returns { "success": true, "userId": "<uuid>" }.

Deleting a user

To permanently remove a user, click the delete icon on their row in the users table. This triggers a confirmation prompt before proceeding. The deletion calls POST /api/admin/delete-user with { "userId": "<uuid>" }. The API:
  1. Deletes the profiles row (which cascades to related records where foreign keys are set to ON DELETE CASCADE).
  2. Deletes the Supabase auth user via the admin API, revoking all login access immediately.
Deleting a user is permanent. All of the user’s profile data and login access are removed. Associated records such as user_tasks, referral_codes, and transactions are also deleted via cascade. This action cannot be undone.

Editing a user

Click the edit icon on any user row to enter inline edit mode. You can update the following fields directly:
  • username
  • phone
  • role — toggle between 'user' and 'admin'
  • wallet_balance, profit, total_profit, referral_earned, frozen_amount
  • level_id — manually assign a VIP level
  • completed_count, current_set
  • referral_code
Click Save to persist the changes. The dashboard writes directly to the profiles table via supabase.from('profiles').update(...).

Changing a user’s VIP level

To manually promote or demote a user’s tier, edit their row and update the level_id field to the ID of the target level. Level IDs map to the rows in the levels table (viewable under Admin > Levels).
Deposits above certain thresholds can automatically upgrade a user’s level_id via a Supabase database trigger when a deposit is approved. Manual edits here override that value immediately.

User roles

The role field on the profiles table controls access:
ValueDescription
'user'Standard platform user — can complete tasks, deposit, and withdraw
'admin'Full admin dashboard access — can manage all users, approve transactions, and configure the platform
Always set a user’s role back to 'user' before removing admin access, or delete the account entirely.

Viewing task history

To review the tasks a specific user has completed or has pending, navigate to Admin > Tasks and filter by the user. Each user_tasks record includes the task title, status (pending, completed, or cancelled), earned amount, and timestamps.

Build docs developers (and LLMs) love