GET /usuarios/porid/
Returns detailed profile information for a specific user. Users can view their own profile, and admins can view any user’s profile.Authentication
Required: Bearer token (JWT) in the Authorization header
- Users can view their own profile (
token.id == user_id) - Admins can view any user’s profile
- Other users cannot view profiles they don’t own (403 Forbidden)
Path Parameters
The MongoDB ObjectId of the user to retrieve
Request
cURL
Python
JavaScript
Response
User’s unique identifier
User’s full name
User’s email address
Hashed password (bcrypt)
User’s role:
visitante, editor, or adminArray of favorite destination IDs (strings)
Array of completed route objects with metadata
Array of visited POI IDs (strings)
Account creation timestamp
Example Response
Error Responses
| Status Code | Description |
|---|---|
| 401 | Unauthorized - Invalid or missing JWT token |
| 403 | Forbidden - User cannot access this profile |
| 404 | Not Found - User with given ID does not exist |
Implementation Reference
This endpoint is implemented insrc/infrastructure/api/routers/usuario_router.py:89-102:
Use Cases
- Admins viewing user details for moderation
- Users viewing their complete profile including tracking data
- Fetching user information for analytics or reporting
- Displaying user activity history
Related Documentation
- Get Current User - Simpler endpoint for current user
- List Users - List all users (admin only)
- User Roles - Learn about role permissions