GET /api/user-data
Retrieves the profile information for the currently authenticated user. This endpoint requires authentication and returns user-specific settings and preferences.Authentication
This endpoint requires a valid session token. If the user is not authenticated, the API returns a 401 Unauthorized error.Response
User’s location or city
User’s English proficiency level. Possible values:
inicial- Beginner levelbasico- Basic levelintermedio- Intermediate levelavanzado- Advanced level
User’s phone number
Newsletter subscription preference. Possible values:
si- Subscribed to newsletterno- Not subscribed to newsletter
Response Example
cURL Example
Error Responses
Error message describing what went wrong
401 Unauthorized
500 Internal Server Error
POST /api/user-data
Updates the profile information for the currently authenticated user.Authentication
This endpoint requires a valid session token. The user ID is automatically extracted from the session.Request Body
User’s location or city
User’s English proficiency level. Must be one of:
inicialbasicointermedioavanzado
User’s phone number
Newsletter subscription preference. Must be either
si or noRequest Example
Response
Success message confirming the data was received
The complete updated user object from the database
Response Example
cURL Example
Error Responses
401 Unauthorized
Related Models
This endpoint interacts with the User model from the database schema. The User model includes additional fields such as:totalClasses- Total number of completed classes (incremented automatically)status- User account statusUserActivity[]- Related user activity recordscreatedAt/updatedAt- Timestamps