USER, RIDER, DRIVER, and ADMIN.
Role overview
| Role | Who it’s for | Access level |
|---|---|---|
USER | General authenticated users | View rides and public data |
RIDER | Passengers booking rides | Book rides, view history, submit feedback |
DRIVER | Drivers accepting and completing rides | Accept rides, update location and status |
ADMIN | Platform administrators | Full access to all /api/admin/* endpoints |
What each role can do
USER
TheUSER role provides general read access. You can view ride status and public ride data, but you cannot book rides or perform driver actions.
RIDER
TheRIDER role is for passengers. With this role you can:
- Book a new ride:
POST /rides/book - Get a fare estimate:
GET /rides/estimate - View your ride history:
GET /rides/history - Check the status of a specific ride:
GET /rides/status/{rideId} - Cancel a ride:
POST /rides/cancel/{rideId} - Submit post-ride feedback and a rating:
POST /rides/feedback/{rideId} - Browse nearby available drivers:
GET /rides/drivers/nearby
DRIVER
TheDRIVER role is for drivers. With this role you can:
- View open ride requests:
GET /rides/requested - Accept a ride or update its status:
POST /rides/status/{rideId} - Update your live location during a ride:
POST /rides/location/{rideId} - Submit feedback on a rider:
POST /rides/feedback/{rideId}
ADMIN
TheADMIN role grants full access to all platform management endpoints under /api/admin/*, including user management, ride oversight, and reporting.
Logging in with a role
You specify your role in therole field of your login request body. The token returned is scoped to that role for the duration of the session.
Authorization header of every subsequent request:
Your account has a default role stored on your profile, but you can request any valid role at login by setting the
role field explicitly. The role you specify at login determines what you can do for that session.