Documentation Index Fetch the complete documentation index at: https://mintlify.com/David9604/BackMaqagr/llms.txt
Use this file to discover all available pages before exploring further.
Get Profile
This endpoint requires authentication. Include the JWT token in the Authorization header.
GET /api/auth/profile
Returns the complete profile data of the authenticated user (without password).
Authentication
Required: Bearer token in Authorization header
Authorization: Bearer {your_jwt_token}
Response
Indicates if the request was successful
Human-readable response message
Response data containing user profile Complete user profile information User’s role name (e.g., “admin”, “user”)
User account status (e.g., “active”, “inactive”, “suspended”)
ISO 8601 timestamp of registration
ISO 8601 timestamp of last login
Example Request
curl -X GET https://api.maqagr.com/api/auth/profile \
-H "Authorization: Bearer eyJhbGciOiJIUzI1NiIs..."
const response = await fetch ( 'https://api.maqagr.com/api/auth/profile' , {
headers: {
'Authorization' : `Bearer ${ token } `
}
});
const data = await response . json ();
import requests
response = requests.get(
'https://api.maqagr.com/api/auth/profile' ,
headers = { 'Authorization' : f 'Bearer { token } ' }
)
data = response.json()
Success Response (200)
{
"success" : true ,
"message" : "Perfil obtenido exitosamente" ,
"data" : {
"user" : {
"user_id" : 1 ,
"name" : "Juan Pérez" ,
"email" : "juan@example.com" ,
"role_id" : 2 ,
"role_name" : "user" ,
"status" : "active" ,
"registration_date" : "2026-02-13T10:00:00.000Z" ,
"last_session" : "2026-03-11T08:30:00.000Z"
}
}
}
Error Responses
401 - Unauthorized (No Token)
{
"success" : false ,
"message" : "Token no proporcionado o inválido"
}
404 - User Not Found
{
"success" : false ,
"message" : "Usuario no encontrado"
}
Update Profile
This endpoint requires authentication. Include the JWT token in the Authorization header.
PUT /api/auth/profile
Allows updating the name and/or email of the authenticated user. Does not allow changing role or status. At least one field must be provided. If updating email, it verifies that it’s not in use by another user.
Authentication
Required: Bearer token in Authorization header
Authorization: Bearer {your_jwt_token}
Request Body
User’s new full name (optional if email is provided)
User’s new email address (optional if name is provided, must be valid format)
At least one field (name or email) must be provided
Response
Indicates if the request was successful
Human-readable response message
Response data containing updated user profile Updated user profile information User’s updated email address
ISO 8601 timestamp of registration
ISO 8601 timestamp of last login
Example Request
curl -X PUT https://api.maqagr.com/api/auth/profile \
-H "Authorization: Bearer eyJhbGciOiJIUzI1NiIs..." \
-H "Content-Type: application/json" \
-d '{
"name": "Juan Pérez Actualizado",
"email": "nuevo@example.com"
}'
const response = await fetch ( 'https://api.maqagr.com/api/auth/profile' , {
method: 'PUT' ,
headers: {
'Authorization' : `Bearer ${ token } ` ,
'Content-Type' : 'application/json'
},
body: JSON . stringify ({
name: 'Juan Pérez Actualizado' ,
email: 'nuevo@example.com'
})
});
const data = await response . json ();
import requests
response = requests.put(
'https://api.maqagr.com/api/auth/profile' ,
headers = { 'Authorization' : f 'Bearer { token } ' },
json = {
'name' : 'Juan Pérez Actualizado' ,
'email' : 'nuevo@example.com'
}
)
data = response.json()
Success Response (200)
{
"success" : true ,
"message" : "Perfil actualizado exitosamente" ,
"data" : {
"user" : {
"user_id" : 1 ,
"name" : "Juan Pérez Actualizado" ,
"email" : "nuevo@example.com" ,
"role_id" : 2 ,
"status" : "active" ,
"registration_date" : "2026-02-13T10:00:00.000Z" ,
"last_session" : "2026-03-11T08:30:00.000Z"
}
}
}
Error Responses
400 - No Fields Provided
{
"success" : false ,
"message" : "Debe proporcionar al menos nombre o email para actualizar"
}
400 - Invalid Email Format
{
"success" : false ,
"message" : "Formato de email inválido"
}
401 - Unauthorized
{
"success" : false ,
"message" : "Token no proporcionado o inválido"
}
409 - Email Already in Use
{
"success" : false ,
"message" : "El email ya está en uso por otro usuario"
}
500 - Internal Server Error
{
"success" : false ,
"message" : "Error interno del servidor"
}