Authentication and roles
Both endpoints require a valid JWT. ThePOST endpoint additionally requires the technician or admin role.
The GET endpoint applies role-based filtering automatically:
- Admin — sees all inspections across every vehicle and technician.
- Technician — sees only inspections they personally submitted, regardless of query parameters.
Create inspection
POST /api/inspections
Submits a new vehicle inspection. The request must be sent as multipart/form-data because four vehicle photos are required.
Pre-conditions
After a successful inspection, a PDF report is generated and emailed to the fleet admin.Request body
ID of the vehicle being inspected.
Current odometer reading. Must be a non-negative integer.
Front photo of the vehicle (multipart field name:
photo_front).Rear photo of the vehicle (multipart field name:
photo_rear).Left-side photo of the vehicle (multipart field name:
photo_left).Right-side photo of the vehicle (multipart field name:
photo_right).Description of any internal damage observed.
Description of any external damage observed.
Suggested next maintenance date in ISO 8601 format (
YYYY-MM-DD).Response
Returns201 Created with a summary of the created inspection and the URL of the generated PDF report.
Success message.
Errors
| Status | Description |
|---|---|
400 | Validation failed — required fields or photos missing. |
401 | Missing or invalid JWT. |
403 | Technician does not have an active assignment for this vehicle. |
404 | Vehicle not found. |
409 | Vehicle has mandatory maintenance that requires attention before inspection. Returns maintenanceStatus in the response body. |
500 | Internal server error. |
List inspections
GET /api/inspections
Returns inspections ordered by creation date (newest first). Each inspection includes the associated vehicle (with fleet) and technician.
Technicians automatically see only their own inspections. The
technicianId query parameter has no effect for technician-role requests.Query parameters
Filter results to inspections for a specific vehicle.
Filter results to inspections submitted by a specific technician. Ignored for technician-role requests (their own ID is always applied).
Response
Errors
| Status | Description |
|---|---|
401 | Missing or invalid JWT. |
500 | Internal server error. |