🔐 Authentication
Update avatar
The API endpoint enables users to update their avatar or profile picture.
By accessing this endpoint and providing the necessary parameters, users can upload a new image file for their desired avatar.
patch/users/avatar
Response
Update avatar
Example response
{
"data": {
"_id": "649e795264e7dba29b726936",
"avatar": {
"_id": "649e7a1a64e7dba29b726965",
"localPath": "public/images/plastic168810754602425641.jpeg",
"url": "http://localhost:8080/images/plastic168810754602425641.jpeg"
},
"createdAt": "2023-06-30T06:42:26.163Z",
"email": "user.email@domain.com",
"emailVerificationExpiry": "2023-06-30T07:02:26.246Z",
"emailVerificationToken": "d2749e5298e1acf73cf09d06477669415503bb81e3c6505eff4560c6522ad263",
"loginType": "EMAIL_PASSWORD",
"password": "$2b$10$hyujCc82BcVxlKL42YH2N.bES5gr3SbSt1njbzYh1Deim/KI2sx0i",
"refreshToken": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJfaWQiOiI2NDllNzk1MjY0ZTdkYmEyOWI3MjY5MzYiLCJpYXQiOjE2ODgxMDc1MjAsImV4cCI6MTY4ODk3MTUyMH0.Y9w5ZbXs8S8n2kuTLBHA5co8ez4KvebyJS2_o-9mxKU",
"role": "ADMIN",
"updatedAt": "2023-06-30T06:45:46.055Z",
"username": "doejohn"
},
"message": "Avatar updated successfully",
"statusCode": 200,
"success": true
}