Skip to main content

Update Profile

Update your user profile. The backend exposes profile updates under api/Authentication: POST /api/Authentication/update-profile and POST /api/Authentication/update-about-info for bio/location etc.

Endpoints

POST /api/Authentication/update-profile
POST /api/Authentication/update-about-info

Authentication: Required

Request Body (update-profile)

{
"fullName": "John Doe",
"bio": "Software developer",
"location": "San Francisco, CA",
"website": "https://johndoe.com"
}

Parameters

ParameterTypeRequiredDescription
fullNamestringNoFull name
biostringNoBiography
locationstringNoLocation
websitestringNoWebsite URL

Response

Success (200 OK)

{
"success": true,
"data": {
"id": "user-id",
"fullName": "John Doe",
"bio": "Software developer",
"location": "San Francisco, CA",
"website": "https://johndoe.com",
"updatedAt": "2024-01-01T01:00:00Z"
}
}

Example

const response = await fetch('http://localhost:5000/api/Authentication/update-profile', {
method: 'POST',
headers: {
'Authorization': `Bearer ${token}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({
fullName: 'John Doe',
bio: 'Software developer',
location: 'San Francisco, CA',
website: 'https://johndoe.com'
})
});
const data = await response.json();

Update profile picture (avatar)

POST /api/Authentication/avatar
Content-Type: multipart/form-data

{ image file }

Delete avatar: DELETE /api/Authentication/avatar

Update cover photo (wallpaper)

POST /api/Authentication/wallpaper
Content-Type: multipart/form-data

{ image file }

Delete wallpaper: DELETE /api/Authentication/wallpaper

Next Steps