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

API Docs

PUT /api/v1/users/{user-id}

Update the information of a specific user.


Permissions

PermissionDescription
users.update_anyUpdate any user as an admin

Request Body Parameters

NameTypeRequiredDescription
first_namestringNoFirst name (max 255)
last_namestringNoLast name (max 255)
emailstringNoEmail (max 255, unique)
phonestringNoPhone number (unique, E.164 format)
bank_account_numberstringNoBank account number (max 50 characters, nullable)
usernamestringNoUsername (max 255, unique)
heightintegerNoUser's height in CM
birth_datedateNoUser's birth date
genderstringNoUser's gender (male, female, other)
passwordstringNoNew password (will be hashed)
trainer_license_imagenullNoOnly null is accepted, which clears the license. Any other value is rejected with 422 — uploads go through Create Media with purpose=trainer_license
trainer_license_approvedboolean|nullNoThe review decision: true approves, false rejects, null returns the user to pending
trainer_license_rejection_reasonstring|nullNoReason shown to the user when rejected (max 1000)

All parameters are optional. If omitted, they will not be updated.

Trainer license review

Setting trainer_license_approved to a non-null value that differs from the user's current decision sends them a TrainerLicenseReviewedNotification (see Notifications). Re-sending the same decision is a no-op and notifies nobody.

Clearing trainer_license_image deletes the stored document and resets both trainer_license_approved and trainer_license_rejection_reason to null, unless the same request sets them explicitly.


Response

200 OK

Returns the updated user resource.

{
  "data": { /* user resource */ }
}

See User Resource.


Error Responses

StatusDescriptionReference
404User not foundNot-found error
409Email or phone already in use
422Validation errorValidation error
401UnauthorizedAuthentication error
403ForbiddenPermission error
Dambel

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

LinkedinInstagramXYoutubeTelegramGitHub