The update profile endpoint lets an authenticated user modify their own profile data, change their password, and upload a new avatar image — all in a single request. The endpoint acceptsDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/scoria02/marbes2021_backend/llms.txt
Use this file to discover all available pages before exploring further.
multipart/form-data so that a file upload can be included alongside text fields.
At least one field must be provided per request. Fields you omit are left unchanged.
Request
Method:PUTPath:
/api/auth/profileAuthentication: Required —
Authorization: Bearer <token>Content-Type:
multipart/form-data
Body parameters
User’s first name. Whitespace is trimmed and the value is title-cased automatically. Must not be blank if included.
User’s last name. Whitespace is trimmed and the value is title-cased automatically. Must not be blank if included.
Phone number. Formatted automatically before storage.
New password. Must be at least 6 characters. Hashed with bcrypt (10 salt rounds) before storage.
Profile picture file. Accepted formats: JPEG, PNG, GIF, WebP. Maximum size: 5 MB. The image is automatically resized to 300 × 300 px after upload.
You must send at least one of the fields above. Sending a request body with none of them returns a
400 error.Middleware pipeline
This endpoint runs the following middleware before reaching the controller:authMiddleware— verifies theAuthorization: Bearer <token>header and decodes the JWT. Returns401if the token is missing, invalid, or expired.validate— checks express-validator results from any upstream validation rules.uploadAvatar— handles themultipart/form-dataparsing and saves the file to a temporary location via Multer.validateAvatar— enforces file type (JPEG/PNG/GIF/WebP) and size (max 5 MB) constraints. Rejects disallowed files before they reach the controller.
Response
200 — success
Always
true on a successful update.Human-readable confirmation message (e.g.
"Perfil actualizado exitosamente").The updated user record as returned by the database. Contains the same fields as the login user object, reflecting any changes just applied.
Examples
Success response
200
Error responses
400
400
401
401
404