ورود | ثبت نام
  • FA
  • EN

API Docs

User Resource

Represents a user in the system.


Schema

FieldTypeDescription
idintegerUser ID
emailstringUser email address (hidden for limited access)
phonestringUser phone number (hidden for limited access)
bank_account_numberstring|nullBank account number (hidden for limited access)
trainer_license_imagestring|nullFilename of the uploaded trainer license document (hidden for limited access)
trainer_license_linkstring|nullDownload path for the license document, or null when none is uploaded (hidden for limited access)
trainer_license_approvedboolean|nullnull = pending review, true = approved, false = rejected (hidden for limited access)
trainer_license_rejection_reasonstring|nullOperator's reason when rejected (hidden for limited access)
usernamestringUsername
first_namestringFirst name
last_namestringLast name
created_atstring (date)Account creation timestamp
referral_codestringUser's referral code
referrer_user_idinteger|nullReferring user ID, if any (hidden for limited access)
heightinteger|nullUser's height in CM
birth_datestring (date)|nullUser's birth date
genderstring|nullUser's gender (male, female, other)
referral_scoreintegerUser's referral score (hidden for limited access)
rolesarrayList of Role Resource (hidden for limited access)
mediaarrayList of Media Resource. Excludes purpose-bearing rows such as the trainer license
current_subscriptionobject|nullUser Premium Subscription Resource

Trainer license: the document is identity PII. It is never attached to the public media array, and trainer_license_link points at the standard media download route, which refuses to serve purpose-bearing media to anyone but the subject and holders of users.view_all. See Download Media.

Note: Fields marked with (hidden for limited access) are only included when the viewer is the user themself or an authenticated user with the users.view_all permission. All other viewers — including unauthenticated guests (e.g. on public endpoints that embed a user, such as the training services list) and users with only users.view_limited — do not receive these fields.


Example

{
  "id": 123,
  "email": "test@example.com",
  "phone": "+12345678",
  "bank_account_number": "IR123456789012345678901234",
  "trainer_license_image": "9f2c1b7e4a.jpg",
  "trainer_license_link": "/api/v1/media/456/9f2c1b7e4a.jpg",
  "trainer_license_approved": true,
  "trainer_license_rejection_reason": null,
  "username": "test_username",
  "first_name": "John",
  "last_name": "Doe",
  "created_at": "1970-01-01 00:00:00",
  "referral_code": "XFER543D4...",
  "referrer_user_id": null,
  "height": 180,
  "birth_date": "1990-01-01",
  "gender": "male",
  "referral_score": 5,
  "roles": [<role resource>, ...],
  "media": [<media resource>, ...],
  "current_subscription": <user premium subscription resource>
}

Referral Score

This number is calculated based on the number of people that this user has invited to the platform + half of their score too.

So if we have a tree like this:

  • User 1
    • User 2
      • User 3

These are gonna be the scores:

  • User 1: 1 + 0.5 (half of 1) = 1.5
  • User 2: 1
  • User 3: 0

The depth has no limit.


Related Resources


Dambel

دمبل، دنیای هوشمند ورزش و تغذیه

LinkedinInstagramXYoutubeTelegramGitHub