Overview
The User Management API provides endpoints for registering users, managing user profiles, updating user information, and handling password changes. It supports different user types (passengers, drivers, and admins) with role-based access control.Endpoints
Register User
Register a new user with authentication credentials. Request BodyIndicates if the registration was successful
Response message
User registration data including user ID and profile information
201- User registered successfully409- Email already registered or credentials exist
Get All Users
Get a paginated list of users (admin only). Query ParametersPage number for pagination
Number of users per page
200- Users retrieved successfully401- Authentication required403- Admins only
Get Current User Profile
Get the profile of the currently authenticated user. Response200- Profile retrieved successfully401- Invalid or expired token500- Internal error while getting user profile
Get User by ID
Retrieve a single user by their UUID. Path ParametersUUID of the user to retrieve
200- User retrieved successfully404- User not found500- Internal server error
Ping Location
Update passenger location with optional heartbeat. Rate limited to 8 pings per 10 seconds. Request BodyLatitude (-90 to 90)
Longitude (-180 to 180)
Location accuracy in meters (minimum 0)
ISO8601 timestamp when location was captured
Force save location regardless of thresholds
200- Location ping processed429- Rate limit exceeded (too many pings)
Update User
Update user information such as name, email, or phone number. Path ParametersUUID of the user to update
Full name (1-100 characters)
Email address (5-150 characters)
Phone number (10-20 characters)
200- User updated successfully400- Invalid input data404- User not found
Change Password
Change the password for a user account. Path ParametersUser UUID
New password (must meet minimum length requirements)
Confirmation of new password (must match newPassword)
200- Password updated successfully400- Invalid password format or passwords don’t match404- User or credentials not found
Delete User
Soft-delete a user by ID. The user is marked as deleted but not permanently removed from the database. Path ParametersUUID of the user to delete
200- User deleted successfully404- User not found500- Internal server error
User Types
The API supports the following user types:passenger- Standard user who books ridesdriver- User who provides transportation servicesadmin- Administrative user with elevated permissions
User Status
Users can have the following status values:active- User account is active and can use the platforminactive- User account is temporarily inactivebanned- User has been banned from the platform
Authentication
Most endpoints require JWT authentication. Include the bearer token in the Authorization header:/users/register and /users (GET) endpoints are public and don’t require authentication.