Overview
The Passengers API provides endpoints for managing passenger profiles, account information, and administrative operations. Passengers can view and update their profiles, while admins have access to list and manage all passenger accounts.Authentication
All endpoints require authentication. Include the JWT token in the Authorization header:Get Passenger Profile
Get the current authenticated passenger’s profile information.Response
Passenger unique identifier
Passenger’s phone number
Passenger’s full name
Date of birth (YYYY-MM-DD format)
Gender:
NotSpecified, Male, FemaleURL to profile picture
Whether phone number is verified
Whether profile is complete
Whether account is active
Last login timestamp
Average rating from drivers
Total number of reviews received
Example Request
Example Response
Complete/Update Passenger Profile
Complete or update passenger profile information including name, date of birth, and gender.Path Parameters
Passenger unique identifier
Request Body
Passenger’s full name (2-100 characters)
Date of birth in YYYY-MM-DD format (passenger must be 13+ years old)
Gender:
NotSpecified, Male, FemaleResponse
Success message
Profile completion status
Example Request
Example Response
List All Passengers (Admin)
Retrieve a paginated list of all passengers with filtering options. Admin only.Query Parameters
Page number for pagination
Number of items per page (max 100)
Search by phone number or full name
Filter by active status
Filter by profile completion status
Filter by phone verification status
Response
List of passenger summaries
Total number of passengers
Current page number
Items per page
Total number of pages
Example Request
Get Passenger by ID (Admin)
Retrieve detailed information about a specific passenger. Public endpoint (useful for viewing trip history with deleted passengers).Path Parameters
Passenger unique identifier
Query Parameters
Include soft-deleted passenger data (useful for trip history)
Response
Passenger unique identifier
Phone number
Full name
Date of birth
Gender
Profile picture URL
Phone verification status
Profile completion status
Active status
Average rating
Total reviews
Account creation date
Last login timestamp
Soft delete status
Example Request
Update Passenger Status
Update passenger active/inactive status.Path Parameters
Passenger unique identifier
Query Parameters
Set passenger active status (true/false)
Example Request
Delete Passenger (Admin)
Soft delete a passenger account. SetsIsDeleted=true and IsActive=false. Admin only.
Path Parameters
Passenger unique identifier
Response
Success message confirming deletion
Example Request
Example Response
Upload Profile Picture
Upload or update passenger profile picture.Request Body (Form Data)
Image file (JPEG, PNG - max 5MB)
Example Request
Delete Profile Picture
Delete passenger profile picture.Example Request
Error Responses
All endpoints may return the following error responses:Error message in Arabic or English
Detailed validation errors (when applicable)
Common Error Codes
400 Bad Request- Invalid request parameters or validation errors401 Unauthorized- Missing or invalid authentication token403 Forbidden- Insufficient permissions404 Not Found- Passenger not found500 Internal Server Error- Server error