Profile API
Managing user profile information
Profile API
Endpoints for managing the current authenticated user's profile information.
Base URL: https://ycwadelaide.adenmgb.com
Authentication: All endpoints require Authorization: Bearer <token> header.
GET /api/staff/profile
Get the current authenticated user's profile information.
Headers:
Success Response (200 OK):
Error Responses:
- 401 Unauthorized - Invalid or missing token
- 404 Not Found - User not found
- 500 Internal Server Error - Server error
Use Cases:
- Display user info in profile screen
- Show current user's name/email in UI
- Check user roles for feature access
- Display account creation/update dates
PUT /api/staff/profile
Update the current user's profile information (username, email, displayName, or password).
Headers:
Request Body:
Success Response (200 OK):
Error Responses:
- 400 Bad Request - Missing currentPassword when changing password
- 400 Bad Request - Username already taken
- 401 Unauthorized - Invalid token
- 404 Not Found - User not found
- 500 Internal Server Error - Update failed
Use Cases:
- Update user profile information
- Change password
- Update display name or email
- Modify username
Important Notes:
- If changing password,
currentPasswordis required - Username must be unique (will return error if taken)
- Email is optional but should be validated client-side
- All fields are optional - only send fields you want to update
- Partial updates are supported
Example - Update display name only:
Example - Change password:
Example - Update email:
Related Guides
- Authentication API - Login and token management
- Backend Development - Authentication