This endpoint allows an authenticated user to update their own profile information. Because it supports avatar image uploads, the request must be sent asDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/fredy-rizo/ecommerce-delivery/llms.txt
Use this file to discover all available pages before exploring further.
multipart/form-data rather than JSON. The user is identified from the JWT token, so no user ID is needed in the request body.
After a successful update, the changes are saved to the database but will not appear in the current JWT token until the user logs out and logs in again. The token is a signed snapshot taken at login time.
Update Profile
Authorization: Bearer <token>Content-Type:
multipart/form-data
Form Fields
The user’s updated full name.
The user’s physical address.
The user’s phone number.
The type of government-issued identification document (e.g.,
"CC", "Pasaporte", "CE").The identification document number.
Optional. One or more image files uploaded under the
avatar field name. Stored in storage/user/ on the server. If omitted, the existing avatar is kept.Response
200 — Profile updated
"Usuario actualizado exitosamente, para visualizar los cambios cierra sesion"true on success.The user document as it existed before the update (the value returned by
findOneAndUpdate without the new option). The database now contains the updated values.401 — No token provided
403 — Token expired or invalid
404 — User not found
Example
Update User Role (Admin Only)
Administrators can assign or replace a user’s role set using this endpoint. Theroles array completely replaces the user’s existing roles.
Authorization: Bearer <token> (must have admin role, value "2")
Path Parameter
The MongoDB
_id of the user whose roles are being updated.Request Body
Array of role objects to assign to the user. Each object must include:
name(string) — human-readable role name (e.g.,"admin","usuario","promotor")value(string) — numeric role code:"1"(usuario),"2"(admin),"3"(promotor),"4"(invitado),"5"(company)
Response
200 — Role updated
"Rol actualizado exitosamente"true on success.403 — Insufficient permissions
Returned when the authenticated user does not have the admin role (value: "2").