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

API Docs

PUT /api/v1/auth/me

Allows the currently authenticated user to update their own profile information.


Permissions

This endpoint requires authentication but does not require any special permissions. Users can only update their own profile.


Request Body Parameters

NameTypeRequiredDescription
first_namestringNoFirst name (max 255 characters)
last_namestringNoLast name (max 255 characters)
emailstringNoEmail address (must be valid email format, unique)
usernamestringNoUsername (max 255 characters, unique)
heightintegerNoUser's height in centimeters
birth_datedateNoUser's birth date (format: YYYY-MM-DD)
genderstringNoUser's gender (male, female, other)
bank_account_numberstringNoBank account number (max 50 characters, nullable)
trainer_license_imagenullNoOnly null is accepted, which clears your trainer license. Any other value is rejected with 422

Notes:

  • All parameters are optional. If omitted, they will not be updated.
  • Uploading a trainer license is not done here — use Create Media with attachable_type=user and purpose=trainer_license.
  • trainer_license_approved and trainer_license_rejection_reason are operator-only and are not accepted on this endpoint; sending them has no effect.
  • Clearing trainer_license_image deletes the stored document and resets the approval back to pending.
  • Email and username must be unique across all users.
  • Users can reuse their own current email and username when updating other fields.

Request Example

PUT /api/v1/auth/me
Authorization: Bearer {token}
Content-Type: application/json

{
  "first_name": "John",
  "last_name": "Doe",
  "email": "john.doe@example.com",
  "username": "johndoe",
  "height": 180,
  "birth_date": "1990-05-15"
}

Response

200 OK

Returns the updated user resource.

Example

{
  "data": {
    "id": 1,
    "first_name": "John",
    "last_name": "Doe",
    "email": "john.doe@example.com",
    "username": "johndoe",
    "height": 180,
    "gender": "male",
    "birth_date": "1990-05-15",
    "created_at": "2023-01-01T00:00:00.000000Z",
    "updated_at": "2023-01-15T10:30:00.000000Z",
    ...
  }
}

For a full schema, see User Resource.


Error Responses

StatusDescriptionReference
401Unauthorized (not authenticated)Authentication error
409Conflict (email or username already in use)See below
422Validation error (invalid input)Validation error

409 Conflict - Email Already in Use

{
  "error": "This email is already in use."
}

409 Conflict - Username Already in Use

{
  "error": "This username is already in use."
}

422 Validation Error Examples

{
  "message": "The email field must be a valid email address.",
  "errors": {
    "email": ["The email field must be a valid email address."]
  }
}
{
  "message": "The height field must be an integer.",
  "errors": {
    "height": ["The height field must be an integer."]
  }
}
{
  "message": "The birth date field must be a valid date.",
  "errors": {
    "birth_date": ["The birth date field must be a valid date."]
  }
}

Related Resources

Dambel

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

LinkedinInstagramXYoutubeTelegramGitHub