Get Profile
Retrieve the authenticated user’s complete profile information
Authentication
Bearer token obtained from login or registrationFormat: Bearer <token>
Response
Indicates if the request was successful
Complete user profile
Computed full name (firstName + lastName)
User role: customer, admin, or moderator
Phone number (if provided)
Email verification status
Complete fitness profile dataShow fitnessProfile properties
Whether the fitness questionnaire has been completed
Gender: hombre, mujer, or null
Height in centimeters (100-250)
Weight in kilograms (30-300)
Fitness level: principiante, intermedio, or avanzado
Main fitness goal: tonificar, ganar masa muscular, or bajar de peso
Medical conditions or health notes (max 500 characters)
Preferred training location: casa or gym
Number of training days per week (1-7)
Preferred session duration: 30 min, 45 min, 1 hr, or +1 hr
Calculated Body Mass Index (if height and weight are provided)
BMI classification: Bajo peso, Peso normal, Sobrepeso, or Obesidad
Workout statistics and achievementsShow fitnessStats properties
Total exercises completed across all workouts
Total training time in minutes
Total training time in hours (formatted string)
Total estimated calories burned
Current consecutive workout days streak
Maximum streak ever achieved
Date of last completed workout (ISO 8601 format)
Array of unlocked achievements
- first_workout: Primera Rutina
- week_streak: Racha de 7 días
- ten_workouts: Dedicación
- fifty_workouts: Guerrero
- month_streak: Leyenda
- hundred_exercises: Incansable
Last 30 completed workouts with details
Loyalty tier based on totalSpent:
- bronze: < $500,000
- silver: 500,000−1,999,999
- gold: 2,000,000−4,999,999
- platinum: $5,000,000+
Total number of orders placed
Total amount spent in COP
Formatted total spent (e.g., “$1.500.000”)
Accumulated loyalty points (1 point per $1,000 spent)
Account creation timestamp (ISO 8601 format)
Code Examples
curl -X GET https://api.fitaiid.com/api/auth/profile \
-H "Authorization: Bearer YOUR_JWT_TOKEN"
Example Response
{
"success": true,
"user": {
"id": "65e4a321b4f78901234567890",
"firstName": "John",
"lastName": "Doe",
"fullName": "John Doe",
"email": "[email protected]",
"role": "customer",
"phone": "5551234567",
"isActive": true,
"isEmailVerified": true,
"fitnessProfile": {
"questionnaireCompleted": true,
"gender": "hombre",
"age": 28,
"height": 175,
"weight": 75,
"fitnessLevel": "intermedio",
"mainGoal": "ganar masa muscular",
"medicalConditions": "",
"trainingLocation": "gym",
"trainingDaysPerWeek": 5,
"sessionDuration": "1 hr"
},
"bmi": 24.5,
"bmiCategory": "Peso normal",
"fitnessStats": {
"totalWorkouts": 42,
"totalExercises": 315,
"totalMinutes": 2520,
"totalHours": "42.0",
"totalCalories": 21000,
"currentStreak": 7,
"maxStreak": 14,
"lastWorkoutDate": "2024-03-06T09:00:00.000Z",
"achievements": [
{
"achievementId": "first_workout",
"nombre": "Primera Rutina",
"unlockedAt": "2024-01-15T10:00:00.000Z"
}
],
"workoutHistory": []
},
"customerLevel": "silver",
"totalOrders": 5,
"totalSpent": 750000,
"formattedTotalSpent": "$750.000",
"loyaltyPoints": 750,
"createdAt": "2024-01-10T15:30:00.000Z"
}
}
Update Profile
Update the authenticated user’s profile information
Authentication
Bearer token obtained from login or registrationFormat: Bearer <token>
Request Body
All fields are optional. Only include the fields you want to update.
User’s first name
- Length: 2-50 characters
- Pattern: Letters and spaces only (including áéíóúñ)
- HTML characters are sanitized
User’s last name
- Length: 2-50 characters
- Pattern: Letters and spaces only (including áéíóúñ)
- HTML characters are sanitized
User’s phone number
- Exactly 10 digits
- Example: “5559876543”
User’s date of birth
- ISO 8601 date format
- Example: “1995-05-15”
User’s gender
- For general profile (not fitness-specific)
Avatar URL or base64 image
- Must start with
http, https, or data:image/
User’s address information
- Maximum 200 characters when stringified
- HTML characters are sanitized
You cannot update the following fields through this endpoint:
- email
- password
- role
- isActive
- isEmailVerified
- fitnessProfile (use dedicated fitness endpoints)
Response
Indicates if the update was successful
Success message: “Perfil actualizado exitosamente”
Updated user profile (same structure as GET profile response)
Error Responses
| Status Code | Error Message | Description |
|---|
| 400 | ”ID de usuario requerido” | Missing authentication token |
| 400 | ”No hay campos para actualizar” | Request body is empty or contains no allowed fields |
| 400 | Validation errors | Invalid field formats |
| 404 | ”Usuario no encontrado” | User no longer exists |
| 401 | ”Token inválido” | Invalid or expired authentication token |
Code Examples
curl -X PUT https://api.fitaiid.com/api/auth/profile \
-H "Authorization: Bearer YOUR_JWT_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"firstName": "Jonathan",
"phone": "5559876543",
"address": {
"street": "123 Main St",
"city": "Bogotá",
"country": "Colombia"
}
}'
Example Response
{
"success": true,
"message": "Perfil actualizado exitosamente",
"user": {
"id": "65e4a321b4f78901234567890",
"firstName": "Jonathan",
"lastName": "Doe",
"fullName": "Jonathan Doe",
"email": "[email protected]",
"phone": "5559876543",
"address": {
"street": "123 Main St",
"city": "Bogotá",
"country": "Colombia"
},
"role": "customer",
"isActive": true,
"isEmailVerified": true,
"customerLevel": "silver",
"createdAt": "2024-01-10T15:30:00.000Z"
}
}
Validation Rules
Name Fields
- Length: 2-50 characters
- Letters and spaces only
- Supports Spanish characters
- HTML entities sanitized
Phone Number
- Exactly 10 digits
- Numbers only
- No spaces or formatting
Address
- Maximum 200 characters
- Can be object or string
- HTML entities sanitized
Avatar
- Valid URL or base64 image
- Must start with http, https, or data:image/
Next Steps
Login
Authenticate to get access token
Google OAuth
Authenticate with Google