Overview
The Companies API provides endpoints for managing company profiles, credentials, drivers, vehicles, and public information. Companies can manage their own profiles while admins have full access to all company operations.Authentication
Most endpoints require authentication. Include the JWT token in the Authorization header:Get Company Profile
Get the current authenticated company’s profile information. Company role required.Response
Company unique identifier
Company email address
Company name
Company phone number
URL to company logo
Company physical address
Commercial registration number
Whether company account is active
Whether profile is complete (requires Name and PhoneNumber)
Last login timestamp
Account creation timestamp
Example Request
Example Response
Update Company Profile
Update company profile information. Company role required.Request Body
Company name (max 200 characters)
Company phone number (digits, spaces, +, -, () allowed)
Company address (max 500 characters)
Commercial registration number (max 50 characters)
Response
Returns the same structure as Get Company Profile with updated values.Example Request
Get Company Public Info
Get basic public information about a company. No authentication required.Path Parameters
Company unique identifier
Response
Company ID
Company name
URL to company logo
Average rating from reviews
Total number of reviews
Active status
Example Request
Example Response
Upload Company Logo
Upload or update company logo. Company role required.Request Body (Form Data)
Image file (JPEG, PNG, WebP - max 5MB, recommended: 512x512px)
Response
URL to the uploaded logo
Success message
Example Request
Delete Company Logo
Delete company logo. Company role required.Example Request
Update Company Credentials
Update company email and/or password. Company role required.Request Body
New email address (valid email format)
Current password for verification
New password (min 8 characters, requires uppercase, lowercase, digit, special char)
Response
Success message
Updated email address
Example Request
List Company Drivers
Get all drivers associated with a company.Path Parameters
Company unique identifier
Query Parameters
Page number
Items per page
Filter by active status
Response
List of company drivers
Total number of drivers
Current page
Items per page
Total pages
Example Request
List Company Vehicles
Get all vehicles associated with a company.Path Parameters
Company unique identifier
Query Parameters
Page number
Items per page
Filter by vehicle type
Response
List of company vehicles
Total number of vehicles
Example Request
Admin: List All Companies
Retrieve a paginated list of all companies. Admin only.Query Parameters
Page number
Items per page
Search by name, email, or commercial registration number
Filter by active status
Filter by profile completion
Example Request
Admin: Get Company by ID
Get detailed company information. Admin only.Path Parameters
Company unique identifier
Example Request
Admin: Create Company
Create a new company account. Admin only.Request Body
Company email address
Initial password
Company name
Company phone number
Example Request
Admin: Update Company
Update company information. Admin only.Path Parameters
Company unique identifier
Request Body
Same as Update Company Profile, plus:Set company active status
Example Request
Admin: Delete Company
Soft delete a company account. Admin only.Path Parameters
Company unique identifier
Example Request
Error Responses
All endpoints may return the following error responses:Common Error Codes
400 Bad Request- Invalid request or validation errors401 Unauthorized- Missing or invalid authentication403 Forbidden- Insufficient permissions404 Not Found- Company not found500 Internal Server Error- Server error