Mobile API Docs
iRhyde Mobile API
Use these endpoints from the Flutter client. All responses are JSON. Set the header Accept: application/json.
1. Register Driver/Customer
POST /api/register
{
"first_name": "Rudo",
"last_name": "Moyo",
"email": "rudo@example.com",
"phone": "+263771234567",
"role": "driver",
"password": "secret123",
"password_confirmation": "secret123"
}
Use role driver or customer. Response returns token plus the created user record.
2. Login
POST /api/login
{
"email": "rudo@example.com",
"password": "secret123"
}
Store the returned token and send it as Authorization: Bearer <token> for protected calls.
3. Profile
- GET
/api/profile– fetch the authenticated user. - PUT
/api/profile– update name, email, phone, or password (includepassword_confirmation).
4. Logout
POST /api/logout – destroys the current Sanctum token.
For testing, seed data creates an admin (admin@example.com / password). Use the iRhyde dashboard to view registrations in real time.