openapi: 3.0.3 info: title: 'Metrotec API Documentation' description: '' version: 1.0.0 servers: - url: 'https://testapi.metrotec.ee' tags: - name: Alarms description: "\nAPI for alarm log reports" - name: Booking description: "\nBooking retrieval" - name: Brigades description: "\nBrigade management" - name: DDD description: "\nDDD Account management" - name: Drivers description: '' - name: 'Export API' description: "\nExport API for retrieving last data (current vehicle positions and status)." - name: Files description: "\nAPIs for managing files" - name: 'Geo Zones' description: "\nGeo zones management" - name: Inputs description: "\nVehicle input name management (digital I/O labels)." - name: Invoices description: "\nAPIs for managing invoices" - name: 'Last Data' description: "\nSend a location link via SMS for a vehicle or POI." - name: Navigation description: "\nRetrieve parsed navigation messages for a vehicle." - name: POI description: "\nPoints of Interest management" - name: Reports description: "\nRoute log data with calculated fields" - name: 'Route Tasks' description: "\nTask geozone information" - name: Settings description: "\nVehicle settings including outputs, events, and geo zones." - name: 'Tech Card' description: '' - name: Users description: "*\n* APIs for managing users" - name: 'Vehicle Faults' description: '' - name: 'Vehicle Status' description: '' - name: Vehicles description: "*\n* APIs for managing vehicles" - name: Waybills description: "\nWaybill types management" components: securitySchemes: default: type: http scheme: bearer description: 'You can retrieve your token by visiting your dashboard and clicking Generate API token.' security: - default: [] paths: /api/alarmlog: get: summary: 'Get alarm log' operationId: getAlarmLog description: 'Returns alarm events filtered by date range, object, and alert group.' parameters: - in: query name: datetime description: 'Date range [from, to] in YYYY-MM-DD format' example: - '2026-01-01' - '2026-01-31' required: true schema: type: array description: 'Date range [from, to] in YYYY-MM-DD format' example: - '2026-01-01' - '2026-01-31' items: type: string - in: query name: datetime.0 description: 'Start date (must be before or equal to end date). Väli value peab olema kehtiv kuupäev. Väli value peab olema kuupäev enne või võrdne kuupäevaga datetime.1.' example: '2026-01-01' required: true schema: type: string description: 'Start date (must be before or equal to end date). Väli value peab olema kehtiv kuupäev. Väli value peab olema kuupäev enne või võrdne kuupäevaga datetime.1.' example: '2026-01-01' - in: query name: datetime.1 description: 'End date (must be after or equal to start date). Väli value peab olema kehtiv kuupäev. Väli value peab olema kuupäev pärast või võrdne kuupäevaga datetime.0.' example: '2026-01-31' required: true schema: type: string description: 'End date (must be after or equal to start date). Väli value peab olema kehtiv kuupäev. Väli value peab olema kuupäev pärast või võrdne kuupäevaga datetime.0.' example: '2026-01-31' - in: query name: object_id description: 'Filter by vehicle/object ID' example: ABC123 required: false schema: type: string description: 'Filter by vehicle/object ID' example: ABC123 nullable: true - in: query name: AlertGroup description: 'Filter by alert group IDs' example: - 1 - 2 - 3 required: false schema: type: array description: 'Filter by alert group IDs' example: - 1 - 2 - 3 items: type: integer - in: query name: offset description: 'Pagination offset' example: 0 required: false schema: type: integer description: 'Pagination offset' example: 0 nullable: true - in: query name: limit description: 'Number of records to return (default: 30)' example: 30 required: false schema: type: integer description: 'Number of records to return (default: 30)' example: 30 nullable: true responses: 401: description: '' content: application/json: schema: type: object example: message: Unauthenticated. properties: message: type: string example: Unauthenticated. tags: - Alarms /api/alarmhistory: get: summary: 'Get alarm history' operationId: getAlarmHistory description: 'Returns sent alarm records filtered by date range and object.' parameters: - in: query name: datetime description: 'Date range [from, to] in YYYY-MM-DD format' example: - '2026-01-01' - '2026-01-31' required: true schema: type: array description: 'Date range [from, to] in YYYY-MM-DD format' example: - '2026-01-01' - '2026-01-31' items: type: string - in: query name: datetime.0 description: 'Start date (must be before or equal to end date). Väli value peab olema kehtiv kuupäev. Väli value peab olema kuupäev enne või võrdne kuupäevaga datetime.1.' example: '2026-01-01' required: true schema: type: string description: 'Start date (must be before or equal to end date). Väli value peab olema kehtiv kuupäev. Väli value peab olema kuupäev enne või võrdne kuupäevaga datetime.1.' example: '2026-01-01' - in: query name: datetime.1 description: 'End date (must be after or equal to start date). Väli value peab olema kehtiv kuupäev. Väli value peab olema kuupäev pärast või võrdne kuupäevaga datetime.0.' example: '2026-01-31' required: true schema: type: string description: 'End date (must be after or equal to start date). Väli value peab olema kehtiv kuupäev. Väli value peab olema kuupäev pärast või võrdne kuupäevaga datetime.0.' example: '2026-01-31' - in: query name: object_id description: 'Filter by vehicle/object ID' example: ABC123 required: false schema: type: string description: 'Filter by vehicle/object ID' example: ABC123 nullable: true - in: query name: offset description: 'Pagination offset' example: 0 required: false schema: type: integer description: 'Pagination offset' example: 0 nullable: true - in: query name: limit description: 'Number of records to return (default: 30)' example: 30 required: false schema: type: integer description: 'Number of records to return (default: 30)' example: 30 nullable: true responses: 401: description: '' content: application/json: schema: type: object example: message: Unauthenticated. properties: message: type: string example: Unauthenticated. tags: - Alarms /api/alarmgroups: get: summary: 'Get alarm groups' operationId: getAlarmGroups description: 'Returns all available alarm groups.' parameters: [] responses: 401: description: '' content: application/json: schema: type: object example: message: Unauthenticated. properties: message: type: string example: Unauthenticated. tags: - Alarms /api/testalarm: post: summary: 'Send test alarm' operationId: sendTestAlarm description: 'Sends a test alarm email and/or SMS to the specified contact.' parameters: [] responses: { } tags: - Alarms requestBody: required: true content: application/json: schema: type: object properties: id: type: integer description: 'The contact ID to send test alarm to' example: 1 required: - id /api/alarmconfig: get: summary: 'List alarm configurations' operationId: listAlarmConfigurations description: '' parameters: [] responses: 401: description: '' content: application/json: schema: type: object example: message: Unauthenticated. properties: message: type: string example: Unauthenticated. tags: - Alarms post: summary: 'Create alarm configuration' operationId: createAlarmConfiguration description: '' parameters: [] responses: { } tags: - Alarms requestBody: required: true content: application/json: schema: type: object properties: Name: type: string description: 'Alarm configuration name. Väli value ei tohi olla pikem kui 255 tähemärki.' example: 'Speed Alert' email: type: string description: 'Email address for notifications. Väli value peab olema kehtiv e-posti aadress.' example: alerts@example.com nullable: true Active: type: boolean description: 'Whether the alarm is active.' example: true sms: type: string description: 'Phone number for SMS notifications (digits only). Must match the regex /^\d+$/.' example: '5555555' nullable: true country_code: type: string description: 'Phone country code. Must match the regex /^\+?\d+$/.' example: '+372' nullable: true alarms: type: object description: 'Array of alarm type IDs. Väljal value peab olema vähemalt 1 elementi.' example: - 1 - 2 - 3 properties: { } required: - Name - alarms '/api/alarmconfig/{id}': get: summary: 'Get alarm configuration' operationId: getAlarmConfiguration description: '' parameters: [] responses: 401: description: '' content: application/json: schema: type: object example: message: Unauthenticated. properties: message: type: string example: Unauthenticated. tags: - Alarms put: summary: 'Update alarm configuration' operationId: updateAlarmConfiguration description: '' parameters: [] responses: { } tags: - Alarms requestBody: required: false content: application/json: schema: type: object properties: Name: type: string description: 'Alarm configuration name. Väli value ei tohi olla pikem kui 255 tähemärki.' example: 'Speed Alert' email: type: string description: 'Email address for notifications. Väli value peab olema kehtiv e-posti aadress.' example: alerts@example.com nullable: true Active: type: boolean description: 'Whether the alarm is active.' example: true sms: type: string description: 'Phone number for SMS notifications (digits only). Must match the regex /^\d+$/.' example: '5555555' nullable: true country_code: type: string description: 'Phone country code. Must match the regex /^\+?\d+$/.' example: '+372' nullable: true alarms: type: object description: 'Array of alarm type IDs. Väljal value peab olema vähemalt 1 elementi.' example: - 1 - 2 - 3 properties: { } delete: summary: 'Delete alarm configuration' operationId: deleteAlarmConfiguration description: '' parameters: [] responses: { } tags: - Alarms parameters: - in: path name: id description: 'The ID of the alarmconfig.' example: architecto required: true schema: type: string /api/booking: get: summary: 'List bookings' operationId: listBookings description: 'Returns all bookings. Use mq=mobile to get grouped percentage data.' parameters: [] responses: 200: description: Success content: application/json: schema: type: object example: data: - id: 1 object_id: '123' driver_id: 1 start_time: '2025-01-15 08:00:00' properties: data: type: array example: - id: 1 object_id: '123' driver_id: 1 start_time: '2025-01-15 08:00:00' items: type: object properties: id: type: integer example: 1 object_id: type: string example: '123' driver_id: type: integer example: 1 start_time: type: string example: '2025-01-15 08:00:00' tags: - Booking requestBody: required: false content: application/json: schema: type: object properties: mq: type: string description: 'Mode: desktop or mobile (mobile returns grouped percentage data).' example: desktop enum: - desktop - mobile nullable: true day: type: string description: 'Filter by specific day. Must be a valid date in the format Y-m-d H:i:s.' example: '2025-01-15 00:00:00' nullable: true post: summary: 'Create a booking' operationId: createABooking description: "Creates a new booking with automatic pin generation. The booking period must be in the future.\nSends a confirmation email to the authenticated user." parameters: [] responses: 201: description: Created content: application/json: schema: type: object example: data: id: 1 object_id: ABC123 alias: 'Truck 1' driver_id: 1 driverName: 'John Doe' start_time: '2025-01-15 08:00:00' stop_time: '2025-01-15 17:00:00' user_id: user1 comment: null pin: '1234' properties: data: type: object properties: id: type: integer example: 1 object_id: type: string example: ABC123 alias: type: string example: 'Truck 1' driver_id: type: integer example: 1 driverName: type: string example: 'John Doe' start_time: type: string example: '2025-01-15 08:00:00' stop_time: type: string example: '2025-01-15 17:00:00' user_id: type: string example: user1 comment: type: string example: null nullable: true pin: type: string example: '1234' 400: description: '' content: application/json: schema: oneOf: - description: 'Period not future' type: object example: message: Period_Must_Be_Future properties: message: type: string example: Period_Must_Be_Future - description: Conflict type: object example: message: Driver_Or_Vehicle_Is_Busy properties: message: type: string example: Driver_Or_Vehicle_Is_Busy tags: - Booking requestBody: required: true content: application/json: schema: type: object properties: object_id: type: string description: 'Vehicle object ID. Must contain only letters and numbers. Väli value ei tohi olla pikem kui 10 tähemärki.' example: ABC123 driver_id: type: integer description: 'Driver ID.' example: 1 purpose: type: string description: 'Purpose of the booking.' example: Delivery start_time: type: string description: 'Booking start time in UTC. Must be a valid date in the format Y-m-d H:i:s.' example: '2025-01-15 08:00:00' stop_time: type: string description: 'Booking end time in UTC. Must be a valid date in the format Y-m-d H:i:s.' example: '2025-01-15 17:00:00' required: - object_id - driver_id - purpose - start_time - stop_time '/api/booking/{id}': get: summary: 'Get booking' operationId: getBooking description: 'Returns a single booking by ID.' parameters: [] responses: 200: description: Success content: application/json: schema: type: object example: data: id: 1 object_id: '123' driver_id: 1 properties: data: type: object properties: id: type: integer example: 1 object_id: type: string example: '123' driver_id: type: integer example: 1 404: description: '' content: application/json: schema: type: object example: message: Not_Found properties: message: type: string example: Not_Found tags: - Booking put: summary: 'Update a booking' operationId: updateABooking description: "Updates an existing booking. The stop time must be in the future.\nSends a notification email to the authenticated user." parameters: [] responses: 200: description: Updated content: application/json: schema: type: object example: data: id: 1 object_id: ABC123 alias: 'Truck 1' driver_id: 1 driverName: 'John Doe' start_time: '2025-01-15 08:00:00' stop_time: '2025-01-15 17:00:00' user_id: user1 comment: null pin: '1234' properties: data: type: object properties: id: type: integer example: 1 object_id: type: string example: ABC123 alias: type: string example: 'Truck 1' driver_id: type: integer example: 1 driverName: type: string example: 'John Doe' start_time: type: string example: '2025-01-15 08:00:00' stop_time: type: string example: '2025-01-15 17:00:00' user_id: type: string example: user1 comment: type: string example: null nullable: true pin: type: string example: '1234' 400: description: '' content: application/json: schema: oneOf: - description: 'Period finished' type: object example: message: Period_Stop_Must_Be_Future properties: message: type: string example: Period_Stop_Must_Be_Future - description: Conflict type: object example: message: Driver_Or_Vehicle_Is_Busy properties: message: type: string example: Driver_Or_Vehicle_Is_Busy 404: description: 'Not found' content: application/json: schema: type: object example: message: Not_Found properties: message: type: string example: Not_Found tags: - Booking requestBody: required: true content: application/json: schema: type: object properties: object_id: type: string description: 'Vehicle object ID. Must contain only letters and numbers. Väli value ei tohi olla pikem kui 10 tähemärki.' example: ABC123 driver_id: type: integer description: 'Driver ID.' example: 1 purpose: type: string description: 'Purpose of the booking.' example: Delivery start_time: type: string description: 'Booking start time in UTC. Must be a valid date in the format Y-m-d H:i:s.' example: '2025-01-15 08:00:00' stop_time: type: string description: 'Booking end time in UTC. Must be a valid date in the format Y-m-d H:i:s.' example: '2025-01-15 17:00:00' required: - object_id - driver_id - purpose - start_time - stop_time delete: summary: 'Delete a booking' operationId: deleteABooking description: "Deletes a booking. The booking period must be in the future (past bookings cannot be deleted).\nSends a cancellation email to the authenticated user." parameters: [] responses: 204: description: Deleted content: text/plain: schema: type: string example: '' 400: description: 'Period not future' content: application/json: schema: type: object example: message: Period_Must_Be_Future properties: message: type: string example: Period_Must_Be_Future 404: description: 'Not found' content: application/json: schema: type: object example: message: Not_Found properties: message: type: string example: Not_Found tags: - Booking parameters: - in: path name: id description: 'The ID of the booking.' example: architecto required: true schema: type: string /api/bookinggrouped: get: summary: 'Get grouped bookings' operationId: getGroupedBookings description: 'Returns booking data grouped by day with occupancy percentage and ownership flag.' parameters: [] responses: 200: description: Success content: application/json: schema: type: object example: data: 2025/01/15: percent: 45 hasOwn: true properties: data: type: object properties: 2025/01/15: type: object properties: percent: type: integer example: 45 hasOwn: type: boolean example: true tags: - Booking /api/bookingobjects: get: summary: 'List booking vehicles' operationId: listBookingVehicles description: 'Returns all bookable vehicles or available vehicles for a given datetime period.' parameters: - in: query name: driver_id description: 'Filter available vehicles by driver.' example: 1 required: false schema: type: integer description: 'Filter available vehicles by driver.' example: 1 nullable: true - in: query name: datetime description: '' example: - architecto required: false schema: type: array description: '' example: - architecto items: type: string nullable: true - in: query name: id description: 'Booking ID to exclude from availability check (used when editing).' example: 1 required: false schema: type: integer description: 'Booking ID to exclude from availability check (used when editing).' example: 1 nullable: true responses: 200: description: Success content: application/json: schema: type: object example: data: - id: ABC123 alias: 'Truck 1' properties: data: type: array example: - id: ABC123 alias: 'Truck 1' items: type: object properties: id: type: string example: ABC123 alias: type: string example: 'Truck 1' tags: - Booking /api/bookinglog: get: summary: 'List booking log entries' operationId: listBookingLogEntries description: 'Returns booking log entries for the given datetime period.' parameters: - in: query name: datetime description: '' example: - architecto required: true schema: type: array description: '' example: - architecto items: type: string - in: query name: offset description: 'Number of records to skip. Väli value peab olema vähemalt -1.' example: 0 required: false schema: type: integer description: 'Number of records to skip. Väli value peab olema vähemalt -1.' example: 0 nullable: true - in: query name: limit description: 'Maximum number of records to return. Väli value peab olema vähemalt 1.' example: 30 required: false schema: type: integer description: 'Maximum number of records to return. Väli value peab olema vähemalt 1.' example: 30 nullable: true responses: 200: description: Success content: application/json: schema: type: object example: data: - id: 1 oid: user1 datet: '2025-01-15 08:00:00' action: SAVE description: ... booking_id: 1 properties: data: type: array example: - id: 1 oid: user1 datet: '2025-01-15 08:00:00' action: SAVE description: ... booking_id: 1 items: type: object properties: id: type: integer example: 1 oid: type: string example: user1 datet: type: string example: '2025-01-15 08:00:00' action: type: string example: SAVE description: type: string example: ... booking_id: type: integer example: 1 tags: - Booking /api/bookingreport: get: summary: 'Get a booking report' operationId: getABookingReport description: 'Returns booking records enriched with driven distance (km) for the given period.' parameters: - in: query name: datetime description: '' example: - architecto required: true schema: type: array description: '' example: - architecto items: type: string - in: query name: object_id description: 'Filter report by vehicle object ID. Must contain only letters and numbers. Väli value ei tohi olla pikem kui 10 tähemärki.' example: ABC123 required: false schema: type: string description: 'Filter report by vehicle object ID. Must contain only letters and numbers. Väli value ei tohi olla pikem kui 10 tähemärki.' example: ABC123 nullable: true responses: 200: description: Success content: application/json: schema: type: object example: data: - id: 1 object_id: ABC123 driver_id: '1' start_time: '2025-01-15 08:00:00' stop_time: '2025-01-15 17:00:00' name: 'John Doe' tehnKontakt: '+372 555 1234' memo: null km: 125.4 properties: data: type: array example: - id: 1 object_id: ABC123 driver_id: '1' start_time: '2025-01-15 08:00:00' stop_time: '2025-01-15 17:00:00' name: 'John Doe' tehnKontakt: '+372 555 1234' memo: null km: 125.4 items: type: object properties: id: type: integer example: 1 object_id: type: string example: ABC123 driver_id: type: string example: '1' start_time: type: string example: '2025-01-15 08:00:00' stop_time: type: string example: '2025-01-15 17:00:00' name: type: string example: 'John Doe' tehnKontakt: type: string example: '+372 555 1234' memo: type: string example: null nullable: true km: type: number example: 125.4 tags: - Booking /api/brigades: get: summary: 'List brigades' operationId: listBrigades description: 'Returns all brigades.' parameters: [] responses: 200: description: Success content: application/json: schema: type: object example: data: - id: 1 brigName: 'Morning Shift' properties: data: type: array example: - id: 1 brigName: 'Morning Shift' items: type: object properties: id: type: integer example: 1 brigName: type: string example: 'Morning Shift' tags: - Brigades post: summary: 'Create a brigade' operationId: createABrigade description: 'Creates a new brigade.' parameters: [] responses: 201: description: Success content: application/json: schema: type: object example: data: id: 1 brigName: 'Morning Shift' properties: data: type: object properties: id: type: integer example: 1 brigName: type: string example: 'Morning Shift' tags: - Brigades requestBody: required: true content: application/json: schema: type: object properties: brigName: type: string description: 'Brigade name. Väli value ei tohi olla pikem kui 255 tähemärki.' example: 'Morning Shift' required: - brigName '/api/brigades/{id}': get: summary: 'Get brigade' operationId: getBrigade description: 'Returns a single brigade by ID.' parameters: [] responses: 200: description: Success content: application/json: schema: type: object example: data: id: 1 brigName: 'Morning Shift' properties: data: type: object properties: id: type: integer example: 1 brigName: type: string example: 'Morning Shift' 404: description: '' content: application/json: schema: type: object example: message: Not_Found properties: message: type: string example: Not_Found tags: - Brigades put: summary: 'Update brigade' operationId: updateBrigade description: 'Updates an existing brigade.' parameters: [] responses: 200: description: Success content: application/json: schema: type: object example: message: Updated properties: message: type: string example: Updated 404: description: '' content: application/json: schema: type: object example: message: Not_Found properties: message: type: string example: Not_Found tags: - Brigades requestBody: required: true content: application/json: schema: type: object properties: brigName: type: string description: 'Brigade name. Väli value ei tohi olla pikem kui 255 tähemärki.' example: 'Morning Shift' required: - brigName delete: summary: 'Delete brigade' operationId: deleteBrigade description: 'Deletes a brigade.' parameters: [] responses: 200: description: Success content: application/json: schema: type: object example: message: Deleted properties: message: type: string example: Deleted 404: description: '' content: application/json: schema: type: object example: message: Not_Found properties: message: type: string example: Not_Found tags: - Brigades parameters: - in: path name: id description: 'The ID of the brigade.' example: architecto required: true schema: type: string /api/dddaccount: get: summary: 'Get DDD account' operationId: getDDDAccount description: 'Returns the DDD account information for the owner.' parameters: [] responses: 200: description: Success content: application/json: schema: type: object example: data: id: 1 expiryDate: '2025-12-31' properties: data: type: object properties: id: type: integer example: 1 expiryDate: type: string example: '2025-12-31' 404: description: '' content: application/json: schema: type: object example: message: 'Not Found' properties: message: type: string example: 'Not Found' tags: - DDD /api/ddddownload: get: summary: 'Download multiple DDD files' operationId: downloadMultipleDDDFiles description: 'Downloads multiple DDD files as a ZIP archive based on filters.' parameters: [] responses: 200: description: Success content: text/plain: schema: type: string example: 'Binary ZIP content' 422: description: '' content: application/json: schema: type: object example: message: 'Validation error' properties: message: type: string example: 'Validation error' tags: - DDD requestBody: required: false content: application/json: schema: type: object properties: object_id: type: array description: '' example: - 16 items: type: integer DriverID: type: array description: '' example: - architecto items: type: string file_type: type: integer description: 'File type: 6 for driver, 7 for vehicle.' example: 7 enum: - 6 - 7 nullable: true datetime: type: array description: 'Väli value peab olema kehtiv kuupäev.' example: - '2026-02-26T15:34:40' items: type: string limit: type: integer description: 'Maximum number of files to include. Väli value peab olema vähemalt 1.' example: 30 nullable: true '/api/ddddownload/{id}': get: summary: 'Download a single DDD file' operationId: downloadASingleDDDFile description: 'Downloads a single DDD file as a ZIP archive.' parameters: [] responses: 200: description: Success content: text/plain: schema: type: string example: 'Binary ZIP content' 404: description: '' content: application/json: schema: type: object example: error: Not_Found properties: error: type: string example: Not_Found tags: - DDD parameters: - in: path name: id description: 'The DDD file ID.' example: 123 required: true schema: type: integer /api/ddddrivers: get: summary: 'List DDD drivers' operationId: listDDDDrivers description: 'Returns a list of drivers with DDD card information.' parameters: [] responses: 200: description: Success content: application/json: schema: type: object example: data: - id: 1 name: John fname: Doe driverName: 'John Doe' driverCardId: ABC123 refreshRate: 30 properties: data: type: array example: - id: 1 name: John fname: Doe driverName: 'John Doe' driverCardId: ABC123 refreshRate: 30 items: type: object properties: id: type: integer example: 1 name: type: string example: John fname: type: string example: Doe driverName: type: string example: 'John Doe' driverCardId: type: string example: ABC123 refreshRate: type: integer example: 30 tags: - DDD requestBody: required: false content: application/json: schema: type: object properties: archive: type: boolean description: 'Include archived drivers.' example: false nullable: true limit: type: integer description: 'Maximum number of records to return. Use -1 for all. Väli value peab olema vähemalt -1.' example: 30 nullable: true post: summary: 'Update DDD drivers' operationId: updateDDDDrivers description: 'Updates the refresh rate for all drivers belonging to the owner.' parameters: [] responses: 201: description: Success content: application/json: schema: type: object example: refreshRate: 30 properties: refreshRate: type: integer example: 30 tags: - DDD requestBody: required: true content: application/json: schema: type: object properties: refreshRate: type: integer description: 'The refresh rate for DDD downloads.' example: 30 archive: type: string description: 'Archive status (0 or 1).' example: '0' enum: - 0 - 1 nullable: true required: - refreshRate '/api/ddddrivers/{id}': get: summary: 'Get DDD driver' operationId: getDDDDriver description: 'Returns a single driver with DDD card information.' parameters: [] responses: 200: description: Success content: application/json: schema: type: object example: data: id: 1 name: John fname: Doe driverName: 'John Doe' driverCardId: ABC123 refreshRate: 30 properties: data: type: object properties: id: type: integer example: 1 name: type: string example: John fname: type: string example: Doe driverName: type: string example: 'John Doe' driverCardId: type: string example: ABC123 refreshRate: type: integer example: 30 404: description: '' content: application/json: schema: type: object example: message: 'Not Found' properties: message: type: string example: 'Not Found' tags: - DDD parameters: - in: path name: id description: 'The driver ID.' example: 1 required: true schema: type: integer /api/dddvehicles: get: summary: 'List DDD vehicles' operationId: listDDDVehicles description: 'Returns a list of vehicles with DDD information and tacho data.' parameters: [] responses: 200: description: Success content: application/json: schema: type: object example: data: - id: 1 alias: 'Truck 1' refreshRate: 30 properties: data: type: array example: - id: 1 alias: 'Truck 1' refreshRate: 30 items: type: object properties: id: type: integer example: 1 alias: type: string example: 'Truck 1' refreshRate: type: integer example: 30 tags: - DDD requestBody: required: false content: application/json: schema: type: object properties: limit: type: integer description: 'Maximum number of records to return. Use -1 for all. Väli value peab olema vähemalt -1.' example: 30 nullable: true post: summary: 'Update DDD vehicles' operationId: updateDDDVehicles description: 'Updates the refresh rate for all vehicles belonging to the owner.' parameters: [] responses: 201: description: Success content: application/json: schema: type: object example: refreshRate: 30 properties: refreshRate: type: integer example: 30 tags: - DDD requestBody: required: true content: application/json: schema: type: object properties: refreshRate: type: integer description: 'The refresh rate for DDD downloads.' example: 30 required: - refreshRate '/api/dddvehicles/{id}': get: summary: 'Get DDD vehicle' operationId: getDDDVehicle description: 'Returns a single vehicle with DDD information.' parameters: [] responses: 200: description: Success content: application/json: schema: type: object example: data: id: 1 alias: 'Truck 1' refreshRate: 30 ins_date: '2025-01-15 10:00:00' properties: data: type: object properties: id: type: integer example: 1 alias: type: string example: 'Truck 1' refreshRate: type: integer example: 30 ins_date: type: string example: '2025-01-15 10:00:00' 404: description: '' content: application/json: schema: type: object example: message: 'Not Found' properties: message: type: string example: 'Not Found' tags: - DDD parameters: - in: path name: id description: 'The vehicle/object ID.' example: 1 required: true schema: type: integer /api/dddfiles: get: summary: 'List DDD files' operationId: listDDDFiles description: 'Returns a list of downloaded DDD files with optional filtering.' parameters: [] responses: 200: description: Success content: application/json: schema: type: object example: data: - id: 1 object_id: 123 file_type: 7 start: '2025-01-01 00:00:00' end: '2025-01-15 23:59:59' properties: data: type: array example: - id: 1 object_id: 123 file_type: 7 start: '2025-01-01 00:00:00' end: '2025-01-15 23:59:59' items: type: object properties: id: type: integer example: 1 object_id: type: integer example: 123 file_type: type: integer example: 7 start: type: string example: '2025-01-01 00:00:00' end: type: string example: '2025-01-15 23:59:59' tags: - DDD requestBody: required: false content: application/json: schema: type: object properties: object_id: type: array description: '' example: - 16 items: type: integer DriverID: type: array description: '' example: - architecto items: type: string file_type: type: integer description: 'File type: 6 for driver, 7 for vehicle.' example: 7 enum: - 6 - 7 nullable: true datetime: type: array description: 'Väli value peab olema kehtiv kuupäev.' example: - '2026-02-26T15:34:40' items: type: string offset: type: integer description: 'Pagination offset. Väli value peab olema vähemalt -1.' example: 0 nullable: true archive: type: boolean description: 'Include archived records.' example: false nullable: true limit: type: integer description: 'Maximum number of records to return. Väli value peab olema vähemalt 1.' example: 30 nullable: true latest: type: boolean description: 'Return only latest records per object/driver.' example: false nullable: true /api/dddlog: get: summary: 'List DDD logs' operationId: listDDDLogs description: 'Returns DDD activity logs including file downloads and requests.' parameters: [] responses: 200: description: Success content: application/json: schema: type: object example: data: - id: 1 object_id: 123 ins_date: '2025-01-15 10:00:00' log: 'File downloaded' properties: data: type: array example: - id: 1 object_id: 123 ins_date: '2025-01-15 10:00:00' log: 'File downloaded' items: type: object properties: id: type: integer example: 1 object_id: type: integer example: 123 ins_date: type: string example: '2025-01-15 10:00:00' log: type: string example: 'File downloaded' tags: - DDD requestBody: required: false content: application/json: schema: type: object properties: object_id: type: string description: 'Filter by object ID. Must contain only letters and numbers. Väli value ei tohi olla pikem kui 10 tähemärki.' example: '123' nullable: true datetime: type: array description: 'Väli value peab olema kehtiv kuupäev.' example: - '2026-02-26T15:34:40' items: type: string offset: type: integer description: 'Pagination offset. Väli value peab olema vähemalt 0.' example: 0 nullable: true limit: type: integer description: 'Maximum number of records to return. Väli value peab olema vähemalt 1.' example: 30 nullable: true /api/ddddriversstatus: get: summary: 'List driver status records' operationId: listDriverStatusRecords description: 'Returns driver status records for the given period.' parameters: [] responses: 200: description: Success content: application/json: schema: type: object example: data: - id: 1 object_id: 123 time: '2025-01-15 10:00:00' status: 1 driver_name: 'John Doe' properties: data: type: array example: - id: 1 object_id: 123 time: '2025-01-15 10:00:00' status: 1 driver_name: 'John Doe' items: type: object properties: id: type: integer example: 1 object_id: type: integer example: 123 time: type: string example: '2025-01-15 10:00:00' status: type: integer example: 1 driver_name: type: string example: 'John Doe' tags: - DDD requestBody: required: false content: application/json: schema: type: object properties: object_id: type: string description: 'Filter by object ID. Must contain only letters and numbers. Väli value ei tohi olla pikem kui 10 tähemärki.' example: '123' nullable: true driver_id: type: integer description: 'Filter by driver ID.' example: 1 nullable: true datetime: type: array description: 'Väli value peab olema kehtiv kuupäev.' example: - '2026-02-26T15:34:40' items: type: string /api/ddddriversstatus/summary: get: summary: 'Get driver status summary' operationId: getDriverStatusSummary description: 'Returns aggregated status summary with time spent in each status.' parameters: [] responses: 200: description: Success content: application/json: schema: type: object example: '1': 3600 '2': 7200 route_length: 150.5 properties: 1: type: integer example: 3600 2: type: integer example: 7200 route_length: type: number example: 150.5 tags: - DDD requestBody: required: false content: application/json: schema: type: object properties: object_id: type: string description: 'Filter by object ID. Must contain only letters and numbers. Väli value ei tohi olla pikem kui 10 tähemärki.' example: '123' nullable: true driver_id: type: integer description: 'Filter by driver ID.' example: 1 nullable: true datetime: type: array description: 'Väli value peab olema kehtiv kuupäev.' example: - '2026-02-26T15:34:40' items: type: string /api/dddrequests: post: summary: 'Create a DDD request' operationId: createADDDRequest description: 'Creates a new DDD file download request for a vehicle.' parameters: [] responses: 201: description: Success content: application/json: schema: type: object example: data: id: 1 object_id: '123' file_type: 7 handled: 0 properties: data: type: object properties: id: type: integer example: 1 object_id: type: string example: '123' file_type: type: integer example: 7 handled: type: integer example: 0 400: description: '' content: application/json: schema: type: object example: message: Request_In_Progress properties: message: type: string example: Request_In_Progress tags: - DDD requestBody: required: true content: application/json: schema: type: object properties: object_id: type: string description: 'The object/vehicle ID. Must contain only letters, numbers, dashes and underscores. Väli value ei tohi olla pikem kui 10 tähemärki.' example: '123' file_type: type: integer description: 'File type: 6 for driver, 7 for vehicle.' example: 7 enum: - 6 - 7 start: type: string description: 'Start date for the request period. Must be a valid date in the format Y-m-d H:i:s.' example: '2025-01-01 00:00:00' nullable: true end: type: string description: 'End date for the request period. Must be a valid date in the format Y-m-d H:i:s.' example: '2025-01-31 23:59:59' nullable: true required: - object_id - file_type /api/dddrequest: post: summary: 'Create DDD log request' operationId: createDDDLogRequest description: 'Creates a new DDD log request entry to track download sessions.' parameters: [] responses: 201: description: Success content: application/json: schema: type: object example: data: id: 1 object_id: '123' sender: user@example.com properties: data: type: object properties: id: type: integer example: 1 object_id: type: string example: '123' sender: type: string example: user@example.com tags: - DDD requestBody: required: true content: application/json: schema: type: object properties: object_id: type: string description: 'The object/vehicle ID. Must contain only letters, numbers, dashes and underscores. Väli value ei tohi olla pikem kui 10 tähemärki.' example: '123' required: - object_id '/api/dddrequest/{id}': put: summary: 'Close DDD log request' operationId: closeDDDLogRequest description: 'Marks a DDD log request as closed by setting the stop time.' parameters: [] responses: 200: description: Success content: application/json: schema: type: object example: data: id: 1 object_id: '123' stop_time: '2025-01-15 10:00:00' properties: data: type: object properties: id: type: integer example: 1 object_id: type: string example: '123' stop_time: type: string example: '2025-01-15 10:00:00' 404: description: '' content: application/json: schema: type: object example: message: 'Not Found' properties: message: type: string example: 'Not Found' tags: - DDD parameters: - in: path name: id description: 'The log request ID.' example: 1 required: true schema: type: integer /api/closedreg: get: summary: 'List closed registrations' operationId: listClosedRegistrations description: 'Returns closed driver-vehicle registrations for a given date period with optional filters and engine working time.' parameters: - in: query name: datetime description: '' example: - architecto required: true schema: type: array description: '' example: - architecto items: type: string - in: query name: driver_id description: 'Filter by driver ID.' example: 42 required: false schema: type: integer description: 'Filter by driver ID.' example: 42 nullable: true - in: query name: object_id description: 'Filter by vehicle object ID. Must contain only letters, numbers, dashes and underscores. Väli value ei tohi olla pikem kui 10 tähemärki.' example: ABC123 required: false schema: type: string description: 'Filter by vehicle object ID. Must contain only letters, numbers, dashes and underscores. Väli value ei tohi olla pikem kui 10 tähemärki.' example: ABC123 nullable: true - in: query name: offset description: 'Pagination offset. Use -1 to return all records.' example: 0 required: false schema: type: integer description: 'Pagination offset. Use -1 to return all records.' example: 0 nullable: true - in: query name: limit description: 'Number of records to return.' example: 30 required: false schema: type: integer description: 'Number of records to return.' example: 30 nullable: true responses: 200: description: Success content: application/json: schema: type: array items: type: object properties: id: type: integer example: 1 object_id: type: string example: ABC123 driver_id: type: integer example: 42 name: type: string example: John fname: type: string example: Doe startUse: type: string example: '2026-01-15 08:00:00' stopUse: type: string example: '2026-01-15 17:00:00' code: type: string example: A1 mode: type: integer example: 1 m_on: type: string example: '08:30:00' example: - id: 1 object_id: ABC123 driver_id: 42 name: John fname: Doe startUse: '2026-01-15 08:00:00' stopUse: '2026-01-15 17:00:00' code: A1 mode: 1 m_on: '08:30:00' tags: - Drivers '/api/qrcode/{id}': get: summary: 'Generate QR code' operationId: generateQRCode description: 'Returns a PNG image of a QR code containing the given object ID.' parameters: [] responses: 200: description: Success content: text/plain: schema: type: string example: '' 403: description: Forbidden content: application/json: schema: type: object example: message: ObjectNotAllowed properties: message: type: string example: ObjectNotAllowed tags: - Drivers parameters: - in: path name: id description: 'The vehicle object ID.' example: ABC123 required: true schema: type: string /api/vehicledriversqr: get: summary: 'List the recent registrations' operationId: listTheRecentRegistrations description: 'Returns the last 10 driver-vehicle registration records for the current driver.' parameters: [] responses: 200: description: Success content: application/json: schema: type: array items: type: object properties: id: type: integer example: 1 object_id: type: string example: ABC123 driver_id: type: integer example: 42 startUse: type: string example: '2026-01-15 08:00:00' stopUse: type: string example: '2026-01-15 17:00:00' example: - id: 1 object_id: ABC123 driver_id: 42 startUse: '2026-01-15 08:00:00' stopUse: '2026-01-15 17:00:00' 400: description: 'No driver ID' content: application/json: schema: type: object example: message: No_Driver_Id properties: message: type: string example: No_Driver_Id 403: description: 'Not a driver' content: application/json: schema: type: object example: message: Drivers_Only properties: message: type: string example: Drivers_Only tags: - Drivers post: summary: 'Register a vehicle' operationId: registerAVehicle description: 'Creates a new driver-vehicle registration via QR code. Auto-closes any existing registration for the vehicle. Requires a vehicle status check if the VehStatusCheck module is active.' parameters: [] responses: 201: description: Success content: application/json: schema: type: object example: id: 1 object_id: ABC123 driver_id: 42 startUse: '2026-01-15 08:00:00' stopUse: null properties: id: type: integer example: 1 object_id: type: string example: ABC123 driver_id: type: integer example: 42 startUse: type: string example: '2026-01-15 08:00:00' stopUse: type: string example: null nullable: true 400: description: '' content: application/json: schema: oneOf: - description: 'Driver busy' type: object example: message: Driver_Is_Busy properties: message: type: string example: Driver_Is_Busy - description: 'Already registered' type: object example: message: Driver_Is_Already_Registered properties: message: type: string example: Driver_Is_Already_Registered - description: 'In repair' type: object example: message: Vehicle_Already_In_Repair properties: message: type: string example: Vehicle_Already_In_Repair - description: 'Check missing' type: object example: message: Veh_Check_Missing properties: message: type: string example: Veh_Check_Missing 403: description: 'Object not allowed' content: application/json: schema: type: object example: message: ObjectNotAllowed properties: message: type: string example: ObjectNotAllowed tags: - Drivers requestBody: required: true content: application/json: schema: type: object properties: object_id: type: string description: 'Vehicle object ID to register. Must contain only letters, numbers, dashes and underscores. Väli value ei tohi olla pikem kui 10 tähemärki.' example: ABC123 check_id: type: integer description: 'Vehicle status check ID (required when VehStatusCheck module is active).' example: 1 nullable: true required: - object_id put: summary: 'Close registration' operationId: closeRegistration description: 'Closes the active driver-vehicle registration. If no active registration exists, returns the last closed record.' parameters: [] responses: 200: description: '' content: application/json: schema: oneOf: - description: Closed type: object example: id: 1 object_id: ABC123 driver_id: 42 startUse: '2026-01-15 08:00:00' stopUse: '2026-01-15 17:00:00' properties: id: type: integer example: 1 object_id: type: string example: ABC123 driver_id: type: integer example: 42 startUse: type: string example: '2026-01-15 08:00:00' stopUse: type: string example: '2026-01-15 17:00:00' - description: 'No active' type: object example: id: 1 object_id: ABC123 driver_id: 42 startUse: '2026-01-14 08:00:00' stopUse: '2026-01-14 17:00:00' properties: id: type: integer example: 1 object_id: type: string example: ABC123 driver_id: type: integer example: 42 startUse: type: string example: '2026-01-14 08:00:00' stopUse: type: string example: '2026-01-14 17:00:00' 403: description: 'Not a driver' content: application/json: schema: type: object example: message: Drivers_Only properties: message: type: string example: Drivers_Only tags: - Drivers /api/vehicledriversbooking: post: summary: 'Register a vehicle via booking' operationId: registerAVehicleViaBooking description: 'Creates a new driver-vehicle registration from a booking record. Validates that the booking period is current and the driver matches the booking assignment.' parameters: [] responses: 201: description: Success content: application/json: schema: type: object example: id: 1 object_id: ABC123 driver_id: 42 startUse: '2026-01-15 08:00:00' stopUse: null properties: id: type: integer example: 1 object_id: type: string example: ABC123 driver_id: type: integer example: 42 startUse: type: string example: '2026-01-15 08:00:00' stopUse: type: string example: null nullable: true 400: description: '' content: application/json: schema: oneOf: - description: 'Period not current' type: object example: message: Period_Must_Be_Now properties: message: type: string example: Period_Must_Be_Now - description: 'Driver busy' type: object example: message: Driver_Is_Busy properties: message: type: string example: Driver_Is_Busy - description: 'Already registered' type: object example: message: Driver_Is_Already_Registered properties: message: type: string example: Driver_Is_Already_Registered 403: description: 'Driver mismatch' content: application/json: schema: type: object example: message: NotAllowed properties: message: type: string example: NotAllowed 404: description: 'Booking not found' content: application/json: schema: type: object example: message: NotFound properties: message: type: string example: NotFound tags: - Drivers requestBody: required: true content: application/json: schema: type: object properties: booking_id: type: integer description: 'Booking record ID to register the driver-vehicle assignment from.' example: 1 required: - booking_id '/api/vehicle/drivers/edit/{id}': put: summary: 'Update fuel data' operationId: updateFuelData description: 'Updates fuel fields (fuelStart, fuelEnd, billFuel) on a driver-vehicle registration record. Requires extended user permissions.' parameters: [] responses: 200: description: Success content: application/json: schema: type: object example: id: 1 object_id: ABC123 driver_id: 42 name: John fname: Doe driverCode: A1 code: QR1 startUse: '2026-01-15 08:00:00' stopUse: '2026-01-15 17:00:00' fuelStart: 45.5 fuelEnd: 30.2 billFuel: 15.3 properties: id: type: integer example: 1 object_id: type: string example: ABC123 driver_id: type: integer example: 42 name: type: string example: John fname: type: string example: Doe driverCode: type: string example: A1 code: type: string example: QR1 startUse: type: string example: '2026-01-15 08:00:00' stopUse: type: string example: '2026-01-15 17:00:00' fuelStart: type: number example: 45.5 fuelEnd: type: number example: 30.2 billFuel: type: number example: 15.3 403: description: 'Not allowed' content: application/json: schema: type: object example: message: NotAllowed properties: message: type: string example: NotAllowed 404: description: 'Not found' content: application/json: schema: type: object example: message: Not_Found properties: message: type: string example: Not_Found tags: - Drivers requestBody: required: false content: application/json: schema: type: object properties: fuelStart: type: number description: 'Fuel level at start of trip.' example: 45.5 nullable: true fuelEnd: type: number description: 'Fuel level at end of trip.' example: 30.2 nullable: true billFuel: type: number description: 'Billed fuel amount.' example: 15.3 nullable: true parameters: - in: path name: id description: 'The registration record ID.' example: 1 required: true schema: type: integer /api/vehicle/drivers: get: summary: 'List active registrations' operationId: listActiveRegistrations description: 'Returns all currently active (open) driver-vehicle registration records.' parameters: [] responses: 200: description: Success content: application/json: schema: type: array items: type: object properties: id: type: integer example: 1 object_id: type: string example: ABC123 driver_id: type: integer example: 42 name: type: string example: John fname: type: string example: Doe code: type: string example: A1 startUse: type: string example: '2026-01-15 08:00:00' stopUse: type: string example: null nullable: true example: - id: 1 object_id: ABC123 driver_id: 42 name: John fname: Doe code: A1 startUse: '2026-01-15 08:00:00' stopUse: null tags: - Drivers post: summary: 'Create registration' operationId: createRegistration description: 'Creates a new driver-vehicle registration. Validates that the period is valid and neither the vehicle nor driver is currently busy.' parameters: [] responses: 201: description: Success content: application/json: schema: type: object example: id: 1 object_id: ABC123 driver_id: 42 name: John fname: Doe code: A1 startUse: '2026-01-15 08:00:00' stopUse: null properties: id: type: integer example: 1 object_id: type: string example: ABC123 driver_id: type: integer example: 42 name: type: string example: John fname: type: string example: Doe code: type: string example: A1 startUse: type: string example: '2026-01-15 08:00:00' stopUse: type: string example: null nullable: true 400: description: '' content: application/json: schema: oneOf: - description: 'Wrong period' type: object example: message: Wrong_Period properties: message: type: string example: Wrong_Period - description: 'Vehicle busy' type: object example: message: Vehicle_Is_Busy properties: message: type: string example: Vehicle_Is_Busy - description: 'Driver busy' type: object example: message: Driver_Is_Busy properties: message: type: string example: Driver_Is_Busy 404: description: 'Driver not found' content: application/json: schema: type: object example: message: Not_Found properties: message: type: string example: Not_Found tags: - Drivers requestBody: required: true content: application/json: schema: type: object properties: object_id: type: string description: 'Vehicle object ID. Must contain only letters, numbers, dashes and underscores. Väli value ei tohi olla pikem kui 10 tähemärki.' example: ABC123 startUse: type: string description: 'Registration start datetime (UTC). Must be a valid date in the format Y-m-d H:i:s.' example: '2026-01-15 08:00:00' stopUse: type: string description: 'Registration end datetime (UTC). Must be a valid date in the format Y-m-d H:i:s.' example: '2026-01-15 17:00:00' nullable: true driver_id: type: integer description: 'Driver ID.' example: 42 nullable: true required: - object_id - startUse '/api/vehicle/drivers/{id}': get: summary: 'Get registration' operationId: getRegistration description: 'Returns a single driver-vehicle registration record by ID.' parameters: [] responses: 200: description: Success content: application/json: schema: type: object example: id: 1 object_id: ABC123 driver_id: 42 name: John fname: Doe code: A1 startUse: '2026-01-15 08:00:00' stopUse: '2026-01-15 17:00:00' properties: id: type: integer example: 1 object_id: type: string example: ABC123 driver_id: type: integer example: 42 name: type: string example: John fname: type: string example: Doe code: type: string example: A1 startUse: type: string example: '2026-01-15 08:00:00' stopUse: type: string example: '2026-01-15 17:00:00' 404: description: 'Not found' content: application/json: schema: type: object example: message: Not_Found properties: message: type: string example: Not_Found tags: - Drivers put: summary: 'Update registration' operationId: updateRegistration description: 'Updates an existing driver-vehicle registration record. Validates period and driver availability when changing the driver.' parameters: [] responses: 200: description: Success content: application/json: schema: type: object example: id: 1 object_id: ABC123 driver_id: 42 name: John fname: Doe code: A1 startUse: '2026-01-15 08:00:00' stopUse: '2026-01-15 17:00:00' properties: id: type: integer example: 1 object_id: type: string example: ABC123 driver_id: type: integer example: 42 name: type: string example: John fname: type: string example: Doe code: type: string example: A1 startUse: type: string example: '2026-01-15 08:00:00' stopUse: type: string example: '2026-01-15 17:00:00' 400: description: '' content: application/json: schema: oneOf: - description: 'Wrong period' type: object example: message: Wrong_Period properties: message: type: string example: Wrong_Period - description: 'Driver busy' type: object example: message: Driver_Is_Busy_Long properties: message: type: string example: Driver_Is_Busy_Long 404: description: 'Not found' content: application/json: schema: type: object example: message: Not_Found properties: message: type: string example: Not_Found tags: - Drivers requestBody: required: true content: application/json: schema: type: object properties: object_id: type: string description: 'Vehicle object ID. Must contain only letters, numbers, dashes and underscores. Väli value ei tohi olla pikem kui 10 tähemärki.' example: ABC123 nullable: true startUse: type: string description: 'Registration start datetime (UTC). Must be a valid date in the format Y-m-d H:i:s.' example: '2026-01-15 08:00:00' stopUse: type: string description: 'Registration end datetime (UTC). Must be a valid date in the format Y-m-d H:i:s.' example: '2026-01-15 17:00:00' nullable: true driver_id: type: integer description: 'Driver ID.' example: 42 nullable: true required: - startUse delete: summary: 'Delete registration' operationId: deleteRegistration description: 'Deletes a driver-vehicle registration record.' parameters: [] responses: 200: description: Success content: application/json: schema: type: object example: message: Deleted properties: message: type: string example: Deleted 403: description: 'Constraint violation' content: application/json: schema: type: object example: message: Constraint_violation properties: message: type: string example: Constraint_violation 404: description: 'Not found' content: application/json: schema: type: object example: message: Not_Found properties: message: type: string example: Not_Found tags: - Drivers parameters: - in: path name: id description: 'The registration record ID.' example: 1 required: true schema: type: integer /api/driverkeys: get: summary: 'List all keys' operationId: listAllKeys description: 'Returns all driver keys with associated driver and user information.' parameters: [] responses: 200: description: Success content: application/json: schema: type: array items: type: object properties: id: type: integer example: 1 name: type: string example: 'Main Key' code: type: string example: KEY001 type: type: integer example: 1 driver: type: integer example: 1 dr_id: type: integer example: 42 driverName: type: string example: John fname: type: string example: Doe driverCardId: type: string example: DC001 user: type: string example: USR1 userName: type: string example: Admin example: - id: 1 name: 'Main Key' code: KEY001 type: 1 driver: 1 dr_id: 42 driverName: John fname: Doe driverCardId: DC001 user: USR1 userName: Admin tags: - Drivers post: summary: 'Create a key' operationId: createAKey description: 'Creates a new driver key record.' parameters: [] responses: 201: description: Success content: application/json: schema: type: object example: id: 1 name: 'Main Key' code: KEY001 type: 1 driver: null dr_id: null driverName: null fname: null driverCardId: null user: null userName: null properties: id: type: integer example: 1 name: type: string example: 'Main Key' code: type: string example: KEY001 type: type: integer example: 1 driver: type: string example: null nullable: true dr_id: type: string example: null nullable: true driverName: type: string example: null nullable: true fname: type: string example: null nullable: true driverCardId: type: string example: null nullable: true user: type: string example: null nullable: true userName: type: string example: null nullable: true tags: - Drivers requestBody: required: true content: application/json: schema: type: object properties: name: type: string description: 'Key name. Väli value ei tohi olla pikem kui 255 tähemärki.' example: 'Main Key' code: type: string description: 'Key code identifier. Väli value ei tohi olla pikem kui 255 tähemärki.' example: KEY001 type: type: integer description: 'Key type.' example: 1 required: - name - code - type '/api/driverkeys/{id}': get: summary: 'Get a key' operationId: getAKey description: 'Returns a single driver key record by ID with the decoded change log.' parameters: [] responses: 200: description: Success content: application/json: schema: type: object example: id: 1 name: 'Main Key' code: KEY001 type: 1 driver: 1 dr_id: null driverName: null fname: null driverCardId: null user: null userName: null properties: id: type: integer example: 1 name: type: string example: 'Main Key' code: type: string example: KEY001 type: type: integer example: 1 driver: type: integer example: 1 dr_id: type: string example: null nullable: true driverName: type: string example: null nullable: true fname: type: string example: null nullable: true driverCardId: type: string example: null nullable: true user: type: string example: null nullable: true userName: type: string example: null nullable: true 404: description: 'Not found' content: application/json: schema: type: object example: message: Not_Found properties: message: type: string example: Not_Found tags: - Drivers put: summary: 'Update key' operationId: updateKey description: 'Updates a driver key record. Only changed fields are persisted and logged.' parameters: [] responses: 200: description: Success content: application/json: schema: type: object example: id: 1 name: 'Updated Key' code: KEY001 type: 1 driver: 1 properties: id: type: integer example: 1 name: type: string example: 'Updated Key' code: type: string example: KEY001 type: type: integer example: 1 driver: type: integer example: 1 404: description: 'Not found' content: application/json: schema: type: object example: message: Not_Found properties: message: type: string example: Not_Found tags: - Drivers requestBody: required: false content: application/json: schema: type: object properties: name: type: string description: 'Key name. Väli value ei tohi olla pikem kui 255 tähemärki.' example: 'Main Key' nullable: true code: type: string description: 'Key code identifier. Väli value ei tohi olla pikem kui 255 tähemärki.' example: KEY001 nullable: true driver: type: string description: 'Whether this key belongs to a driver (0 or 1).' example: 1 enum: - 0 - 1 nullable: true type: type: integer description: 'Key type.' example: 1 nullable: true delete: summary: 'Delete key' operationId: deleteKey description: 'Deletes a driver key record.' parameters: [] responses: 200: description: Success content: application/json: schema: type: object example: message: Deleted properties: message: type: string example: Deleted 403: description: 'Constraint violation' content: application/json: schema: type: object example: message: Constraint_violation properties: message: type: string example: Constraint_violation 404: description: 'Not found' content: application/json: schema: type: object example: message: Not_Found properties: message: type: string example: Not_Found tags: - Drivers parameters: - in: path name: id description: 'The key record ID.' example: 1 required: true schema: type: integer /api/drivers: get: summary: 'List drivers' operationId: listDrivers description: 'Returns all drivers with optional filtering by user association and archive status.' parameters: - in: query name: usersOnly description: 'Filter by user association (0 = without users, 1 = with users).' example: 1 required: false schema: type: string description: 'Filter by user association (0 = without users, 1 = with users).' example: 1 enum: - 0 - 1 nullable: true - in: query name: archive description: 'Include archived drivers (0 = active only, 1 = include archived).' example: 0 required: false schema: type: string description: 'Include archived drivers (0 = active only, 1 = include archived).' example: 0 enum: - 0 - 1 nullable: true responses: 200: description: Success content: application/json: schema: type: array items: type: object properties: id: type: integer example: 1 name: type: string example: John fname: type: string example: Doe full_name: type: string example: 'John Doe' gsm: type: string example: '+37255512345' comment: type: string example: 'Senior driver' p1: type: string example: null nullable: true p2: type: string example: null nullable: true p3: type: string example: null nullable: true user_id: type: string example: null nullable: true driverCardId: type: string example: DC001 key_id: type: integer example: 1 code: type: string example: KEY001 keyName: type: string example: 'Main Key' driver: type: integer example: 1 archive: type: integer example: 0 example: - id: 1 name: John fname: Doe full_name: 'John Doe' gsm: '+37255512345' comment: 'Senior driver' p1: null p2: null p3: null user_id: null driverCardId: DC001 key_id: 1 code: KEY001 keyName: 'Main Key' driver: 1 archive: 0 tags: - Drivers post: summary: 'Create the driver' operationId: createTheDriver description: 'Creates a new driver record. If a key_id is provided and already assigned to another driver, the key is released from the previous driver first.' parameters: [] responses: 201: description: Success content: application/json: schema: type: object example: id: 1 name: John fname: Doe full_name: 'John Doe' gsm: '+37255512345' comment: null p1: null p2: null p3: null user_id: null driverCardId: null key_id: 1 code: KEY001 keyName: 'Main Key' driver: 1 archive: 0 properties: id: type: integer example: 1 name: type: string example: John fname: type: string example: Doe full_name: type: string example: 'John Doe' gsm: type: string example: '+37255512345' comment: type: string example: null nullable: true p1: type: string example: null nullable: true p2: type: string example: null nullable: true p3: type: string example: null nullable: true user_id: type: string example: null nullable: true driverCardId: type: string example: null nullable: true key_id: type: integer example: 1 code: type: string example: KEY001 keyName: type: string example: 'Main Key' driver: type: integer example: 1 archive: type: integer example: 0 tags: - Drivers requestBody: required: true content: application/json: schema: type: object properties: name: type: string description: 'Driver first name. Väli value ei tohi olla pikem kui 16 tähemärki.' example: John fname: type: string description: 'Driver last name. Väli value ei tohi olla pikem kui 16 tähemärki.' example: Doe gsm: type: string description: 'Phone number. Väli value ei tohi olla pikem kui 16 tähemärki.' example: '+37255512345' nullable: true comment: type: string description: 'Comment or note. Väli value ei tohi olla pikem kui 255 tähemärki.' example: 'Senior driver' nullable: true key_id: type: integer description: 'Associated driver key ID.' example: 1 nullable: true p1: type: string description: 'Custom field 1. Väli value ei tohi olla pikem kui 20 tähemärki.' example: 'Value 1' nullable: true p2: type: string description: 'Custom field 2. Väli value ei tohi olla pikem kui 20 tähemärki.' example: 'Value 2' nullable: true p3: type: string description: 'Custom field 3. Väli value ei tohi olla pikem kui 20 tähemärki.' example: 'Value 3' nullable: true archive: type: string description: 'Archive status (0 = active, 1 = archived).' example: 0 enum: - 0 - 1 nullable: true required: - name - fname '/api/drivers/{id}': get: summary: 'Get the driver' operationId: getTheDriver description: 'Returns a single driver record by ID with a decoded change log.' parameters: [] responses: 200: description: Success content: application/json: schema: type: object example: id: 1 name: John fname: Doe full_name: 'John Doe' gsm: '+37255512345' comment: null p1: null p2: null p3: null user_id: null driverCardId: DC001 key_id: 1 code: KEY001 keyName: 'Main Key' driver: 1 archive: 0 properties: id: type: integer example: 1 name: type: string example: John fname: type: string example: Doe full_name: type: string example: 'John Doe' gsm: type: string example: '+37255512345' comment: type: string example: null nullable: true p1: type: string example: null nullable: true p2: type: string example: null nullable: true p3: type: string example: null nullable: true user_id: type: string example: null nullable: true driverCardId: type: string example: DC001 key_id: type: integer example: 1 code: type: string example: KEY001 keyName: type: string example: 'Main Key' driver: type: integer example: 1 archive: type: integer example: 0 404: description: 'Not found' content: application/json: schema: type: object example: message: Not_Found properties: message: type: string example: Not_Found tags: - Drivers put: summary: 'Update driver' operationId: updateDriver description: 'Updates a driver record. Handles key reassignment with logging when key_id changes.' parameters: [] responses: 200: description: Success content: application/json: schema: type: object example: id: 1 name: John fname: Doe full_name: 'John Doe' gsm: '+37255512345' comment: null p1: null p2: null p3: null user_id: null driverCardId: DC001 key_id: 1 code: KEY001 keyName: 'Main Key' driver: 1 archive: 0 properties: id: type: integer example: 1 name: type: string example: John fname: type: string example: Doe full_name: type: string example: 'John Doe' gsm: type: string example: '+37255512345' comment: type: string example: null nullable: true p1: type: string example: null nullable: true p2: type: string example: null nullable: true p3: type: string example: null nullable: true user_id: type: string example: null nullable: true driverCardId: type: string example: DC001 key_id: type: integer example: 1 code: type: string example: KEY001 keyName: type: string example: 'Main Key' driver: type: integer example: 1 archive: type: integer example: 0 404: description: 'Not found' content: application/json: schema: type: object example: message: Not_Found properties: message: type: string example: Not_Found tags: - Drivers requestBody: required: true content: application/json: schema: type: object properties: name: type: string description: 'Driver first name. Väli value ei tohi olla pikem kui 16 tähemärki.' example: John fname: type: string description: 'Driver last name. Väli value ei tohi olla pikem kui 16 tähemärki.' example: Doe gsm: type: string description: 'Phone number. Väli value ei tohi olla pikem kui 16 tähemärki.' example: '+37255512345' nullable: true comment: type: string description: 'Comment or note. Väli value ei tohi olla pikem kui 255 tähemärki.' example: 'Senior driver' nullable: true key_id: type: integer description: 'Associated driver key ID.' example: 1 nullable: true p1: type: string description: 'Custom field 1. Väli value ei tohi olla pikem kui 20 tähemärki.' example: 'Value 1' nullable: true p2: type: string description: 'Custom field 2. Väli value ei tohi olla pikem kui 20 tähemärki.' example: 'Value 2' nullable: true p3: type: string description: 'Custom field 3. Väli value ei tohi olla pikem kui 20 tähemärki.' example: 'Value 3' nullable: true archive: type: string description: 'Archive status (0 = active, 1 = archived).' example: 0 enum: - 0 - 1 nullable: true required: - name - fname delete: summary: 'Delete (archive) driver' operationId: deletearchiveDriver description: 'Archives a driver record, releases assigned key, and cleans up DDD files.' parameters: [] responses: 200: description: Success content: application/json: schema: type: object example: message: Deleted properties: message: type: string example: Deleted 404: description: 'Not found' content: application/json: schema: type: object example: message: Not_Found properties: message: type: string example: Not_Found tags: - Drivers parameters: - in: path name: id description: 'The driver record ID.' example: 1 required: true schema: type: integer /api/lastdata: get: summary: 'List all last data (Export API)' operationId: listAllLastDataExportAPI description: 'Returns the latest data for all vehicles accessible by the authenticated user.' parameters: [] responses: 200: description: Success content: application/json: schema: type: array items: type: object properties: ID: type: integer example: 1 objectID: type: string example: ABC123 alias: type: string example: 'Truck 1' Xpos: type: string example: '24.75' Ypos: type: string example: '59.43' Counter1: type: number example: 50.5 Counter2: type: integer example: 0 GMTime: type: string example: '2025-01-15 14:30:00' Speed: type: integer example: 60 Heading: type: integer example: 180 Input: type: integer example: 0 LastCommunicationLocalTime: type: string example: '2025-01-15 16:30:00' Content: type: string example: '' Power: type: number example: 12.5 BatLevel: type: number example: 4.2 NoGPSFix: type: integer example: 0 t1: type: integer example: 0 t2: type: integer example: 0 t3: type: integer example: 0 t4: type: integer example: 0 Counter: type: integer example: 1475 GroupID: type: integer example: 1 GroupName: type: string example: Trucks Odo: type: integer example: 150000 MotoHrs: type: integer example: 3500 status: type: string example: null nullable: true example: - ID: 1 objectID: ABC123 alias: 'Truck 1' Xpos: '24.75' Ypos: '59.43' Counter1: 50.5 Counter2: 0 GMTime: '2025-01-15 14:30:00' Speed: 60 Heading: 180 Input: 0 LastCommunicationLocalTime: '2025-01-15 16:30:00' Content: '' Power: 12.5 BatLevel: 4.2 NoGPSFix: 0 t1: 0 t2: 0 t3: 0 t4: 0 Counter: 1475 GroupID: 1 GroupName: Trucks Odo: 150000 MotoHrs: 3500 status: null tags: - 'Export API' '/api/lastdata/{id}': get: summary: 'Show last data by vehicle (Export API)' operationId: showLastDataByVehicleExportAPI description: 'Returns the latest data for a specific vehicle.' parameters: [] responses: 200: description: Success content: application/json: schema: type: object example: ID: 1 objectID: ABC123 alias: 'Truck 1' Xpos: '24.75' Ypos: '59.43' Counter1: 50.5 Counter2: 0 GMTime: '2025-01-15 14:30:00' Speed: 60 Heading: 180 Input: 0 LastCommunicationLocalTime: '2025-01-15 16:30:00' Content: '' Power: 12.5 BatLevel: 4.2 NoGPSFix: 0 t1: 0 t2: 0 t3: 0 t4: 0 Counter: 1475 GroupID: 1 GroupName: Trucks Odo: 150000 MotoHrs: 3500 status: null properties: ID: type: integer example: 1 objectID: type: string example: ABC123 alias: type: string example: 'Truck 1' Xpos: type: string example: '24.75' Ypos: type: string example: '59.43' Counter1: type: number example: 50.5 Counter2: type: integer example: 0 GMTime: type: string example: '2025-01-15 14:30:00' Speed: type: integer example: 60 Heading: type: integer example: 180 Input: type: integer example: 0 LastCommunicationLocalTime: type: string example: '2025-01-15 16:30:00' Content: type: string example: '' Power: type: number example: 12.5 BatLevel: type: number example: 4.2 NoGPSFix: type: integer example: 0 t1: type: integer example: 0 t2: type: integer example: 0 t3: type: integer example: 0 t4: type: integer example: 0 Counter: type: integer example: 1475 GroupID: type: integer example: 1 GroupName: type: string example: Trucks Odo: type: integer example: 150000 MotoHrs: type: integer example: 3500 status: type: string example: null nullable: true 404: description: 'Not found' content: application/json: schema: type: object example: error: Vehicle_Not_Found properties: error: type: string example: Vehicle_Not_Found tags: - 'Export API' parameters: - in: path name: id description: 'The vehicle object ID.' example: ABC123 required: true schema: type: string '/api/drivereport/{start}/{stop}': get: summary: 'List all drive reports (Export API)' operationId: listAllDriveReportsExportAPI description: 'Returns drive reports for all vehicles within a date range. The maximum period is 7 days.' parameters: [] responses: 200: description: Success content: application/json: schema: type: array items: type: object properties: ID: type: integer example: 1 objectID: type: string example: ABC123 startTime: type: string example: '2025-01-15 08:30:00' previousStopTime: type: string example: '2025-01-15 08:00:00' stopTime: type: string example: '2025-01-15 09:15:00' stopEnd: type: string example: '2025-01-15 09:20:00' routeLengthKM: type: number example: 45.2 drivingTimeSeconds: type: integer example: 2700 pauseTimeSeconds: type: integer example: 300 averageSpeed: type: integer example: 60 maxSpeed: type: integer example: 90 AddressAtStartingPoint: type: string example: 'Main St 1' AddressAtEndPoint: type: string example: 'Oak Ave 5' status: type: integer example: 0 driverCardId: type: string example: DRV001 driverName: type: string example: 'John Doe' example: - ID: 1 objectID: ABC123 startTime: '2025-01-15 08:30:00' previousStopTime: '2025-01-15 08:00:00' stopTime: '2025-01-15 09:15:00' stopEnd: '2025-01-15 09:20:00' routeLengthKM: 45.2 drivingTimeSeconds: 2700 pauseTimeSeconds: 300 averageSpeed: 60 maxSpeed: 90 AddressAtStartingPoint: 'Main St 1' AddressAtEndPoint: 'Oak Ave 5' status: 0 driverCardId: DRV001 driverName: 'John Doe' 400: description: 'Period too long' content: application/json: schema: type: object example: error: 'Ordered period should not exceed 7 days' properties: error: type: string example: 'Ordered period should not exceed 7 days' tags: - 'Export API' parameters: - in: path name: start description: 'Start date in Y-m-dH:i:s format (no space).' example: '2025-01-1508:00:00' required: true schema: type: string - in: path name: stop description: 'Stop date in Y-m-dH:i:s format (no space).' example: '2025-01-1517:00:00' required: true schema: type: string '/api/drivereport/{start}/{stop}/{id}': get: summary: 'Show drive reports by vehicle (Export API)' operationId: showDriveReportsByVehicleExportAPI description: 'Returns drive reports for a specific vehicle within a date range. The maximum period is 7 days.' parameters: [] responses: 200: description: Success content: application/json: schema: type: array items: type: object properties: ID: type: integer example: 1 objectID: type: string example: ABC123 startTime: type: string example: '2025-01-15 08:30:00' previousStopTime: type: string example: '2025-01-15 08:00:00' stopTime: type: string example: '2025-01-15 09:15:00' stopEnd: type: string example: '2025-01-15 09:20:00' routeLengthKM: type: number example: 45.2 drivingTimeSeconds: type: integer example: 2700 pauseTimeSeconds: type: integer example: 300 averageSpeed: type: integer example: 60 maxSpeed: type: integer example: 90 AddressAtStartingPoint: type: string example: 'Main St 1' AddressAtEndPoint: type: string example: 'Oak Ave 5' status: type: integer example: 0 driverCardId: type: string example: DRV001 driverName: type: string example: 'John Doe' example: - ID: 1 objectID: ABC123 startTime: '2025-01-15 08:30:00' previousStopTime: '2025-01-15 08:00:00' stopTime: '2025-01-15 09:15:00' stopEnd: '2025-01-15 09:20:00' routeLengthKM: 45.2 drivingTimeSeconds: 2700 pauseTimeSeconds: 300 averageSpeed: 60 maxSpeed: 90 AddressAtStartingPoint: 'Main St 1' AddressAtEndPoint: 'Oak Ave 5' status: 0 driverCardId: DRV001 driverName: 'John Doe' 400: description: 'Period too long' content: application/json: schema: type: object example: error: 'Ordered period should not exceed 7 days' properties: error: type: string example: 'Ordered period should not exceed 7 days' 404: description: 'Not found' content: application/json: schema: type: object example: error: Vehicle_Not_Found properties: error: type: string example: Vehicle_Not_Found tags: - 'Export API' parameters: - in: path name: start description: 'Start date in Y-m-dH:i:s format (no space).' example: '2025-01-1508:00:00' required: true schema: type: string - in: path name: stop description: 'Stop date in Y-m-dH:i:s format (no space).' example: '2025-01-1517:00:00' required: true schema: type: string - in: path name: id description: 'The vehicle object ID.' example: ABC123 required: true schema: type: string '/api/fuelreport/{start}/{stop}': get: summary: 'List all fuel reports (Export API)' operationId: listAllFuelReportsExportAPI description: 'Returns fuel reports for all vehicles within a date range. The maximum period is 7 days.' parameters: [] responses: 200: description: Success content: application/json: schema: type: array items: type: object properties: ID: type: integer example: 1 objectID: type: string example: ABC123 startTime: type: string example: '2025-01-15 08:00:00' stopTime: type: string example: '2025-01-15 08:30:00' maxTime: type: string example: '2025-01-15 08:30:00' fuelBeforeL: type: number example: 120.5 fuelAfterL: type: number example: 180.0 routeLengthKM: type: number example: 25.3 fuelAddress: type: string example: 'Main St 1' example: - ID: 1 objectID: ABC123 startTime: '2025-01-15 08:00:00' stopTime: '2025-01-15 08:30:00' maxTime: '2025-01-15 08:30:00' fuelBeforeL: 120.5 fuelAfterL: 180.0 routeLengthKM: 25.3 fuelAddress: 'Main St 1' 400: description: 'Period too long' content: application/json: schema: type: object example: error: 'Ordered period should not exceed 7 days' properties: error: type: string example: 'Ordered period should not exceed 7 days' tags: - 'Export API' parameters: - in: path name: start description: 'Start date in Y-m-dH:i:s format (no space).' example: '2025-01-1508:00:00' required: true schema: type: string - in: path name: stop description: 'Stop date in Y-m-dH:i:s format (no space).' example: '2025-01-1517:00:00' required: true schema: type: string '/api/fuelreport/{start}/{stop}/{id}': get: summary: 'Show fuel reports by vehicle (Export API)' operationId: showFuelReportsByVehicleExportAPI description: 'Returns fuel reports for a specific vehicle within a date range. The maximum period is 7 days.' parameters: [] responses: 200: description: Success content: application/json: schema: type: array items: type: object properties: ID: type: integer example: 1 objectID: type: string example: ABC123 startTime: type: string example: '2025-01-15 08:00:00' stopTime: type: string example: '2025-01-15 08:30:00' maxTime: type: string example: '2025-01-15 08:30:00' fuelBeforeL: type: number example: 120.5 fuelAfterL: type: number example: 180.0 routeLengthKM: type: number example: 25.3 fuelAddress: type: string example: 'Main St 1' example: - ID: 1 objectID: ABC123 startTime: '2025-01-15 08:00:00' stopTime: '2025-01-15 08:30:00' maxTime: '2025-01-15 08:30:00' fuelBeforeL: 120.5 fuelAfterL: 180.0 routeLengthKM: 25.3 fuelAddress: 'Main St 1' 400: description: 'Period too long' content: application/json: schema: type: object example: error: 'Ordered period should not exceed 7 days' properties: error: type: string example: 'Ordered period should not exceed 7 days' 404: description: 'Not found' content: application/json: schema: type: object example: error: Vehicle_Not_Found properties: error: type: string example: Vehicle_Not_Found tags: - 'Export API' parameters: - in: path name: start description: 'Start date in Y-m-dH:i:s format (no space).' example: '2025-01-1508:00:00' required: true schema: type: string - in: path name: stop description: 'Stop date in Y-m-dH:i:s format (no space).' example: '2025-01-1517:00:00' required: true schema: type: string - in: path name: id description: 'The vehicle object ID.' example: ABC123 required: true schema: type: string '/api/enginereport/{start}/{stop}': get: summary: 'List all engine reports (Export API)' operationId: listAllEngineReportsExportAPI description: 'Returns engine reports for all vehicles within a date range. The maximum period is 7 days.' parameters: [] responses: 200: description: Success content: application/json: schema: type: array items: type: object properties: ID: type: integer example: 1 objectID: type: string example: ABC123 startTime: type: string example: '2025-01-15 08:00:00' stopTime: type: string example: '2025-01-15 09:30:00' stopEnd: type: string example: '2025-01-15 09:35:00' runningTime: type: string example: '01:30:00' input: type: integer example: 7 status: type: integer example: 0 distance: type: number example: 45.2 fuel: type: number example: 12.5 example: - ID: 1 objectID: ABC123 startTime: '2025-01-15 08:00:00' stopTime: '2025-01-15 09:30:00' stopEnd: '2025-01-15 09:35:00' runningTime: '01:30:00' input: 7 status: 0 distance: 45.2 fuel: 12.5 400: description: 'Period too long' content: application/json: schema: type: object example: error: 'Ordered period should not exceed 7 days' properties: error: type: string example: 'Ordered period should not exceed 7 days' tags: - 'Export API' parameters: - in: path name: start description: 'Start date in Y-m-dH:i:s format (no space).' example: '2025-01-1508:00:00' required: true schema: type: string - in: path name: stop description: 'Stop date in Y-m-dH:i:s format (no space).' example: '2025-01-1517:00:00' required: true schema: type: string '/api/enginereport/{start}/{stop}/{id}': get: summary: 'Show engine reports by vehicle (Export API)' operationId: showEngineReportsByVehicleExportAPI description: 'Returns engine reports for a specific vehicle within a date range. The maximum period is 7 days.' parameters: [] responses: 200: description: Success content: application/json: schema: type: array items: type: object properties: ID: type: integer example: 1 objectID: type: string example: ABC123 startTime: type: string example: '2025-01-15 08:00:00' stopTime: type: string example: '2025-01-15 09:30:00' stopEnd: type: string example: '2025-01-15 09:35:00' runningTime: type: string example: '01:30:00' input: type: integer example: 7 status: type: integer example: 0 distance: type: number example: 45.2 fuel: type: number example: 12.5 example: - ID: 1 objectID: ABC123 startTime: '2025-01-15 08:00:00' stopTime: '2025-01-15 09:30:00' stopEnd: '2025-01-15 09:35:00' runningTime: '01:30:00' input: 7 status: 0 distance: 45.2 fuel: 12.5 400: description: 'Period too long' content: application/json: schema: type: object example: error: 'Ordered period should not exceed 7 days' properties: error: type: string example: 'Ordered period should not exceed 7 days' 404: description: 'Not found' content: application/json: schema: type: object example: error: Vehicle_Not_Found properties: error: type: string example: Vehicle_Not_Found tags: - 'Export API' parameters: - in: path name: start description: 'Start date in Y-m-dH:i:s format (no space).' example: '2025-01-1508:00:00' required: true schema: type: string - in: path name: stop description: 'Stop date in Y-m-dH:i:s format (no space).' example: '2025-01-1517:00:00' required: true schema: type: string - in: path name: id description: 'The vehicle object ID.' example: ABC123 required: true schema: type: string '/api/routelog/{start}/{id}': get: summary: 'Show route log entry (Export API)' operationId: showRouteLogEntryExportAPI description: "Returns the last route log entry before the given time for a specific vehicle,\nincluding reverse geocoded location." parameters: [] responses: 200: description: Success content: application/json: schema: type: object example: GMTime: '2025-01-15 07:58:00' fuel: 120.5 lat: '59.43' lon: '24.75' input: 64 t1: 21 t2: 0 t3: 0 t4: 0 location: 'Estonia, Tallinn, Main St 1' properties: GMTime: type: string example: '2025-01-15 07:58:00' fuel: type: number example: 120.5 lat: type: string example: '59.43' lon: type: string example: '24.75' input: type: integer example: 64 t1: type: integer example: 21 t2: type: integer example: 0 t3: type: integer example: 0 t4: type: integer example: 0 location: type: string example: 'Estonia, Tallinn, Main St 1' 404: description: '' content: application/json: schema: oneOf: - description: 'Not found' type: object example: error: Vehicle_Not_Found properties: error: type: string example: Vehicle_Not_Found - description: 'No data' type: object example: error: Data_Not_Found properties: error: type: string example: Data_Not_Found tags: - 'Export API' parameters: - in: path name: start description: 'Start date in Y-m-dH:i:s format (no space).' example: '2025-01-1508:00:00' required: true schema: type: string - in: path name: id description: 'The vehicle object ID.' example: ABC123 required: true schema: type: string '/api/drivers/{start}/{stop}': get: summary: 'List all driver assignments (Export API)' operationId: listAllDriverAssignmentsExportAPI description: 'Returns driver-vehicle assignments for all vehicles within a date range. The maximum period is 7 days.' parameters: [] responses: 200: description: Success content: application/json: schema: type: array items: type: object properties: objectID: type: string example: ABC123 startUse: type: string example: '2025-01-15 08:00:00' stopUse: type: string example: '2025-01-15 17:00:00' name: type: string example: 'John Doe' example: - objectID: ABC123 startUse: '2025-01-15 08:00:00' stopUse: '2025-01-15 17:00:00' name: 'John Doe' 400: description: 'Period too long' content: application/json: schema: type: object example: error: 'Ordered period should not exceed 7 days' properties: error: type: string example: 'Ordered period should not exceed 7 days' tags: - 'Export API' parameters: - in: path name: start description: 'Start date in Y-m-dH:i:s format (no space).' example: '2025-01-1508:00:00' required: true schema: type: string - in: path name: stop description: 'Stop date in Y-m-dH:i:s format (no space).' example: '2025-01-1517:00:00' required: true schema: type: string '/api/drivers/{start}/{stop}/{id}': get: summary: 'Show driver assignments by vehicle (Export API)' operationId: showDriverAssignmentsByVehicleExportAPI description: 'Returns driver-vehicle assignments for a specific vehicle within a date range. The maximum period is 7 days.' parameters: [] responses: 200: description: Success content: application/json: schema: type: array items: type: object properties: objectID: type: string example: ABC123 startUse: type: string example: '2025-01-15 08:00:00' stopUse: type: string example: '2025-01-15 17:00:00' name: type: string example: 'John Doe' example: - objectID: ABC123 startUse: '2025-01-15 08:00:00' stopUse: '2025-01-15 17:00:00' name: 'John Doe' 400: description: 'Period too long' content: application/json: schema: type: object example: error: 'Ordered period should not exceed 7 days' properties: error: type: string example: 'Ordered period should not exceed 7 days' 404: description: 'Not found' content: application/json: schema: type: object example: error: Vehicle_Not_Found properties: error: type: string example: Vehicle_Not_Found tags: - 'Export API' parameters: - in: path name: start description: 'Start date in Y-m-dH:i:s format (no space).' example: '2025-01-1508:00:00' required: true schema: type: string - in: path name: stop description: 'Stop date in Y-m-dH:i:s format (no space).' example: '2025-01-1517:00:00' required: true schema: type: string - in: path name: id description: 'The vehicle object ID.' example: ABC123 required: true schema: type: string /api/stockdata: get: summary: 'List all stock data (Export API)' operationId: listAllStockDataExportAPI description: "Returns the latest stock data for all vehicles accessible by the authenticated user.\nIncludes tank and customer mapping information." parameters: [] responses: 200: description: Success content: application/json: schema: type: array items: type: object properties: ID: type: integer example: 1 objectID: type: string example: ABC123 alias: type: string example: 'Tank 1' Xpos: type: string example: '24.75' Ypos: type: string example: '59.43' Counter1: type: number example: 50.5 Counter2: type: integer example: 0 GMTime: type: string example: '2025-01-15 14:30:00' Speed: type: integer example: 0 Heading: type: integer example: 180 Input: type: integer example: 0 LastCommunicationLocalTime: type: string example: '2025-01-15 16:30:00' Content: type: string example: '' Power: type: number example: 12.5 BatLevel: type: number example: 4.2 NoGPSFix: type: integer example: 0 t1: type: integer example: 0 t2: type: integer example: 0 t3: type: integer example: 0 t4: type: integer example: 0 Counter: type: integer example: 1475 GroupID: type: integer example: 1 GroupName: type: string example: Tanks Odo: type: integer example: 0 MotoHrs: type: integer example: 0 status: type: string example: null nullable: true CustomerID: type: string example: CUST001 TankNr: type: string example: T-100 next_refill_time: type: string example: '2025-01-20 08:00:00' tank_vol: type: integer example: 5000 example: - ID: 1 objectID: ABC123 alias: 'Tank 1' Xpos: '24.75' Ypos: '59.43' Counter1: 50.5 Counter2: 0 GMTime: '2025-01-15 14:30:00' Speed: 0 Heading: 180 Input: 0 LastCommunicationLocalTime: '2025-01-15 16:30:00' Content: '' Power: 12.5 BatLevel: 4.2 NoGPSFix: 0 t1: 0 t2: 0 t3: 0 t4: 0 Counter: 1475 GroupID: 1 GroupName: Tanks Odo: 0 MotoHrs: 0 status: null CustomerID: CUST001 TankNr: T-100 next_refill_time: '2025-01-20 08:00:00' tank_vol: 5000 tags: - 'Export API' '/api/stockdata/{id}': get: summary: 'Show stock data by vehicle (Export API)' operationId: showStockDataByVehicleExportAPI description: 'Returns the latest stock data for a specific vehicle.' parameters: [] responses: 200: description: Success content: application/json: schema: type: object example: ID: 1 objectID: ABC123 alias: 'Tank 1' Xpos: '24.75' Ypos: '59.43' Counter1: 50.5 Counter2: 0 GMTime: '2025-01-15 14:30:00' Speed: 0 Heading: 180 Input: 0 LastCommunicationLocalTime: '2025-01-15 16:30:00' Content: '' Power: 12.5 BatLevel: 4.2 NoGPSFix: 0 t1: 0 t2: 0 t3: 0 t4: 0 Counter: 1475 GroupID: 1 GroupName: Tanks Odo: 0 MotoHrs: 0 status: null CustomerID: CUST001 TankNr: T-100 next_refill_time: '2025-01-20 08:00:00' tank_vol: 5000 properties: ID: type: integer example: 1 objectID: type: string example: ABC123 alias: type: string example: 'Tank 1' Xpos: type: string example: '24.75' Ypos: type: string example: '59.43' Counter1: type: number example: 50.5 Counter2: type: integer example: 0 GMTime: type: string example: '2025-01-15 14:30:00' Speed: type: integer example: 0 Heading: type: integer example: 180 Input: type: integer example: 0 LastCommunicationLocalTime: type: string example: '2025-01-15 16:30:00' Content: type: string example: '' Power: type: number example: 12.5 BatLevel: type: number example: 4.2 NoGPSFix: type: integer example: 0 t1: type: integer example: 0 t2: type: integer example: 0 t3: type: integer example: 0 t4: type: integer example: 0 Counter: type: integer example: 1475 GroupID: type: integer example: 1 GroupName: type: string example: Tanks Odo: type: integer example: 0 MotoHrs: type: integer example: 0 status: type: string example: null nullable: true CustomerID: type: string example: CUST001 TankNr: type: string example: T-100 next_refill_time: type: string example: '2025-01-20 08:00:00' tank_vol: type: integer example: 5000 404: description: 'Not found' content: application/json: schema: type: object example: error: Vehicle_Not_Found properties: error: type: string example: Vehicle_Not_Found tags: - 'Export API' parameters: - in: path name: id description: 'The vehicle object ID.' example: ABC123 required: true schema: type: string /api/files: get: summary: 'Get all files for a pivot' operationId: getAllFilesForAPivot description: '' parameters: - in: query name: pivot_type description: 'The entity type' example: route_tasks required: true schema: type: string description: 'The entity type' example: route_tasks - in: query name: pivot_id description: 'The entity ID' example: '12345' required: true schema: type: string description: 'The entity ID' example: '12345' responses: 200: description: '' content: application/json: schema: type: array items: type: object properties: id: type: integer example: 1 pivot_id: type: string example: '12345' pivot_type: type: string example: route_tasks defined_name: type: string example: document.pdf mime: type: string example: application/pdf file_type: type: string example: other uploaded_at: type: string example: '2025-11-28T10:00:00.000000Z' url: type: string example: 'https://api.example.com/cli_img/metrotec_12345_abc123.pdf' example: - id: 1 pivot_id: '12345' pivot_type: route_tasks defined_name: document.pdf mime: application/pdf file_type: other uploaded_at: '2025-11-28T10:00:00.000000Z' url: 'https://api.example.com/cli_img/metrotec_12345_abc123.pdf' tags: - Files post: summary: 'Upload a new file' operationId: uploadANewFile description: '' parameters: [] responses: 201: description: '' content: application/json: schema: type: object example: id: 1 pivot_id: '12345' pivot_type: route_tasks defined_name: document.pdf mime: application/pdf file_type: other uploaded_at: '2025-11-28T10:00:00.000000Z' url: 'https://api.example.com/cli_img/metrotec_12345_abc123.pdf' properties: id: type: integer example: 1 pivot_id: type: string example: '12345' pivot_type: type: string example: route_tasks defined_name: type: string example: document.pdf mime: type: string example: application/pdf file_type: type: string example: other uploaded_at: type: string example: '2025-11-28T10:00:00.000000Z' url: type: string example: 'https://api.example.com/cli_img/metrotec_12345_abc123.pdf' tags: - Files requestBody: required: true content: multipart/form-data: schema: type: object properties: file: type: string format: binary description: 'The file to upload. Must be a file.' pivot_type: type: string description: 'Type of entity the file belongs to.' example: route_tasks enum: - accounts - logos - route_tasks - vehicle_faults - feedback_answers - tech_card_works - signatures - fish_documents - fish_document_signatures pivot_id: type: string description: 'ID of the entity the file belongs to. Väli value ei tohi olla pikem kui 255 tähemärki.' example: '12345' max_files: type: integer description: 'Maximum number of files allowed for this entity. Väli value peab olema vähemalt 1.' example: 5 nullable: true hidden: type: boolean description: 'Whether the file should be hidden.' example: false nullable: true file_type: type: string description: 'Type of file (image, cmr, delivery_note, etc.).' example: image enum: - image - cmr - cmr_template - delivery_note - order - other - receiver_signature - sender_signature - carrier_signature - fish_document nullable: true auto_crop: type: boolean description: 'Automatically crop whitespace from images.' example: false nullable: true auto_type: type: string description: 'Convert image to specified format.' example: webp enum: - jpg - gif - png - webp nullable: true required: - file - pivot_type - pivot_id '/api/files/{id}': get: summary: 'Get a specific file' operationId: getASpecificFile description: '' parameters: [] responses: 200: description: '' content: application/json: schema: type: object example: id: 1 pivot_id: '12345' pivot_type: route_tasks defined_name: document.pdf mime: application/pdf file_type: other uploaded_at: '2025-11-28T10:00:00.000000Z' url: 'https://api.example.com/cli_img/metrotec_12345_abc123.pdf' properties: id: type: integer example: 1 pivot_id: type: string example: '12345' pivot_type: type: string example: route_tasks defined_name: type: string example: document.pdf mime: type: string example: application/pdf file_type: type: string example: other uploaded_at: type: string example: '2025-11-28T10:00:00.000000Z' url: type: string example: 'https://api.example.com/cli_img/metrotec_12345_abc123.pdf' tags: - Files put: summary: 'Update a file' operationId: updateAFile description: '' parameters: [] responses: 200: description: '' content: application/json: schema: type: object example: id: 1 pivot_id: '12345' pivot_type: route_tasks defined_name: document.pdf mime: application/pdf file_type: cmr uploaded_at: '2025-11-28T10:00:00.000000Z' url: 'https://api.example.com/cli_img/metrotec_12345_abc123.pdf' properties: id: type: integer example: 1 pivot_id: type: string example: '12345' pivot_type: type: string example: route_tasks defined_name: type: string example: document.pdf mime: type: string example: application/pdf file_type: type: string example: cmr uploaded_at: type: string example: '2025-11-28T10:00:00.000000Z' url: type: string example: 'https://api.example.com/cli_img/metrotec_12345_abc123.pdf' tags: - Files requestBody: required: true content: application/json: schema: type: object properties: file_type: type: string description: 'Type of file (image, cmr, delivery_note, etc.).' example: cmr enum: - image - cmr - cmr_template - delivery_note - order - other - receiver_signature - sender_signature - carrier_signature - fish_document required: - file_type delete: summary: 'Delete a file' operationId: deleteAFile description: '' parameters: [] responses: 204: description: success content: text/plain: schema: type: string example: '' tags: - Files parameters: - in: path name: id description: 'The ID of the file.' example: 1 required: true schema: type: integer - in: path name: file description: 'File ID' example: 1 required: true schema: type: integer '/api/drawing/{file_id}': post: summary: 'Add a drawing overlay to an existing image' operationId: addADrawingOverlayToAnExistingImage description: "Takes an existing image file and overlays a PNG drawing on top of it.\nThe original file is replaced with the new combined image." parameters: [] responses: 201: description: '' content: application/json: schema: type: object example: id: 1 pivot_id: '12345' pivot_type: route_tasks defined_name: photo.png mime: image/png file_type: image uploaded_at: '2025-11-28T10:00:00.000000Z' url: 'https://api.example.com/cli_img/metrotec_12345_abc123.png' properties: id: type: integer example: 1 pivot_id: type: string example: '12345' pivot_type: type: string example: route_tasks defined_name: type: string example: photo.png mime: type: string example: image/png file_type: type: string example: image uploaded_at: type: string example: '2025-11-28T10:00:00.000000Z' url: type: string example: 'https://api.example.com/cli_img/metrotec_12345_abc123.png' tags: - Files requestBody: required: true content: multipart/form-data: schema: type: object properties: file: type: string format: binary description: 'The PNG overlay image with transparency. Must be a file. Väli value peab olema pilt.' required: - file parameters: - in: path name: file_id description: 'The ID of the file.' example: 1 required: true schema: type: integer - in: path name: file description: 'The file ID' example: 1 required: true schema: type: integer /api/signature: post: summary: 'Upload signature for route tasks' operationId: uploadSignatureForRouteTasks description: 'Uploads a signature image and associates it with one or more route tasks.' parameters: [] responses: 201: description: '' content: application/json: schema: type: array items: type: object properties: id: type: integer example: 1 pivot_id: type: string example: '12345' pivot_type: type: string example: signatures defined_name: type: string example: signature.png mime: type: string example: image/png file_type: type: string example: receiver_signature uploaded_at: type: string example: '2025-11-28T10:00:00.000000Z' url: type: string example: 'https://api.example.com/signatures/metrotec_12345_abc123.png' example: - id: 1 pivot_id: '12345' pivot_type: signatures defined_name: signature.png mime: image/png file_type: receiver_signature uploaded_at: '2025-11-28T10:00:00.000000Z' url: 'https://api.example.com/signatures/metrotec_12345_abc123.png' tags: - Files requestBody: required: true content: multipart/form-data: schema: type: object properties: signature: type: string format: binary description: 'The signature image file. Must be a file. Väli value peab olema pilt.' ids: type: array description: '' example: - 16 items: type: integer pivot_type: type: string description: 'Type of pivot for signature storage.' example: signatures enum: - signatures - fish_document_signatures file_type: type: string description: 'Type of signature.' example: receiver_signature enum: - receiver_signature - sender_signature - carrier_signature nullable: true required: - signature - ids /api/geozones: get: summary: 'List geo zones' operationId: listGeoZones description: 'Returns all geo zones with their objects.' parameters: [] responses: 200: description: Success content: text/plain: schema: type: string example: '{"data": [{"id": 1, "name": "Zone A", "geometry": {...}, "zObjects": []}]}' tags: - 'Geo Zones' post: summary: 'Create geo zone' operationId: createGeoZone description: 'Creates a new geo zone.' parameters: [] responses: 201: description: Success content: application/json: schema: type: object example: data: id: 1 name: 'Zone A' properties: data: type: object properties: id: type: integer example: 1 name: type: string example: 'Zone A' tags: - 'Geo Zones' requestBody: required: true content: application/json: schema: type: object properties: geometry: type: object description: 'GeoJSON geometry object.' example: type: Polygon coordinates: - - - 24.7 - 59.4 - - 24.8 - 59.4 - - 24.8 - 59.5 - - 24.7 - 59.5 - - 24.7 - 59.4 properties: type: type: string description: '' example: Polygon enum: - circle - Polygon coordinates: type: object description: 'This field is required when geometry.type is Polygon.' example: null properties: { } latlng: type: object description: 'This field is required when geometry.type is circle.' example: null properties: { } radius: type: number description: 'This field is required when geometry.type is circle.' example: 4326.41688 required: - type name: type: string description: 'Geozone name. Väli value ei tohi olla pikem kui 255 tähemärki.' example: 'Warehouse Zone' cAlarmState: type: boolean description: 'Enable count alarm.' example: false nullable: true countAlarm: type: integer description: 'Minimum count for alarm (min 2). Väli value peab olema vähemalt 2.' example: 2 nullable: true zObjects: type: array description: '' example: - architecto items: type: string required: - geometry - name '/api/geozones/{id}': get: summary: 'Get geo zone' operationId: getGeoZone description: 'Returns a single geo zone with full details.' parameters: [] responses: 200: description: Success content: text/plain: schema: type: string example: '{"data": {"id": 1, "name": "Zone A", "geometry": {...}, "zObjects": [], "cAlarmState": false}}' 404: description: '' content: application/json: schema: type: object example: message: noGeozoneError properties: message: type: string example: noGeozoneError tags: - 'Geo Zones' put: summary: 'Update geo zone' operationId: updateGeoZone description: 'Updates an existing geo zone.' parameters: [] responses: 200: description: Success content: application/json: schema: type: object example: message: Updated properties: message: type: string example: Updated 404: description: '' content: application/json: schema: type: object example: message: noGeozoneError properties: message: type: string example: noGeozoneError tags: - 'Geo Zones' requestBody: required: false content: application/json: schema: type: object properties: geometry: type: object description: 'GeoJSON geometry object.' example: type: Polygon coordinates: - - - 24.7 - 59.4 - - 24.8 - 59.4 - - 24.8 - 59.5 - - 24.7 - 59.5 - - 24.7 - 59.4 properties: type: type: string description: 'This field is required when geometry is present.' example: circle enum: - circle - Polygon coordinates: type: object description: 'This field is required when geometry.type is Polygon.' example: null properties: { } latlng: type: object description: 'This field is required when geometry.type is circle.' example: null properties: { } radius: type: number description: 'This field is required when geometry.type is circle.' example: 4326.41688 nullable: true name: type: string description: 'Geozone name. Väli value ei tohi olla pikem kui 255 tähemärki.' example: 'Warehouse Zone' nullable: true cAlarmState: type: boolean description: 'Enable count alarm.' example: false nullable: true countAlarm: type: integer description: 'Minimum count for alarm (min 2). Väli value peab olema vähemalt 2.' example: 2 nullable: true zObjects: type: array description: '' example: - architecto items: type: string delete: summary: 'Delete geo zone' operationId: deleteGeoZone description: 'Deletes a geo zone.' parameters: [] responses: 200: description: Success content: application/json: schema: type: object example: message: Deleted properties: message: type: string example: Deleted 404: description: '' content: application/json: schema: type: object example: message: noGeozoneError properties: message: type: string example: noGeozoneError tags: - 'Geo Zones' parameters: - in: path name: id description: 'The ID of the geozone.' example: architecto required: true schema: type: string /api/geotoobject: get: summary: 'List geo zone object assignments' operationId: listGeoZoneObjectAssignments description: 'Returns all object assignments to geo zones.' parameters: [] responses: 200: description: Success content: application/json: schema: type: object example: data: - id: 1 geozoneID: 1 object_id: '123' geo_id: 5 properties: data: type: array example: - id: 1 geozoneID: 1 object_id: '123' geo_id: 5 items: type: object properties: id: type: integer example: 1 geozoneID: type: integer example: 1 object_id: type: string example: '123' geo_id: type: integer example: 5 tags: - 'Geo Zones' post: summary: 'Assign object to geo zone' operationId: assignObjectToGeoZone description: 'Creates a new object-to-geozone assignment.' parameters: [] responses: 201: description: Success content: application/json: schema: type: object example: data: id: 1 geozoneID: 1 object_id: '123' properties: data: type: object properties: id: type: integer example: 1 geozoneID: type: integer example: 1 object_id: type: string example: '123' 400: description: '' content: application/json: schema: oneOf: - description: '' type: object example: message: GeoToObject_Exists properties: message: type: string example: GeoToObject_Exists - description: '' type: object example: message: No_Device_Class properties: message: type: string example: No_Device_Class tags: - 'Geo Zones' requestBody: required: true content: application/json: schema: type: object properties: object_id: type: string description: 'Object/vehicle ID to assign to geozone.' example: '123' geozoneID: type: integer description: 'Geozone ID.' example: 1 required: - object_id - geozoneID '/api/geotoobject/{id}': delete: summary: 'Remove object from geo zone' operationId: removeObjectFromGeoZone description: 'Deletes an object-to-geozone assignment.' parameters: [] responses: 200: description: Success content: application/json: schema: type: object example: message: Deleted properties: message: type: string example: Deleted 400: description: '' content: application/json: schema: type: object example: message: No_Device_Class properties: message: type: string example: No_Device_Class 404: description: '' content: application/json: schema: type: object example: message: Not_Found properties: message: type: string example: Not_Found tags: - 'Geo Zones' parameters: - in: path name: id description: 'The ID of the geotoobject.' example: architecto required: true schema: type: string /api/inputs: get: summary: 'List all inputs' operationId: listAllInputs description: 'Returns all input names grouped by vehicle object ID.' parameters: [] responses: 200: description: Success content: application/json: schema: type: array items: type: object properties: id: type: string example: ABC123 inputs: type: array example: - id: 1 nr: 1 name: Ignition color: '#FF0000' items: type: object properties: id: type: integer example: 1 nr: type: integer example: 1 name: type: string example: Ignition color: type: string example: '#FF0000' example: - id: ABC123 inputs: - id: 1 nr: 1 name: Ignition color: '#FF0000' tags: - Inputs '/api/inputs/{obj}': get: summary: 'Show inputs for a vehicle' operationId: showInputsForAVehicle description: 'Returns all input names for a specific vehicle.' parameters: [] responses: 200: description: Success content: application/json: schema: type: array items: type: object properties: id: type: integer example: 1 nr: type: integer example: 1 name: type: string example: Ignition color: type: string example: '#FF0000' object_id: type: string example: ABC123 example: - id: 1 nr: 1 name: Ignition color: '#FF0000' object_id: ABC123 tags: - Inputs post: summary: 'Create input' operationId: createInput description: 'Creates a new input name for a vehicle. The input number must be unique per vehicle.' parameters: [] responses: 201: description: Success content: application/json: schema: type: object example: id: 5 nr: 1 name: Ignition color: '#FF0000' object_id: ABC123 properties: id: type: integer example: 5 nr: type: integer example: 1 name: type: string example: Ignition color: type: string example: '#FF0000' object_id: type: string example: ABC123 400: description: 'Duplicate nr' content: application/json: schema: type: object example: message: Not_Unique_Input_Nr properties: message: type: string example: Not_Unique_Input_Nr 403: description: Forbidden content: application/json: schema: type: object example: message: ObjectNotAllowed properties: message: type: string example: ObjectNotAllowed tags: - Inputs requestBody: required: true content: application/json: schema: type: object properties: nr: type: integer description: 'Input number (1-19). Väli value peab olema vahemikus 1 kuni 19.' example: 1 name: type: string description: 'Input name.' example: Ignition color: type: string description: 'Hex RGB color code. Must match the regex /^#?[0-9A-Fa-f]{6}$/.' example: '#FF0000' required: - nr - name - color parameters: - in: path name: obj description: 'The vehicle object ID.' example: ABC123 required: true schema: type: string '/api/inputs/{obj}/{id}': put: summary: 'Update input' operationId: updateInput description: 'Updates an existing input name. Input number must remain unique per vehicle.' parameters: [] responses: 200: description: Success content: application/json: schema: type: object example: id: 5 nr: 1 name: 'Ignition On' color: '#00FF00' object_id: ABC123 properties: id: type: integer example: 5 nr: type: integer example: 1 name: type: string example: 'Ignition On' color: type: string example: '#00FF00' object_id: type: string example: ABC123 400: description: 'Duplicate nr' content: application/json: schema: type: object example: message: Not_Unique_Input_Nr properties: message: type: string example: Not_Unique_Input_Nr 403: description: Forbidden content: application/json: schema: type: object example: message: ObjectNotAllowed properties: message: type: string example: ObjectNotAllowed 404: description: 'Not found' content: application/json: schema: type: object example: message: Not_Found properties: message: type: string example: Not_Found tags: - Inputs requestBody: required: false content: application/json: schema: type: object properties: nr: type: integer description: 'Input number (1-19). Väli value peab olema vahemikus 1 kuni 19.' example: 1 name: type: string description: 'Input name.' example: Ignition color: type: string description: 'Hex RGB color code. Must match the regex /^#?[0-9A-Fa-f]{6}$/.' example: '#FF0000' delete: summary: 'Delete input' operationId: deleteInput description: 'Deletes an input name record.' parameters: [] responses: 200: description: Success content: application/json: schema: type: object example: message: Deleted properties: message: type: string example: Deleted 403: description: Forbidden content: application/json: schema: type: object example: message: ObjectNotAllowed properties: message: type: string example: ObjectNotAllowed 404: description: 'Not found' content: application/json: schema: type: object example: message: Not_Found properties: message: type: string example: Not_Found tags: - Inputs parameters: - in: path name: obj description: 'The vehicle object ID.' example: ABC123 required: true schema: type: string - in: path name: id description: 'The input record ID.' example: 5 required: true schema: type: integer '/api/inputs/{id}': delete: summary: 'Delete all inputs for a vehicle' operationId: deleteAllInputsForAVehicle description: 'Removes all input name records for a specific vehicle.' parameters: [] responses: 204: description: Success content: text/plain: schema: type: string example: '' 403: description: Forbidden content: application/json: schema: type: object example: message: ObjectNotAllowed properties: message: type: string example: ObjectNotAllowed tags: - Inputs parameters: - in: path name: id description: 'The vehicle object ID.' example: ABC123 required: true schema: type: string /api/input-settings: get: summary: 'List all input settings' operationId: listAllInputSettings description: 'Returns all input name records across all vehicles.' parameters: [] responses: 200: description: Success content: application/json: schema: type: array items: type: object properties: id: type: integer example: 1 nr: type: integer example: 1 name: type: string example: Ignition color: type: string example: '#FF0000' object_id: type: string example: ABC123 example: - id: 1 nr: 1 name: Ignition color: '#FF0000' object_id: ABC123 tags: - Inputs post: summary: 'Create input setting' operationId: createInputSetting description: 'Creates a new input name record. The input number must be unique per vehicle.' parameters: [] responses: 201: description: Success content: application/json: schema: type: object example: id: 5 nr: 1 name: Ignition color: '#FF0000' object_id: ABC123 properties: id: type: integer example: 5 nr: type: integer example: 1 name: type: string example: Ignition color: type: string example: '#FF0000' object_id: type: string example: ABC123 400: description: 'Duplicate nr' content: application/json: schema: type: object example: message: Not_Unique_Input_Nr properties: message: type: string example: Not_Unique_Input_Nr 403: description: Forbidden content: application/json: schema: type: object example: message: ObjectNotAllowed properties: message: type: string example: ObjectNotAllowed tags: - Inputs requestBody: required: true content: application/json: schema: type: object properties: nr: type: integer description: 'Input number (1-19). Väli value peab olema vahemikus 1 kuni 19.' example: 1 name: type: string description: 'Input name.' example: Ignition color: type: string description: 'Hex RGB color code. Must match the regex /^#?[0-9A-Fa-f]{6}$/.' example: '#FF0000' object_id: type: string description: 'Vehicle object ID to assign the input to. Must contain only letters, numbers, dashes and underscores. Väli value ei tohi olla pikem kui 15 tähemärki.' example: ABC123 required: - nr - name - color - object_id '/api/input-settings/{id}': get: summary: 'Show input setting' operationId: showInputSetting description: 'Returns a single input name record by its ID.' parameters: [] responses: 200: description: Success content: application/json: schema: type: object example: id: 5 nr: 1 name: Ignition color: '#FF0000' object_id: ABC123 properties: id: type: integer example: 5 nr: type: integer example: 1 name: type: string example: Ignition color: type: string example: '#FF0000' object_id: type: string example: ABC123 404: description: 'Not found' content: application/json: schema: type: object example: message: Not_Found properties: message: type: string example: Not_Found tags: - Inputs put: summary: 'Update input setting' operationId: updateInputSetting description: 'Updates an existing input name record. The input number must remain unique per vehicle.' parameters: [] responses: 200: description: Success content: application/json: schema: type: object example: id: 5 nr: 1 name: 'Ignition On' color: '#00FF00' object_id: ABC123 properties: id: type: integer example: 5 nr: type: integer example: 1 name: type: string example: 'Ignition On' color: type: string example: '#00FF00' object_id: type: string example: ABC123 400: description: 'Duplicate nr' content: application/json: schema: type: object example: message: Not_Unique_Input_Nr properties: message: type: string example: Not_Unique_Input_Nr 403: description: Forbidden content: application/json: schema: type: object example: message: ObjectNotAllowed properties: message: type: string example: ObjectNotAllowed 404: description: 'Not found' content: application/json: schema: type: object example: message: Not_Found properties: message: type: string example: Not_Found tags: - Inputs requestBody: required: false content: application/json: schema: type: object properties: nr: type: integer description: 'Input number (1-19). Väli value peab olema vahemikus 1 kuni 19.' example: 1 name: type: string description: 'Input name.' example: Ignition color: type: string description: 'Hex RGB color code. Must match the regex /^#?[0-9A-Fa-f]{6}$/.' example: '#FF0000' object_id: type: string description: 'Vehicle object ID to assign the input to. Must contain only letters, numbers, dashes and underscores. Väli value ei tohi olla pikem kui 15 tähemärki.' example: ABC123 delete: summary: 'Delete input setting' operationId: deleteInputSetting description: 'Deletes an input name record.' parameters: [] responses: 200: description: Success content: application/json: schema: type: object example: message: Deleted properties: message: type: string example: Deleted 404: description: 'Not found' content: application/json: schema: type: object example: message: Not_Found properties: message: type: string example: Not_Found tags: - Inputs parameters: - in: path name: id description: 'The input record ID.' example: 5 required: true schema: type: integer /api/temperature: get: summary: 'List all temperature settings' operationId: listAllTemperatureSettings description: 'Returns temperature name records for all vehicles.' parameters: [] responses: 200: description: Success content: application/json: schema: type: array items: type: object properties: id: type: string example: ABC123 temperatures: type: array example: - temp_key: t1 name: Fridge color: '#FF0000' items: type: object properties: temp_key: type: string example: t1 name: type: string example: Fridge color: type: string example: '#FF0000' category_name: type: string example: Trucks example: - id: ABC123 temperatures: - temp_key: t1 name: Fridge color: '#FF0000' category_name: Trucks tags: - Inputs '/api/temperature/{id}': get: summary: 'Show temperature setting' operationId: showTemperatureSetting description: 'Returns a single temperature name record by vehicle object ID.' parameters: [] responses: 200: description: Success content: application/json: schema: type: object example: id: ABC123 temperatures: - temp_key: t1 name: Fridge color: '#FF0000' properties: id: type: string example: ABC123 temperatures: type: array example: - temp_key: t1 name: Fridge color: '#FF0000' items: type: object properties: temp_key: type: string example: t1 name: type: string example: Fridge color: type: string example: '#FF0000' 204: description: 'Not found' content: application/json: schema: type: string example: '' tags: - Inputs put: summary: 'Upsert temperature setting' operationId: upsertTemperatureSetting description: 'Creates or updates temperature names for a vehicle. If a record exists for the given vehicle, it is updated; otherwise a new record is created.' parameters: [] responses: 200: description: Success content: application/json: schema: type: object example: id: ABC123 temperatures: - temp_key: t1 name: Fridge color: '#FF0000' properties: id: type: string example: ABC123 temperatures: type: array example: - temp_key: t1 name: Fridge color: '#FF0000' items: type: object properties: temp_key: type: string example: t1 name: type: string example: Fridge color: type: string example: '#FF0000' 403: description: Forbidden content: application/json: schema: type: object example: message: ObjectNotAllowed properties: message: type: string example: ObjectNotAllowed tags: - Inputs requestBody: required: false content: application/json: schema: type: object properties: temperatures: type: array description: 'Array of temperature sensor configurations.' example: - temp_key: t1 name: Fridge color: '#FF0000' items: type: object properties: temp_key: type: string description: 'Temperature key (t1, t2, t3, or t4).' example: t1 enum: - t1 - t2 - t3 - t4 name: type: string description: 'Sensor display name.' example: Fridge color: type: string description: 'Hex RGB color code. Must match the regex /^#?[0-9A-Fa-f]{6}$/.' example: '#FF0000' delete: summary: 'Delete temperature setting' operationId: deleteTemperatureSetting description: 'Removes temperature names for a vehicle.' parameters: [] responses: 200: description: Success content: application/json: schema: type: object example: message: Deleted properties: message: type: string example: Deleted 403: description: Forbidden content: application/json: schema: type: object example: message: ObjectNotAllowed properties: message: type: string example: ObjectNotAllowed 404: description: 'Not found' content: application/json: schema: type: object example: message: Not_Found properties: message: type: string example: Not_Found tags: - Inputs parameters: - in: path name: id description: 'The vehicle object ID.' example: ABC123 required: true schema: type: string /api/invoice: get: summary: 'Get invoices' operationId: getInvoices description: "Returns invoices filtered by date range and other criteria.\nUnpaid invoices are always included regardless of date filter." parameters: - in: query name: 'datetime[]' description: 'Date range [from, to]' example: '["2025-01-01", "2025-01-31"]' required: true schema: type: string description: 'Date range [from, to]' example: '["2025-01-01", "2025-01-31"]' - in: query name: oid description: 'Filter by organization ID' example: metrotec required: false schema: type: string description: 'Filter by organization ID' example: metrotec - in: query name: manager description: 'Filter by manager' example: admin required: false schema: type: string description: 'Filter by manager' example: admin - in: query name: paid description: 'Filter unpaid only (must be 0)' example: 0 required: false schema: type: integer description: 'Filter unpaid only (must be 0)' example: 0 - in: query name: offset description: 'Pagination offset (-1 for all)' example: 0 required: false schema: type: integer description: 'Pagination offset (-1 for all)' example: 0 responses: 200: description: '' content: application/json: schema: type: object example: data: - id: 1 inv_date: '2025-01-15 00:00:00' payment_date: '2025-02-15 00:00:00' inv_sum: 150.5 paid: 0 name: 'Manager Name' comments: 'Monthly invoice' manager: admin oid: metrotec inv_name: 'Company Name' paidD: unpaid properties: data: type: array example: - id: 1 inv_date: '2025-01-15 00:00:00' payment_date: '2025-02-15 00:00:00' inv_sum: 150.5 paid: 0 name: 'Manager Name' comments: 'Monthly invoice' manager: admin oid: metrotec inv_name: 'Company Name' paidD: unpaid items: type: object properties: id: type: integer example: 1 inv_date: type: string example: '2025-01-15 00:00:00' payment_date: type: string example: '2025-02-15 00:00:00' inv_sum: type: number example: 150.5 paid: type: integer example: 0 name: type: string example: 'Manager Name' comments: type: string example: 'Monthly invoice' manager: type: string example: admin oid: type: string example: metrotec inv_name: type: string example: 'Company Name' paidD: type: string example: unpaid tags: - Invoices requestBody: required: true content: application/json: schema: type: object properties: datetime: type: object description: 'Date range [from, to]. Väljal value peab olema 2 elementi.' example: - '2025-01-01' - '2025-01-31' properties: - type: string description: 'Väli value peab olema kehtiv kuupäev.' example: '2025-01-01' - type: string description: 'Väli value peab olema kehtiv kuupäev.' example: '2025-01-31' required: - 0 - 1 oid: type: string description: 'Filter by organization ID. Väli value ei tohi olla pikem kui 255 tähemärki.' example: metrotec nullable: true manager: type: string description: 'Filter by manager. Väli value ei tohi olla pikem kui 255 tähemärki.' example: admin nullable: true paid: type: string description: 'Filter unpaid invoices only (value must be 0).' example: 0 enum: - 0 nullable: true offset: type: integer description: 'Pagination offset (-1 for all results). Väli value peab olema vähemalt -1.' example: 0 nullable: true required: - datetime '/api/invoice/{id}': get: summary: 'Download invoice PDF' operationId: downloadInvoicePDF description: 'Returns the invoice PDF file for download.' parameters: [] responses: 200: description: Success content: text/plain: schema: type: string example: 'Binary PDF content' 404: description: '' content: application/json: schema: type: object example: message: 'Not Found' properties: message: type: string example: 'Not Found' tags: - Invoices parameters: - in: path name: id description: 'The invoice number.' example: 123 required: true schema: type: integer '/api/sendlocation/{type}/{id}': post: summary: 'Send location via SMS' operationId: sendLocationViaSMS description: 'Sends a Google Maps location link via SMS for either a vehicle or a POI.' parameters: [] responses: 200: description: Success content: application/json: schema: type: object example: ok: 1 properties: ok: type: integer example: 1 404: description: 'Not found' content: application/json: schema: type: object example: error: Not_Found properties: error: type: string example: Not_Found tags: - 'Last Data' requestBody: required: true content: application/json: schema: type: object properties: country_code: type: string description: 'The country calling code (e.g. +370).' example: '+370' phone_nr: type: string description: 'The phone number (digits only). Must match the regex /^\d+$/.' example: '61234567' required: - country_code - phone_nr parameters: - in: path name: type description: 'The location type. Must be "poi" or "vehicle".' example: vehicle required: true schema: type: string - in: path name: id description: 'The vehicle object ID or POI ID.' example: ABC123 required: true schema: type: string /api/lastdataprofile: get: summary: 'List all profiles' operationId: listAllProfiles description: 'Returns all last data profiles, filtered optionally by organization ID.' parameters: - in: query name: oid description: 'Filter by organization ID.' example: org123 required: false schema: type: string description: 'Filter by organization ID.' example: org123 nullable: true responses: 200: description: Success content: application/json: schema: type: array items: type: object properties: id: type: integer example: 1 oid: type: string example: org123 mainFields: type: array example: - 1 - 2 items: type: integer hasMore: type: integer example: 1 is_hybrid_view: type: integer example: 0 main_table: type: array example: - 3 - 4 items: type: integer extended_table: type: array example: - 5 - 6 items: type: integer example: - id: 1 oid: org123 mainFields: - 1 - 2 hasMore: 1 is_hybrid_view: 0 main_table: - 3 - 4 extended_table: - 5 - 6 tags: - 'Last Data' post: summary: 'Create a profile' operationId: createAProfile description: 'Creates a new last data profile. Field arrays are converted from IDs to JSON for storage.' parameters: [] responses: 201: description: Created content: application/json: schema: type: object example: id: 1 oid: org123 mainFields: - 1 - 2 hasMore: 1 is_hybrid_view: 0 main_table: - 3 - 4 extended_table: - 5 - 6 properties: id: type: integer example: 1 oid: type: string example: org123 mainFields: type: array example: - 1 - 2 items: type: integer hasMore: type: integer example: 1 is_hybrid_view: type: integer example: 0 main_table: type: array example: - 3 - 4 items: type: integer extended_table: type: array example: - 5 - 6 items: type: integer tags: - 'Last Data' requestBody: required: true content: application/json: schema: type: object properties: oid: type: string description: 'The organization ID.' example: org123 mainFields: type: object description: 'Array of main field IDs.' example: - 1 - 2 - 3 properties: { } nullable: true hasMore: type: boolean description: 'Whether the profile has more fields.' example: true nullable: true is_hybrid_view: type: boolean description: 'Whether hybrid view is enabled.' example: false nullable: true main_table: type: object description: 'Array of main table field IDs.' example: - 1 - 2 properties: { } nullable: true extended_table: type: object description: 'Array of extended table field IDs.' example: - 3 - 4 properties: { } nullable: true required: - oid '/api/lastdataprofile/{id}': get: summary: 'Show a profile' operationId: showAProfile description: 'Returns a single last data profile by ID.' parameters: [] responses: 200: description: Success content: application/json: schema: type: object example: id: 1 oid: org123 mainFields: - 1 - 2 hasMore: 1 is_hybrid_view: 0 main_table: - 3 - 4 extended_table: - 5 - 6 properties: id: type: integer example: 1 oid: type: string example: org123 mainFields: type: array example: - 1 - 2 items: type: integer hasMore: type: integer example: 1 is_hybrid_view: type: integer example: 0 main_table: type: array example: - 3 - 4 items: type: integer extended_table: type: array example: - 5 - 6 items: type: integer 404: description: 'Not found' content: application/json: schema: type: object example: error: Not_Found properties: error: type: string example: Not_Found tags: - 'Last Data' put: summary: 'Update a profile' operationId: updateAProfile description: 'Updates an existing last data profile. Field arrays are converted from IDs to JSON for storage.' parameters: [] responses: 200: description: Updated content: application/json: schema: type: object example: id: 1 oid: org123 mainFields: - 1 - 2 hasMore: 1 is_hybrid_view: 0 main_table: - 3 - 4 extended_table: - 5 - 6 properties: id: type: integer example: 1 oid: type: string example: org123 mainFields: type: array example: - 1 - 2 items: type: integer hasMore: type: integer example: 1 is_hybrid_view: type: integer example: 0 main_table: type: array example: - 3 - 4 items: type: integer extended_table: type: array example: - 5 - 6 items: type: integer 404: description: 'Not found' content: application/json: schema: type: object example: error: Not_Found properties: error: type: string example: Not_Found tags: - 'Last Data' requestBody: required: false content: application/json: schema: type: object properties: oid: type: string description: 'The organization ID.' example: org123 nullable: true mainFields: type: object description: 'Array of main field IDs.' example: - 1 - 2 - 3 properties: { } nullable: true hasMore: type: boolean description: 'Whether the profile has more fields.' example: true nullable: true is_hybrid_view: type: boolean description: 'Whether hybrid view is enabled.' example: false nullable: true main_table: type: object description: 'Array of main table field IDs.' example: - 1 - 2 properties: { } nullable: true extended_table: type: object description: 'Array of extended table field IDs.' example: - 3 - 4 properties: { } nullable: true delete: summary: 'Delete a profile' operationId: deleteAProfile description: 'Deletes a last data profile by ID.' parameters: [] responses: 200: description: Deleted content: application/json: schema: type: object example: ok: 1 properties: ok: type: integer example: 1 404: description: 'Not found' content: application/json: schema: type: object example: error: Not_Found properties: error: type: string example: Not_Found tags: - 'Last Data' parameters: - in: path name: id description: 'The profile ID.' example: 1 required: true schema: type: integer '/api/navi/{id}': get: summary: 'List navi messages' operationId: listNaviMessages description: 'Returns the last navigation messages (answers and requests) for the given vehicle.' parameters: [] responses: 200: description: Success content: application/json: schema: type: array items: type: object properties: id: type: integer example: 1 date: type: string example: '14:30:00 15.01.2025' dateRaw: type: string example: '2025-01-15 14:30:00' handled: type: string example: ok type: type: string example: a txt: type: string example: 'FMT:Hello' example: - id: 1 date: '14:30:00 15.01.2025' dateRaw: '2025-01-15 14:30:00' handled: ok type: a txt: 'FMT:Hello' 403: description: 'No access' content: application/json: schema: type: object example: error: ObjectNotAllowed properties: error: type: string example: ObjectNotAllowed tags: - Navigation parameters: - in: path name: id description: 'The vehicle object ID.' example: ABC123 required: true schema: type: string '/api/navirequest/{id}': post: summary: 'Send navi request' operationId: sendNaviRequest description: 'Sends a navigation request to a vehicle. Long messages (FMT/FMS) are split into chunks automatically.' parameters: [] responses: 200: description: Success content: application/json: schema: type: array items: type: object properties: id: type: integer example: 1 date: type: string example: '14:30:00 15.01.2025' dateRaw: type: string example: '2025-01-15 14:30:00' handled: type: integer example: 0 type: type: string example: r txt: type: string example: 'FMT:Hello from dispatch' example: - id: 1 date: '14:30:00 15.01.2025' dateRaw: '2025-01-15 14:30:00' handled: 0 type: r txt: 'FMT:Hello from dispatch' 400: description: 'Missing coordinates' content: application/json: schema: type: object example: error: Wrong_Parameters properties: error: type: string example: Wrong_Parameters 403: description: 'No access' content: application/json: schema: type: object example: error: ObjectNotAllowed properties: error: type: string example: ObjectNotAllowed tags: - Navigation requestBody: required: true content: application/json: schema: type: object properties: type: type: string description: 'The navi message type.' example: FMT enum: - FMA - FMT - FMS txt: type: string description: 'The message text.' example: 'Hello from dispatch' nullable: true x: type: number description: 'Longitude coordinate (required for FMS type).' example: 25.27956 nullable: true 'y': type: number description: 'Latitude coordinate (required for FMS type).' example: 54.68726 nullable: true required: - type parameters: - in: path name: id description: 'The vehicle object ID.' example: ABC123 required: true schema: type: string '/api/navirequests/{start}/{stop}/{id}': get: summary: 'List navi requests (Export API)' operationId: listNaviRequestsExportAPI description: 'Returns navigation requests for a vehicle within a date range. The maximum period is 7 days.' parameters: [] responses: 200: description: Success content: application/json: schema: type: array items: type: object properties: ID: type: integer example: 1 objectID: type: string example: ABC123 SerialNr: type: string example: SN001 Content: type: string example: 'FMT:Hello' handled: type: integer example: 0 LocalTime: type: string example: '2025-01-15 14:30:00' insdate: type: string example: '2025-01-15 14:30:00' example: - ID: 1 objectID: ABC123 SerialNr: SN001 Content: 'FMT:Hello' handled: 0 LocalTime: '2025-01-15 14:30:00' insdate: '2025-01-15 14:30:00' 400: description: 'Period too long' content: application/json: schema: type: object example: error: 'Ordered period should not exceed 7 days' properties: error: type: string example: 'Ordered period should not exceed 7 days' 404: description: 'No access' content: application/json: schema: type: object example: error: Vehicle_Not_Found properties: error: type: string example: Vehicle_Not_Found tags: - Navigation parameters: - in: path name: start description: 'Start date in Y-m-dH:i:s format (no space).' example: '2025-01-1508:00:00' required: true schema: type: string - in: path name: stop description: 'Stop date in Y-m-dH:i:s format (no space).' example: '2025-01-1517:00:00' required: true schema: type: string - in: path name: id description: 'The vehicle object ID.' example: ABC123 required: true schema: type: string /api/navirequests: post: summary: 'Send navi request (Export API)' operationId: sendNaviRequestExportAPI description: 'Creates a navigation request for a vehicle. Supports MESSAGE, GETDESTINATION, SETLOCATION, CONTROL, and COMMAND types.' parameters: [] responses: 201: description: Created content: application/json: schema: type: object example: id: 1 object_id: ABC123 Content: 'FMT:Hello' handled: 0 date: '2025-01-15 14:30:00' properties: id: type: integer example: 1 object_id: type: string example: ABC123 Content: type: string example: 'FMT:Hello' handled: type: integer example: 0 date: type: string example: '2025-01-15 14:30:00' 403: description: 'No access' content: application/json: schema: type: object example: error: Not_Allowed properties: error: type: string example: Not_Allowed 404: description: 'Wrong message' content: application/json: schema: type: object example: error: Wrong_message properties: error: type: string example: Wrong_message tags: - Navigation requestBody: required: true content: application/json: schema: type: object properties: object_id: type: string description: 'The vehicle object ID. Must contain only letters, numbers, dashes and underscores. Väli value ei tohi olla pikem kui 10 tähemärki.' example: ABC123 type: type: string description: 'The message type: MESSAGE, GETDESTINATION, SETLOCATION, CONTROL, or COMMAND. Must contain only letters and numbers. Väli value ei tohi olla pikem kui 30 tähemärki.' example: MESSAGE lon: type: number description: 'Longitude (used for SETLOCATION type).' example: 25.27956 nullable: true lat: type: number description: 'Latitude (used for SETLOCATION type).' example: 54.68726 nullable: true functionId: type: integer description: 'Output function ID (required for CONTROL type).' example: 1 nullable: true msg: type: string description: 'The message text.' example: 'Hello from dispatch' nullable: true required: - object_id - type '/api/smsrequests/{start}/{stop}/{id}': get: summary: 'List SMS requests (Export API)' operationId: listSMSRequestsExportAPI description: 'Returns SMS requests for a vehicle within a date range. The maximum period is 7 days.' parameters: [] responses: 200: description: Success content: application/json: schema: type: array items: type: object properties: ID: type: integer example: 1 objectID: type: string example: ABC123 Content: type: string example: 'Check engine' handled: type: integer example: 0 date: type: string example: '2025-01-15 14:30:00' example: - ID: 1 objectID: ABC123 Content: 'Check engine' handled: 0 date: '2025-01-15 14:30:00' 400: description: 'Period too long' content: application/json: schema: type: object example: error: 'Ordered period should not exceed 7 days' properties: error: type: string example: 'Ordered period should not exceed 7 days' 404: description: 'No access' content: application/json: schema: type: object example: error: Vehicle_Not_Found properties: error: type: string example: Vehicle_Not_Found tags: - Navigation parameters: - in: path name: start description: 'Start date in Y-m-dH:i:s format (no space).' example: '2025-01-1508:00:00' required: true schema: type: string - in: path name: stop description: 'Stop date in Y-m-dH:i:s format (no space).' example: '2025-01-1517:00:00' required: true schema: type: string - in: path name: id description: 'The vehicle object ID.' example: ABC123 required: true schema: type: string /api/smsrequests: post: summary: 'Send SMS request (Export API)' operationId: sendSMSRequestExportAPI description: 'Creates an SMS request for a vehicle.' parameters: [] responses: 201: description: Created content: application/json: schema: type: object example: id: 1 object_id: ABC123 Content: 'Check engine status' handled: 0 date: '2025-01-15 14:30:00' properties: id: type: integer example: 1 object_id: type: string example: ABC123 Content: type: string example: 'Check engine status' handled: type: integer example: 0 date: type: string example: '2025-01-15 14:30:00' 401: description: 'No access' content: application/json: schema: type: object example: error: Not_Allowed properties: error: type: string example: Not_Allowed tags: - Navigation requestBody: required: true content: application/json: schema: type: object properties: object_id: type: string description: 'The vehicle object ID. Must contain only letters, numbers, dashes and underscores. Väli value ei tohi olla pikem kui 10 tähemärki.' example: ABC123 msg: type: string description: 'The SMS message text.' example: 'Check engine status' nullable: true required: - object_id '/api/smsanswers/{start}/{stop}/{id}': get: summary: 'List SMS answers (Export API)' operationId: listSMSAnswersExportAPI description: 'Returns SMS answers for a vehicle within a date range. The maximum period is 7 days.' parameters: [] responses: 200: description: Success content: application/json: schema: type: array items: type: object properties: ID: type: integer example: 1 objectID: type: string example: ABC123 time: type: string example: '2025-01-15 14:30:00' content: type: string example: 'Engine OK' example: - ID: 1 objectID: ABC123 time: '2025-01-15 14:30:00' content: 'Engine OK' 400: description: 'Period too long' content: application/json: schema: type: object example: error: 'Ordered period should not exceed 7 days' properties: error: type: string example: 'Ordered period should not exceed 7 days' tags: - Navigation parameters: - in: path name: start description: 'Start date in Y-m-dH:i:s format (no space).' example: '2025-01-1508:00:00' required: true schema: type: string - in: path name: stop description: 'Stop date in Y-m-dH:i:s format (no space).' example: '2025-01-1517:00:00' required: true schema: type: string - in: path name: id description: 'The vehicle object ID.' example: ABC123 required: true schema: type: string '/api/navianswers/{start}/{stop}/{id}': get: summary: 'List navi answers (Export API)' operationId: listNaviAnswersExportAPI description: "Returns navi answers for a vehicle within a date range. Maximum period is 7 days.\nContent is parsed through the navi text parser (FMA/FMT/FMS formats)." parameters: [] responses: 200: description: Success content: application/json: schema: type: array items: type: object properties: ID: type: integer example: 1 objectID: type: string example: ABC123 time: type: string example: '2025-01-15 14:30:00' content: type: string example: 'FMT message text' example: - ID: 1 objectID: ABC123 time: '2025-01-15 14:30:00' content: 'FMT message text' 400: description: 'Period too long' content: application/json: schema: type: object example: error: 'Ordered period should not exceed 7 days' properties: error: type: string example: 'Ordered period should not exceed 7 days' tags: - Navigation parameters: - in: path name: start description: 'Start date in Y-m-dH:i:s format (no space).' example: '2025-01-1508:00:00' required: true schema: type: string - in: path name: stop description: 'Stop date in Y-m-dH:i:s format (no space).' example: '2025-01-1517:00:00' required: true schema: type: string - in: path name: id description: 'The vehicle object ID.' example: ABC123 required: true schema: type: string /api/poi: get: summary: 'List POI' operationId: listPOI description: 'Returns all Points of Interest, optionally filtered by name.' parameters: [] responses: 200: description: Success content: application/json: schema: type: object example: data: - id: 1 name: Office lat: 59.437 lon: 24.745 properties: data: type: array example: - id: 1 name: Office lat: 59.437 lon: 24.745 items: type: object properties: id: type: integer example: 1 name: type: string example: Office lat: type: number example: 59.437 lon: type: number example: 24.745 tags: - POI requestBody: required: false content: application/json: schema: type: object properties: q: type: string description: 'Optional search query for POI name. Väli value ei tohi olla pikem kui 255 tähemärki.' example: Office nullable: true post: summary: 'Create POI' operationId: createPOI description: 'Creates a new Point of Interest.' parameters: [] responses: 201: description: Success content: application/json: schema: type: object example: data: id: 1 name: Office lat: 59.437 lon: 24.745 properties: data: type: object properties: id: type: integer example: 1 name: type: string example: Office lat: type: number example: 59.437 lon: type: number example: 24.745 tags: - POI requestBody: required: true content: application/json: schema: type: object properties: type: type: integer description: 'POI type (1-9). Väli value peab olema vahemikus 1 kuni 9.' example: 1 nullable: true lon: type: number description: Longitude. example: 24.745369 lat: type: number description: Latitude. example: 59.437221 radius: type: integer description: 'Radius in meters.' example: 100 nullable: true name: type: string description: 'POI name. Väli value ei tohi olla pikem kui 255 tähemärki.' example: 'Main Office' nullable: true comment: type: string description: 'Comment or MAC address for WiFi routers. Väli value ei tohi olla pikem kui 255 tähemärki.' example: Headquarters nullable: true rgAddress: type: string description: 'Reverse geocoded address. Väli value ei tohi olla pikem kui 255 tähemärki.' example: 'Narva mnt 5, Tallinn' nullable: true phone_nr: type: string description: 'Phone number. Must match the regex /^\d+$/.' example: '5551234' nullable: true country_code: type: string description: 'Country code. Must match the regex /^\+?\d+$/.' example: '+372' nullable: true contact_name: type: string description: 'Contact person name. Väli value ei tohi olla pikem kui 255 tähemärki.' example: 'John Doe' nullable: true purpose: type: integer description: 'POI purpose: 0=POI, 1=Customer, 2=WiFi Router, 3=BLE Beacon.' example: 0 enum: - 0 - 1 - 2 - 3 old_id: type: integer description: '' example: 16 nullable: true required: - lon - lat - purpose '/api/poi/{id}': get: summary: 'Get POI' operationId: getPOI description: 'Returns a single Point of Interest by ID.' parameters: [] responses: 200: description: Success content: application/json: schema: type: object example: data: id: 1 name: Office lat: 59.437 lon: 24.745 properties: data: type: object properties: id: type: integer example: 1 name: type: string example: Office lat: type: number example: 59.437 lon: type: number example: 24.745 404: description: '' content: application/json: schema: type: object example: message: Not_Found properties: message: type: string example: Not_Found tags: - POI put: summary: 'Update POI' operationId: updatePOI description: 'Updates an existing Point of Interest.' parameters: [] responses: 200: description: Success content: application/json: schema: type: object example: message: Updated properties: message: type: string example: Updated 404: description: '' content: application/json: schema: type: object example: message: Not_Found properties: message: type: string example: Not_Found tags: - POI requestBody: required: true content: application/json: schema: type: object properties: type: type: integer description: 'POI type (1-9). Väli value peab olema vahemikus 1 kuni 9.' example: 1 nullable: true lon: type: number description: Longitude. example: 24.745369 nullable: true lat: type: number description: Latitude. example: 59.437221 nullable: true radius: type: integer description: 'Radius in meters.' example: 100 nullable: true name: type: string description: 'POI name. Väli value ei tohi olla pikem kui 255 tähemärki.' example: 'Main Office' nullable: true comment: type: string description: 'Comment or MAC address for WiFi routers. Väli value ei tohi olla pikem kui 255 tähemärki.' example: Headquarters nullable: true rgAddress: type: string description: 'Reverse geocoded address. Väli value ei tohi olla pikem kui 255 tähemärki.' example: 'Narva mnt 5, Tallinn' nullable: true phone_nr: type: string description: 'Phone number. Must match the regex /^\d+$/.' example: '5551234' nullable: true country_code: type: string description: 'Country code. Must match the regex /^\+?\d+$/.' example: '+372' nullable: true contact_name: type: string description: 'Contact person name. Väli value ei tohi olla pikem kui 255 tähemärki.' example: 'John Doe' nullable: true purpose: type: integer description: 'POI purpose: 0=POI, 1=Customer, 2=WiFi Router, 3=BLE Beacon.' example: 0 enum: - 0 - 1 - 2 - 3 required: - purpose delete: summary: 'Delete POI' operationId: deletePOI description: 'Deletes a Point of Interest.' parameters: [] responses: 200: description: Success content: application/json: schema: type: object example: message: Deleted properties: message: type: string example: Deleted 404: description: '' content: application/json: schema: type: object example: message: Not_Found properties: message: type: string example: Not_Found tags: - POI parameters: - in: path name: id description: 'The ID of the poi.' example: architecto required: true schema: type: string /api/poisearch: get: summary: 'Search POI by name' operationId: searchPOIByName description: 'Searches for Points of Interest by name. Returns up to 10 results.' parameters: [] responses: 200: description: Success content: application/json: schema: type: object example: data: - id: 1 lat: 59.437 lon: 24.745 name: Office properties: data: type: array example: - id: 1 lat: 59.437 lon: 24.745 name: Office items: type: object properties: id: type: integer example: 1 lat: type: number example: 59.437 lon: type: number example: 24.745 name: type: string example: Office tags: - POI requestBody: required: true content: application/json: schema: type: object properties: q: type: string description: 'Search query for POI name. Väli value ei tohi olla pikem kui 255 tähemärki.' example: Office required: - q /api/poigroups: get: summary: 'List POI groups' operationId: listPOIGroups description: 'Returns all POI groups with custom names merged with defaults.' parameters: [] responses: 200: description: Success content: application/json: schema: type: object example: data: - id: 1 type_name: A - id: 2 type_name: B properties: data: type: array example: - id: 1 type_name: A - id: 2 type_name: B items: type: object properties: id: type: integer example: 1 type_name: type: string example: A tags: - POI '/api/poigroups/{id}': put: summary: 'Update POI group' operationId: updatePOIGroup description: "Updates the name of a POI group. Creates the record if it doesn't exist." parameters: [] responses: 200: description: Success content: application/json: schema: type: object example: message: Updated properties: message: type: string example: Updated tags: - POI requestBody: required: true content: application/json: schema: type: object properties: type_name: type: string description: 'Name for the POI group. Väli value ei tohi olla pikem kui 255 tähemärki.' example: Warehouses required: - type_name parameters: - in: path name: id description: 'The ID of the poigroup.' example: architecto required: true schema: type: string /api/poireport: get: summary: 'List POI reports' operationId: listPOIReports description: 'Returns a list of POI reports with optional filtering.' parameters: [] responses: 200: description: Success content: application/json: schema: type: object example: data: - id: 1 status: 0 type: poi group: vehicle properties: data: type: array example: - id: 1 status: 0 type: poi group: vehicle items: type: object properties: id: type: integer example: 1 status: type: integer example: 0 type: type: string example: poi group: type: string example: vehicle tags: - POI requestBody: required: false content: application/json: schema: type: object properties: in: type: array description: '' example: - 16 items: type: integer post: summary: 'Create a POI report' operationId: createAPOIReport description: 'Creates a new POI report request.' parameters: [] responses: 201: description: Success content: application/json: schema: type: object example: data: id: 1 status: 0 type: poi properties: data: type: object properties: id: type: integer example: 1 status: type: integer example: 0 type: type: string example: poi tags: - POI requestBody: required: true content: application/json: schema: type: object properties: datetime: type: array description: 'Väli value peab olema kehtiv kuupäev.' example: - '2026-02-26T15:34:38' items: type: string type: type: string description: 'Report type: poi, geo, country, or rtasks.' example: poi enum: - poi - geo - country - rtasks type_id: type: integer description: 'Optional type identifier.' example: 1 nullable: true group: type: string description: 'Group by: vehicle or category.' example: vehicle enum: - vehicle - category group_id: type: string description: 'Optional group identifier. Väli value ei tohi olla pikem kui 10 tähemärki.' example: '123' nullable: true required: - type - group '/api/poireport/{id}': get: summary: 'Get POI report details' operationId: getPOIReportDetails description: 'Returns detailed rows for a specific POI report.' parameters: [] responses: 200: description: Success content: application/json: schema: type: object example: data: - id: 1 type_name: Office object_id: 123 properties: data: type: array example: - id: 1 type_name: Office object_id: 123 items: type: object properties: id: type: integer example: 1 type_name: type: string example: Office object_id: type: integer example: 123 404: description: '' content: application/json: schema: type: object example: message: Not_Found properties: message: type: string example: Not_Found tags: - POI delete: summary: 'Delete a POI report' operationId: deleteAPOIReport description: 'Deletes a POI report by ID.' parameters: [] responses: 200: description: Success content: application/json: schema: type: object example: message: Deleted properties: message: type: string example: Deleted 404: description: '' content: application/json: schema: type: object example: message: Not_Found properties: message: type: string example: Not_Found tags: - POI parameters: - in: path name: id description: 'The ID of the poireport.' example: architecto required: true schema: type: string /api/routelog: get: summary: 'List route log entries' operationId: listRouteLogEntries description: 'Returns route log entries with calculated fields (fuel, distance, drive time, CAN data) for the given object and period.' parameters: - in: query name: datetime description: '' example: - architecto required: true schema: type: array description: '' example: - architecto items: type: string - in: query name: obj description: 'The object ID. Väli value ei tohi olla pikem kui 10 tähemärki.' example: ABC123 required: true schema: type: string description: 'The object ID. Väli value ei tohi olla pikem kui 10 tähemärki.' example: ABC123 - in: query name: offset description: 'Number of records to skip. Use -1 to disable pagination. Väli value peab olema vähemalt -1.' example: -1 required: false schema: type: integer description: 'Number of records to skip. Use -1 to disable pagination. Väli value peab olema vähemalt -1.' example: -1 nullable: true - in: query name: limit description: 'Maximum number of records to return. Väli value peab olema vähemalt 1.' example: 30 required: false schema: type: integer description: 'Maximum number of records to return. Väli value peab olema vähemalt 1.' example: 30 nullable: true responses: 200: description: Success content: application/json: schema: type: object example: data: - id: 1 s: 60 v1: 12.0 v2: 50.0 mh: 3600 i: 64 tt: 120 dt: 100.0 t: 1705305600 st: 0 lt: 59.437 ln: 24.753 km: 1.5 ff: 50.0 tf: 0.5 f: 50.0 f1: 25.0 f2: 25.0 d: 1.5 t1: null t2: null t3: null t4: null r: 2 k: 0 odo: null properties: data: type: array example: - id: 1 s: 60 v1: 12 v2: 50 mh: 3600 i: 64 tt: 120 dt: 100 t: 1705305600 st: 0 lt: 59.437 ln: 24.753 km: 1.5 ff: 50 tf: 0.5 f: 50 f1: 25 f2: 25 d: 1.5 t1: null t2: null t3: null t4: null r: 2 k: 0 odo: null items: type: object properties: id: type: integer example: 1 s: type: integer example: 60 v1: type: number example: 12.0 v2: type: number example: 50.0 mh: type: integer example: 3600 i: type: integer example: 64 tt: type: integer example: 120 dt: type: number example: 100.0 t: type: integer example: 1705305600 st: type: integer example: 0 lt: type: number example: 59.437 ln: type: number example: 24.753 km: type: number example: 1.5 ff: type: number example: 50.0 tf: type: number example: 0.5 f: type: number example: 50.0 f1: type: number example: 25.0 f2: type: number example: 25.0 d: type: number example: 1.5 t1: type: string example: null nullable: true t2: type: string example: null nullable: true t3: type: string example: null nullable: true t4: type: string example: null nullable: true r: type: integer example: 2 k: type: integer example: 0 odo: type: string example: null nullable: true 403: description: 'Object not allowed' content: application/json: schema: type: object example: message: ObjectNotAllowed properties: message: type: string example: ObjectNotAllowed tags: - Reports /api/iolog: get: summary: 'Get IO log grouped' operationId: getIOLogGrouped description: 'Returns grouped IO log entries by day and input, with accumulated distance, fuel, running time, and count. Includes planned fuel consumption for supported vehicle types.' parameters: - in: query name: datetime description: '' example: - architecto required: true schema: type: array description: '' example: - architecto items: type: string - in: query name: object_id description: 'The object ID to filter by. Väli value ei tohi olla pikem kui 10 tähemärki.' example: ABC123 required: true schema: type: string description: 'The object ID to filter by. Väli value ei tohi olla pikem kui 10 tähemärki.' example: ABC123 - in: query name: input description: '' example: - 16 required: true schema: type: array description: '' example: - 16 items: type: integer - in: query name: fuel description: 'Include fuel data in splitted km calculation. 1 to include, 0 to exclude.' example: 1 required: false schema: type: integer description: 'Include fuel data in splitted km calculation. 1 to include, 0 to exclude.' example: 1 nullable: true responses: 200: description: Success content: application/json: schema: type: object example: '2025-01-15': '7': distance: 125.4 fuel: 15.2 running_time: 7200 times: 3 properties: '2025-01-15': type: object properties: 7: type: object properties: distance: type: number example: 125.4 fuel: type: number example: 15.2 running_time: type: integer example: 7200 times: type: integer example: 3 tags: - Reports /api/iologdetail: get: summary: 'Get IO log detail' operationId: getIOLogDetail description: 'Returns detailed IO log entries grouped by day and input, including splitted distance and fuel data.' parameters: - in: query name: datetime description: '' example: - architecto required: true schema: type: array description: '' example: - architecto items: type: string - in: query name: object_id description: 'The object ID to filter by. Väli value ei tohi olla pikem kui 10 tähemärki.' example: ABC123 required: true schema: type: string description: 'The object ID to filter by. Väli value ei tohi olla pikem kui 10 tähemärki.' example: ABC123 - in: query name: input description: '' example: - 16 required: true schema: type: array description: '' example: - 16 items: type: integer - in: query name: fuel description: 'Include fuel data in splitted km calculation. 1 to include, 0 to exclude.' example: 1 required: false schema: type: integer description: 'Include fuel data in splitted km calculation. 1 to include, 0 to exclude.' example: 1 nullable: true responses: 200: description: Success content: application/json: schema: type: object example: '2025-01-15': '7': - distance: 12.5 fuel: 3 running_time: 3600 start_time: '2025-01-15 08:00:00' stop_time: '2025-01-15 09:00:00' properties: '2025-01-15': type: object properties: 7: type: array example: - distance: 12.5 fuel: 3 running_time: 3600 start_time: '2025-01-15 08:00:00' stop_time: '2025-01-15 09:00:00' items: type: object properties: distance: type: number example: 12.5 fuel: type: integer example: 3 running_time: type: integer example: 3600 start_time: type: string example: '2025-01-15 08:00:00' stop_time: type: string example: '2025-01-15 09:00:00' tags: - Reports /api/ioperiods: get: summary: 'Get IO periods' operationId: getIOPeriods description: 'Returns IO activity periods grouped by day and input, with start/stop times in seconds. Multi-day periods are split across days.' parameters: - in: query name: datetime description: '' example: - architecto required: true schema: type: array description: '' example: - architecto items: type: string - in: query name: object_id description: 'The object ID to filter by. Väli value ei tohi olla pikem kui 10 tähemärki.' example: ABC123 required: true schema: type: string description: 'The object ID to filter by. Väli value ei tohi olla pikem kui 10 tähemärki.' example: ABC123 - in: query name: input description: '' example: - 16 required: true schema: type: array description: '' example: - 16 items: type: integer responses: 200: description: Success content: application/json: schema: type: object example: 15.01.2025: '7': - - 28800 - 64800 properties: 15.01.2025: type: object properties: 7: type: array example: - - 28800 - 64800 items: type: array tags: - Reports /api/whlog: get: summary: 'Get working hours log' operationId: getWorkingHoursLog description: 'Returns working hours diary entries grouped by day and input, with multi-day periods split across days. Supports lookup by driver or vehicle.' parameters: - in: query name: datetime description: '' example: - architecto required: true schema: type: array description: '' example: - architecto items: type: string - in: query name: id description: 'The driver or vehicle ID. Väli value ei tohi olla pikem kui 10 tähemärki.' example: ABC123 required: true schema: type: string description: 'The driver or vehicle ID. Väli value ei tohi olla pikem kui 10 tähemärki.' example: ABC123 - in: query name: key description: 'Type of lookup: "driver" or "vehicle".' example: vehicle required: true schema: type: string description: 'Type of lookup: "driver" or "vehicle".' example: vehicle enum: - driver - vehicle responses: 200: description: Success content: application/json: schema: type: object example: 15.01.2025: '7': - start_time: '2025-01-15 06:00:00' stop_time: '2025-01-15 18:00:00' localBegin: '08:00:00' localEnd: '20:00:00' driverID: '1' name: 'John Doe' duration: 43200 object_id: ABC123 id: 1 properties: 15.01.2025: type: object properties: 7: type: array example: - start_time: '2025-01-15 06:00:00' stop_time: '2025-01-15 18:00:00' localBegin: '08:00:00' localEnd: '20:00:00' driverID: '1' name: 'John Doe' duration: 43200 object_id: ABC123 id: 1 items: type: object properties: start_time: type: string example: '2025-01-15 06:00:00' stop_time: type: string example: '2025-01-15 18:00:00' localBegin: type: string example: '08:00:00' localEnd: type: string example: '20:00:00' driverID: type: string example: '1' name: type: string example: 'John Doe' duration: type: integer example: 43200 object_id: type: string example: ABC123 id: type: integer example: 1 tags: - Reports /api/driveperiods: get: summary: 'Get drive periods' operationId: getDrivePeriods description: 'Returns drive activity periods grouped by day, with start/stop times in seconds. Cross-day periods are split.' parameters: - in: query name: datetime description: '' example: - architecto required: true schema: type: array description: '' example: - architecto items: type: string - in: query name: object_id description: 'The object ID to filter by. Väli value ei tohi olla pikem kui 10 tähemärki.' example: ABC123 required: false schema: type: string description: 'The object ID to filter by. Väli value ei tohi olla pikem kui 10 tähemärki.' example: ABC123 nullable: true - in: query name: driverId description: 'The driver ID to filter by.' example: 1 required: false schema: type: integer description: 'The driver ID to filter by.' example: 1 nullable: true responses: 200: description: Success content: application/json: schema: type: object example: 15.01.2025: - - 28800 - 64800 properties: 15.01.2025: type: array example: - - 28800 - 64800 items: type: array tags: - Reports /api/workperiods: get: summary: 'Get work periods' operationId: getWorkPeriods description: 'Returns work activity periods grouped by day, with start/stop times in seconds. Supports filtering by vehicle or driver. Cross-day periods are split.' parameters: - in: query name: datetime description: '' example: - architecto required: true schema: type: array description: '' example: - architecto items: type: string - in: query name: object_id description: 'The object ID to filter by. Väli value ei tohi olla pikem kui 10 tähemärki.' example: ABC123 required: false schema: type: string description: 'The object ID to filter by. Väli value ei tohi olla pikem kui 10 tähemärki.' example: ABC123 nullable: true - in: query name: driverID description: 'The driver ID to filter by.' example: 1 required: false schema: type: integer description: 'The driver ID to filter by.' example: 1 nullable: true responses: 200: description: Success content: application/json: schema: type: object example: 15.01.2025: - - 28800 - 64800 properties: 15.01.2025: type: array example: - - 28800 - 64800 items: type: array tags: - Reports /api/co2report: get: summary: 'Get CO2 report' operationId: getCO2Report description: 'Returns CO2 emissions data grouped by vehicle, with total distance, engine type, and fuel source breakdown.' parameters: - in: query name: datetime description: '' example: - architecto required: true schema: type: array description: '' example: - architecto items: type: string - in: query name: object_id description: 'The object ID to filter by. Väli value ei tohi olla pikem kui 10 tähemärki.' example: ABC123 required: false schema: type: string description: 'The object ID to filter by. Väli value ei tohi olla pikem kui 10 tähemärki.' example: ABC123 nullable: true - in: query name: categoryID description: 'The vehicle category ID to filter by.' example: 1 required: false schema: type: integer description: 'The vehicle category ID to filter by.' example: 1 nullable: true responses: 200: description: Success content: application/json: schema: type: array items: type: object properties: id: type: string example: ABC123 object_id: type: string example: ABC123 total_km: type: number example: 125.4 engine_type: type: string example: diesel co2_sources: type: array example: - quantity: 50 co2_per_unit: 2640 fuel_name: Diesel items: type: object properties: quantity: type: number example: 50.0 co2_per_unit: type: integer example: 2640 fuel_name: type: string example: Diesel example: - id: ABC123 object_id: ABC123 total_km: 125.4 engine_type: diesel co2_sources: - quantity: 50.0 co2_per_unit: 2640 fuel_name: Diesel tags: - Reports /api/routemap: get: summary: 'Get route on map' operationId: getRouteOnMap description: 'Generates a PNG image of the route plotted on a map for the given object and period.' parameters: - in: query name: datetime description: '' example: - architecto required: true schema: type: array description: '' example: - architecto items: type: string - in: query name: object_id description: 'The object ID. Väli value ei tohi olla pikem kui 10 tähemärki.' example: ABC123 required: true schema: type: string description: 'The object ID. Väli value ei tohi olla pikem kui 10 tähemärki.' example: ABC123 - in: query name: width description: 'Image width in pixels (480-900). Väli value peab olema vahemikus 480 kuni 900.' example: 900 required: true schema: type: integer description: 'Image width in pixels (480-900). Väli value peab olema vahemikus 480 kuni 900.' example: 900 - in: query name: height description: 'Image height in pixels (360-834). Väli value peab olema vahemikus 360 kuni 834.' example: 450 required: true schema: type: integer description: 'Image height in pixels (360-834). Väli value peab olema vahemikus 360 kuni 834.' example: 450 responses: 200: description: Success content: text/plain: schema: type: string example: 'Binary PNG image' 500: description: Failed content: application/json: schema: type: object example: message: 'Failed to generate map image' properties: message: type: string example: 'Failed to generate map image' tags: - Reports /api/routeloge: get: summary: 'Get encoded route log' operationId: getEncodedRouteLog description: 'Returns polyline-encoded route log data optimized for rendering. Supports multiple data types (fuel, input, temps, powers, rpm, keypad, path/speed).' parameters: - in: query name: datetime description: '' example: - architecto required: true schema: type: array description: '' example: - architecto items: type: string - in: query name: obj description: 'The object ID. Väli value ei tohi olla pikem kui 10 tähemärki.' example: ABC123 required: true schema: type: string description: 'The object ID. Väli value ei tohi olla pikem kui 10 tähemärki.' example: ABC123 - in: query name: type description: 'Type of encoded data to return. One of: fuel, input, temps, powers, rpm, kp, default.' example: default required: false schema: type: string description: 'Type of encoded data to return. One of: fuel, input, temps, powers, rpm, kp, default.' example: default enum: - fuel - input - temps - powers - rpm - kp - default nullable: true responses: 200: description: Success content: application/json: schema: type: object example: poly: - BFsBF... iterations: 1 cnt: 500 startTime: - 1705305600 keys: - - 'y' - x - t - Speed properties: poly: type: array example: - BFsBF... items: type: string iterations: type: integer example: 1 cnt: type: integer example: 500 startTime: type: array example: - 1705305600 items: type: integer keys: type: array example: - - 'y' - x - t - Speed items: type: array 403: description: 'Object not allowed' content: application/json: schema: type: object example: message: ObjectNotAllowed properties: message: type: string example: ObjectNotAllowed tags: - Reports '/api/rawlog/{id}': get: summary: 'List raw log entries' operationId: listRawLogEntries description: 'Returns raw route log entries with fuel delta and time delta calculations for the given object and period.' parameters: - in: query name: datetime description: '' example: - architecto required: true schema: type: array description: '' example: - architecto items: type: string - in: query name: offset description: 'Number of records to skip. Use -1 to disable pagination. Väli value peab olema vähemalt -1.' example: 0 required: false schema: type: integer description: 'Number of records to skip. Use -1 to disable pagination. Väli value peab olema vähemalt -1.' example: 0 nullable: true - in: query name: limit description: 'Maximum number of records to return. Väli value peab olema vähemalt 1.' example: 30 required: false schema: type: integer description: 'Maximum number of records to return. Väli value peab olema vähemalt 1.' example: 30 nullable: true responses: 200: description: Success content: application/json: schema: type: object example: data: - id: 1 Speed: 60 t1: null t2: null t3: null t4: null distance: 1.5 csqlevel: 20 lat: 59.437 lng: 24.753 adc1: 50.0 adc2: 12.0 input: '10000000' fd: 0.5 Counter: 45.2 td: 30 GMTime: '2025-01-15 08:00:00' properties: data: type: array example: - id: 1 Speed: 60 t1: null t2: null t3: null t4: null distance: 1.5 csqlevel: 20 lat: 59.437 lng: 24.753 adc1: 50 adc2: 12 input: '10000000' fd: 0.5 Counter: 45.2 td: 30 GMTime: '2025-01-15 08:00:00' items: type: object properties: id: type: integer example: 1 Speed: type: integer example: 60 t1: type: string example: null nullable: true t2: type: string example: null nullable: true t3: type: string example: null nullable: true t4: type: string example: null nullable: true distance: type: number example: 1.5 csqlevel: type: integer example: 20 lat: type: number example: 59.437 lng: type: number example: 24.753 adc1: type: number example: 50.0 adc2: type: number example: 12.0 input: type: string example: '10000000' fd: type: number example: 0.5 Counter: type: number example: 45.2 td: type: integer example: 30 GMTime: type: string example: '2025-01-15 08:00:00' 403: description: 'Object not allowed' content: application/json: schema: type: object example: message: ObjectNotAllowed properties: message: type: string example: ObjectNotAllowed tags: - Reports delete: summary: 'Delete raw log entries' operationId: deleteRawLogEntries description: 'Deletes specific raw log entries by their IDs for the given object.' parameters: [] responses: 204: description: Deleted content: text/plain: schema: type: string example: '' 403: description: 'Object not allowed' content: application/json: schema: type: object example: message: ObjectNotAllowed properties: message: type: string example: ObjectNotAllowed tags: - Reports requestBody: required: true content: application/json: schema: type: object properties: ids: type: array description: '' example: - 16 items: type: integer required: - ids parameters: - in: path name: id description: 'The object ID.' example: ABC123 required: true schema: type: string '/api/intervalroutelog/{id}': get: summary: 'Get interval route log' operationId: getIntervalRouteLog description: 'Returns route log records at the specified interval for the given object and period.' parameters: - in: query name: datetime description: '' example: - architecto required: true schema: type: array description: '' example: - architecto items: type: string - in: query name: interval description: 'Interval in minutes between data points. Väli value peab olema vähemalt 1.' example: 5 required: true schema: type: integer description: 'Interval in minutes between data points. Väli value peab olema vähemalt 1.' example: 5 - in: query name: offset description: 'Pagination offset. Use -1 for no pagination. Väli value peab olema vähemalt -1.' example: 0 required: false schema: type: integer description: 'Pagination offset. Use -1 for no pagination. Väli value peab olema vähemalt -1.' example: 0 nullable: true - in: query name: limit description: 'Number of records to return. Väli value peab olema vähemalt 1.' example: 30 required: false schema: type: integer description: 'Number of records to return. Väli value peab olema vähemalt 1.' example: 30 nullable: true responses: 200: description: Success content: application/json: schema: type: array items: type: object properties: id: type: integer example: 1 Speed: type: integer example: 80 GMTime: type: string example: '2025-01-15 08:05:00' t1: type: number example: 20.5 t2: type: number example: 21.0 t3: type: string example: null nullable: true t4: type: string example: null nullable: true example: - id: 1 Speed: 80 GMTime: '2025-01-15 08:05:00' t1: 20.5 t2: 21.0 t3: null t4: null 403: description: Forbidden content: application/json: schema: type: object example: message: ObjectNotAllowed properties: message: type: string example: ObjectNotAllowed tags: - Reports parameters: - in: path name: id description: 'The object ID.' example: ABC123 required: true schema: type: string '/api/intervalroutelog/{obj}/{id}': put: summary: 'Update temperature values' operationId: updateTemperatureValues description: 'Updates temperature sensor values for a specific route log record.' parameters: [] responses: 200: description: Success content: application/json: schema: type: object example: rlid: 456 t1: 20.5 t2: 21.0 t3: null t4: null properties: rlid: type: integer example: 456 t1: type: number example: 20.5 t2: type: number example: 21.0 t3: type: string example: null nullable: true t4: type: string example: null nullable: true 403: description: Forbidden content: application/json: schema: type: object example: message: ObjectNotAllowed properties: message: type: string example: ObjectNotAllowed tags: - Reports requestBody: required: false content: application/json: schema: type: object properties: t1: type: number description: 'Temperature sensor 1 value.' example: 20.5 nullable: true t2: type: number description: 'Temperature sensor 2 value.' example: 21.0 nullable: true t3: type: number description: 'Temperature sensor 3 value.' example: null nullable: true t4: type: number description: 'Temperature sensor 4 value.' example: null nullable: true parameters: - in: path name: obj description: 'The object ID.' example: ABC123 required: true schema: type: string - in: path name: id description: 'The route log record ID.' example: 456 required: true schema: type: integer /api/pivot: get: summary: 'Get the main pivot report' operationId: getTheMainPivotReport description: 'Returns a pivot report with headers, data rows grouped by object or category, and totals.' parameters: - in: query name: datetime description: '' example: - architecto required: true schema: type: array description: '' example: - architecto items: type: string - in: query name: groupBy description: 'Group results by object or category.' example: object required: true schema: type: string description: 'Group results by object or category.' example: object enum: - object - category - in: query name: categoryId description: 'Filter by category ID.' example: 1 required: false schema: type: integer description: 'Filter by category ID.' example: 1 nullable: true - in: query name: fuelType description: 'Filter by fuel type.' example: 1 required: false schema: type: integer description: 'Filter by fuel type.' example: 1 nullable: true responses: 200: description: Success content: application/json: schema: type: object example: headers: - field1 - field2 data: [] total: { } properties: headers: type: array example: - field1 - field2 items: type: string data: type: array example: [] total: type: object properties: { } tags: - Reports '/api/pivot/{id}': get: summary: 'Get detail pivot report' operationId: getDetailPivotReport description: 'Returns a detailed pivot report for a specific object with headers, daily data rows, and totals.' parameters: - in: query name: datetime description: '' example: - architecto required: true schema: type: array description: '' example: - architecto items: type: string responses: 200: description: Success content: application/json: schema: type: object example: headers: - field1 - field2 data: [] total: { } properties: headers: type: array example: - field1 - field2 items: type: string data: type: array example: [] total: type: object properties: { } 403: description: Forbidden content: application/json: schema: type: object example: message: ObjectNotAllowed properties: message: type: string example: ObjectNotAllowed tags: - Reports parameters: - in: path name: id description: 'The object ID.' example: ABC123 required: true schema: type: string '/api/daypivot/{id}': get: summary: 'Get day pivot report' operationId: getDayPivotReport description: 'Returns a detailed pivot report for a specific object and single day.' parameters: - in: query name: date description: 'The date in Y-m-d format. Must be a valid date in the format Y-m-d.' example: '2025-01-15' required: true schema: type: string description: 'The date in Y-m-d format. Must be a valid date in the format Y-m-d.' example: '2025-01-15' responses: 200: description: Success content: application/json: schema: type: object example: headers: - field1 - field2 data: [] total: { } properties: headers: type: array example: - field1 - field2 items: type: string data: type: array example: [] total: type: object properties: { } 403: description: Forbidden content: application/json: schema: type: object example: message: ObjectNotAllowed properties: message: type: string example: ObjectNotAllowed tags: - Reports parameters: - in: path name: id description: 'The object ID.' example: ABC123 required: true schema: type: string '/api/whdriverpivot/{id}': get: summary: 'Get WH pivot report by driver' operationId: getWHPivotReportByDriver description: 'Returns a working hours pivot report for a specific driver with daily breakdown.' parameters: - in: query name: datetime description: '' example: - architecto required: true schema: type: array description: '' example: - architecto items: type: string responses: 200: description: Success content: application/json: schema: type: object example: headers: - field1 - field2 data: [] total: { } properties: headers: type: array example: - field1 - field2 items: type: string data: type: array example: [] total: type: object properties: { } 403: description: Forbidden content: application/json: schema: type: object example: message: DriverNotAllowed properties: message: type: string example: DriverNotAllowed tags: - Reports parameters: - in: path name: id description: 'The driver ID.' example: 123 required: true schema: type: integer '/api/whpivot/{id}': get: summary: 'Get WH pivot report' operationId: getWHPivotReport description: 'Returns a working hours pivot report for a specific object with daily breakdown.' parameters: - in: query name: datetime description: '' example: - architecto required: true schema: type: array description: '' example: - architecto items: type: string responses: 200: description: Success content: application/json: schema: type: object example: headers: - field1 - field2 data: [] total: { } properties: headers: type: array example: - field1 - field2 items: type: string data: type: array example: [] total: type: object properties: { } 403: description: Forbidden content: application/json: schema: type: object example: message: ObjectNotAllowed properties: message: type: string example: ObjectNotAllowed tags: - Reports parameters: - in: path name: id description: 'The object ID.' example: ABC123 required: true schema: type: string /api/drives: get: summary: 'Get drive report' operationId: getDriveReport description: 'Returns all drive records for the given object and period.' parameters: - in: query name: datetime description: '' example: - architecto required: true schema: type: array description: '' example: - architecto items: type: string - in: query name: obj description: 'The object ID. Must contain only letters, numbers, dashes and underscores. Väli value ei tohi olla pikem kui 10 tähemärki.' example: ABC123 required: true schema: type: string description: 'The object ID. Must contain only letters, numbers, dashes and underscores. Väli value ei tohi olla pikem kui 10 tähemärki.' example: ABC123 responses: 200: description: Success content: application/json: schema: type: array items: type: object properties: id: type: integer example: 123 route_length: type: number example: 150.5 status: type: integer example: 1 start_time: type: string example: '2025-01-15 08:00:00' stop_time: type: string example: '2025-01-15 12:00:00' driving_time: type: integer example: 3600 RevGeoS: type: string example: Vilnius RevGeoE: type: string example: Kaunas example: - id: 123 route_length: 150.5 status: 1 start_time: '2025-01-15 08:00:00' stop_time: '2025-01-15 12:00:00' driving_time: 3600 RevGeoS: Vilnius RevGeoE: Kaunas tags: - Reports /api/speed: get: summary: 'Get speed report' operationId: getSpeedReport description: 'Returns speed data for the given object and period.' parameters: - in: query name: datetime description: '' example: - architecto required: true schema: type: array description: '' example: - architecto items: type: string - in: query name: object_id description: 'The object ID. Väli value ei tohi olla pikem kui 10 tähemärki.' example: ABC123 required: true schema: type: string description: 'The object ID. Väli value ei tohi olla pikem kui 10 tähemärki.' example: ABC123 responses: 200: description: Success content: application/json: schema: type: array items: type: object properties: Speed: type: integer example: 80 distance: type: number example: 1.5 workBegin: type: string example: 15.01.2025 time_diff: type: integer example: 30 gm: type: string example: '2025-01-15 08:05:00' example: - Speed: 80 distance: 1.5 workBegin: 15.01.2025 time_diff: 30 gm: '2025-01-15 08:05:00' tags: - Reports /api/traveldiary: get: summary: 'Get travel diary' operationId: getTravelDiary description: "Returns travel diary records for the given period. Drivers get records by their driver ID,\nother users must specify an object ID." parameters: - in: query name: datetime description: '' example: - architecto required: true schema: type: array description: '' example: - architecto items: type: string - in: query name: object_id description: 'The object ID. Required for non-driver users. Väli value ei tohi olla pikem kui 10 tähemärki.' example: ABC123 required: false schema: type: string description: 'The object ID. Required for non-driver users. Väli value ei tohi olla pikem kui 10 tähemärki.' example: ABC123 nullable: true - in: query name: offset description: 'Pagination offset. Use -1 for no pagination. Väli value peab olema vähemalt -1.' example: 0 required: false schema: type: integer description: 'Pagination offset. Use -1 for no pagination. Väli value peab olema vähemalt -1.' example: 0 nullable: true - in: query name: limit description: 'Number of records to return. Väli value peab olema vähemalt 1.' example: 30 required: false schema: type: integer description: 'Number of records to return. Väli value peab olema vähemalt 1.' example: 30 nullable: true responses: 200: description: Success content: application/json: schema: type: array items: type: object properties: id: type: integer example: 123 object_id: type: string example: ABC123 day: type: string example: '2025-01-15' name: type: string example: John fname: type: string example: Doe start_time: type: string example: '2025-01-15 08:00:00' stop_time: type: string example: '2025-01-15 12:00:00' route_length: type: number example: 150.5 driving_time: type: integer example: 3600 max_speed: type: integer example: 120 example: - id: 123 object_id: ABC123 day: '2025-01-15' name: John fname: Doe start_time: '2025-01-15 08:00:00' stop_time: '2025-01-15 12:00:00' route_length: 150.5 driving_time: 3600 max_speed: 120 404: description: 'No object ID' content: application/json: schema: type: object example: message: No_Object_Id_Defined properties: message: type: string example: No_Object_Id_Defined tags: - Reports '/api/traveldiary/{id}': get: summary: 'Get travel diary record details' operationId: getTravelDiaryRecordDetails description: 'Returns a single travel diary record with its route points.' parameters: - in: query name: routeOnly description: 'When true, only route coordinates (lat/lng) are returned without full details.' example: false required: false schema: type: boolean description: 'When true, only route coordinates (lat/lng) are returned without full details.' example: false nullable: true responses: 200: description: Success content: application/json: schema: type: object example: id: 123 object_id: ABC123 start_time: '2025-01-15 08:00:00' stop_time: '2025-01-15 12:00:00' route: - lat: 54.6872 lng: 25.2797 t: '2025-01-15 08:05:00' d: 0.5 id: 1 properties: id: type: integer example: 123 object_id: type: string example: ABC123 start_time: type: string example: '2025-01-15 08:00:00' stop_time: type: string example: '2025-01-15 12:00:00' route: type: array example: - lat: 54.6872 lng: 25.2797 t: '2025-01-15 08:05:00' d: 0.5 id: 1 items: type: object properties: lat: type: number example: 54.6872 lng: type: number example: 25.2797 t: type: string example: '2025-01-15 08:05:00' d: type: number example: 0.5 id: type: integer example: 1 404: description: 'Not found' content: application/json: schema: type: object example: message: NotFound properties: message: type: string example: NotFound tags: - Reports put: summary: 'Update travel diary record' operationId: updateTravelDiaryRecord description: 'Updates the private drive flag and/or description of a travel diary record.' parameters: [] responses: 200: description: Success content: application/json: schema: type: object example: id: 123 is_private_drive: true drive_description: 'Business trip' properties: id: type: integer example: 123 is_private_drive: type: boolean example: true drive_description: type: string example: 'Business trip' 403: description: Forbidden content: application/json: schema: type: object example: message: Forbidden properties: message: type: string example: Forbidden tags: - Reports requestBody: required: false content: application/json: schema: type: object properties: is_private_drive: type: boolean description: 'Whether this is a private drive.' example: true nullable: true drive_description: type: string description: 'Description of the drive. Väli value ei tohi olla pikem kui 255 tähemärki.' example: 'Business trip to Vilnius' nullable: true parameters: - in: path name: id description: 'The drive record ID.' example: 123 required: true schema: type: integer '/api/splitdrives/{id}': put: summary: 'Split a drive record' operationId: splitADriveRecord description: 'Splits a drive record into two parts at the specified route log point. Returns the two resulting drive records.' parameters: [] responses: 200: description: Success content: application/json: schema: type: array items: type: object properties: id: type: integer example: 123 object_id: type: string example: ABC123 start_time: type: string example: '2025-01-15 08:00:00' stop_time: type: string example: '2025-01-15 12:00:00' example: - id: 123 object_id: ABC123 start_time: '2025-01-15 08:00:00' stop_time: '2025-01-15 12:00:00' - id: 124 object_id: ABC123 start_time: '2025-01-15 12:05:00' stop_time: '2025-01-15 17:00:00' 400: description: 'Cannot split' content: application/json: schema: type: object example: message: No_Split_Here properties: message: type: string example: No_Split_Here 404: description: 'Not found' content: application/json: schema: type: object example: message: NotFound properties: message: type: string example: NotFound tags: - Reports requestBody: required: true content: application/json: schema: type: object properties: splitAt: type: integer description: 'The route log record ID at which to split the drive.' example: 12345 required: - splitAt parameters: - in: path name: id description: 'The drive record ID.' example: 123 required: true schema: type: integer '/api/joindrives/{id}': put: summary: 'Join drive records' operationId: joinDriveRecords description: 'Joins a drive record with the next one. The original record is deleted and the joined record is returned.' parameters: [] responses: 200: description: Success content: application/json: schema: type: object example: id: 124 object_id: ABC123 start_time: '2025-01-15 08:00:00' stop_time: '2025-01-15 17:00:00' properties: id: type: integer example: 124 object_id: type: string example: ABC123 start_time: type: string example: '2025-01-15 08:00:00' stop_time: type: string example: '2025-01-15 17:00:00' 400: description: 'Cannot join' content: application/json: schema: type: object example: message: NotJoined properties: message: type: string example: NotJoined 404: description: 'Not found' content: application/json: schema: type: object example: message: NotFound properties: message: type: string example: NotFound tags: - Reports parameters: - in: path name: id description: 'The drive record ID.' example: 123 required: true schema: type: integer /api/fuel: get: summary: 'List fuel records' operationId: listFuelRecords description: 'Returns a list of fuel records for the given period with optional filters.' parameters: - in: query name: datetime description: 'Date period filter.' example: '2024-01-01 00:00:00,2024-01-31 23:59:59' required: true schema: type: string description: 'Date period filter.' example: '2024-01-01 00:00:00,2024-01-31 23:59:59' - in: query name: object_id description: 'Filter by object ID. Väli value ei tohi olla pikem kui 10 tähemärki.' example: ABC123 required: false schema: type: string description: 'Filter by object ID. Väli value ei tohi olla pikem kui 10 tähemärki.' example: ABC123 nullable: true - in: query name: driverid description: 'Filter by primary driver ID.' example: 1 required: false schema: type: integer description: 'Filter by primary driver ID.' example: 1 nullable: true - in: query name: driverid2 description: 'Filter by secondary driver ID.' example: 2 required: false schema: type: integer description: 'Filter by secondary driver ID.' example: 2 nullable: true - in: query name: RevGeo description: 'Filter by address (partial match).' example: Street required: false schema: type: string description: 'Filter by address (partial match).' example: Street nullable: true - in: query name: offset description: 'Pagination offset. Use -1 to disable pagination. Väli value peab olema vähemalt -1.' example: 0 required: false schema: type: integer description: 'Pagination offset. Use -1 to disable pagination. Väli value peab olema vähemalt -1.' example: 0 nullable: true - in: query name: limit description: 'Number of records to return. Väli value peab olema vähemalt 1.' example: 30 required: false schema: type: integer description: 'Number of records to return. Väli value peab olema vähemalt 1.' example: 30 nullable: true responses: 200: description: Success content: application/json: schema: type: array items: type: object properties: id: type: integer example: 1 object_id: type: string example: ABC123 StartTime: type: string example: '2024-01-01 08:00:00' EndTime: type: string example: '2024-01-01 09:00:00' amount: type: integer example: 50 example: - id: 1 object_id: ABC123 StartTime: '2024-01-01 08:00:00' EndTime: '2024-01-01 09:00:00' amount: 50 tags: - Reports post: summary: 'Create a fuel record' operationId: createAFuelRecord description: 'Creates a new fuel record from two route log points. Updates the status of both route log records.' parameters: [] responses: 201: description: Success content: application/json: schema: type: object example: id: 1 properties: id: type: integer example: 1 400: description: 'Invalid points' content: application/json: schema: type: object example: message: Wrong_Points_Id properties: message: type: string example: Wrong_Points_Id 403: description: Forbidden content: application/json: schema: type: object example: message: ObjectNotAllowed properties: message: type: string example: ObjectNotAllowed tags: - Reports requestBody: required: true content: application/json: schema: type: object properties: id1: type: integer description: 'The first route log record ID (start point).' example: 100 id2: type: integer description: 'The second route log record ID (end point).' example: 200 object_id: type: string description: 'The object ID. Väli value ei tohi olla pikem kui 10 tähemärki.' example: ABC123 required: - id1 - id2 - object_id '/api/fuel/{id}': put: summary: 'Update fuel record' operationId: updateFuelRecord description: 'Updates the bill sum of a fuel record.' parameters: [] responses: 200: description: Success content: application/json: schema: type: object example: id: 1 object_id: ABC123 billSum: 150 properties: id: type: integer example: 1 object_id: type: string example: ABC123 billSum: type: integer example: 150 404: description: 'Not found' content: application/json: schema: type: object example: message: Not_Found properties: message: type: string example: Not_Found tags: - Reports requestBody: required: true content: application/json: schema: type: object properties: billSum: type: integer description: 'The bill sum value.' example: 150 required: - billSum delete: summary: 'Delete fuel record' operationId: deleteFuelRecord description: 'Deletes a fuel record and clears the fuel status from the route log.' parameters: [] responses: 204: description: Success content: application/json: schema: type: object example: { } properties: { } 404: description: 'Not found' content: application/json: schema: type: object example: message: Not_Found properties: message: type: string example: Not_Found tags: - Reports parameters: - in: path name: id description: 'The fuel record ID.' example: 1 required: true schema: type: integer '/api/zonetask/{id}': get: summary: 'Get task geozone' operationId: getTaskGeozone description: 'Returns the geozone associated with a specific task.' parameters: [] responses: 200: description: '' content: application/json: schema: type: object example: id: 1 name: 'Zone A' lat: 59.123 lng: 24.456 geometry: ... countAlarm: maxqtty: 5 properties: id: type: integer example: 1 name: type: string example: 'Zone A' lat: type: number example: 59.123 lng: type: number example: 24.456 geometry: type: string example: ... countAlarm: type: object properties: maxqtty: type: integer example: 5 404: description: '' content: application/json: schema: type: object example: message: 'Not found' properties: message: type: string example: 'Not found' tags: - 'Route Tasks' parameters: - in: path name: id description: 'The task ID.' example: 12345 required: true schema: type: integer /api/taskspdf: get: summary: 'Get tasks PDF by task IDs' operationId: getTasksPDFByTaskIDs description: 'Generates a PDF report for the specified task IDs.' parameters: - in: query name: nr description: 'Array of task IDs.' example: - 1 - 2 - 3 required: true schema: type: array description: 'Array of task IDs.' example: - 1 - 2 - 3 items: type: integer responses: 200: description: 'PDF file' content: text/plain: schema: type: string example: 'PDF binary content' tags: - 'Route Tasks' requestBody: required: false content: application/json: schema: type: object properties: nr: type: array description: '' example: - 16 items: type: integer /api/tasksbyperiod: get: summary: 'Get tasks by date period' operationId: getTasksByDatePeriod description: 'Returns all tasks within the specified date period (max 7 days).' parameters: - in: query name: datetime description: 'Array of two datetime strings [start, end].' example: - '2025-01-01 00:00:00' - '2025-01-07 23:59:59' required: true schema: type: array description: 'Array of two datetime strings [start, end].' example: - '2025-01-01 00:00:00' - '2025-01-07 23:59:59' items: type: string responses: 401: description: '' content: application/json: schema: type: object example: message: Unauthenticated. properties: message: type: string example: Unauthenticated. tags: - 'Route Tasks' requestBody: required: true content: application/json: schema: type: object properties: datetime: type: string description: '' example: architecto required: - datetime /api/routetasks: get: summary: 'Get tasks report' operationId: getTasksReport description: 'Returns a filtered and paginated list of route tasks for reporting.' parameters: - in: query name: start_time description: 'Date period [start, end].' example: - '2025-01-01 00:00:00' - '2025-01-31 23:59:59' required: true schema: type: array description: 'Date period [start, end].' example: - '2025-01-01 00:00:00' - '2025-01-31 23:59:59' items: type: string - in: query name: object_id description: 'Filter by vehicle ID.' example: ABC123 required: false schema: type: string description: 'Filter by vehicle ID.' example: ABC123 - in: query name: order_ref description: 'Filter by order reference (partial match).' example: architecto required: false schema: type: string description: 'Filter by order reference (partial match).' example: architecto - in: query name: status description: 'integer|integer[] Filter by status or array of statuses.' example: architecto required: false schema: type: string description: 'integer|integer[] Filter by status or array of statuses.' example: architecto - in: query name: isDetailed description: 'Include file and signature details.' example: true required: false schema: type: boolean description: 'Include file and signature details.' example: true - in: query name: offset description: 'Pagination offset (-1 for no pagination).' example: 0 required: false schema: type: integer description: 'Pagination offset (-1 for no pagination).' example: 0 - in: query name: limit description: 'Maximum records to return.' example: 30 required: false schema: type: integer description: 'Maximum records to return.' example: 30 responses: 200: description: '' content: application/json: schema: type: array items: type: object properties: id: type: integer example: 1 object_id: type: string example: ABC123 status: type: integer example: 1 start_time: type: string example: '2025-01-01 10:00:00' example: - id: 1 object_id: ABC123 status: 1 start_time: '2025-01-01 10:00:00' tags: - 'Route Tasks' '/api/routetasks/{task_id}': get: summary: 'Get a specific task' operationId: getASpecificTask description: 'Returns a single route task with files, signatures and products.' parameters: [] responses: 401: description: '' content: application/json: schema: type: object example: message: Unauthenticated. properties: message: type: string example: Unauthenticated. 404: description: 'Task not found' content: application/json: schema: type: object example: message: 'Not Found' properties: message: type: string example: 'Not Found' tags: - 'Route Tasks' security: [] put: summary: 'Update a task' operationId: updateATask description: "Updates an existing route task. All base fields are optional on update.\nAdditional profile-specific fields are listed per scenario below.\n\n**Status Changes:**\n- Setting status to 4 (rejected) will deactivate the task and remove group assignment\n- Setting status to 3 (completed) or 7 (signed) triggers task-specific completion logic\n\n

Request Body per Profile

\n\n
\nRudus\n\n
{\n    "object_id": "ABC123",\n    "lat": 59.437,\n    "lon": 24.7536,\n    "start_time": "2025-01-15 08:00:00",\n    "stop_time": "2025-01-15 17:00:00",\n    "task_address": "Construction Site, Tartu",\n    "order_ref": "ORD-2025-001",\n    "status": 1,\n    "preparation_time": "2025-01-15 07:30:00",\n    "volume": 8.5,\n    "client_id": "CLIENT123",\n    "ordered_volume": 10,\n    "delivered_volume": 8.2,\n    "pumped_volume": 8,\n    "dn_trash": "0.5",\n    "dn_plastic": "1.2",\n    "dn_water": "10.5",\n    "categoryID": 15,\n    "client_emails": [\n        "client@example.com"\n    ],\n    "last_cargo": 0,\n    "geozone_entered_at": "2025-01-15 11:20:00",\n    "arrived_at": "2025-01-15 11:15:00",\n    "geozone_left_at": "2025-01-15 11:50:00",\n    "work_finished_at": "2025-01-15 11:45:00",\n    "concrete_type": "C30/37",\n    "concrete_strength_class": "C30",\n    "environmental_class": "XC3",\n    "dmax": "16",\n    "consistency_class": "S3",\n    "cement_type": "CEM II/A-LL 42,5N",\n    "additives": "Superplasticizer",\n    "concrete_extra_info": "High durability",\n    "concrete_extra_info2": "Special finish",\n    "unload_method": "Pump",\n    "driving_instructions": "Use back entrance",\n    "offer_number": "OFF-2025-123",\n    "work_order_number": "WO-2025-456",\n    "notes": "Handle with care",\n    "operator_name": "John Smith",\n    "pumper_name": "ABC Pumping Ltd",\n    "pump_type": "Stationary",\n    "factory_id": 5,\n    "client_address": "123 Construction Ave",\n    "other_object_id": "PUMP-01",\n    "products": [\n        {\n            "product_id": 1,\n            "quantity": 8.5,\n            "weight": 150\n        }\n    ]\n}
\n
\n\n
\nPadapigi\n\n
{\n    "object_id": "ABC123",\n    "lat": 59.437,\n    "lon": 24.7536,\n    "start_time": "2025-01-15 08:00:00",\n    "stop_time": "2025-01-15 17:00:00",\n    "task_address": "Customer Site, Tartu",\n    "order_ref": "ORD-2025-001",\n    "status": 1,\n    "contact_name": "John Doe",\n    "contact_country_code": "+372",\n    "contact_phone_nr": "5551234",\n    "product_name": "Electronic Components",\n    "project_nr": "PROJ-2025-10",\n    "weight": 15000,\n    "amount": 24,\n    "carrier": "Baltic Express",\n    "receiver_email": "receiver@example.com",\n    "receiver_name": "Tech Solutions UAB",\n    "directo_invoice": "987654",\n    "own_transport": true,\n    "products": [\n        {\n            "product_id": 1,\n            "quantity": 24,\n            "weight": 15000\n        }\n    ]\n}
\n
\n\n
\nDirecto\n\n
{\n    "object_id": "ABC123",\n    "lat": 59.437,\n    "lon": 24.7536,\n    "start_time": "2025-01-15 08:00:00",\n    "stop_time": "2025-01-15 17:00:00",\n    "task_address": "Customer Site, Tartu",\n    "order_ref": "ORD-2025-001",\n    "status": 1,\n    "contact_name": "John Doe",\n    "contact_email": "john@example.com",\n    "contact_sender": "SENDER123",\n    "contact_receiver": "ABC Logistics Ltd",\n    "contact_trailer": "TRL456",\n    "contact_order": "ORD-DIR-100",\n    "contact_delivery_term": "DAP",\n    "contact_language": "eng",\n    "delivery_name": "ABC Logistics Ltd",\n    "delivery_address1": "Industrial Street 15",\n    "delivery_address2": "Riga, LV-1234",\n    "delivery_address3": "Latvia",\n    "start_address1": "Warehouse A",\n    "start_address2": "Tallinn Port",\n    "start_address3": "Estonia",\n    "weight": 15000,\n    "amount": 24,\n    "hash": "abc123def456",\n    "products": [\n        {\n            "product_id": 1,\n            "quantity": 24,\n            "weight": 15000\n        }\n    ]\n}
\n
\n\n
\nEsvika\n\n
{\n    "object_id": "ABC123",\n    "lat": 59.437,\n    "lon": 24.7536,\n    "start_time": "2025-01-15 08:00:00",\n    "stop_time": "2025-01-15 17:00:00",\n    "task_address": "Customer Site, Tartu",\n    "order_ref": "ORD-2025-001",\n    "status": 1,\n    "contact_name": "John Doe",\n    "contact_country_code": "+372",\n    "contact_phone_nr": "5551234",\n    "amount": 24,\n    "weight": 15000,\n    "vehicle_type": "Curtainsider",\n    "carrier": "Baltic Express",\n    "order_number": "ORD-FI-2025-100",\n    "unloading_time": 45,\n    "products": [\n        {\n            "product_id": 1,\n            "quantity": 24,\n            "weight": 15000\n        }\n    ]\n}
\n
\n\n
\nOlaret\n\n
{\n    "object_id": "ABC123",\n    "lat": 59.437,\n    "lon": 24.7536,\n    "start_time": "2025-01-15 08:00:00",\n    "stop_time": "2025-01-15 17:00:00",\n    "task_address": "Port Terminal, Tallinn",\n    "order_ref": "ORD-2025-001",\n    "status": 1,\n    "worder": "WO_2025_456",\n    "do_send": true,\n    "containerno": "MSCU1234567",\n    "products": [\n        {\n            "product_id": 1,\n            "quantity": 1,\n            "weight": 5000\n        }\n    ]\n}
\n
\n\n
\nLotusTimber\n\n
{\n    "object_id": "ABC123",\n    "lat": 59.437,\n    "lon": 24.7536,\n    "start_time": "2025-01-15 08:00:00",\n    "stop_time": "2025-01-15 17:00:00",\n    "task_address": "Timber Yard, Pärnu",\n    "order_ref": "ORD-2025-001",\n    "status": 1,\n    "customer_id": 1,\n    "carrier_id": 2,\n    "trailer_nr": "TRL-789",\n    "contact_name": "John Doe",\n    "contact_country_code": "+372",\n    "contact_phone_nr": "5551234",\n    "receiver_name": "Tech Solutions UAB",\n    "receiver_email": "receiver@example.com",\n    "products": [\n        {\n            "product_id": 1,\n            "quantity": 30,\n            "weight": 25000\n        }\n    ]\n}
\n
\n\n
\nVeokeskus\n\n
{\n    "object_id": "ABC123",\n    "lat": 59.437,\n    "lon": 24.7536,\n    "start_time": "2025-01-15 08:00:00",\n    "stop_time": "2025-01-15 17:00:00",\n    "task_address": "Customer Site, Tartu",\n    "order_ref": "ORD-2025-001",\n    "status": 1,\n    "contact_name": "John Doe",\n    "contact_country_code": "+372",\n    "contact_phone_nr": "5551234",\n    "amount": 24,\n    "weight": 15000,\n    "receiver_email": "receiver@example.com",\n    "receiver_name": "Tech Solutions UAB",\n    "vehicle_type": "Curtainsider",\n    "unloading_time": 45,\n    "products": [\n        {\n            "product_id": 1,\n            "quantity": 24,\n            "weight": 15000\n        }\n    ]\n}
\n
\n\n
\nMorobell\n\n
{\n    "object_id": "ABC123",\n    "lat": 59.437,\n    "lon": 24.7536,\n    "start_time": "2025-01-15 08:00:00",\n    "stop_time": "2025-01-15 17:00:00",\n    "task_address": "Customer Site, Tartu",\n    "order_ref": "ORD-2025-001",\n    "status": 1,\n    "contact_name": "John Doe",\n    "contact_country_code": "+372",\n    "contact_phone_nr": "5551234",\n    "receiver_email": "receiver@example.com",\n    "receiver_name": "Tech Solutions UAB",\n    "added_documents": "CMR, invoice",\n    "seal_number": "SEAL-12345",\n    "fish_document_id": 1,\n    "products": [\n        {\n            "product_id": 1,\n            "quantity": 10,\n            "weight": 500\n        }\n    ]\n}
\n
" parameters: [] responses: 403: description: '' content: application/json: schema: oneOf: - description: Forbidden type: object example: message: Forbidden properties: message: type: string example: Forbidden - description: 'Invalid Period' type: object example: message: 'Invalid period' properties: message: type: string example: 'Invalid period' 409: description: 'Duplicate Order Ref' content: application/json: schema: type: object example: message: 'Duplicate order reference' properties: message: type: string example: 'Duplicate order reference' tags: - 'Route Tasks' requestBody: required: false content: application/json: schema: type: object properties: object_id: type: string description: 'Vehicle object ID. Väli value ei tohi olla pikem kui 10 tähemärki.' example: ABC123 lat: type: number description: 'Destination latitude.' example: 59.437 lon: type: number description: 'Destination longitude.' example: 24.7536 start_time: type: string description: 'Planned start time. Must be a valid date in the format Y-m-d H:i:s.' example: '2025-01-15 08:00:00' stop_time: type: string description: 'Planned end time. Must be a valid date in the format Y-m-d H:i:s.' example: '2025-01-15 17:00:00' start_lat: type: number description: 'Start location latitude.' example: 59.437 nullable: true start_lon: type: number description: 'Start location longitude.' example: 24.7536 nullable: true start_address: type: string description: 'Start address. Väli value ei tohi olla pikem kui 255 tähemärki.' example: 'Warehouse, Tallinn' nullable: true task_address: type: string description: 'Destination address. Väli value ei tohi olla pikem kui 255 tähemärki.' example: 'Customer Site, Tartu' nullable: true order_ref: type: string description: 'Order reference number. Väli value ei tohi olla pikem kui 255 tähemärki.' example: ORD-2025-001 nullable: true order_details: type: string description: 'Order details or notes.' example: 'Fragile goods - handle with care' nullable: true task_description: type: string description: 'Task description.' example: 'Deliver package to reception' nullable: true task_notes: type: string description: 'Additional task notes.' example: 'Call customer before arrival' nullable: true cancel_reason: type: string description: 'Reason for cancellation.' example: 'Customer not available' nullable: true status: type: integer description: 'Task status (see RouteTasksStatus enum for valid values).' example: 1 enum: - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 planned_km: type: string description: 'Planned distance in km.' example: 150 nullable: true is_not_own_vehicle: type: boolean description: 'Whether using a third-party vehicle.' example: false active: type: boolean description: 'Whether the task is active.' example: true group_id: type: integer description: 'Task group ID.' example: 1 nullable: true customer_id: type: integer description: 'Customer party ID. The id of an existing record in the parties table.' example: 1 nullable: true carrier_id: type: integer description: 'Carrier party ID. The id of an existing record in the parties table.' example: 2 nullable: true sender_id: type: integer description: 'Sender party ID. The id of an existing record in the parties table.' example: 3 nullable: true trailer_nr: type: string description: 'Trailer registration number. Väli value ei tohi olla pikem kui 50 tähemärki.' example: TRL-001 nullable: true order_id: type: integer description: 'The id of an existing record in the orders table.' example: 16 nullable: true driver_notes: type: string description: 'Notes from driver.' example: 'Delivered successfully' nullable: true products: type: array description: 'List of products for this task.' example: - product_id: 1 quantity: 10 weight: 100 - product_name: 'Custom product' quantity: 5 items: type: object properties: product_id: type: integer description: 'Product ID (optional if product_name is provided). The id of an existing record in the products table.' example: 1 nullable: true product_name: type: string description: 'Custom product name (used when no product_id is set). Väli value ei tohi olla pikem kui 255 tähemärki.' example: 'Custom product' nullable: true quantity: type: number description: 'Product quantity. Väli value peab olema vähemalt 0.' example: 10.0 nullable: true specific_quantity: type: string description: 'Specific quantity (e.g. pails). Väli value ei tohi olla pikem kui 100 tähemärki.' example: '5 pails' nullable: true weight: type: number description: 'Product net weight in kg. Väli value peab olema vähemalt 0.' example: 100.0 nullable: true net_weight: type: integer description: 'Product net weight in kg. Väli value peab olema vähemalt 0.' example: 80 nullable: true security: [] parameters: - in: path name: task_id description: 'The ID of the task.' example: 16 required: true schema: type: integer - in: path name: task description: 'Task ID.' example: 1 required: true schema: type: integer /api/tasks: get: summary: 'Get all tasks' operationId: getAllTasks description: 'Returns a list of route tasks for the authenticated user. By default, only active tasks are returned.' parameters: - in: query name: all description: 'Show all tasks including completed ones.' example: false required: false schema: type: boolean description: 'Show all tasks including completed ones.' example: false - in: query name: offset description: 'Pagination offset.' example: 0 required: false schema: type: integer description: 'Pagination offset.' example: 0 - in: query name: limit description: 'Number of records to return.' example: 30 required: false schema: type: integer description: 'Number of records to return.' example: 30 - in: query name: files description: 'Include files with tasks.' example: false required: false schema: type: boolean description: 'Include files with tasks.' example: false responses: 200: description: '' content: application/json: schema: oneOf: - description: 'Standard Task' type: array items: type: object properties: id: type: integer example: 12346 oid: type: string example: metrotec object_id: type: string example: ABC123 lat: type: number example: 59.437 lon: type: number example: 24.754 start_lat: type: string example: null nullable: true start_lon: type: string example: null nullable: true start_address: type: string example: null nullable: true start_time: type: string example: '2025-01-20 08:00:00' stop_time: type: string example: '2025-01-20 17:00:00' order_ref: type: string example: ORDER-2025-001 order_details: type: string example: null nullable: true task_address: type: string example: 'Tallinn, Estonia' task_description: type: string example: 'Standard delivery task' cancel_reason: type: string example: null nullable: true status: type: integer example: 1 created_at: type: string example: '2025-01-19 16:00:00' updated_at: type: string example: '2025-01-19 16:00:00' work_started_at: type: string example: null nullable: true work_finished_at: type: string example: null nullable: true arrived_at: type: string example: null nullable: true geozone_entered_at: type: string example: null nullable: true geozone_left_at: type: string example: null nullable: true sender: type: string example: DispatchSystem tracking_nr: type: string example: abc123xyz789def456 task_notes: type: string example: null nullable: true active: type: boolean example: true group_id: type: string example: null nullable: true fish_document_id: type: string example: null nullable: true is_not_own_vehicle: type: boolean example: false customer_id: type: string example: null nullable: true carrier_id: type: string example: null nullable: true trailer_nr: type: string example: null nullable: true sender_id: type: string example: null nullable: true driver_notes: type: string example: null nullable: true hasGz: type: boolean example: false planned_km: type: string example: null nullable: true distance: type: string example: null nullable: true products: type: array example: [] files: type: array example: [] signatures: type: array example: [] waypoints: type: array example: [] audits: type: array example: [] waybills: type: array example: [] example: - id: 12346 oid: metrotec object_id: ABC123 lat: 59.437 lon: 24.754 start_lat: null start_lon: null start_address: null start_time: '2025-01-20 08:00:00' stop_time: '2025-01-20 17:00:00' order_ref: ORDER-2025-001 order_details: null task_address: 'Tallinn, Estonia' task_description: 'Standard delivery task' cancel_reason: null status: 1 created_at: '2025-01-19 16:00:00' updated_at: '2025-01-19 16:00:00' work_started_at: null work_finished_at: null arrived_at: null geozone_entered_at: null geozone_left_at: null sender: DispatchSystem tracking_nr: abc123xyz789def456 task_notes: null active: true group_id: null fish_document_id: null is_not_own_vehicle: false customer_id: null carrier_id: null trailer_nr: null sender_id: null driver_notes: null hasGz: false planned_km: null distance: null products: [] files: [] signatures: [] waypoints: [] audits: [] waybills: [] - description: 'Rudus Task' type: array items: type: object properties: id: type: integer example: 12345 oid: type: string example: metrotec object_id: type: string example: RUDUS-01 lat: type: number example: 59.437 lon: type: number example: 24.754 start_lat: type: number example: 59.395 start_lon: type: number example: 24.662 start_address: type: string example: 'Factory, Tallinn' start_time: type: string example: '2025-01-20 08:00:00' stop_time: type: string example: '2025-01-20 12:00:00' order_ref: type: string example: RUDUS-2025-001 order_details: type: string example: 'Client: Construction Site A' task_address: type: string example: 'Construction Site A, Tallinn' task_description: type: string example: 'Concrete delivery C30/37' cancel_reason: type: string example: null nullable: true status: type: integer example: 2 created_at: type: string example: '2025-01-19 15:30:00' updated_at: type: string example: '2025-01-20 08:15:00' work_started_at: type: string example: '2025-01-20 08:05:00' work_finished_at: type: string example: '2025-01-20 11:45:00' arrived_at: type: string example: '2025-01-20 11:15:00' geozone_entered_at: type: string example: '2025-01-20 11:20:00' geozone_left_at: type: string example: '2025-01-20 11:50:00' sender: type: string example: RudusAPI tracking_nr: type: string example: abc123xyz789def456 task_notes: type: string example: 'Special delivery' active: type: boolean example: true group_id: type: integer example: 10 fish_document_id: type: string example: null nullable: true is_not_own_vehicle: type: boolean example: false customer_id: type: string example: null nullable: true carrier_id: type: string example: null nullable: true trailer_nr: type: string example: null nullable: true sender_id: type: string example: null nullable: true driver_notes: type: string example: null nullable: true hasGz: type: boolean example: false planned_km: type: string example: null nullable: true distance: type: string example: null nullable: true concrete_type: type: string example: C30/37 concrete_strength_class: type: string example: C30 environmental_class: type: string example: XC3 dmax: type: string example: '16' consistency_class: type: string example: S3 cement_type: type: string example: 'CEM II/A-LL 42,5N' additives: type: string example: Superplasticizer concrete_extra_info: type: string example: 'High durability' concrete_extra_info2: type: string example: 'Special finish required' preparation_time: type: string example: '2025-01-20 07:30:00' volume: type: number example: 8.5 unload_method: type: string example: Pump driving_instructions: type: string example: 'Use back entrance' client_id: type: string example: CLIENT123 offer_number: type: string example: OFF-2025-123 ordered_volume: type: number example: 10.0 delivered_volume: type: number example: 8.2 pumped_volume: type: number example: 8.0 work_order_number: type: string example: WO-2025-456 notes: type: string example: 'Handle with care' operator_name: type: string example: 'John Smith' pumper_name: type: string example: 'ABC Pumping Ltd' pump_type: type: string example: Stationary factory_id: type: integer example: 5 client_address: type: string example: '123 Construction Ave' dn_trash: type: string example: '0.5' dn_water: type: string example: '10.5' dn_plastic: type: string example: '1.2' client_email: type: string example: null nullable: true client_emails: type: array example: - client@example.com - manager@example.com items: type: string last_cargo: type: integer example: 0 other_object_id: type: string example: PUMP-01 products: type: array example: [] files: type: array example: [] signatures: type: array example: [] waypoints: type: array example: [] audits: type: array example: [] waybills: type: array example: [] example: - id: 12345 oid: metrotec object_id: RUDUS-01 lat: 59.437 lon: 24.754 start_lat: 59.395 start_lon: 24.662 start_address: 'Factory, Tallinn' start_time: '2025-01-20 08:00:00' stop_time: '2025-01-20 12:00:00' order_ref: RUDUS-2025-001 order_details: 'Client: Construction Site A' task_address: 'Construction Site A, Tallinn' task_description: 'Concrete delivery C30/37' cancel_reason: null status: 2 created_at: '2025-01-19 15:30:00' updated_at: '2025-01-20 08:15:00' work_started_at: '2025-01-20 08:05:00' work_finished_at: '2025-01-20 11:45:00' arrived_at: '2025-01-20 11:15:00' geozone_entered_at: '2025-01-20 11:20:00' geozone_left_at: '2025-01-20 11:50:00' sender: RudusAPI tracking_nr: abc123xyz789def456 task_notes: 'Special delivery' active: true group_id: 10 fish_document_id: null is_not_own_vehicle: false customer_id: null carrier_id: null trailer_nr: null sender_id: null driver_notes: null hasGz: false planned_km: null distance: null concrete_type: C30/37 concrete_strength_class: C30 environmental_class: XC3 dmax: '16' consistency_class: S3 cement_type: 'CEM II/A-LL 42,5N' additives: Superplasticizer concrete_extra_info: 'High durability' concrete_extra_info2: 'Special finish required' preparation_time: '2025-01-20 07:30:00' volume: 8.5 unload_method: Pump driving_instructions: 'Use back entrance' client_id: CLIENT123 offer_number: OFF-2025-123 ordered_volume: 10.0 delivered_volume: 8.2 pumped_volume: 8.0 work_order_number: WO-2025-456 notes: 'Handle with care' operator_name: 'John Smith' pumper_name: 'ABC Pumping Ltd' pump_type: Stationary factory_id: 5 client_address: '123 Construction Ave' dn_trash: '0.5' dn_water: '10.5' dn_plastic: '1.2' client_email: null client_emails: - client@example.com - manager@example.com last_cargo: 0 other_object_id: PUMP-01 products: [] files: [] signatures: [] waypoints: [] audits: [] waybills: [] - description: 'Padapigi Task' type: array items: type: object properties: id: type: integer example: 12347 oid: type: string example: metrotec object_id: type: string example: TRUCK-05 lat: type: number example: 59.437 lon: type: number example: 24.754 start_lat: type: number example: 59.395 start_lon: type: number example: 24.662 start_address: type: string example: 'Warehouse A, Tallinn' start_time: type: string example: '2025-01-20 06:00:00' stop_time: type: string example: '2025-01-20 18:00:00' order_ref: type: string example: PAD-2025-100 order_details: type: string example: 'CMR delivery to Latvia' task_address: type: string example: 'Warehouse District, Tallinn' task_description: type: string example: 'International delivery to Latvia' cancel_reason: type: string example: null nullable: true status: type: integer example: 2 created_at: type: string example: '2025-01-19 14:00:00' updated_at: type: string example: '2025-01-20 06:30:00' work_started_at: type: string example: '2025-01-20 06:15:00' work_finished_at: type: string example: null nullable: true arrived_at: type: string example: null nullable: true geozone_entered_at: type: string example: null nullable: true geozone_left_at: type: string example: null nullable: true sender: type: string example: PadapigiAPI tracking_nr: type: string example: abc123xyz789def456 task_notes: type: string example: 'CMR documents prepared' active: type: boolean example: true group_id: type: integer example: 15 fish_document_id: type: string example: null nullable: true is_not_own_vehicle: type: boolean example: false customer_id: type: string example: null nullable: true carrier_id: type: string example: null nullable: true trailer_nr: type: string example: null nullable: true sender_id: type: string example: null nullable: true driver_notes: type: string example: null nullable: true hasGz: type: boolean example: false planned_km: type: string example: null nullable: true distance: type: string example: null nullable: true contact_name: type: string example: 'John Doe' contact_country_code: type: string example: '+371' contact_phone_nr: type: string example: '21234567' product_name: type: string example: 'Electronic Components' receiver_email: type: string example: receiver@example.lv receiver_name: type: string example: 'ABC Logistics Ltd' project_nr: type: string example: PROJ-2025-10 directo_invoice: type: string example: '987654' carrier: type: string example: 'Baltic Express' weight: type: integer example: 15000 amount: type: integer example: 24 own_transport: type: boolean example: true products: type: array example: [] files: type: array example: [] signatures: type: array example: [] waypoints: type: array example: [] audits: type: array example: [] waybills: type: array example: [] example: - id: 12347 oid: metrotec object_id: TRUCK-05 lat: 59.437 lon: 24.754 start_lat: 59.395 start_lon: 24.662 start_address: 'Warehouse A, Tallinn' start_time: '2025-01-20 06:00:00' stop_time: '2025-01-20 18:00:00' order_ref: PAD-2025-100 order_details: 'CMR delivery to Latvia' task_address: 'Warehouse District, Tallinn' task_description: 'International delivery to Latvia' cancel_reason: null status: 2 created_at: '2025-01-19 14:00:00' updated_at: '2025-01-20 06:30:00' work_started_at: '2025-01-20 06:15:00' work_finished_at: null arrived_at: null geozone_entered_at: null geozone_left_at: null sender: PadapigiAPI tracking_nr: abc123xyz789def456 task_notes: 'CMR documents prepared' active: true group_id: 15 fish_document_id: null is_not_own_vehicle: false customer_id: null carrier_id: null trailer_nr: null sender_id: null driver_notes: null hasGz: false planned_km: null distance: null contact_name: 'John Doe' contact_country_code: '+371' contact_phone_nr: '21234567' product_name: 'Electronic Components' receiver_email: receiver@example.lv receiver_name: 'ABC Logistics Ltd' project_nr: PROJ-2025-10 directo_invoice: '987654' carrier: 'Baltic Express' weight: 15000 amount: 24 own_transport: true products: [] files: [] signatures: [] waypoints: [] audits: [] waybills: [] - description: 'Directo Task' type: array items: type: object properties: id: type: integer example: 12348 oid: type: string example: metrotec object_id: type: string example: INT-TRUCK-02 lat: type: number example: 54.687 lon: type: number example: 25.279 start_lat: type: number example: 59.437 start_lon: type: number example: 24.754 start_address: type: string example: 'Tallinn Logistics Center' start_time: type: string example: '2025-01-20 05:00:00' stop_time: type: string example: '2025-01-21 18:00:00' order_ref: type: string example: DIR-2025-055 order_details: type: string example: 'Electronics to Lithuania' task_address: type: string example: 'Vilnius, Lithuania' task_description: type: string example: 'Electronics transport to Lithuania' cancel_reason: type: string example: null nullable: true status: type: integer example: 2 created_at: type: string example: '2025-01-19 12:00:00' updated_at: type: string example: '2025-01-20 05:45:00' work_started_at: type: string example: '2025-01-20 05:30:00' work_finished_at: type: string example: null nullable: true arrived_at: type: string example: null nullable: true geozone_entered_at: type: string example: null nullable: true geozone_left_at: type: string example: null nullable: true sender: type: string example: DirectoAPI tracking_nr: type: string example: abc123xyz789def456 task_notes: type: string example: 'Border documents ready' active: type: boolean example: true group_id: type: integer example: 20 fish_document_id: type: string example: null nullable: true is_not_own_vehicle: type: boolean example: false customer_id: type: string example: null nullable: true carrier_id: type: string example: null nullable: true trailer_nr: type: string example: null nullable: true sender_id: type: string example: null nullable: true driver_notes: type: string example: 'Contact receiver 1 hour before arrival' hasGz: type: boolean example: false planned_km: type: string example: null nullable: true distance: type: string example: null nullable: true contact_name: type: string example: 'Maria Vasileva' contact_email: type: string example: maria@example.lt contact_sender: type: string example: SENDER123 contact_receiver: type: string example: 'ABC Logistics Ltd' contact_trailer: type: string example: TRL456 contact_order: type: string example: ORD-DIR-055 contact_delivery_term: type: string example: DAP contact_language: type: string example: en delivery_name: type: string example: 'Tech Solutions UAB' delivery_address: type: string example: 'Vilnius, Lithuania' delivery_address1: type: string example: 'Industrial Street 15' delivery_address2: type: string example: 'Vilnius, LT-01100' delivery_address3: type: string example: Lithuania phone: type: string example: '+37061234567' start_address1: type: string example: 'Logistics Center' start_address2: type: string example: 'Tallinn Port' start_address3: type: string example: Estonia sent_time: type: string example: null nullable: true weight: type: integer example: 12000 hash: type: string example: abc123def456 amount: type: integer example: 150 products: type: array example: [] files: type: array example: [] signatures: type: array example: [] waypoints: type: array example: [] audits: type: array example: [] waybills: type: array example: [] example: - id: 12348 oid: metrotec object_id: INT-TRUCK-02 lat: 54.687 lon: 25.279 start_lat: 59.437 start_lon: 24.754 start_address: 'Tallinn Logistics Center' start_time: '2025-01-20 05:00:00' stop_time: '2025-01-21 18:00:00' order_ref: DIR-2025-055 order_details: 'Electronics to Lithuania' task_address: 'Vilnius, Lithuania' task_description: 'Electronics transport to Lithuania' cancel_reason: null status: 2 created_at: '2025-01-19 12:00:00' updated_at: '2025-01-20 05:45:00' work_started_at: '2025-01-20 05:30:00' work_finished_at: null arrived_at: null geozone_entered_at: null geozone_left_at: null sender: DirectoAPI tracking_nr: abc123xyz789def456 task_notes: 'Border documents ready' active: true group_id: 20 fish_document_id: null is_not_own_vehicle: false customer_id: null carrier_id: null trailer_nr: null sender_id: null driver_notes: 'Contact receiver 1 hour before arrival' hasGz: false planned_km: null distance: null contact_name: 'Maria Vasileva' contact_email: maria@example.lt contact_sender: SENDER123 contact_receiver: 'ABC Logistics Ltd' contact_trailer: TRL456 contact_order: ORD-DIR-055 contact_delivery_term: DAP contact_language: en delivery_name: 'Tech Solutions UAB' delivery_address: 'Vilnius, Lithuania' delivery_address1: 'Industrial Street 15' delivery_address2: 'Vilnius, LT-01100' delivery_address3: Lithuania phone: '+37061234567' start_address1: 'Logistics Center' start_address2: 'Tallinn Port' start_address3: Estonia sent_time: null weight: 12000 hash: abc123def456 amount: 150 products: [] files: [] signatures: [] waypoints: [] audits: [] waybills: [] - description: 'Esvika Task' type: array items: type: object properties: id: type: integer example: 12349 oid: type: string example: metrotec object_id: type: string example: ESV-TRUCK-08 lat: type: number example: 60.169 lon: type: number example: 24.938 start_lat: type: number example: 59.437 start_lon: type: number example: 24.754 start_address: type: string example: 'Tallinn Distribution Center' start_time: type: string example: '2025-01-20 07:00:00' stop_time: type: string example: '2025-01-20 16:00:00' order_ref: type: string example: ESV-2025-220 order_details: type: string example: 'Container to Helsinki Port' task_address: type: string example: 'Helsinki Port, Finland' task_description: type: string example: 'Container transport to Helsinki' cancel_reason: type: string example: null nullable: true status: type: integer example: 2 created_at: type: string example: '2025-01-19 13:30:00' updated_at: type: string example: '2025-01-20 07:20:00' work_started_at: type: string example: '2025-01-20 07:10:00' work_finished_at: type: string example: null nullable: true arrived_at: type: string example: null nullable: true geozone_entered_at: type: string example: null nullable: true geozone_left_at: type: string example: null nullable: true sender: type: string example: EsvikaAPI tracking_nr: type: string example: abc123xyz789def456 task_notes: type: string example: 'Ferry booking confirmed' active: type: boolean example: true group_id: type: integer example: 25 fish_document_id: type: string example: null nullable: true is_not_own_vehicle: type: boolean example: false customer_id: type: string example: null nullable: true carrier_id: type: string example: null nullable: true trailer_nr: type: string example: null nullable: true sender_id: type: string example: null nullable: true driver_notes: type: string example: null nullable: true hasGz: type: boolean example: false planned_km: type: string example: null nullable: true distance: type: string example: null nullable: true contact_name: type: string example: 'Pekka Virtanen' contact_country_code: type: string example: '+358' contact_phone_nr: type: string example: '401234567' amount: type: number example: 1.0 weight: type: integer example: 22000 order_number: type: string example: ORD-FI-2025-100 carrier: type: string example: 'Nordic Transport Oy' vehicle_type: type: string example: Curtainsider receiver_name: type: string example: 'Helsinki Logistics Oy' receiver_email: type: string example: receiver@logistics.fi unloading_time: type: integer example: 45 products: type: array example: [] files: type: array example: [] signatures: type: array example: [] waypoints: type: array example: [] audits: type: array example: [] waybills: type: array example: [] example: - id: 12349 oid: metrotec object_id: ESV-TRUCK-08 lat: 60.169 lon: 24.938 start_lat: 59.437 start_lon: 24.754 start_address: 'Tallinn Distribution Center' start_time: '2025-01-20 07:00:00' stop_time: '2025-01-20 16:00:00' order_ref: ESV-2025-220 order_details: 'Container to Helsinki Port' task_address: 'Helsinki Port, Finland' task_description: 'Container transport to Helsinki' cancel_reason: null status: 2 created_at: '2025-01-19 13:30:00' updated_at: '2025-01-20 07:20:00' work_started_at: '2025-01-20 07:10:00' work_finished_at: null arrived_at: null geozone_entered_at: null geozone_left_at: null sender: EsvikaAPI tracking_nr: abc123xyz789def456 task_notes: 'Ferry booking confirmed' active: true group_id: 25 fish_document_id: null is_not_own_vehicle: false customer_id: null carrier_id: null trailer_nr: null sender_id: null driver_notes: null hasGz: false planned_km: null distance: null contact_name: 'Pekka Virtanen' contact_country_code: '+358' contact_phone_nr: '401234567' amount: 1.0 weight: 22000 order_number: ORD-FI-2025-100 carrier: 'Nordic Transport Oy' vehicle_type: Curtainsider receiver_name: 'Helsinki Logistics Oy' receiver_email: receiver@logistics.fi unloading_time: 45 products: [] files: [] signatures: [] waypoints: [] audits: [] waybills: [] - description: 'Olaret Task' type: array items: type: object properties: id: type: integer example: 12350 oid: type: string example: metrotec object_id: type: string example: CONTAINER-TRUCK-03 lat: type: number example: 59.437 lon: type: number example: 24.754 start_lat: type: string example: null nullable: true start_lon: type: string example: null nullable: true start_address: type: string example: null nullable: true start_time: type: string example: '2025-01-20 09:00:00' stop_time: type: string example: '2025-01-20 15:00:00' order_ref: type: string example: OLA-2025-456 order_details: type: string example: 'Container pickup' task_address: type: string example: 'Container Terminal, Port of Tallinn' task_description: type: string example: 'Container pickup and delivery' cancel_reason: type: string example: null nullable: true status: type: integer example: 1 created_at: type: string example: '2025-01-19 17:00:00' updated_at: type: string example: '2025-01-19 17:00:00' work_started_at: type: string example: null nullable: true work_finished_at: type: string example: null nullable: true arrived_at: type: string example: null nullable: true geozone_entered_at: type: string example: null nullable: true geozone_left_at: type: string example: null nullable: true sender: type: string example: OlaretAPI tracking_nr: type: string example: abc123xyz789def456 task_notes: type: string example: 'Terminal gate code: 1234' active: type: boolean example: true group_id: type: string example: null nullable: true fish_document_id: type: string example: null nullable: true is_not_own_vehicle: type: boolean example: false customer_id: type: string example: null nullable: true carrier_id: type: string example: null nullable: true trailer_nr: type: string example: null nullable: true sender_id: type: string example: null nullable: true driver_notes: type: string example: null nullable: true hasGz: type: boolean example: false planned_km: type: string example: null nullable: true distance: type: string example: null nullable: true worder: type: string example: WO_2025_456 do_send: type: boolean example: true containerno: type: string example: MSCU1234567 products: type: array example: [] files: type: array example: [] signatures: type: array example: [] waypoints: type: array example: [] audits: type: array example: [] waybills: type: array example: [] example: - id: 12350 oid: metrotec object_id: CONTAINER-TRUCK-03 lat: 59.437 lon: 24.754 start_lat: null start_lon: null start_address: null start_time: '2025-01-20 09:00:00' stop_time: '2025-01-20 15:00:00' order_ref: OLA-2025-456 order_details: 'Container pickup' task_address: 'Container Terminal, Port of Tallinn' task_description: 'Container pickup and delivery' cancel_reason: null status: 1 created_at: '2025-01-19 17:00:00' updated_at: '2025-01-19 17:00:00' work_started_at: null work_finished_at: null arrived_at: null geozone_entered_at: null geozone_left_at: null sender: OlaretAPI tracking_nr: abc123xyz789def456 task_notes: 'Terminal gate code: 1234' active: true group_id: null fish_document_id: null is_not_own_vehicle: false customer_id: null carrier_id: null trailer_nr: null sender_id: null driver_notes: null hasGz: false planned_km: null distance: null worder: WO_2025_456 do_send: true containerno: MSCU1234567 products: [] files: [] signatures: [] waypoints: [] audits: [] waybills: [] - description: 'LotusTimber Task' type: array items: type: object properties: id: type: integer example: 12351 oid: type: string example: metrotec object_id: type: string example: TIMBER-TRUCK-01 lat: type: number example: 58.378 lon: type: number example: 26.729 start_lat: type: number example: 59.437 start_lon: type: number example: 24.754 start_address: type: string example: 'Timber Yard, Tallinn' start_time: type: string example: '2025-01-20 06:00:00' stop_time: type: string example: '2025-01-20 14:00:00' order_ref: type: string example: LOTUS-2025-001 order_details: type: string example: 'Timber delivery to sawmill' task_address: type: string example: 'Sawmill, Tartu' task_description: type: string example: 'Timber transport' cancel_reason: type: string example: null nullable: true status: type: integer example: 2 created_at: type: string example: '2025-01-19 15:00:00' updated_at: type: string example: '2025-01-20 06:30:00' work_started_at: type: string example: '2025-01-20 06:15:00' work_finished_at: type: string example: null nullable: true arrived_at: type: string example: null nullable: true geozone_entered_at: type: string example: null nullable: true geozone_left_at: type: string example: null nullable: true sender: type: string example: LotusTimberAPI tracking_nr: type: string example: abc123xyz789def456 task_notes: type: string example: 'Handle with care' active: type: boolean example: true group_id: type: string example: null nullable: true fish_document_id: type: string example: null nullable: true is_not_own_vehicle: type: boolean example: false customer_id: type: integer example: 1 carrier_id: type: integer example: 2 trailer_nr: type: string example: TRL-789 sender_id: type: string example: null nullable: true driver_notes: type: string example: null nullable: true hasGz: type: boolean example: false planned_km: type: string example: null nullable: true distance: type: string example: null nullable: true products: type: array example: [] files: type: array example: [] signatures: type: array example: [] waypoints: type: array example: [] audits: type: array example: [] waybills: type: array example: [] example: - id: 12351 oid: metrotec object_id: TIMBER-TRUCK-01 lat: 58.378 lon: 26.729 start_lat: 59.437 start_lon: 24.754 start_address: 'Timber Yard, Tallinn' start_time: '2025-01-20 06:00:00' stop_time: '2025-01-20 14:00:00' order_ref: LOTUS-2025-001 order_details: 'Timber delivery to sawmill' task_address: 'Sawmill, Tartu' task_description: 'Timber transport' cancel_reason: null status: 2 created_at: '2025-01-19 15:00:00' updated_at: '2025-01-20 06:30:00' work_started_at: '2025-01-20 06:15:00' work_finished_at: null arrived_at: null geozone_entered_at: null geozone_left_at: null sender: LotusTimberAPI tracking_nr: abc123xyz789def456 task_notes: 'Handle with care' active: true group_id: null fish_document_id: null is_not_own_vehicle: false customer_id: 1 carrier_id: 2 trailer_nr: TRL-789 sender_id: null driver_notes: null hasGz: false planned_km: null distance: null products: [] files: [] signatures: [] waypoints: [] audits: [] waybills: [] - description: 'Veokeskus Task' type: array items: type: object properties: id: type: integer example: 12350 oid: type: string example: metrotec object_id: type: string example: VEO-TRUCK-01 lat: type: number example: 59.437 lon: type: number example: 24.754 start_lat: type: number example: 59.395 start_lon: type: number example: 24.662 start_address: type: string example: 'Tallinn Warehouse' start_time: type: string example: '2025-01-20 08:00:00' stop_time: type: string example: '2025-01-20 17:00:00' order_ref: type: string example: VEO-2025-001 order_details: type: string example: 'Full truck load delivery' task_address: type: string example: 'Tartu, Estonia' task_description: type: string example: 'Delivery to distribution center' cancel_reason: type: string example: null nullable: true status: type: integer example: 2 created_at: type: string example: '2025-01-19 14:00:00' updated_at: type: string example: '2025-01-20 08:15:00' work_started_at: type: string example: '2025-01-20 08:05:00' work_finished_at: type: string example: null nullable: true arrived_at: type: string example: null nullable: true geozone_entered_at: type: string example: null nullable: true geozone_left_at: type: string example: null nullable: true sender: type: string example: VeokeskusAPI tracking_nr: type: string example: veo123abc789xyz456 task_notes: type: string example: 'Delivery note required' active: type: boolean example: true group_id: type: integer example: 30 fish_document_id: type: string example: null nullable: true is_not_own_vehicle: type: boolean example: false customer_id: type: string example: null nullable: true carrier_id: type: string example: null nullable: true trailer_nr: type: string example: null nullable: true sender_id: type: string example: null nullable: true driver_notes: type: string example: null nullable: true hasGz: type: boolean example: false planned_km: type: string example: null nullable: true distance: type: string example: null nullable: true contact_name: type: string example: 'Mart Tamm' contact_country_code: type: string example: '+372' contact_phone_nr: type: string example: '5551234' amount: type: integer example: 24 weight: type: integer example: 18000 order_number: type: string example: null nullable: true carrier: type: string example: null nullable: true vehicle_type: type: string example: 'Box truck' receiver_name: type: string example: 'Tartu Logistics OU' receiver_email: type: string example: receiver@logistics.ee unloading_time: type: integer example: 60 products: type: array example: [] files: type: array example: [] signatures: type: array example: [] waypoints: type: array example: [] audits: type: array example: [] waybills: type: array example: [] example: - id: 12350 oid: metrotec object_id: VEO-TRUCK-01 lat: 59.437 lon: 24.754 start_lat: 59.395 start_lon: 24.662 start_address: 'Tallinn Warehouse' start_time: '2025-01-20 08:00:00' stop_time: '2025-01-20 17:00:00' order_ref: VEO-2025-001 order_details: 'Full truck load delivery' task_address: 'Tartu, Estonia' task_description: 'Delivery to distribution center' cancel_reason: null status: 2 created_at: '2025-01-19 14:00:00' updated_at: '2025-01-20 08:15:00' work_started_at: '2025-01-20 08:05:00' work_finished_at: null arrived_at: null geozone_entered_at: null geozone_left_at: null sender: VeokeskusAPI tracking_nr: veo123abc789xyz456 task_notes: 'Delivery note required' active: true group_id: 30 fish_document_id: null is_not_own_vehicle: false customer_id: null carrier_id: null trailer_nr: null sender_id: null driver_notes: null hasGz: false planned_km: null distance: null contact_name: 'Mart Tamm' contact_country_code: '+372' contact_phone_nr: '5551234' amount: 24 weight: 18000 order_number: null carrier: null vehicle_type: 'Box truck' receiver_name: 'Tartu Logistics OU' receiver_email: receiver@logistics.ee unloading_time: 60 products: [] files: [] signatures: [] waypoints: [] audits: [] waybills: [] tags: - 'Route Tasks' security: [] post: summary: 'Create a new task' operationId: createANewTask description: "Creates a new route task. The available fields depend on the user's profile type.\nAll task types share common base fields (documented below), with additional profile-specific\nfields listed per scenario.\n\n**Validation overrides by profile:**\n- **Rudus, Padapigi, Directo, Esvika, Veokeskus, Morobell**: `object_id` becomes optional (nullable)\n- **Rudus, Directo**: `lat` and `lon` become optional (nullable)\n- **Directo**: `task_address` max length constraint is removed\n\n

Request Body per Profile

\n\n
\nRudus\n\n
{\n    "object_id": "ABC123",\n    "lat": 59.437,\n    "lon": 24.7536,\n    "start_time": "2025-01-15 08:00:00",\n    "stop_time": "2025-01-15 17:00:00",\n    "task_address": "Construction Site, Tartu",\n    "order_ref": "ORD-2025-001",\n    "status": 1,\n    "preparation_time": "2025-01-15 07:30:00",\n    "volume": 8.5,\n    "client_id": "CLIENT123",\n    "ordered_volume": 10,\n    "delivered_volume": 8.2,\n    "pumped_volume": 8,\n    "dn_trash": "0.5",\n    "dn_plastic": "1.2",\n    "dn_water": "10.5",\n    "categoryID": 15,\n    "client_emails": [\n        "client@example.com"\n    ],\n    "last_cargo": 0,\n    "geozone_entered_at": "2025-01-15 11:20:00",\n    "arrived_at": "2025-01-15 11:15:00",\n    "geozone_left_at": "2025-01-15 11:50:00",\n    "work_finished_at": "2025-01-15 11:45:00",\n    "concrete_type": "C30/37",\n    "concrete_strength_class": "C30",\n    "environmental_class": "XC3",\n    "dmax": "16",\n    "consistency_class": "S3",\n    "cement_type": "CEM II/A-LL 42,5N",\n    "additives": "Superplasticizer",\n    "concrete_extra_info": "High durability",\n    "concrete_extra_info2": "Special finish",\n    "unload_method": "Pump",\n    "driving_instructions": "Use back entrance",\n    "offer_number": "OFF-2025-123",\n    "work_order_number": "WO-2025-456",\n    "notes": "Handle with care",\n    "operator_name": "John Smith",\n    "pumper_name": "ABC Pumping Ltd",\n    "pump_type": "Stationary",\n    "factory_id": 5,\n    "client_address": "123 Construction Ave",\n    "other_object_id": "PUMP-01",\n    "products": [\n        {\n            "product_id": 1,\n            "quantity": 8.5,\n            "weight": 150\n        }\n    ]\n}
\n
\n\n
\nPadapigi\n\n
{\n    "object_id": "ABC123",\n    "lat": 59.437,\n    "lon": 24.7536,\n    "start_time": "2025-01-15 08:00:00",\n    "stop_time": "2025-01-15 17:00:00",\n    "task_address": "Customer Site, Tartu",\n    "order_ref": "ORD-2025-001",\n    "status": 1,\n    "contact_name": "John Doe",\n    "contact_country_code": "+372",\n    "contact_phone_nr": "5551234",\n    "product_name": "Electronic Components",\n    "project_nr": "PROJ-2025-10",\n    "weight": 15000,\n    "amount": 24,\n    "carrier": "Baltic Express",\n    "receiver_email": "receiver@example.com",\n    "receiver_name": "Tech Solutions UAB",\n    "directo_invoice": "987654",\n    "own_transport": true,\n    "products": [\n        {\n            "product_id": 1,\n            "quantity": 24,\n            "weight": 15000\n        }\n    ]\n}
\n
\n\n
\nDirecto\n\n
{\n    "object_id": "ABC123",\n    "lat": 59.437,\n    "lon": 24.7536,\n    "start_time": "2025-01-15 08:00:00",\n    "stop_time": "2025-01-15 17:00:00",\n    "task_address": "Customer Site, Tartu",\n    "order_ref": "ORD-2025-001",\n    "status": 1,\n    "contact_name": "John Doe",\n    "contact_email": "john@example.com",\n    "contact_sender": "SENDER123",\n    "contact_receiver": "ABC Logistics Ltd",\n    "contact_trailer": "TRL456",\n    "contact_order": "ORD-DIR-100",\n    "contact_delivery_term": "DAP",\n    "contact_language": "eng",\n    "delivery_name": "ABC Logistics Ltd",\n    "delivery_address1": "Industrial Street 15",\n    "delivery_address2": "Riga, LV-1234",\n    "delivery_address3": "Latvia",\n    "start_address1": "Warehouse A",\n    "start_address2": "Tallinn Port",\n    "start_address3": "Estonia",\n    "weight": 15000,\n    "amount": 24,\n    "hash": "abc123def456",\n    "products": [\n        {\n            "product_id": 1,\n            "quantity": 24,\n            "weight": 15000\n        }\n    ]\n}
\n
\n\n
\nEsvika\n\n
{\n    "object_id": "ABC123",\n    "lat": 59.437,\n    "lon": 24.7536,\n    "start_time": "2025-01-15 08:00:00",\n    "stop_time": "2025-01-15 17:00:00",\n    "task_address": "Customer Site, Tartu",\n    "order_ref": "ORD-2025-001",\n    "status": 1,\n    "contact_name": "John Doe",\n    "contact_country_code": "+372",\n    "contact_phone_nr": "5551234",\n    "amount": 24,\n    "weight": 15000,\n    "vehicle_type": "Curtainsider",\n    "carrier": "Baltic Express",\n    "order_number": "ORD-FI-2025-100",\n    "unloading_time": 45,\n    "products": [\n        {\n            "product_id": 1,\n            "quantity": 24,\n            "weight": 15000\n        }\n    ]\n}
\n
\n\n
\nOlaret\n\n
{\n    "object_id": "ABC123",\n    "lat": 59.437,\n    "lon": 24.7536,\n    "start_time": "2025-01-15 08:00:00",\n    "stop_time": "2025-01-15 17:00:00",\n    "task_address": "Port Terminal, Tallinn",\n    "order_ref": "ORD-2025-001",\n    "status": 1,\n    "worder": "WO_2025_456",\n    "do_send": true,\n    "containerno": "MSCU1234567",\n    "products": [\n        {\n            "product_id": 1,\n            "quantity": 1,\n            "weight": 5000\n        }\n    ]\n}
\n
\n\n
\nLotusTimber\n\n
{\n    "object_id": "ABC123",\n    "lat": 59.437,\n    "lon": 24.7536,\n    "start_time": "2025-01-15 08:00:00",\n    "stop_time": "2025-01-15 17:00:00",\n    "task_address": "Timber Yard, Pärnu",\n    "order_ref": "ORD-2025-001",\n    "status": 1,\n    "customer_id": 1,\n    "carrier_id": 2,\n    "trailer_nr": "TRL-789",\n    "contact_name": "John Doe",\n    "contact_country_code": "+372",\n    "contact_phone_nr": "5551234",\n    "receiver_name": "Tech Solutions UAB",\n    "receiver_email": "receiver@example.com",\n    "products": [\n        {\n            "product_id": 1,\n            "quantity": 30,\n            "weight": 25000\n        }\n    ]\n}
\n
\n\n
\nVeokeskus\n\n
{\n    "object_id": "ABC123",\n    "lat": 59.437,\n    "lon": 24.7536,\n    "start_time": "2025-01-15 08:00:00",\n    "stop_time": "2025-01-15 17:00:00",\n    "task_address": "Customer Site, Tartu",\n    "order_ref": "ORD-2025-001",\n    "status": 1,\n    "contact_name": "John Doe",\n    "contact_country_code": "+372",\n    "contact_phone_nr": "5551234",\n    "amount": 24,\n    "weight": 15000,\n    "receiver_email": "receiver@example.com",\n    "receiver_name": "Tech Solutions UAB",\n    "vehicle_type": "Curtainsider",\n    "unloading_time": 45,\n    "products": [\n        {\n            "product_id": 1,\n            "quantity": 24,\n            "weight": 15000\n        }\n    ]\n}
\n
\n\n
\nMorobell\n\n
{\n    "object_id": "ABC123",\n    "lat": 59.437,\n    "lon": 24.7536,\n    "start_time": "2025-01-15 08:00:00",\n    "stop_time": "2025-01-15 17:00:00",\n    "task_address": "Customer Site, Tartu",\n    "order_ref": "ORD-2025-001",\n    "status": 1,\n    "contact_name": "John Doe",\n    "contact_country_code": "+372",\n    "contact_phone_nr": "5551234",\n    "receiver_email": "receiver@example.com",\n    "receiver_name": "Tech Solutions UAB",\n    "added_documents": "CMR, invoice",\n    "seal_number": "SEAL-12345",\n    "fish_document_id": 1,\n    "products": [\n        {\n            "product_id": 1,\n            "quantity": 10,\n            "weight": 500\n        }\n    ]\n}
\n
" parameters: [] responses: 201: description: '' content: application/json: schema: oneOf: - description: 'Standard Task' type: object example: id: 12346 oid: metrotec object_id: ABC123 lat: 59.437 lon: 24.754 start_lat: null start_lon: null start_address: null start_time: '2025-01-20 08:00:00' stop_time: '2025-01-20 17:00:00' order_ref: ORDER-2025-001 order_details: null task_address: 'Tallinn, Estonia' task_description: 'Standard delivery task' cancel_reason: null status: 1 created_at: '2025-01-19 16:00:00' updated_at: '2025-01-19 16:00:00' sender: DispatchSystem tracking_nr: abc123xyz789def456 task_notes: null active: true group_id: null is_not_own_vehicle: false products: [] files: [] signatures: [] properties: id: type: integer example: 12346 oid: type: string example: metrotec object_id: type: string example: ABC123 lat: type: number example: 59.437 lon: type: number example: 24.754 start_lat: type: string example: null nullable: true start_lon: type: string example: null nullable: true start_address: type: string example: null nullable: true start_time: type: string example: '2025-01-20 08:00:00' stop_time: type: string example: '2025-01-20 17:00:00' order_ref: type: string example: ORDER-2025-001 order_details: type: string example: null nullable: true task_address: type: string example: 'Tallinn, Estonia' task_description: type: string example: 'Standard delivery task' cancel_reason: type: string example: null nullable: true status: type: integer example: 1 created_at: type: string example: '2025-01-19 16:00:00' updated_at: type: string example: '2025-01-19 16:00:00' sender: type: string example: DispatchSystem tracking_nr: type: string example: abc123xyz789def456 task_notes: type: string example: null nullable: true active: type: boolean example: true group_id: type: string example: null nullable: true is_not_own_vehicle: type: boolean example: false products: type: array example: [] files: type: array example: [] signatures: type: array example: [] - description: 'Rudus Task' type: object example: id: 12345 oid: metrotec object_id: RUDUS-01 lat: 59.437 lon: 24.754 start_lat: 59.395 start_lon: 24.662 start_address: 'Factory, Tallinn' start_time: '2025-01-20 08:00:00' stop_time: '2025-01-20 12:00:00' order_ref: RUDUS-2025-001 order_details: 'Client: Construction Site A' task_address: 'Construction Site A, Tallinn' task_description: 'Concrete delivery C30/37' cancel_reason: null status: 1 created_at: '2025-01-19 15:30:00' updated_at: '2025-01-19 15:30:00' sender: RudusAPI tracking_nr: abc123xyz789def456 task_notes: 'Special delivery' active: true group_id: 10 is_not_own_vehicle: false preparation_time: '2025-01-20 07:30:00' volume: 8.5 client_id: CLIENT123 ordered_volume: 10.0 delivered_volume: 8.2 pumped_volume: 8.0 dn_trash: '0.5' dn_plastic: '1.2' dn_water: '10.5' categoryID: 15 client_emails: - client@example.com - manager@example.com last_cargo: 0 concrete_type: C30/37 concrete_strength_class: C30 environmental_class: XC3 dmax: '16' consistency_class: S3 cement_type: 'CEM II/A-LL 42,5N' additives: Superplasticizer concrete_extra_info: 'High durability' concrete_extra_info2: 'Special finish required' unload_method: Pump driving_instructions: 'Use back entrance' offer_number: OFF-2025-123 work_order_number: WO-2025-456 notes: 'Handle with care' operator_name: 'John Smith' pumper_name: 'ABC Pumping Ltd' pump_type: Stationary factory_id: 5 client_address: '123 Construction Ave' other_object_id: PUMP-01 products: [] files: [] signatures: [] properties: id: type: integer example: 12345 oid: type: string example: metrotec object_id: type: string example: RUDUS-01 lat: type: number example: 59.437 lon: type: number example: 24.754 start_lat: type: number example: 59.395 start_lon: type: number example: 24.662 start_address: type: string example: 'Factory, Tallinn' start_time: type: string example: '2025-01-20 08:00:00' stop_time: type: string example: '2025-01-20 12:00:00' order_ref: type: string example: RUDUS-2025-001 order_details: type: string example: 'Client: Construction Site A' task_address: type: string example: 'Construction Site A, Tallinn' task_description: type: string example: 'Concrete delivery C30/37' cancel_reason: type: string example: null nullable: true status: type: integer example: 1 created_at: type: string example: '2025-01-19 15:30:00' updated_at: type: string example: '2025-01-19 15:30:00' sender: type: string example: RudusAPI tracking_nr: type: string example: abc123xyz789def456 task_notes: type: string example: 'Special delivery' active: type: boolean example: true group_id: type: integer example: 10 is_not_own_vehicle: type: boolean example: false preparation_time: type: string example: '2025-01-20 07:30:00' volume: type: number example: 8.5 client_id: type: string example: CLIENT123 ordered_volume: type: number example: 10.0 delivered_volume: type: number example: 8.2 pumped_volume: type: number example: 8.0 dn_trash: type: string example: '0.5' dn_plastic: type: string example: '1.2' dn_water: type: string example: '10.5' categoryID: type: integer example: 15 client_emails: type: array example: - client@example.com - manager@example.com items: type: string last_cargo: type: integer example: 0 concrete_type: type: string example: C30/37 concrete_strength_class: type: string example: C30 environmental_class: type: string example: XC3 dmax: type: string example: '16' consistency_class: type: string example: S3 cement_type: type: string example: 'CEM II/A-LL 42,5N' additives: type: string example: Superplasticizer concrete_extra_info: type: string example: 'High durability' concrete_extra_info2: type: string example: 'Special finish required' unload_method: type: string example: Pump driving_instructions: type: string example: 'Use back entrance' offer_number: type: string example: OFF-2025-123 work_order_number: type: string example: WO-2025-456 notes: type: string example: 'Handle with care' operator_name: type: string example: 'John Smith' pumper_name: type: string example: 'ABC Pumping Ltd' pump_type: type: string example: Stationary factory_id: type: integer example: 5 client_address: type: string example: '123 Construction Ave' other_object_id: type: string example: PUMP-01 products: type: array example: [] files: type: array example: [] signatures: type: array example: [] - description: 'Padapigi Task' type: object example: id: 12347 oid: metrotec object_id: TRUCK-05 lat: 59.437 lon: 24.754 start_lat: 59.395 start_lon: 24.662 start_address: 'Warehouse A, Tallinn' start_time: '2025-01-20 06:00:00' stop_time: '2025-01-20 18:00:00' order_ref: PAD-2025-100 order_details: 'CMR delivery to Latvia' task_address: 'Warehouse District, Tallinn' task_description: 'International delivery to Latvia' cancel_reason: null status: 1 created_at: '2025-01-19 14:00:00' updated_at: '2025-01-19 14:00:00' sender: PadapigiAPI tracking_nr: abc123xyz789def456 task_notes: 'CMR documents prepared' active: false group_id: 15 is_not_own_vehicle: false contact_name: 'John Doe' contact_email: john.doe@example.com contact_sender: SENDER123 contact_receiver: 'ABC Logistics Ltd' contact_trailer: TRL456 contact_order: ORD-PAD-100 contact_delivery_term: DAP contact_language: en delivery_name: 'ABC Logistics Ltd' delivery_address1: 'Industrial Street 15' delivery_address2: 'Riga, LV-1234' delivery_address3: Latvia start_address1: 'Warehouse A' start_address2: 'Tallinn Port' start_address3: Estonia weight: 15000 amount: 24 hash: abc123def456 products: [] files: [] signatures: [] properties: id: type: integer example: 12347 oid: type: string example: metrotec object_id: type: string example: TRUCK-05 lat: type: number example: 59.437 lon: type: number example: 24.754 start_lat: type: number example: 59.395 start_lon: type: number example: 24.662 start_address: type: string example: 'Warehouse A, Tallinn' start_time: type: string example: '2025-01-20 06:00:00' stop_time: type: string example: '2025-01-20 18:00:00' order_ref: type: string example: PAD-2025-100 order_details: type: string example: 'CMR delivery to Latvia' task_address: type: string example: 'Warehouse District, Tallinn' task_description: type: string example: 'International delivery to Latvia' cancel_reason: type: string example: null nullable: true status: type: integer example: 1 created_at: type: string example: '2025-01-19 14:00:00' updated_at: type: string example: '2025-01-19 14:00:00' sender: type: string example: PadapigiAPI tracking_nr: type: string example: abc123xyz789def456 task_notes: type: string example: 'CMR documents prepared' active: type: boolean example: false group_id: type: integer example: 15 is_not_own_vehicle: type: boolean example: false contact_name: type: string example: 'John Doe' contact_email: type: string example: john.doe@example.com contact_sender: type: string example: SENDER123 contact_receiver: type: string example: 'ABC Logistics Ltd' contact_trailer: type: string example: TRL456 contact_order: type: string example: ORD-PAD-100 contact_delivery_term: type: string example: DAP contact_language: type: string example: en delivery_name: type: string example: 'ABC Logistics Ltd' delivery_address1: type: string example: 'Industrial Street 15' delivery_address2: type: string example: 'Riga, LV-1234' delivery_address3: type: string example: Latvia start_address1: type: string example: 'Warehouse A' start_address2: type: string example: 'Tallinn Port' start_address3: type: string example: Estonia weight: type: integer example: 15000 amount: type: integer example: 24 hash: type: string example: abc123def456 products: type: array example: [] files: type: array example: [] signatures: type: array example: [] - description: 'Directo Task' type: object example: id: 12348 oid: metrotec object_id: INT-TRUCK-02 lat: 54.687 lon: 25.279 start_lat: 59.437 start_lon: 24.754 start_address: 'Tallinn Logistics Center' start_time: '2025-01-20 05:00:00' stop_time: '2025-01-21 18:00:00' order_ref: DIR-2025-055 order_details: 'Electronics to Lithuania' task_address: 'Vilnius, Lithuania' task_description: 'Electronics transport to Lithuania' cancel_reason: null status: 1 created_at: '2025-01-19 12:00:00' updated_at: '2025-01-19 12:00:00' sender: DirectoAPI tracking_nr: abc123xyz789def456 task_notes: 'Border documents ready' active: false group_id: 20 is_not_own_vehicle: false amount: 150 contact_name: 'Maria Vasileva' contact_country_code: '+370' contact_phone_nr: '61234567' product_name: 'Electronic Components' project_nr: PROJ-2025-10 weight: 12000 carrier: 'Baltic Express' receiver_email: receiver@example.lt receiver_name: 'Tech Solutions UAB' directo_invoice: '987654' driver_notes: 'Contact receiver 1 hour before arrival' own_transport: true products: [] files: [] signatures: [] properties: id: type: integer example: 12348 oid: type: string example: metrotec object_id: type: string example: INT-TRUCK-02 lat: type: number example: 54.687 lon: type: number example: 25.279 start_lat: type: number example: 59.437 start_lon: type: number example: 24.754 start_address: type: string example: 'Tallinn Logistics Center' start_time: type: string example: '2025-01-20 05:00:00' stop_time: type: string example: '2025-01-21 18:00:00' order_ref: type: string example: DIR-2025-055 order_details: type: string example: 'Electronics to Lithuania' task_address: type: string example: 'Vilnius, Lithuania' task_description: type: string example: 'Electronics transport to Lithuania' cancel_reason: type: string example: null nullable: true status: type: integer example: 1 created_at: type: string example: '2025-01-19 12:00:00' updated_at: type: string example: '2025-01-19 12:00:00' sender: type: string example: DirectoAPI tracking_nr: type: string example: abc123xyz789def456 task_notes: type: string example: 'Border documents ready' active: type: boolean example: false group_id: type: integer example: 20 is_not_own_vehicle: type: boolean example: false amount: type: integer example: 150 contact_name: type: string example: 'Maria Vasileva' contact_country_code: type: string example: '+370' contact_phone_nr: type: string example: '61234567' product_name: type: string example: 'Electronic Components' project_nr: type: string example: PROJ-2025-10 weight: type: integer example: 12000 carrier: type: string example: 'Baltic Express' receiver_email: type: string example: receiver@example.lt receiver_name: type: string example: 'Tech Solutions UAB' directo_invoice: type: string example: '987654' driver_notes: type: string example: 'Contact receiver 1 hour before arrival' own_transport: type: boolean example: true products: type: array example: [] files: type: array example: [] signatures: type: array example: [] - description: 'Esvika Task' type: object example: id: 12349 oid: metrotec object_id: ESV-TRUCK-08 lat: 60.169 lon: 24.938 start_lat: 59.437 start_lon: 24.754 start_address: 'Tallinn Distribution Center' start_time: '2025-01-20 07:00:00' stop_time: '2025-01-20 16:00:00' order_ref: ESV-2025-220 order_details: 'Container to Helsinki Port' task_address: 'Helsinki Port, Finland' task_description: 'Container transport to Helsinki' cancel_reason: null status: 1 created_at: '2025-01-19 13:30:00' updated_at: '2025-01-19 13:30:00' sender: EsvikaAPI tracking_nr: abc123xyz789def456 task_notes: 'Ferry booking confirmed' active: false group_id: 25 is_not_own_vehicle: false contact_name: 'Pekka Virtanen' contact_country_code: '+358' contact_phone_nr: '401234567' amount: 1.0 weight: 22000 vehicle_type: Curtainsider carrier: 'Nordic Transport Oy' order_number: ORD-FI-2025-100 unloading_time: 45 products: [] files: [] signatures: [] properties: id: type: integer example: 12349 oid: type: string example: metrotec object_id: type: string example: ESV-TRUCK-08 lat: type: number example: 60.169 lon: type: number example: 24.938 start_lat: type: number example: 59.437 start_lon: type: number example: 24.754 start_address: type: string example: 'Tallinn Distribution Center' start_time: type: string example: '2025-01-20 07:00:00' stop_time: type: string example: '2025-01-20 16:00:00' order_ref: type: string example: ESV-2025-220 order_details: type: string example: 'Container to Helsinki Port' task_address: type: string example: 'Helsinki Port, Finland' task_description: type: string example: 'Container transport to Helsinki' cancel_reason: type: string example: null nullable: true status: type: integer example: 1 created_at: type: string example: '2025-01-19 13:30:00' updated_at: type: string example: '2025-01-19 13:30:00' sender: type: string example: EsvikaAPI tracking_nr: type: string example: abc123xyz789def456 task_notes: type: string example: 'Ferry booking confirmed' active: type: boolean example: false group_id: type: integer example: 25 is_not_own_vehicle: type: boolean example: false contact_name: type: string example: 'Pekka Virtanen' contact_country_code: type: string example: '+358' contact_phone_nr: type: string example: '401234567' amount: type: number example: 1.0 weight: type: integer example: 22000 vehicle_type: type: string example: Curtainsider carrier: type: string example: 'Nordic Transport Oy' order_number: type: string example: ORD-FI-2025-100 unloading_time: type: integer example: 45 products: type: array example: [] files: type: array example: [] signatures: type: array example: [] - description: 'Olaret Task' type: object example: id: 12350 oid: metrotec object_id: CONTAINER-TRUCK-03 lat: 59.437 lon: 24.754 start_lat: null start_lon: null start_address: null start_time: '2025-01-20 09:00:00' stop_time: '2025-01-20 15:00:00' order_ref: OLA-2025-456 order_details: 'Container pickup' task_address: 'Container Terminal, Port of Tallinn' task_description: 'Container pickup and delivery' cancel_reason: null status: 1 created_at: '2025-01-19 17:00:00' updated_at: '2025-01-19 17:00:00' sender: OlaretAPI tracking_nr: abc123xyz789def456 task_notes: 'Terminal gate code: 1234' active: true group_id: null is_not_own_vehicle: false worder: WO_2025_456 containerno: MSCU1234567 do_send: true products: [] files: [] signatures: [] properties: id: type: integer example: 12350 oid: type: string example: metrotec object_id: type: string example: CONTAINER-TRUCK-03 lat: type: number example: 59.437 lon: type: number example: 24.754 start_lat: type: string example: null nullable: true start_lon: type: string example: null nullable: true start_address: type: string example: null nullable: true start_time: type: string example: '2025-01-20 09:00:00' stop_time: type: string example: '2025-01-20 15:00:00' order_ref: type: string example: OLA-2025-456 order_details: type: string example: 'Container pickup' task_address: type: string example: 'Container Terminal, Port of Tallinn' task_description: type: string example: 'Container pickup and delivery' cancel_reason: type: string example: null nullable: true status: type: integer example: 1 created_at: type: string example: '2025-01-19 17:00:00' updated_at: type: string example: '2025-01-19 17:00:00' sender: type: string example: OlaretAPI tracking_nr: type: string example: abc123xyz789def456 task_notes: type: string example: 'Terminal gate code: 1234' active: type: boolean example: true group_id: type: string example: null nullable: true is_not_own_vehicle: type: boolean example: false worder: type: string example: WO_2025_456 containerno: type: string example: MSCU1234567 do_send: type: boolean example: true products: type: array example: [] files: type: array example: [] signatures: type: array example: [] - description: 'LotusTimber Task' type: object example: id: 12351 oid: metrotec object_id: TIMBER-TRUCK-01 lat: 58.378 lon: 26.729 start_lat: 59.437 start_lon: 24.754 start_address: 'Timber Yard, Tallinn' start_time: '2025-01-20 06:00:00' stop_time: '2025-01-20 14:00:00' order_ref: LOTUS-2025-001 order_details: 'Timber delivery to sawmill' customer_id: 1 carrier_id: 2 trailer_nr: TRL-789 task_address: 'Sawmill, Tartu' task_description: 'Timber transport' cancel_reason: null status: 1 created_at: '2025-01-19 15:00:00' updated_at: '2025-01-19 15:00:00' sender: LotusTimberAPI tracking_nr: abc123xyz789def456 task_notes: 'Handle with care' active: true group_id: null is_not_own_vehicle: false products: - id: 1 name: 'Pine Logs' pivot: route_task_id: 12351 product_id: 1 quantity: '25.00' weight: '1500.00' created_at: '2025-01-19 15:00:00' updated_at: '2025-01-19 15:00:00' - id: 2 name: 'Spruce Logs' pivot: route_task_id: 12351 product_id: 2 quantity: '15.00' weight: '900.00' created_at: '2025-01-19 15:00:00' updated_at: '2025-01-19 15:00:00' files: [] signatures: [] properties: id: type: integer example: 12351 oid: type: string example: metrotec object_id: type: string example: TIMBER-TRUCK-01 lat: type: number example: 58.378 lon: type: number example: 26.729 start_lat: type: number example: 59.437 start_lon: type: number example: 24.754 start_address: type: string example: 'Timber Yard, Tallinn' start_time: type: string example: '2025-01-20 06:00:00' stop_time: type: string example: '2025-01-20 14:00:00' order_ref: type: string example: LOTUS-2025-001 order_details: type: string example: 'Timber delivery to sawmill' customer_id: type: integer example: 1 carrier_id: type: integer example: 2 trailer_nr: type: string example: TRL-789 task_address: type: string example: 'Sawmill, Tartu' task_description: type: string example: 'Timber transport' cancel_reason: type: string example: null nullable: true status: type: integer example: 1 created_at: type: string example: '2025-01-19 15:00:00' updated_at: type: string example: '2025-01-19 15:00:00' sender: type: string example: LotusTimberAPI tracking_nr: type: string example: abc123xyz789def456 task_notes: type: string example: 'Handle with care' active: type: boolean example: true group_id: type: string example: null nullable: true is_not_own_vehicle: type: boolean example: false products: type: array example: - id: 1 name: 'Pine Logs' pivot: route_task_id: 12351 product_id: 1 quantity: '25.00' weight: '1500.00' created_at: '2025-01-19 15:00:00' updated_at: '2025-01-19 15:00:00' - id: 2 name: 'Spruce Logs' pivot: route_task_id: 12351 product_id: 2 quantity: '15.00' weight: '900.00' created_at: '2025-01-19 15:00:00' updated_at: '2025-01-19 15:00:00' items: type: object properties: id: type: integer example: 1 name: type: string example: 'Pine Logs' pivot: type: object properties: route_task_id: type: integer example: 12351 product_id: type: integer example: 1 quantity: type: string example: '25.00' weight: type: string example: '1500.00' created_at: type: string example: '2025-01-19 15:00:00' updated_at: type: string example: '2025-01-19 15:00:00' files: type: array example: [] signatures: type: array example: [] - description: 'Veokeskus Task' type: object example: id: 12350 oid: metrotec object_id: VEO-TRUCK-01 lat: 59.437 lon: 24.754 start_lat: 59.395 start_lon: 24.662 start_address: 'Tallinn Warehouse' start_time: '2025-01-20 08:00:00' stop_time: '2025-01-20 17:00:00' order_ref: VEO-2025-001 order_details: 'Full truck load delivery' task_address: 'Tartu, Estonia' task_description: 'Delivery to distribution center' cancel_reason: null status: 1 created_at: '2025-01-20 07:00:00' updated_at: '2025-01-20 07:00:00' sender: VeokeskusAPI tracking_nr: veo123abc789xyz456 task_notes: 'Delivery note required' active: false group_id: 30 is_not_own_vehicle: false contact_name: 'Mart Tamm' contact_country_code: '+372' contact_phone_nr: '5551234' amount: 24 weight: 18000 vehicle_type: 'Box truck' receiver_email: receiver@logistics.ee receiver_name: 'Tartu Logistics OÜ' unloading_time: 60 products: [] files: [] signatures: [] waypoints: [] properties: id: type: integer example: 12350 oid: type: string example: metrotec object_id: type: string example: VEO-TRUCK-01 lat: type: number example: 59.437 lon: type: number example: 24.754 start_lat: type: number example: 59.395 start_lon: type: number example: 24.662 start_address: type: string example: 'Tallinn Warehouse' start_time: type: string example: '2025-01-20 08:00:00' stop_time: type: string example: '2025-01-20 17:00:00' order_ref: type: string example: VEO-2025-001 order_details: type: string example: 'Full truck load delivery' task_address: type: string example: 'Tartu, Estonia' task_description: type: string example: 'Delivery to distribution center' cancel_reason: type: string example: null nullable: true status: type: integer example: 1 created_at: type: string example: '2025-01-20 07:00:00' updated_at: type: string example: '2025-01-20 07:00:00' sender: type: string example: VeokeskusAPI tracking_nr: type: string example: veo123abc789xyz456 task_notes: type: string example: 'Delivery note required' active: type: boolean example: false group_id: type: integer example: 30 is_not_own_vehicle: type: boolean example: false contact_name: type: string example: 'Mart Tamm' contact_country_code: type: string example: '+372' contact_phone_nr: type: string example: '5551234' amount: type: integer example: 24 weight: type: integer example: 18000 vehicle_type: type: string example: 'Box truck' receiver_email: type: string example: receiver@logistics.ee receiver_name: type: string example: 'Tartu Logistics OÜ' unloading_time: type: integer example: 60 products: type: array example: [] files: type: array example: [] signatures: type: array example: [] waypoints: type: array example: [] 400: description: 'Validation Error' content: application/json: schema: type: object example: message: Lat_Lon_Must_Be_Defined properties: message: type: string example: Lat_Lon_Must_Be_Defined 409: description: 'Duplicate Order Ref' content: application/json: schema: type: object example: message: 'Duplicate order reference' properties: message: type: string example: 'Duplicate order reference' tags: - 'Route Tasks' requestBody: required: true content: application/json: schema: type: object properties: object_id: type: string description: 'Vehicle object ID. Väli value ei tohi olla pikem kui 10 tähemärki.' example: ABC123 lat: type: number description: 'Destination latitude.' example: 59.437 lon: type: number description: 'Destination longitude.' example: 24.7536 start_time: type: string description: 'Planned start time. Must be a valid date in the format Y-m-d H:i:s.' example: '2025-01-15 08:00:00' stop_time: type: string description: 'Planned end time. Must be a valid date in the format Y-m-d H:i:s.' example: '2025-01-15 17:00:00' start_lat: type: number description: 'Start location latitude.' example: 59.437 nullable: true start_lon: type: number description: 'Start location longitude.' example: 24.7536 nullable: true start_address: type: string description: 'Start address. Väli value ei tohi olla pikem kui 255 tähemärki.' example: 'Warehouse, Tallinn' nullable: true task_address: type: string description: 'Destination address. Väli value ei tohi olla pikem kui 255 tähemärki.' example: 'Customer Site, Tartu' nullable: true order_ref: type: string description: 'Order reference number. Väli value ei tohi olla pikem kui 255 tähemärki.' example: ORD-2025-001 nullable: true order_details: type: string description: 'Order details or notes.' example: 'Fragile goods - handle with care' nullable: true task_description: type: string description: 'Task description.' example: 'Deliver package to reception' nullable: true task_notes: type: string description: 'Additional task notes.' example: 'Call customer before arrival' nullable: true cancel_reason: type: string description: 'Reason for cancellation.' example: 'Customer not available' nullable: true status: type: integer description: 'Task status (see RouteTasksStatus enum for valid values).' example: 1 enum: - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 planned_km: type: string description: 'Planned distance in km.' example: 150 nullable: true is_not_own_vehicle: type: boolean description: 'Whether using a third-party vehicle.' example: false active: type: boolean description: 'Whether the task is active.' example: true group_id: type: integer description: 'Task group ID.' example: 1 nullable: true customer_id: type: integer description: 'Customer party ID. The id of an existing record in the parties table.' example: 1 nullable: true carrier_id: type: integer description: 'Carrier party ID. The id of an existing record in the parties table.' example: 2 nullable: true sender_id: type: integer description: 'Sender party ID. The id of an existing record in the parties table.' example: 3 nullable: true trailer_nr: type: string description: 'Trailer registration number. Väli value ei tohi olla pikem kui 50 tähemärki.' example: TRL-001 nullable: true order_id: type: integer description: 'The id of an existing record in the orders table.' example: 16 nullable: true driver_notes: type: string description: 'Notes from driver.' example: 'Delivered successfully' nullable: true products: type: array description: 'List of products for this task.' example: - product_id: 1 quantity: 10 weight: 100 - product_name: 'Custom product' quantity: 5 items: type: object properties: product_id: type: integer description: 'Product ID (optional if product_name is provided). The id of an existing record in the products table.' example: 1 nullable: true product_name: type: string description: 'Custom product name (used when no product_id is set). Väli value ei tohi olla pikem kui 255 tähemärki.' example: 'Custom product' nullable: true quantity: type: number description: 'Product quantity. Väli value peab olema vähemalt 0.' example: 10.0 nullable: true specific_quantity: type: string description: 'Specific quantity (e.g. pails). Väli value ei tohi olla pikem kui 100 tähemärki.' example: '5 pails' nullable: true weight: type: number description: 'Product net weight in kg. Väli value peab olema vähemalt 0.' example: 100.0 nullable: true net_weight: type: integer description: 'Product net weight in kg. Väli value peab olema vähemalt 0.' example: 80 nullable: true required: - object_id - lat - lon - start_time - stop_time security: [] '/api/tasks/{id}': get: summary: 'Get a specific task' operationId: getASpecificTask description: 'Returns a single route task with files, signatures and products.' parameters: [] responses: 401: description: '' content: application/json: schema: type: object example: message: Unauthenticated. properties: message: type: string example: Unauthenticated. 404: description: 'Task not found' content: application/json: schema: type: object example: message: 'Not Found' properties: message: type: string example: 'Not Found' tags: - 'Route Tasks' security: [] put: summary: 'Update a task' operationId: updateATask description: "Updates an existing route task. All base fields are optional on update.\nAdditional profile-specific fields are listed per scenario below.\n\n**Status Changes:**\n- Setting status to 4 (rejected) will deactivate the task and remove group assignment\n- Setting status to 3 (completed) or 7 (signed) triggers task-specific completion logic\n\n

Request Body per Profile

\n\n
\nRudus\n\n
{\n    "object_id": "ABC123",\n    "lat": 59.437,\n    "lon": 24.7536,\n    "start_time": "2025-01-15 08:00:00",\n    "stop_time": "2025-01-15 17:00:00",\n    "task_address": "Construction Site, Tartu",\n    "order_ref": "ORD-2025-001",\n    "status": 1,\n    "preparation_time": "2025-01-15 07:30:00",\n    "volume": 8.5,\n    "client_id": "CLIENT123",\n    "ordered_volume": 10,\n    "delivered_volume": 8.2,\n    "pumped_volume": 8,\n    "dn_trash": "0.5",\n    "dn_plastic": "1.2",\n    "dn_water": "10.5",\n    "categoryID": 15,\n    "client_emails": [\n        "client@example.com"\n    ],\n    "last_cargo": 0,\n    "geozone_entered_at": "2025-01-15 11:20:00",\n    "arrived_at": "2025-01-15 11:15:00",\n    "geozone_left_at": "2025-01-15 11:50:00",\n    "work_finished_at": "2025-01-15 11:45:00",\n    "concrete_type": "C30/37",\n    "concrete_strength_class": "C30",\n    "environmental_class": "XC3",\n    "dmax": "16",\n    "consistency_class": "S3",\n    "cement_type": "CEM II/A-LL 42,5N",\n    "additives": "Superplasticizer",\n    "concrete_extra_info": "High durability",\n    "concrete_extra_info2": "Special finish",\n    "unload_method": "Pump",\n    "driving_instructions": "Use back entrance",\n    "offer_number": "OFF-2025-123",\n    "work_order_number": "WO-2025-456",\n    "notes": "Handle with care",\n    "operator_name": "John Smith",\n    "pumper_name": "ABC Pumping Ltd",\n    "pump_type": "Stationary",\n    "factory_id": 5,\n    "client_address": "123 Construction Ave",\n    "other_object_id": "PUMP-01",\n    "products": [\n        {\n            "product_id": 1,\n            "quantity": 8.5,\n            "weight": 150\n        }\n    ]\n}
\n
\n\n
\nPadapigi\n\n
{\n    "object_id": "ABC123",\n    "lat": 59.437,\n    "lon": 24.7536,\n    "start_time": "2025-01-15 08:00:00",\n    "stop_time": "2025-01-15 17:00:00",\n    "task_address": "Customer Site, Tartu",\n    "order_ref": "ORD-2025-001",\n    "status": 1,\n    "contact_name": "John Doe",\n    "contact_country_code": "+372",\n    "contact_phone_nr": "5551234",\n    "product_name": "Electronic Components",\n    "project_nr": "PROJ-2025-10",\n    "weight": 15000,\n    "amount": 24,\n    "carrier": "Baltic Express",\n    "receiver_email": "receiver@example.com",\n    "receiver_name": "Tech Solutions UAB",\n    "directo_invoice": "987654",\n    "own_transport": true,\n    "products": [\n        {\n            "product_id": 1,\n            "quantity": 24,\n            "weight": 15000\n        }\n    ]\n}
\n
\n\n
\nDirecto\n\n
{\n    "object_id": "ABC123",\n    "lat": 59.437,\n    "lon": 24.7536,\n    "start_time": "2025-01-15 08:00:00",\n    "stop_time": "2025-01-15 17:00:00",\n    "task_address": "Customer Site, Tartu",\n    "order_ref": "ORD-2025-001",\n    "status": 1,\n    "contact_name": "John Doe",\n    "contact_email": "john@example.com",\n    "contact_sender": "SENDER123",\n    "contact_receiver": "ABC Logistics Ltd",\n    "contact_trailer": "TRL456",\n    "contact_order": "ORD-DIR-100",\n    "contact_delivery_term": "DAP",\n    "contact_language": "eng",\n    "delivery_name": "ABC Logistics Ltd",\n    "delivery_address1": "Industrial Street 15",\n    "delivery_address2": "Riga, LV-1234",\n    "delivery_address3": "Latvia",\n    "start_address1": "Warehouse A",\n    "start_address2": "Tallinn Port",\n    "start_address3": "Estonia",\n    "weight": 15000,\n    "amount": 24,\n    "hash": "abc123def456",\n    "products": [\n        {\n            "product_id": 1,\n            "quantity": 24,\n            "weight": 15000\n        }\n    ]\n}
\n
\n\n
\nEsvika\n\n
{\n    "object_id": "ABC123",\n    "lat": 59.437,\n    "lon": 24.7536,\n    "start_time": "2025-01-15 08:00:00",\n    "stop_time": "2025-01-15 17:00:00",\n    "task_address": "Customer Site, Tartu",\n    "order_ref": "ORD-2025-001",\n    "status": 1,\n    "contact_name": "John Doe",\n    "contact_country_code": "+372",\n    "contact_phone_nr": "5551234",\n    "amount": 24,\n    "weight": 15000,\n    "vehicle_type": "Curtainsider",\n    "carrier": "Baltic Express",\n    "order_number": "ORD-FI-2025-100",\n    "unloading_time": 45,\n    "products": [\n        {\n            "product_id": 1,\n            "quantity": 24,\n            "weight": 15000\n        }\n    ]\n}
\n
\n\n
\nOlaret\n\n
{\n    "object_id": "ABC123",\n    "lat": 59.437,\n    "lon": 24.7536,\n    "start_time": "2025-01-15 08:00:00",\n    "stop_time": "2025-01-15 17:00:00",\n    "task_address": "Port Terminal, Tallinn",\n    "order_ref": "ORD-2025-001",\n    "status": 1,\n    "worder": "WO_2025_456",\n    "do_send": true,\n    "containerno": "MSCU1234567",\n    "products": [\n        {\n            "product_id": 1,\n            "quantity": 1,\n            "weight": 5000\n        }\n    ]\n}
\n
\n\n
\nLotusTimber\n\n
{\n    "object_id": "ABC123",\n    "lat": 59.437,\n    "lon": 24.7536,\n    "start_time": "2025-01-15 08:00:00",\n    "stop_time": "2025-01-15 17:00:00",\n    "task_address": "Timber Yard, Pärnu",\n    "order_ref": "ORD-2025-001",\n    "status": 1,\n    "customer_id": 1,\n    "carrier_id": 2,\n    "trailer_nr": "TRL-789",\n    "contact_name": "John Doe",\n    "contact_country_code": "+372",\n    "contact_phone_nr": "5551234",\n    "receiver_name": "Tech Solutions UAB",\n    "receiver_email": "receiver@example.com",\n    "products": [\n        {\n            "product_id": 1,\n            "quantity": 30,\n            "weight": 25000\n        }\n    ]\n}
\n
\n\n
\nVeokeskus\n\n
{\n    "object_id": "ABC123",\n    "lat": 59.437,\n    "lon": 24.7536,\n    "start_time": "2025-01-15 08:00:00",\n    "stop_time": "2025-01-15 17:00:00",\n    "task_address": "Customer Site, Tartu",\n    "order_ref": "ORD-2025-001",\n    "status": 1,\n    "contact_name": "John Doe",\n    "contact_country_code": "+372",\n    "contact_phone_nr": "5551234",\n    "amount": 24,\n    "weight": 15000,\n    "receiver_email": "receiver@example.com",\n    "receiver_name": "Tech Solutions UAB",\n    "vehicle_type": "Curtainsider",\n    "unloading_time": 45,\n    "products": [\n        {\n            "product_id": 1,\n            "quantity": 24,\n            "weight": 15000\n        }\n    ]\n}
\n
\n\n
\nMorobell\n\n
{\n    "object_id": "ABC123",\n    "lat": 59.437,\n    "lon": 24.7536,\n    "start_time": "2025-01-15 08:00:00",\n    "stop_time": "2025-01-15 17:00:00",\n    "task_address": "Customer Site, Tartu",\n    "order_ref": "ORD-2025-001",\n    "status": 1,\n    "contact_name": "John Doe",\n    "contact_country_code": "+372",\n    "contact_phone_nr": "5551234",\n    "receiver_email": "receiver@example.com",\n    "receiver_name": "Tech Solutions UAB",\n    "added_documents": "CMR, invoice",\n    "seal_number": "SEAL-12345",\n    "fish_document_id": 1,\n    "products": [\n        {\n            "product_id": 1,\n            "quantity": 10,\n            "weight": 500\n        }\n    ]\n}
\n
" parameters: [] responses: 403: description: '' content: application/json: schema: oneOf: - description: Forbidden type: object example: message: Forbidden properties: message: type: string example: Forbidden - description: 'Invalid Period' type: object example: message: 'Invalid period' properties: message: type: string example: 'Invalid period' 409: description: 'Duplicate Order Ref' content: application/json: schema: type: object example: message: 'Duplicate order reference' properties: message: type: string example: 'Duplicate order reference' tags: - 'Route Tasks' requestBody: required: false content: application/json: schema: type: object properties: object_id: type: string description: 'Vehicle object ID. Väli value ei tohi olla pikem kui 10 tähemärki.' example: ABC123 lat: type: number description: 'Destination latitude.' example: 59.437 lon: type: number description: 'Destination longitude.' example: 24.7536 start_time: type: string description: 'Planned start time. Must be a valid date in the format Y-m-d H:i:s.' example: '2025-01-15 08:00:00' stop_time: type: string description: 'Planned end time. Must be a valid date in the format Y-m-d H:i:s.' example: '2025-01-15 17:00:00' start_lat: type: number description: 'Start location latitude.' example: 59.437 nullable: true start_lon: type: number description: 'Start location longitude.' example: 24.7536 nullable: true start_address: type: string description: 'Start address. Väli value ei tohi olla pikem kui 255 tähemärki.' example: 'Warehouse, Tallinn' nullable: true task_address: type: string description: 'Destination address. Väli value ei tohi olla pikem kui 255 tähemärki.' example: 'Customer Site, Tartu' nullable: true order_ref: type: string description: 'Order reference number. Väli value ei tohi olla pikem kui 255 tähemärki.' example: ORD-2025-001 nullable: true order_details: type: string description: 'Order details or notes.' example: 'Fragile goods - handle with care' nullable: true task_description: type: string description: 'Task description.' example: 'Deliver package to reception' nullable: true task_notes: type: string description: 'Additional task notes.' example: 'Call customer before arrival' nullable: true cancel_reason: type: string description: 'Reason for cancellation.' example: 'Customer not available' nullable: true status: type: integer description: 'Task status (see RouteTasksStatus enum for valid values).' example: 1 enum: - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 planned_km: type: string description: 'Planned distance in km.' example: 150 nullable: true is_not_own_vehicle: type: boolean description: 'Whether using a third-party vehicle.' example: false active: type: boolean description: 'Whether the task is active.' example: true group_id: type: integer description: 'Task group ID.' example: 1 nullable: true customer_id: type: integer description: 'Customer party ID. The id of an existing record in the parties table.' example: 1 nullable: true carrier_id: type: integer description: 'Carrier party ID. The id of an existing record in the parties table.' example: 2 nullable: true sender_id: type: integer description: 'Sender party ID. The id of an existing record in the parties table.' example: 3 nullable: true trailer_nr: type: string description: 'Trailer registration number. Väli value ei tohi olla pikem kui 50 tähemärki.' example: TRL-001 nullable: true order_id: type: integer description: 'The id of an existing record in the orders table.' example: 16 nullable: true driver_notes: type: string description: 'Notes from driver.' example: 'Delivered successfully' nullable: true products: type: array description: 'List of products for this task.' example: - product_id: 1 quantity: 10 weight: 100 - product_name: 'Custom product' quantity: 5 items: type: object properties: product_id: type: integer description: 'Product ID (optional if product_name is provided). The id of an existing record in the products table.' example: 1 nullable: true product_name: type: string description: 'Custom product name (used when no product_id is set). Väli value ei tohi olla pikem kui 255 tähemärki.' example: 'Custom product' nullable: true quantity: type: number description: 'Product quantity. Väli value peab olema vähemalt 0.' example: 10.0 nullable: true specific_quantity: type: string description: 'Specific quantity (e.g. pails). Väli value ei tohi olla pikem kui 100 tähemärki.' example: '5 pails' nullable: true weight: type: number description: 'Product net weight in kg. Väli value peab olema vähemalt 0.' example: 100.0 nullable: true net_weight: type: integer description: 'Product net weight in kg. Väli value peab olema vähemalt 0.' example: 80 nullable: true security: [] delete: summary: 'Delete a task' operationId: deleteATask description: 'Deletes a route task and its associated extra data from the task-type-specific table.' parameters: [] responses: 204: description: Success content: application/json: schema: type: object example: { } properties: { } 403: description: Forbidden content: application/json: schema: type: object example: message: Forbidden properties: message: type: string example: Forbidden tags: - 'Route Tasks' security: [] parameters: - in: path name: id description: 'The ID of the task.' example: 16 required: true schema: type: integer - in: path name: task description: 'Task ID.' example: 1 required: true schema: type: integer /api/orders: get: summary: 'Get all orders' operationId: getAllOrders description: '' parameters: - in: query name: per_page description: 'Number of records per page.' example: 30 required: false schema: type: integer description: 'Number of records per page.' example: 30 - in: query name: page description: 'Page number.' example: 1 required: false schema: type: integer description: 'Page number.' example: 1 responses: 200: description: '' content: application/json: schema: type: array items: type: object properties: id: type: integer example: 1 oid: type: string example: metrotec start_address: type: string example: 'Warehouse, Tallinn' lat: type: number example: 59.437 lon: type: number example: 24.7536 start_time: type: string example: '2026-01-15 08:00:00' stop_time: type: string example: '2026-01-15 17:00:00' order_ref: type: string example: ORD-2026-001 order_details: type: string example: 'Fragile goods' customer_id: type: integer example: 1 task_address: type: string example: 'Customer Site, Tartu' task_notes: type: string example: 'Call before arrival' task_description: type: string example: 'Deliver package to reception' driver_notes: type: string example: null nullable: true cancel_reason: type: string example: null nullable: true status: type: integer example: 1 sender: type: string example: admin sender_id: type: string example: null nullable: true customer: type: string example: null nullable: true sender_party: type: string example: null nullable: true created_at: type: string example: '2026-01-15 08:00:00' updated_at: type: string example: '2026-01-15 08:00:00' example: - id: 1 oid: metrotec start_address: 'Warehouse, Tallinn' lat: 59.437 lon: 24.7536 start_time: '2026-01-15 08:00:00' stop_time: '2026-01-15 17:00:00' order_ref: ORD-2026-001 order_details: 'Fragile goods' customer_id: 1 task_address: 'Customer Site, Tartu' task_notes: 'Call before arrival' task_description: 'Deliver package to reception' driver_notes: null cancel_reason: null status: 1 sender: admin sender_id: null customer: null sender_party: null created_at: '2026-01-15 08:00:00' updated_at: '2026-01-15 08:00:00' tags: - 'Route Tasks' post: summary: 'Create a new order' operationId: createANewOrder description: '' parameters: [] responses: 201: description: '' content: application/json: schema: type: object example: id: 1 oid: metrotec start_address: 'Warehouse, Tallinn' lat: 59.437 lon: 24.7536 start_time: '2026-01-15 08:00:00' stop_time: '2026-01-15 17:00:00' order_ref: ORD-2026-001 order_details: 'Fragile goods' customer_id: 1 task_address: 'Customer Site, Tartu' task_notes: 'Call before arrival' task_description: 'Deliver package to reception' driver_notes: null cancel_reason: null status: 1 sender: admin sender_id: null customer: null sender_party: null created_at: '2026-01-15 08:00:00' updated_at: '2026-01-15 08:00:00' properties: id: type: integer example: 1 oid: type: string example: metrotec start_address: type: string example: 'Warehouse, Tallinn' lat: type: number example: 59.437 lon: type: number example: 24.7536 start_time: type: string example: '2026-01-15 08:00:00' stop_time: type: string example: '2026-01-15 17:00:00' order_ref: type: string example: ORD-2026-001 order_details: type: string example: 'Fragile goods' customer_id: type: integer example: 1 task_address: type: string example: 'Customer Site, Tartu' task_notes: type: string example: 'Call before arrival' task_description: type: string example: 'Deliver package to reception' driver_notes: type: string example: null nullable: true cancel_reason: type: string example: null nullable: true status: type: integer example: 1 sender: type: string example: admin sender_id: type: string example: null nullable: true customer: type: string example: null nullable: true sender_party: type: string example: null nullable: true created_at: type: string example: '2026-01-15 08:00:00' updated_at: type: string example: '2026-01-15 08:00:00' tags: - 'Route Tasks' requestBody: required: true content: application/json: schema: type: object properties: start_address: type: string description: 'Start address. Väli value ei tohi olla pikem kui 255 tähemärki.' example: 'Warehouse, Tallinn' nullable: true lat: type: number description: 'Destination latitude.' example: 59.437 nullable: true lon: type: number description: 'Destination longitude.' example: 24.7536 nullable: true start_time: type: string description: 'Planned start time. Must be a valid date in the format Y-m-d H:i:s.' example: '2026-01-15 08:00:00' stop_time: type: string description: 'Planned end time. Must be a valid date in the format Y-m-d H:i:s.' example: '2026-01-15 17:00:00' order_ref: type: string description: 'Order reference number. Väli value ei tohi olla pikem kui 255 tähemärki.' example: ORD-2026-001 nullable: true order_details: type: string description: 'Order details or notes.' example: 'Fragile goods - handle with care' nullable: true customer_id: type: integer description: 'Customer party ID. The id of an existing record in the parties table.' example: 1 nullable: true task_address: type: string description: 'Destination address. Väli value ei tohi olla pikem kui 255 tähemärki.' example: 'Customer Site, Tartu' nullable: true task_notes: type: string description: 'Additional task notes.' example: 'Call customer before arrival' nullable: true task_description: type: string description: 'Task description.' example: 'Deliver package to reception' nullable: true driver_notes: type: string description: 'Notes from driver.' example: 'Delivered successfully' nullable: true cancel_reason: type: string description: 'Reason for cancellation. Väli value ei tohi olla pikem kui 255 tähemärki.' example: 'Customer not available' nullable: true status: type: integer description: 'Order status (1-9).' example: 1 enum: - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 sender_id: type: integer description: 'Sender party ID. The id of an existing record in the parties table.' example: 3 nullable: true required: - start_time - stop_time '/api/orders/{id}': get: summary: 'Get a specific order' operationId: getASpecificOrder description: '' parameters: [] responses: 200: description: '' content: application/json: schema: type: object example: id: 1 oid: metrotec start_address: 'Warehouse, Tallinn' lat: 59.437 lon: 24.7536 start_time: '2026-01-15 08:00:00' stop_time: '2026-01-15 17:00:00' order_ref: ORD-2026-001 order_details: 'Fragile goods' customer_id: 1 task_address: 'Customer Site, Tartu' task_notes: 'Call before arrival' task_description: 'Deliver package to reception' driver_notes: null cancel_reason: null status: 1 sender: admin sender_id: null customer: null sender_party: null created_at: '2026-01-15 08:00:00' updated_at: '2026-01-15 08:00:00' properties: id: type: integer example: 1 oid: type: string example: metrotec start_address: type: string example: 'Warehouse, Tallinn' lat: type: number example: 59.437 lon: type: number example: 24.7536 start_time: type: string example: '2026-01-15 08:00:00' stop_time: type: string example: '2026-01-15 17:00:00' order_ref: type: string example: ORD-2026-001 order_details: type: string example: 'Fragile goods' customer_id: type: integer example: 1 task_address: type: string example: 'Customer Site, Tartu' task_notes: type: string example: 'Call before arrival' task_description: type: string example: 'Deliver package to reception' driver_notes: type: string example: null nullable: true cancel_reason: type: string example: null nullable: true status: type: integer example: 1 sender: type: string example: admin sender_id: type: string example: null nullable: true customer: type: string example: null nullable: true sender_party: type: string example: null nullable: true created_at: type: string example: '2026-01-15 08:00:00' updated_at: type: string example: '2026-01-15 08:00:00' 404: description: 'Not found' content: application/json: schema: type: object example: message: 'Not Found' properties: message: type: string example: 'Not Found' tags: - 'Route Tasks' put: summary: 'Update an order' operationId: updateAnOrder description: '' parameters: [] responses: 200: description: '' content: application/json: schema: type: object example: id: 1 oid: metrotec start_address: 'Warehouse, Tallinn' lat: 59.437 lon: 24.7536 start_time: '2026-01-15 08:00:00' stop_time: '2026-01-15 17:00:00' order_ref: ORD-2026-001 order_details: 'Updated details' customer_id: 1 task_address: 'Customer Site, Tartu' task_notes: 'Call before arrival' task_description: 'Deliver package to reception' driver_notes: 'Delivered successfully' cancel_reason: null status: 2 sender: admin sender_id: null customer: null sender_party: null created_at: '2026-01-15 08:00:00' updated_at: '2026-01-15 10:00:00' properties: id: type: integer example: 1 oid: type: string example: metrotec start_address: type: string example: 'Warehouse, Tallinn' lat: type: number example: 59.437 lon: type: number example: 24.7536 start_time: type: string example: '2026-01-15 08:00:00' stop_time: type: string example: '2026-01-15 17:00:00' order_ref: type: string example: ORD-2026-001 order_details: type: string example: 'Updated details' customer_id: type: integer example: 1 task_address: type: string example: 'Customer Site, Tartu' task_notes: type: string example: 'Call before arrival' task_description: type: string example: 'Deliver package to reception' driver_notes: type: string example: 'Delivered successfully' cancel_reason: type: string example: null nullable: true status: type: integer example: 2 sender: type: string example: admin sender_id: type: string example: null nullable: true customer: type: string example: null nullable: true sender_party: type: string example: null nullable: true created_at: type: string example: '2026-01-15 08:00:00' updated_at: type: string example: '2026-01-15 10:00:00' 403: description: Forbidden content: application/json: schema: type: object example: message: Forbidden properties: message: type: string example: Forbidden tags: - 'Route Tasks' requestBody: required: false content: application/json: schema: type: object properties: start_address: type: string description: 'Start address. Väli value ei tohi olla pikem kui 255 tähemärki.' example: 'Warehouse, Tallinn' nullable: true lat: type: number description: 'Destination latitude.' example: 59.437 nullable: true lon: type: number description: 'Destination longitude.' example: 24.7536 nullable: true start_time: type: string description: 'Planned start time. Must be a valid date in the format Y-m-d H:i:s.' example: '2026-01-15 08:00:00' stop_time: type: string description: 'Planned end time. Must be a valid date in the format Y-m-d H:i:s.' example: '2026-01-15 17:00:00' order_ref: type: string description: 'Order reference number. Väli value ei tohi olla pikem kui 255 tähemärki.' example: ORD-2026-001 nullable: true order_details: type: string description: 'Order details or notes.' example: 'Fragile goods - handle with care' nullable: true customer_id: type: integer description: 'Customer party ID. The id of an existing record in the parties table.' example: 1 nullable: true task_address: type: string description: 'Destination address. Väli value ei tohi olla pikem kui 255 tähemärki.' example: 'Customer Site, Tartu' nullable: true task_notes: type: string description: 'Additional task notes.' example: 'Call customer before arrival' nullable: true task_description: type: string description: 'Task description.' example: 'Deliver package to reception' nullable: true driver_notes: type: string description: 'Notes from driver.' example: 'Delivered successfully' nullable: true cancel_reason: type: string description: 'Reason for cancellation. Väli value ei tohi olla pikem kui 255 tähemärki.' example: 'Customer not available' nullable: true status: type: integer description: 'Order status (1-9).' example: 1 enum: - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 sender_id: type: integer description: 'Sender party ID. The id of an existing record in the parties table.' example: 3 nullable: true delete: summary: 'Delete an order' operationId: deleteAnOrder description: '' parameters: [] responses: 204: description: Success content: text/plain: schema: type: string example: '' 403: description: Forbidden content: application/json: schema: type: object example: message: Forbidden properties: message: type: string example: Forbidden tags: - 'Route Tasks' parameters: - in: path name: id description: 'The ID of the order.' example: 16 required: true schema: type: integer - in: path name: order description: 'Order ID' example: 1 required: true schema: type: integer /api/parties: get: summary: 'Get all parties' operationId: getAllParties description: '' parameters: - in: query name: 'filter[archived]' description: 'Show all parties including inactive' example: true required: false schema: type: boolean description: 'Show all parties including inactive' example: true - in: query name: 'filter[role]' description: 'Filter by role ID (searches in JSON array)' example: 1 required: false schema: type: integer description: 'Filter by role ID (searches in JSON array)' example: 1 responses: 200: description: '' content: application/json: schema: type: array items: type: object properties: id: type: integer example: 1 oid: type: string example: metrotec role: type: array example: - 1 - 2 items: type: integer lang: type: string example: est company_name: type: string example: 'Example Company' company_no: type: string example: '12345678' company_vat_no: type: string example: EE123456789 company_country_code: type: string example: '+372' company_phone_nr: type: string example: '5555 5555' company_email: type: string example: info@example.com company_address: type: string example: 'Example Street 1, Tallinn' contact_name: type: string example: 'John Doe' contact_country_code: type: string example: '+372' contact_phone_nr: type: string example: '5555 5556' contact_email: type: string example: john@example.com active: type: boolean example: true default: type: boolean example: false created_at: type: string example: '2025-01-01T00:00:00.000000Z' updated_at: type: string example: '2025-11-28T10:00:00.000000Z' example: - id: 1 oid: metrotec role: - 1 - 2 lang: est company_name: 'Example Company' company_no: '12345678' company_vat_no: EE123456789 company_country_code: '+372' company_phone_nr: '5555 5555' company_email: info@example.com company_address: 'Example Street 1, Tallinn' contact_name: 'John Doe' contact_country_code: '+372' contact_phone_nr: '5555 5556' contact_email: john@example.com active: true default: false created_at: '2025-01-01T00:00:00.000000Z' updated_at: '2025-11-28T10:00:00.000000Z' tags: - 'Route Tasks' post: summary: 'Create a new party' operationId: createANewParty description: '' parameters: [] responses: 201: description: '' content: application/json: schema: type: object example: id: 1 oid: metrotec role: - 1 - 2 def_lang: est company_name: 'Example Company' company_no: '12345678' company_vat_no: EE123456789 company_country_code: '+372' company_phone_nr: '5555 5555' company_email: info@example.com company_address: 'Example Street 1, Tallinn' contact_name: 'John Doe' contact_country_code: '+372' contact_phone_nr: '5555 5556' contact_email: john@example.com active: true default: false created_at: '2025-11-28T10:00:00.000000Z' updated_at: '2025-11-28T10:00:00.000000Z' properties: id: type: integer example: 1 oid: type: string example: metrotec role: type: array example: - 1 - 2 items: type: integer def_lang: type: string example: est company_name: type: string example: 'Example Company' company_no: type: string example: '12345678' company_vat_no: type: string example: EE123456789 company_country_code: type: string example: '+372' company_phone_nr: type: string example: '5555 5555' company_email: type: string example: info@example.com company_address: type: string example: 'Example Street 1, Tallinn' contact_name: type: string example: 'John Doe' contact_country_code: type: string example: '+372' contact_phone_nr: type: string example: '5555 5556' contact_email: type: string example: john@example.com active: type: boolean example: true default: type: boolean example: false created_at: type: string example: '2025-11-28T10:00:00.000000Z' updated_at: type: string example: '2025-11-28T10:00:00.000000Z' tags: - 'Route Tasks' requestBody: required: true content: application/json: schema: type: object properties: company_name: type: string description: 'Company name. Väli value ei tohi olla pikem kui 255 tähemärki.' example: 'Example Company' role: type: array description: 'Role IDs (1 = Customer, 2 = Sender, 3 = Carrier).' example: - 1 items: type: integer enum: - 1 - 2 - 3 lang: type: string description: 'Default language for communications (est, rus, eng, swe, lat).' example: est enum: - est - rus - eng - swe - lat company_no: type: string description: 'Company registration number. Väli value ei tohi olla pikem kui 255 tähemärki.' example: '12345678' nullable: true company_vat_no: type: string description: 'VAT number. Väli value ei tohi olla pikem kui 255 tähemärki.' example: EE123456789 nullable: true company_country_code: type: string description: 'Company phone country code. Väli value ei tohi olla pikem kui 10 tähemärki.' example: '+372' nullable: true company_phone_nr: type: string description: 'Company phone number. Väli value ei tohi olla pikem kui 255 tähemärki.' example: '5555 5555' nullable: true company_email: type: string description: 'Company email address. Väli value ei tohi olla pikem kui 255 tähemärki.' example: info@example.com nullable: true company_address: type: string description: 'Company legal address. Väli value ei tohi olla pikem kui 500 tähemärki.' example: 'Example Street 1, Tallinn' nullable: true contact_name: type: string description: 'Contact person name. Väli value ei tohi olla pikem kui 255 tähemärki.' example: 'John Doe' nullable: true contact_country_code: type: string description: 'Contact person phone country code. Väli value ei tohi olla pikem kui 10 tähemärki.' example: '+372' nullable: true contact_phone_nr: type: string description: 'Contact person phone number. Väli value ei tohi olla pikem kui 255 tähemärki.' example: '5555 5556' nullable: true contact_email: type: string description: 'Contact person email. Väli value ei tohi olla pikem kui 255 tähemärki.' example: john@example.com nullable: true active: type: boolean description: 'Whether the party is active.' example: true nullable: true default: type: boolean description: 'Whether this is the default party for the role (only one per role per organization).' example: false nullable: true payment_term: type: string description: 'Väli value ei tohi olla pikem kui 255 tähemärki.' example: b nullable: true required: - company_name - role - lang '/api/parties/{id}': get: summary: 'Get a specific party' operationId: getASpecificParty description: '' parameters: [] responses: 200: description: '' content: application/json: schema: type: object example: id: 1 oid: metrotec role: - 1 - 2 def_lang: est company_name: 'Example Company' company_no: '12345678' company_vat_no: EE123456789 company_country_code: '+372' company_phone_nr: '5555 5555' company_email: info@example.com company_address: 'Example Street 1, Tallinn' contact_name: 'John Doe' contact_country_code: '+372' contact_phone_nr: '5555 5556' contact_email: john@example.com active: true default: false created_at: '2025-01-01T00:00:00.000000Z' updated_at: '2025-11-28T10:00:00.000000Z' properties: id: type: integer example: 1 oid: type: string example: metrotec role: type: array example: - 1 - 2 items: type: integer def_lang: type: string example: est company_name: type: string example: 'Example Company' company_no: type: string example: '12345678' company_vat_no: type: string example: EE123456789 company_country_code: type: string example: '+372' company_phone_nr: type: string example: '5555 5555' company_email: type: string example: info@example.com company_address: type: string example: 'Example Street 1, Tallinn' contact_name: type: string example: 'John Doe' contact_country_code: type: string example: '+372' contact_phone_nr: type: string example: '5555 5556' contact_email: type: string example: john@example.com active: type: boolean example: true default: type: boolean example: false created_at: type: string example: '2025-01-01T00:00:00.000000Z' updated_at: type: string example: '2025-11-28T10:00:00.000000Z' tags: - 'Route Tasks' put: summary: 'Update a party' operationId: updateAParty description: '' parameters: [] responses: 200: description: '' content: application/json: schema: type: object example: id: 1 oid: metrotec role: - 1 - 2 def_lang: est company_name: 'Updated Company' company_no: '12345678' company_vat_no: EE123456789 company_country_code: '+372' company_phone_nr: '5555 5555' company_email: info@example.com company_address: 'Example Street 1, Tallinn' contact_name: 'John Doe' contact_country_code: '+372' contact_phone_nr: '5555 5556' contact_email: john@example.com active: true default: false created_at: '2025-01-01T00:00:00.000000Z' updated_at: '2025-11-28T10:00:00.000000Z' properties: id: type: integer example: 1 oid: type: string example: metrotec role: type: array example: - 1 - 2 items: type: integer def_lang: type: string example: est company_name: type: string example: 'Updated Company' company_no: type: string example: '12345678' company_vat_no: type: string example: EE123456789 company_country_code: type: string example: '+372' company_phone_nr: type: string example: '5555 5555' company_email: type: string example: info@example.com company_address: type: string example: 'Example Street 1, Tallinn' contact_name: type: string example: 'John Doe' contact_country_code: type: string example: '+372' contact_phone_nr: type: string example: '5555 5556' contact_email: type: string example: john@example.com active: type: boolean example: true default: type: boolean example: false created_at: type: string example: '2025-01-01T00:00:00.000000Z' updated_at: type: string example: '2025-11-28T10:00:00.000000Z' tags: - 'Route Tasks' requestBody: required: true content: application/json: schema: type: object properties: company_name: type: string description: 'Company name. Väli value ei tohi olla pikem kui 255 tähemärki.' example: 'Example Company' role: type: array description: 'Role IDs (1 = Customer, 2 = Sender, 3 = Carrier).' example: - 1 items: type: integer enum: - 1 - 2 - 3 lang: type: string description: 'Default language for communications (est, rus, eng, swe, lat).' example: est enum: - est - rus - eng - swe - lat company_no: type: string description: 'Company registration number. Väli value ei tohi olla pikem kui 255 tähemärki.' example: '12345678' nullable: true company_vat_no: type: string description: 'VAT number. Väli value ei tohi olla pikem kui 255 tähemärki.' example: EE123456789 nullable: true company_country_code: type: string description: 'Company phone country code. Väli value ei tohi olla pikem kui 10 tähemärki.' example: '+372' nullable: true company_phone_nr: type: string description: 'Company phone number. Väli value ei tohi olla pikem kui 255 tähemärki.' example: '5555 5555' nullable: true company_email: type: string description: 'Company email address. Väli value ei tohi olla pikem kui 255 tähemärki.' example: info@example.com nullable: true company_address: type: string description: 'Company legal address. Väli value ei tohi olla pikem kui 500 tähemärki.' example: 'Example Street 1, Tallinn' nullable: true contact_name: type: string description: 'Contact person name. Väli value ei tohi olla pikem kui 255 tähemärki.' example: 'John Doe' nullable: true contact_country_code: type: string description: 'Contact person phone country code. Väli value ei tohi olla pikem kui 10 tähemärki.' example: '+372' nullable: true contact_phone_nr: type: string description: 'Contact person phone number. Väli value ei tohi olla pikem kui 255 tähemärki.' example: '5555 5556' nullable: true contact_email: type: string description: 'Contact person email. Väli value ei tohi olla pikem kui 255 tähemärki.' example: john@example.com nullable: true active: type: boolean description: 'Whether the party is active.' example: true nullable: true default: type: boolean description: 'Whether this is the default party for the role (only one per role per organization).' example: false nullable: true payment_term: type: string description: 'Väli value ei tohi olla pikem kui 255 tähemärki.' example: b nullable: true required: - company_name - role - lang delete: summary: 'Delete a party' operationId: deleteAParty description: '' parameters: [] responses: 204: description: success content: text/plain: schema: type: string example: '' tags: - 'Route Tasks' parameters: - in: path name: id description: 'The ID of the party.' example: 16 required: true schema: type: integer - in: path name: party description: 'Party ID' example: 1 required: true schema: type: integer /api/products: get: summary: 'Get all products' operationId: getAllProducts description: '' parameters: - in: query name: archived description: 'Show all products including inactive' example: true required: false schema: type: boolean description: 'Show all products including inactive' example: true - in: query name: show_type description: 'Filter by show type (1 = RouteTask, 2 = FishDocument)' example: 1 required: false schema: type: integer description: 'Filter by show type (1 = RouteTask, 2 = FishDocument)' example: 1 responses: 200: description: '' content: application/json: schema: type: array items: type: object properties: id: type: integer example: 1 oid: type: string example: metrotec value: type: string example: PROD001 text: type: string example: 'Product Name' external_id: type: string example: EXT123 active: type: boolean example: true default: type: boolean example: false show_type: type: integer example: 1 created_at: type: string example: '2025-01-01T00:00:00.000000Z' updated_at: type: string example: '2025-11-28T10:00:00.000000Z' example: - id: 1 oid: metrotec value: PROD001 text: 'Product Name' external_id: EXT123 active: true default: false show_type: 1 created_at: '2025-01-01T00:00:00.000000Z' updated_at: '2025-11-28T10:00:00.000000Z' tags: - 'Route Tasks' post: summary: 'Create a new product' operationId: createANewProduct description: '' parameters: [] responses: 201: description: '' content: application/json: schema: type: object example: id: 1 oid: metrotec value: PROD001 text: 'Product Name' external_id: EXT123 active: true default: false created_at: '2025-11-28T10:00:00.000000Z' updated_at: '2025-11-28T10:00:00.000000Z' properties: id: type: integer example: 1 oid: type: string example: metrotec value: type: string example: PROD001 text: type: string example: 'Product Name' external_id: type: string example: EXT123 active: type: boolean example: true default: type: boolean example: false created_at: type: string example: '2025-11-28T10:00:00.000000Z' updated_at: type: string example: '2025-11-28T10:00:00.000000Z' tags: - 'Route Tasks' requestBody: required: true content: application/json: schema: type: object properties: value: type: string description: 'Product code. Väli value ei tohi olla pikem kui 10 tähemärki.' example: PROD001 text: type: string description: 'Product name. Väli value ei tohi olla pikem kui 150 tähemärki.' example: 'Product Name' external_id: type: string description: 'External system identifier. Väli value ei tohi olla pikem kui 30 tähemärki.' example: EXT123 nullable: true comment: type: string description: 'Product comment. Väli value ei tohi olla pikem kui 255 tähemärki.' example: 'Additional product information' nullable: true active: type: boolean description: 'Whether the product is active.' example: true nullable: true default: type: boolean description: 'Whether this is the default product (only one per organization).' example: false nullable: true show_type: type: integer description: 'Where the product should be shown (1 = RouteTask, 2 = FishDocument).' example: 1 enum: - 1 - 2 nullable: true required: - value - text '/api/products/{id}': get: summary: 'Get a specific product' operationId: getASpecificProduct description: '' parameters: [] responses: 200: description: '' content: application/json: schema: type: object example: id: 1 oid: metrotec value: PROD001 text: 'Product Name' external_id: EXT123 active: true default: false created_at: '2025-01-01T00:00:00.000000Z' updated_at: '2025-11-28T10:00:00.000000Z' properties: id: type: integer example: 1 oid: type: string example: metrotec value: type: string example: PROD001 text: type: string example: 'Product Name' external_id: type: string example: EXT123 active: type: boolean example: true default: type: boolean example: false created_at: type: string example: '2025-01-01T00:00:00.000000Z' updated_at: type: string example: '2025-11-28T10:00:00.000000Z' tags: - 'Route Tasks' put: summary: 'Update a product' operationId: updateAProduct description: '' parameters: [] responses: 200: description: '' content: application/json: schema: type: object example: id: 1 oid: metrotec value: PROD001 text: 'Updated Product Name' external_id: EXT123 active: true default: false created_at: '2025-01-01T00:00:00.000000Z' updated_at: '2025-11-28T10:00:00.000000Z' properties: id: type: integer example: 1 oid: type: string example: metrotec value: type: string example: PROD001 text: type: string example: 'Updated Product Name' external_id: type: string example: EXT123 active: type: boolean example: true default: type: boolean example: false created_at: type: string example: '2025-01-01T00:00:00.000000Z' updated_at: type: string example: '2025-11-28T10:00:00.000000Z' tags: - 'Route Tasks' requestBody: required: true content: application/json: schema: type: object properties: value: type: string description: 'Product code. Väli value ei tohi olla pikem kui 10 tähemärki.' example: PROD001 text: type: string description: 'Product name. Väli value ei tohi olla pikem kui 150 tähemärki.' example: 'Product Name' external_id: type: string description: 'External system identifier. Väli value ei tohi olla pikem kui 30 tähemärki.' example: EXT123 nullable: true comment: type: string description: 'Product comment. Väli value ei tohi olla pikem kui 255 tähemärki.' example: 'Additional product information' nullable: true active: type: boolean description: 'Whether the product is active.' example: true nullable: true default: type: boolean description: 'Whether this is the default product (only one per organization).' example: false nullable: true show_type: type: integer description: 'Where the product should be shown (1 = RouteTask, 2 = FishDocument).' example: 1 enum: - 1 - 2 nullable: true required: - value - text delete: summary: 'Delete a product' operationId: deleteAProduct description: '' parameters: [] responses: 204: description: success content: text/plain: schema: type: string example: '' tags: - 'Route Tasks' parameters: - in: path name: id description: 'The ID of the product.' example: 16 required: true schema: type: integer - in: path name: product description: 'Product ID' example: 1 required: true schema: type: integer /api/ships: get: summary: 'Get all ships' operationId: getAllShips description: '' parameters: - in: query name: 'filter[archived]' description: 'Show all ships including inactive' example: true required: false schema: type: boolean description: 'Show all ships including inactive' example: true responses: 200: description: '' content: application/json: schema: type: array items: type: object properties: id: type: integer example: 1 ship_name: type: string example: Aurora owner_name: type: string example: 'John Smith' board_number: type: string example: EST-1234 captain_name: type: string example: 'Captain Jack' license_number: type: string example: LIC-2025-001 receiver: type: string example: 'Fish Processing Ltd' receiver_address: type: string example: 'Harbor Street 1, Tallinn' fish_destination: type: string example: 'Processing Plant A' active: type: boolean example: true created_at: type: string example: '2025-01-01T00:00:00.000000Z' updated_at: type: string example: '2025-11-28T10:00:00.000000Z' example: - id: 1 ship_name: Aurora owner_name: 'John Smith' board_number: EST-1234 captain_name: 'Captain Jack' license_number: LIC-2025-001 receiver: 'Fish Processing Ltd' receiver_address: 'Harbor Street 1, Tallinn' fish_destination: 'Processing Plant A' active: true created_at: '2025-01-01T00:00:00.000000Z' updated_at: '2025-11-28T10:00:00.000000Z' tags: - 'Route Tasks' post: summary: 'Create a new ship' operationId: createANewShip description: '' parameters: [] responses: 201: description: '' content: application/json: schema: type: object example: id: 1 ship_name: Aurora owner_name: 'John Smith' board_number: EST-1234 captain_name: 'Captain Jack' license_number: LIC-2025-001 receiver: 'Fish Processing Ltd' receiver_address: 'Harbor Street 1, Tallinn' fish_destination: 'Processing Plant A' active: true created_at: '2025-11-28T10:00:00.000000Z' updated_at: '2025-11-28T10:00:00.000000Z' properties: id: type: integer example: 1 ship_name: type: string example: Aurora owner_name: type: string example: 'John Smith' board_number: type: string example: EST-1234 captain_name: type: string example: 'Captain Jack' license_number: type: string example: LIC-2025-001 receiver: type: string example: 'Fish Processing Ltd' receiver_address: type: string example: 'Harbor Street 1, Tallinn' fish_destination: type: string example: 'Processing Plant A' active: type: boolean example: true created_at: type: string example: '2025-11-28T10:00:00.000000Z' updated_at: type: string example: '2025-11-28T10:00:00.000000Z' tags: - 'Route Tasks' requestBody: required: true content: application/json: schema: type: object properties: ship_name: type: string description: 'Name of the ship. Väli value ei tohi olla pikem kui 255 tähemärki.' example: Aurora owner_name: type: string description: 'Name of the ship owner. Väli value ei tohi olla pikem kui 255 tähemärki.' example: 'John Smith' nullable: true board_number: type: string description: 'Ship board number. Väli value ei tohi olla pikem kui 255 tähemärki.' example: EST-1234 nullable: true captain_name: type: string description: 'Name of the ship captain. Väli value ei tohi olla pikem kui 255 tähemärki.' example: 'Captain Jack' nullable: true email: type: string description: 'Email address(es) for the ship, comma-separated for multiple. Väli value ei tohi olla pikem kui 255 tähemärki.' example: 'captain@ship.com, owner@ship.com' nullable: true license_number: type: string description: 'Ship license number. Väli value ei tohi olla pikem kui 255 tähemärki.' example: LIC-2025-001 nullable: true receiver_id: type: integer description: 'ID of the receiver party. The id of an existing record in the parties table.' example: 1 nullable: true fish_destination: type: object description: 'Fish destination with coordinates.' example: address: 'Processing Plant A, Harbor 5' lat: 59.437 lon: 24.753 properties: address: type: string description: 'Väli value ei tohi olla pikem kui 500 tähemärki.' example: 'Processing Plant A, Harbor 5' nullable: true lat: type: number description: '' example: 59.437 nullable: true lon: type: number description: '' example: 24.753 nullable: true nullable: true active: type: boolean description: 'Whether the ship is active.' example: true nullable: true required: - ship_name '/api/ships/{id}': get: summary: 'Get a specific ship' operationId: getASpecificShip description: '' parameters: [] responses: 200: description: '' content: application/json: schema: type: object example: id: 1 ship_name: Aurora owner_name: 'John Smith' board_number: EST-1234 captain_name: 'Captain Jack' license_number: LIC-2025-001 receiver: 'Fish Processing Ltd' receiver_address: 'Harbor Street 1, Tallinn' fish_destination: 'Processing Plant A' active: true created_at: '2025-01-01T00:00:00.000000Z' updated_at: '2025-11-28T10:00:00.000000Z' properties: id: type: integer example: 1 ship_name: type: string example: Aurora owner_name: type: string example: 'John Smith' board_number: type: string example: EST-1234 captain_name: type: string example: 'Captain Jack' license_number: type: string example: LIC-2025-001 receiver: type: string example: 'Fish Processing Ltd' receiver_address: type: string example: 'Harbor Street 1, Tallinn' fish_destination: type: string example: 'Processing Plant A' active: type: boolean example: true created_at: type: string example: '2025-01-01T00:00:00.000000Z' updated_at: type: string example: '2025-11-28T10:00:00.000000Z' tags: - 'Route Tasks' put: summary: 'Update a ship' operationId: updateAShip description: '' parameters: [] responses: 200: description: '' content: application/json: schema: type: object example: id: 1 ship_name: 'Aurora Updated' owner_name: 'John Smith' board_number: EST-1234 captain_name: 'Captain Jack' license_number: LIC-2025-001 receiver: 'Fish Processing Ltd' receiver_address: 'Harbor Street 1, Tallinn' fish_destination: 'Processing Plant A' active: true created_at: '2025-01-01T00:00:00.000000Z' updated_at: '2025-11-28T10:00:00.000000Z' properties: id: type: integer example: 1 ship_name: type: string example: 'Aurora Updated' owner_name: type: string example: 'John Smith' board_number: type: string example: EST-1234 captain_name: type: string example: 'Captain Jack' license_number: type: string example: LIC-2025-001 receiver: type: string example: 'Fish Processing Ltd' receiver_address: type: string example: 'Harbor Street 1, Tallinn' fish_destination: type: string example: 'Processing Plant A' active: type: boolean example: true created_at: type: string example: '2025-01-01T00:00:00.000000Z' updated_at: type: string example: '2025-11-28T10:00:00.000000Z' tags: - 'Route Tasks' requestBody: required: true content: application/json: schema: type: object properties: ship_name: type: string description: 'Name of the ship. Väli value ei tohi olla pikem kui 255 tähemärki.' example: Aurora owner_name: type: string description: 'Name of the ship owner. Väli value ei tohi olla pikem kui 255 tähemärki.' example: 'John Smith' nullable: true board_number: type: string description: 'Ship board number. Väli value ei tohi olla pikem kui 255 tähemärki.' example: EST-1234 nullable: true captain_name: type: string description: 'Name of the ship captain. Väli value ei tohi olla pikem kui 255 tähemärki.' example: 'Captain Jack' nullable: true email: type: string description: 'Email address(es) for the ship, comma-separated for multiple. Väli value ei tohi olla pikem kui 255 tähemärki.' example: 'captain@ship.com, owner@ship.com' nullable: true license_number: type: string description: 'Ship license number. Väli value ei tohi olla pikem kui 255 tähemärki.' example: LIC-2025-001 nullable: true receiver_id: type: integer description: 'ID of the receiver party. The id of an existing record in the parties table.' example: 1 nullable: true fish_destination: type: object description: 'Fish destination with coordinates.' example: address: 'Processing Plant A, Harbor 5' lat: 59.437 lon: 24.753 properties: address: type: string description: 'Väli value ei tohi olla pikem kui 500 tähemärki.' example: 'Processing Plant A, Harbor 5' nullable: true lat: type: number description: '' example: 59.437 nullable: true lon: type: number description: '' example: 24.753 nullable: true nullable: true active: type: boolean description: 'Whether the ship is active.' example: true nullable: true required: - ship_name delete: summary: 'Delete a ship' operationId: deleteAShip description: '' parameters: [] responses: 204: description: success content: text/plain: schema: type: string example: '' tags: - 'Route Tasks' parameters: - in: path name: id description: 'The ID of the ship.' example: 16 required: true schema: type: integer - in: path name: ship description: 'Ship ID' example: 1 required: true schema: type: integer /api/fishdocuments/report: get: summary: 'Get fish documents report' operationId: getFishDocumentsReport description: 'Returns fish documents filtered by date range and other criteria.' parameters: - in: query name: filter.start_time description: '' example: [] required: false schema: type: object description: '' example: [] properties: { } - in: query name: filter description: '' example: [] required: false schema: type: object description: '' example: [] properties: { } - in: query name: filter.start_time.0 description: 'Start date (must be before or equal to end date). Väli value peab olema kehtiv kuupäev. Väli value peab olema kuupäev enne või võrdne kuupäevaga filter.start_time.1.' example: '2026-01-01' required: true schema: type: string description: 'Start date (must be before or equal to end date). Väli value peab olema kehtiv kuupäev. Väli value peab olema kuupäev enne või võrdne kuupäevaga filter.start_time.1.' example: '2026-01-01' - in: query name: filter.start_time.1 description: 'End date (must be after or equal to start date). Väli value peab olema kehtiv kuupäev. Väli value peab olema kuupäev pärast või võrdne kuupäevaga filter.start_time.0.' example: '2026-01-31' required: true schema: type: string description: 'End date (must be after or equal to start date). Väli value peab olema kehtiv kuupäev. Väli value peab olema kuupäev pärast või võrdne kuupäevaga filter.start_time.0.' example: '2026-01-31' - in: query name: filter.status description: 'Filter by status (0=New, 1=InWorks, 2=Sent, 3=Finished).' example: 1 required: false schema: type: integer description: 'Filter by status (0=New, 1=InWorks, 2=Sent, 3=Finished).' example: 1 nullable: true - in: query name: filter.ship_id description: 'Filter by ship ID.' example: 1 required: false schema: type: integer description: 'Filter by ship ID.' example: 1 nullable: true - in: query name: filter.object_id description: 'Filter by vehicle/object ID. Väli value ei tohi olla pikem kui 255 tähemärki.' example: ABC123 required: false schema: type: string description: 'Filter by vehicle/object ID. Väli value ei tohi olla pikem kui 255 tähemärki.' example: ABC123 nullable: true - in: query name: filter.carrier_id description: 'Filter by carrier ID.' example: 1 required: false schema: type: integer description: 'Filter by carrier ID.' example: 1 nullable: true - in: query name: 'filter[start_time]' description: 'Date range [from, to] in YYYY-MM-DD format' example: - '2026-01-01' - '2026-01-31' required: true schema: type: array description: 'Date range [from, to] in YYYY-MM-DD format' example: - '2026-01-01' - '2026-01-31' items: type: string - in: query name: 'filter[status]' description: 'Filter by status' example: 1 required: false schema: type: integer description: 'Filter by status' example: 1 - in: query name: 'filter[ship_id]' description: 'Filter by ship ID' example: 1 required: false schema: type: integer description: 'Filter by ship ID' example: 1 - in: query name: 'filter[object_id]' description: 'Filter by vehicle/object ID' example: ABC123 required: false schema: type: string description: 'Filter by vehicle/object ID' example: ABC123 - in: query name: 'filter[carrier_id]' description: 'Filter by carrier ID' example: 1 required: false schema: type: integer description: 'Filter by carrier ID' example: 1 responses: 401: description: '' content: application/json: schema: type: object example: message: Unauthenticated. properties: message: type: string example: Unauthenticated. tags: - 'Route Tasks' /api/fishdocuments: get: summary: 'Get all fish documents' operationId: getAllFishDocuments description: 'Returns documents that are not sent/finished, or sent/finished today.' parameters: [] responses: 200: description: '' content: application/json: schema: type: array items: type: object properties: id: type: integer example: 1 document_number: type: string example: FD-2026-001 object_id: type: string example: ABC123 ship_name: type: string example: Aurora receiver_id: type: integer example: 1 receiver: type: object properties: id: type: integer example: 1 company_name: type: string example: 'Fish Processing Ltd' destination_address: type: string example: 'Harbor Street 1, Tallinn' quantity: type: number example: 500.5 status: type: integer example: 0 created_at: type: string example: '2026-01-14T10:00:00.000000Z' updated_at: type: string example: '2026-01-14T10:00:00.000000Z' example: - id: 1 document_number: FD-2026-001 object_id: ABC123 ship_name: Aurora receiver_id: 1 receiver: id: 1 company_name: 'Fish Processing Ltd' destination_address: 'Harbor Street 1, Tallinn' quantity: 500.5 status: 0 created_at: '2026-01-14T10:00:00.000000Z' updated_at: '2026-01-14T10:00:00.000000Z' tags: - 'Route Tasks' post: summary: 'Create a new fish document' operationId: createANewFishDocument description: '' parameters: [] responses: 201: description: '' content: application/json: schema: type: object example: id: 1 document_number: FD-2026-001 object_id: ABC123 ship_name: Aurora status: 0 created_at: '2026-01-14T10:00:00.000000Z' updated_at: '2026-01-14T10:00:00.000000Z' properties: id: type: integer example: 1 document_number: type: string example: FD-2026-001 object_id: type: string example: ABC123 ship_name: type: string example: Aurora status: type: integer example: 0 created_at: type: string example: '2026-01-14T10:00:00.000000Z' updated_at: type: string example: '2026-01-14T10:00:00.000000Z' tags: - 'Route Tasks' requestBody: required: true content: application/json: schema: type: object properties: object_id: type: string description: 'Vehicle/object identifier. Väli value ei tohi olla pikem kui 50 tähemärki.' example: ABC123 trailer_nr: type: string description: 'Trailer number. Väli value ei tohi olla pikem kui 255 tähemärki.' example: TRL-456 ship_id: type: integer description: 'ID of the associated ship. The id of an existing record in the ships table.' example: 1 ship_name: type: string description: 'Name of the ship. Väli value ei tohi olla pikem kui 255 tähemärki.' example: Aurora owner_name: type: string description: 'Name of the ship owner. Väli value ei tohi olla pikem kui 255 tähemärki.' example: 'John Smith' board_number: type: string description: 'Ship board number. Väli value ei tohi olla pikem kui 255 tähemärki.' example: EST-1234 license_number: type: string description: 'Fishing license number. Väli value ei tohi olla pikem kui 255 tähemärki.' example: LIC-2026-001 voyage_number: type: string description: 'Voyage number. Väli value ei tohi olla pikem kui 255 tähemärki.' example: VOY-2026-005 receiver_id: type: integer description: 'ID of the receiver party. The id of an existing record in the parties table.' example: 1 receiver_name: type: string description: 'Receiver person name. Väli value ei tohi olla pikem kui 255 tähemärki.' example: 'Jane Doe' nullable: true destination_address: type: string description: 'Destination address. Väli value ei tohi olla pikem kui 500 tähemärki.' example: 'Harbor Street 1, Tallinn' destination_lat: type: number description: 'Destination latitude.' example: 59.437 nullable: true destination_lon: type: number description: 'Destination longitude.' example: 24.753 nullable: true products: type: array description: 'Array of products with quantities. Väljal value peab olema vähemalt 1 elementi.' example: - product_id: 1 quantity: 500 fishing_area: IIId items: type: object properties: id: type: integer description: 'ID of the existing fish document product record (for updates).' example: 1 nullable: true product_id: type: integer description: 'ID of the fish product type. The id of an existing record in the products table.' example: 1 quantity: type: integer description: 'Quantity of fish in kg. Väli value peab olema vähemalt 0.' example: 500 fishing_area: type: string description: 'Fishing area code or name. Väli value ei tohi olla pikem kui 255 tähemärki.' example: IIId nullable: true size_category: type: string description: 'Size category. Väli value ei tohi olla pikem kui 255 tähemärki.' example: Large nullable: true freshness_category: type: string description: 'Freshness category. Väli value ei tohi olla pikem kui 255 tähemärki.' example: A nullable: true purpose: type: string description: 'Purpose of the product. Väli value ei tohi olla pikem kui 255 tähemärki.' example: 'Human consumption' nullable: true count_number: type: string description: 'Count number. Väli value ei tohi olla pikem kui 255 tähemärki.' example: '100' nullable: true required: - product_id - quantity category: type: string description: 'Fish category. Väli value ei tohi olla pikem kui 255 tähemärki.' example: A nullable: true captain_name: type: string description: 'Name of the captain. Väli value ei tohi olla pikem kui 255 tähemärki.' example: 'Captain Jack' carrier_id: type: integer description: 'ID of the carrier party. The id of an existing record in the parties table.' example: 1 unloading_at: type: string description: 'Unloading date and time. Väli value peab olema kehtiv kuupäev.' example: '2026-01-15 10:00:00' nullable: true unloading_location: type: string description: 'Unloading location. Väli value ei tohi olla pikem kui 500 tähemärki.' example: 'Dock B' nullable: true status: type: integer description: 'Document status (0=new, 1=in progress, 2=completed). Väli value peab olema vähemalt 0. Väli value ei tohi olla suurem kui 255.' example: 0 nullable: true required: - object_id - trailer_nr - ship_id - ship_name - owner_name - board_number - license_number - voyage_number - receiver_id - destination_address - products - captain_name - carrier_id '/api/fishdocuments/{id}': get: summary: 'Get a specific fish document' operationId: getASpecificFishDocument description: '' parameters: [] responses: 200: description: '' content: application/json: schema: type: object example: id: 1 document_number: FD-2026-001 object_id: ABC123 trailer_nr: TRL-456 ship_id: 1 ship_name: Aurora owner_name: 'John Smith' board_number: EST-1234 license_number: LIC-2026-001 voyage_number: VOY-2026-005 receiver_id: 1 receiver: id: 1 company_name: 'Fish Processing Ltd' receiver_name: 'Jane Doe' destination_address: 'Harbor Street 1, Tallinn' destination_lat: 59.437 destination_lon: 24.753 product_id: 1 quantity: 500.5 fishing_area: IIId containers: 10 category: A captain_name: 'Captain Jack' carrier_name: 'Transport Co' unloading_at: '2026-01-15T10:00:00.000000Z' unloading_location: 'Dock B' status: 0 captain_signed: false carrier_signed: false receiver_signed: false created_at: '2026-01-14T10:00:00.000000Z' updated_at: '2026-01-14T10:00:00.000000Z' properties: id: type: integer example: 1 document_number: type: string example: FD-2026-001 object_id: type: string example: ABC123 trailer_nr: type: string example: TRL-456 ship_id: type: integer example: 1 ship_name: type: string example: Aurora owner_name: type: string example: 'John Smith' board_number: type: string example: EST-1234 license_number: type: string example: LIC-2026-001 voyage_number: type: string example: VOY-2026-005 receiver_id: type: integer example: 1 receiver: type: object properties: id: type: integer example: 1 company_name: type: string example: 'Fish Processing Ltd' receiver_name: type: string example: 'Jane Doe' destination_address: type: string example: 'Harbor Street 1, Tallinn' destination_lat: type: number example: 59.437 destination_lon: type: number example: 24.753 product_id: type: integer example: 1 quantity: type: number example: 500.5 fishing_area: type: string example: IIId containers: type: integer example: 10 category: type: string example: A captain_name: type: string example: 'Captain Jack' carrier_name: type: string example: 'Transport Co' unloading_at: type: string example: '2026-01-15T10:00:00.000000Z' unloading_location: type: string example: 'Dock B' status: type: integer example: 0 captain_signed: type: boolean example: false carrier_signed: type: boolean example: false receiver_signed: type: boolean example: false created_at: type: string example: '2026-01-14T10:00:00.000000Z' updated_at: type: string example: '2026-01-14T10:00:00.000000Z' tags: - 'Route Tasks' put: summary: 'Update a fish document' operationId: updateAFishDocument description: '' parameters: [] responses: 200: description: '' content: application/json: schema: type: object example: id: 1 document_number: FD-2026-001 object_id: ABC123 ship_name: 'Aurora Updated' status: 1 created_at: '2026-01-14T10:00:00.000000Z' updated_at: '2026-01-14T11:00:00.000000Z' properties: id: type: integer example: 1 document_number: type: string example: FD-2026-001 object_id: type: string example: ABC123 ship_name: type: string example: 'Aurora Updated' status: type: integer example: 1 created_at: type: string example: '2026-01-14T10:00:00.000000Z' updated_at: type: string example: '2026-01-14T11:00:00.000000Z' tags: - 'Route Tasks' requestBody: required: true content: application/json: schema: type: object properties: object_id: type: string description: 'Vehicle/object identifier. Väli value ei tohi olla pikem kui 50 tähemärki.' example: ABC123 trailer_nr: type: string description: 'Trailer number. Väli value ei tohi olla pikem kui 255 tähemärki.' example: TRL-456 ship_id: type: integer description: 'ID of the associated ship. The id of an existing record in the ships table.' example: 1 ship_name: type: string description: 'Name of the ship. Väli value ei tohi olla pikem kui 255 tähemärki.' example: Aurora owner_name: type: string description: 'Name of the ship owner. Väli value ei tohi olla pikem kui 255 tähemärki.' example: 'John Smith' board_number: type: string description: 'Ship board number. Väli value ei tohi olla pikem kui 255 tähemärki.' example: EST-1234 license_number: type: string description: 'Fishing license number. Väli value ei tohi olla pikem kui 255 tähemärki.' example: LIC-2026-001 voyage_number: type: string description: 'Voyage number. Väli value ei tohi olla pikem kui 255 tähemärki.' example: VOY-2026-005 receiver_id: type: integer description: 'ID of the receiver party. The id of an existing record in the parties table.' example: 1 receiver_name: type: string description: 'Receiver person name. Väli value ei tohi olla pikem kui 255 tähemärki.' example: 'Jane Doe' nullable: true destination_address: type: string description: 'Destination address. Väli value ei tohi olla pikem kui 500 tähemärki.' example: 'Harbor Street 1, Tallinn' destination_lat: type: number description: 'Destination latitude.' example: 59.437 nullable: true destination_lon: type: number description: 'Destination longitude.' example: 24.753 nullable: true products: type: array description: 'Array of products with quantities. Väljal value peab olema vähemalt 1 elementi.' example: - product_id: 1 quantity: 500 fishing_area: IIId items: type: object properties: id: type: integer description: 'ID of the existing fish document product record (for updates).' example: 1 nullable: true product_id: type: integer description: 'ID of the fish product type. The id of an existing record in the products table.' example: 1 quantity: type: integer description: 'Quantity of fish in kg. Väli value peab olema vähemalt 0.' example: 500 fishing_area: type: string description: 'Fishing area code or name. Väli value ei tohi olla pikem kui 255 tähemärki.' example: IIId nullable: true size_category: type: string description: 'Size category. Väli value ei tohi olla pikem kui 255 tähemärki.' example: Large nullable: true freshness_category: type: string description: 'Freshness category. Väli value ei tohi olla pikem kui 255 tähemärki.' example: A nullable: true purpose: type: string description: 'Purpose of the product. Väli value ei tohi olla pikem kui 255 tähemärki.' example: 'Human consumption' nullable: true count_number: type: string description: 'Count number. Väli value ei tohi olla pikem kui 255 tähemärki.' example: '100' nullable: true required: - product_id - quantity category: type: string description: 'Fish category. Väli value ei tohi olla pikem kui 255 tähemärki.' example: A nullable: true captain_name: type: string description: 'Name of the captain. Väli value ei tohi olla pikem kui 255 tähemärki.' example: 'Captain Jack' carrier_id: type: integer description: 'ID of the carrier party. The id of an existing record in the parties table.' example: 1 unloading_at: type: string description: 'Unloading date and time. Väli value peab olema kehtiv kuupäev.' example: '2026-01-15 10:00:00' nullable: true unloading_location: type: string description: 'Unloading location.' example: 'Dock B' status: type: integer description: 'Document status (0=new, 1=in progress, 2=completed). Väli value peab olema vähemalt 0. Väli value ei tohi olla suurem kui 255.' example: 0 nullable: true required: - object_id - trailer_nr - ship_id - ship_name - owner_name - board_number - license_number - voyage_number - receiver_id - destination_address - products - captain_name - carrier_id parameters: - in: path name: id description: 'The ID of the fishdocument.' example: 16 required: true schema: type: integer - in: path name: fishDocument description: 'Fish Document ID' example: 1 required: true schema: type: integer /api/routetasksgroups: get: summary: 'Get all task groups' operationId: getAllTaskGroups description: "Returns a list of active task groups for the authenticated user.\nGroups are filtered based on:\n- Groups with group_date >= today\n- Or groups with group_date < today that have at least one task with an active status" parameters: [] responses: 200: description: '' content: application/json: schema: type: array items: type: object properties: id: type: integer example: 1 oid: type: string example: metrotec name: type: string example: 'Morning Route' group_date: type: string example: '2025-01-20T08:00:00.000000Z' object_id: type: string example: ABC123 other_object_id: type: string example: null nullable: true work_started_at: type: string example: null nullable: true should_return: type: boolean example: true active: type: boolean example: true driver_name: type: string example: 'John Doe' languages: type: string example: 'Estonian, English' driver_phone: type: string example: '+372 5555 5555' trailer_number: type: string example: TRL-123 carrier_id: type: integer example: 1 status: type: string example: null nullable: true created_at: type: string example: '2025-01-19T10:00:00.000000Z' updated_at: type: string example: '2025-01-19T10:00:00.000000Z' carrier: type: object properties: id: type: integer example: 1 company_name: type: string example: 'ABC Logistics' company_no: type: string example: '12345678' company_vat_no: type: string example: EE123456789 company_phone_nr: type: string example: '+372 5555 5555' company_country_code: type: string example: '+372' company_email: type: string example: info@abc.com company_address: type: string example: 'Warehouse St 1' example: - id: 1 oid: metrotec name: 'Morning Route' group_date: '2025-01-20T08:00:00.000000Z' object_id: ABC123 other_object_id: null work_started_at: null should_return: true active: true driver_name: 'John Doe' languages: 'Estonian, English' driver_phone: '+372 5555 5555' trailer_number: TRL-123 carrier_id: 1 status: null created_at: '2025-01-19T10:00:00.000000Z' updated_at: '2025-01-19T10:00:00.000000Z' carrier: id: 1 company_name: 'ABC Logistics' company_no: '12345678' company_vat_no: EE123456789 company_phone_nr: '+372 5555 5555' company_country_code: '+372' company_email: info@abc.com company_address: 'Warehouse St 1' tags: - 'Route Tasks' post: summary: 'Create a new task group' operationId: createANewTaskGroup description: '' parameters: [] responses: 201: description: '' content: application/json: schema: type: object example: id: 1 oid: metrotec name: 'Morning Route' group_date: '2025-01-20T08:00:00.000000Z' object_id: ABC123 other_object_id: null work_started_at: null should_return: true active: true driver_name: 'John Doe' languages: 'Estonian, English' driver_phone: '+372 5555 5555' trailer_number: TRL-123 carrier_id: 1 status: null created_at: '2025-01-19T10:00:00.000000Z' updated_at: '2025-01-19T10:00:00.000000Z' properties: id: type: integer example: 1 oid: type: string example: metrotec name: type: string example: 'Morning Route' group_date: type: string example: '2025-01-20T08:00:00.000000Z' object_id: type: string example: ABC123 other_object_id: type: string example: null nullable: true work_started_at: type: string example: null nullable: true should_return: type: boolean example: true active: type: boolean example: true driver_name: type: string example: 'John Doe' languages: type: string example: 'Estonian, English' driver_phone: type: string example: '+372 5555 5555' trailer_number: type: string example: TRL-123 carrier_id: type: integer example: 1 status: type: string example: null nullable: true created_at: type: string example: '2025-01-19T10:00:00.000000Z' updated_at: type: string example: '2025-01-19T10:00:00.000000Z' tags: - 'Route Tasks' requestBody: required: true content: application/json: schema: type: object properties: name: type: string description: 'Group name. Väli value ei tohi olla pikem kui 255 tähemärki.' example: 'Morning Delivery Route' group_date: type: string description: 'Date and time of the group. Väli value peab olema kehtiv kuupäev.' example: '2025-01-20 08:00:00' object_id: type: string description: 'Vehicle object ID. Väli value ei tohi olla pikem kui 10 tähemärki.' example: ABC123 nullable: true other_object_id: type: string description: 'Secondary vehicle object ID (e.g., for Padapigi when no primary vehicle). Väli value ei tohi olla pikem kui 10 tähemärki.' example: XYZ789 nullable: true work_started_at: type: string description: 'Timestamp when work started. Väli value peab olema kehtiv kuupäev.' example: '2025-01-20 08:15:00' nullable: true should_return: type: boolean description: 'Whether vehicle should return to origin.' example: true nullable: true active: type: boolean description: 'Whether the group is active.' example: true nullable: true driver_name: type: string description: 'Driver name. Väli value ei tohi olla pikem kui 255 tähemärki.' example: 'John Doe' nullable: true languages: type: string description: 'Languages spoken by driver. Väli value ei tohi olla pikem kui 500 tähemärki.' example: 'Estonian, English, Russian' nullable: true driver_phone: type: string description: 'Driver phone number. Väli value ei tohi olla pikem kui 50 tähemärki.' example: '+372 5555 5555' nullable: true trailer_number: type: string description: 'Trailer registration number. Väli value ei tohi olla pikem kui 255 tähemärki.' example: TRL-123 nullable: true carrier_id: type: integer description: 'Party ID of the carrier. The id of an existing record in the parties table.' example: 1 nullable: true required: - name - group_date '/api/routetasksgroups/{id}': get: summary: 'Get a specific task group' operationId: getASpecificTaskGroup description: '' parameters: [] responses: 200: description: '' content: application/json: schema: type: object example: id: 1 oid: metrotec name: 'Morning Route' group_date: '2025-01-20T08:00:00.000000Z' object_id: ABC123 other_object_id: null work_started_at: null should_return: true active: true driver_name: 'John Doe' languages: 'Estonian, English' driver_phone: '+372 5555 5555' trailer_number: TRL-123 carrier_id: 1 status: null created_at: '2025-01-19T10:00:00.000000Z' updated_at: '2025-01-19T10:00:00.000000Z' carrier: id: 1 company_name: 'ABC Logistics' company_no: '12345678' company_vat_no: EE123456789 company_phone_nr: '+372 5555 5555' company_country_code: '+372' company_email: info@abc.com company_address: 'Warehouse St 1' properties: id: type: integer example: 1 oid: type: string example: metrotec name: type: string example: 'Morning Route' group_date: type: string example: '2025-01-20T08:00:00.000000Z' object_id: type: string example: ABC123 other_object_id: type: string example: null nullable: true work_started_at: type: string example: null nullable: true should_return: type: boolean example: true active: type: boolean example: true driver_name: type: string example: 'John Doe' languages: type: string example: 'Estonian, English' driver_phone: type: string example: '+372 5555 5555' trailer_number: type: string example: TRL-123 carrier_id: type: integer example: 1 status: type: string example: null nullable: true created_at: type: string example: '2025-01-19T10:00:00.000000Z' updated_at: type: string example: '2025-01-19T10:00:00.000000Z' carrier: type: object properties: id: type: integer example: 1 company_name: type: string example: 'ABC Logistics' company_no: type: string example: '12345678' company_vat_no: type: string example: EE123456789 company_phone_nr: type: string example: '+372 5555 5555' company_country_code: type: string example: '+372' company_email: type: string example: info@abc.com company_address: type: string example: 'Warehouse St 1' 404: description: 'Not Found' content: application/json: schema: type: object example: message: 'Not Found' properties: message: type: string example: 'Not Found' tags: - 'Route Tasks' put: summary: 'Update a task group' operationId: updateATaskGroup description: '' parameters: [] responses: 200: description: '' content: application/json: schema: type: object example: id: 1 oid: metrotec name: 'Updated Morning Route' group_date: '2025-01-20T08:00:00.000000Z' object_id: ABC123 other_object_id: null work_started_at: '2025-01-20T08:15:00.000000Z' should_return: true active: true driver_name: 'John Doe' languages: 'Estonian, English' driver_phone: '+372 5555 5555' trailer_number: TRL-123 carrier_id: 1 status: null created_at: '2025-01-19T10:00:00.000000Z' updated_at: '2025-01-20T08:15:00.000000Z' properties: id: type: integer example: 1 oid: type: string example: metrotec name: type: string example: 'Updated Morning Route' group_date: type: string example: '2025-01-20T08:00:00.000000Z' object_id: type: string example: ABC123 other_object_id: type: string example: null nullable: true work_started_at: type: string example: '2025-01-20T08:15:00.000000Z' should_return: type: boolean example: true active: type: boolean example: true driver_name: type: string example: 'John Doe' languages: type: string example: 'Estonian, English' driver_phone: type: string example: '+372 5555 5555' trailer_number: type: string example: TRL-123 carrier_id: type: integer example: 1 status: type: string example: null nullable: true created_at: type: string example: '2025-01-19T10:00:00.000000Z' updated_at: type: string example: '2025-01-20T08:15:00.000000Z' 403: description: Forbidden content: application/json: schema: type: object example: message: Forbidden properties: message: type: string example: Forbidden tags: - 'Route Tasks' requestBody: required: false content: application/json: schema: type: object properties: name: type: string description: 'Group name. Väli value ei tohi olla pikem kui 255 tähemärki.' example: 'Morning Delivery Route' group_date: type: string description: 'Date and time of the group. Väli value peab olema kehtiv kuupäev.' example: '2025-01-20 08:00:00' object_id: type: string description: 'Vehicle object ID. Väli value ei tohi olla pikem kui 10 tähemärki.' example: ABC123 nullable: true other_object_id: type: string description: 'Secondary vehicle object ID (e.g., for Padapigi when no primary vehicle). Väli value ei tohi olla pikem kui 10 tähemärki.' example: XYZ789 nullable: true work_started_at: type: string description: 'Timestamp when work started. Väli value peab olema kehtiv kuupäev.' example: '2025-01-20 08:15:00' nullable: true should_return: type: boolean description: 'Whether vehicle should return to origin.' example: true nullable: true active: type: boolean description: 'Whether the group is active.' example: true nullable: true driver_name: type: string description: 'Driver name. Väli value ei tohi olla pikem kui 255 tähemärki.' example: 'John Doe' nullable: true languages: type: string description: 'Languages spoken by driver. Väli value ei tohi olla pikem kui 500 tähemärki.' example: 'Estonian, English, Russian' nullable: true driver_phone: type: string description: 'Driver phone number. Väli value ei tohi olla pikem kui 50 tähemärki.' example: '+372 5555 5555' nullable: true trailer_number: type: string description: 'Trailer registration number. Väli value ei tohi olla pikem kui 255 tähemärki.' example: TRL-123 nullable: true carrier_id: type: integer description: 'Party ID of the carrier. The id of an existing record in the parties table.' example: 1 nullable: true delete: summary: 'Delete a task group' operationId: deleteATaskGroup description: "Soft deletes a task group. The group will be marked as deleted but not\npermanently removed from the database." parameters: [] responses: 204: description: Success content: text/plain: schema: type: string example: '' 403: description: Forbidden content: application/json: schema: type: object example: message: Forbidden properties: message: type: string example: Forbidden tags: - 'Route Tasks' parameters: - in: path name: id description: 'The ID of the routetasksgroup.' example: 16 required: true schema: type: integer - in: path name: taskGroup description: 'Task Group ID' example: 1 required: true schema: type: integer '/api/relatedtasks/{type}/{id}': get: summary: 'Get related tasks' operationId: getRelatedTasks description: 'Returns tasks related to a specific object type and task ID.' parameters: [] responses: 401: description: '' content: application/json: schema: type: object example: message: Unauthenticated. properties: message: type: string example: Unauthenticated. tags: - 'Route Tasks' parameters: - in: path name: type description: 'Object type (1=Mixer, 2=Pump, 3=Pumi).' example: 1 required: true schema: type: integer - in: path name: id description: 'Task ID.' example: 12345 required: true schema: type: integer /api/routetasksbynr: get: summary: 'Get tasks by order reference numbers' operationId: getTasksByOrderReferenceNumbers description: 'Returns tasks matching the specified order reference numbers with profile data.' parameters: - in: query name: nr description: 'Array of order reference numbers.' example: - 12345 - 12346 required: true schema: type: array description: 'Array of order reference numbers.' example: - 12345 - 12346 items: type: integer responses: 401: description: '' content: application/json: schema: type: object example: message: Unauthenticated. properties: message: type: string example: Unauthenticated. 404: description: '' content: application/json: schema: type: object example: message: 'Not found' properties: message: type: string example: 'Not found' tags: - 'Route Tasks' requestBody: required: false content: application/json: schema: type: object properties: nr: type: array description: '' example: - 16 items: type: integer '/api/routetasksbywofull/{id}': get: summary: 'Get tasks by work order' operationId: getTasksByWorkOrder description: 'Returns all tasks matching the specified work order number with profile data.' parameters: [] responses: 401: description: '' content: application/json: schema: type: object example: message: Unauthenticated. properties: message: type: string example: Unauthenticated. 404: description: '' content: application/json: schema: type: object example: message: 'Not found' properties: message: type: string example: 'Not found' tags: - 'Route Tasks' parameters: - in: path name: id description: 'The work order number.' example: 12345 required: true schema: type: integer '/api/search/{field}': get: summary: 'Search field values' operationId: searchFieldValues description: 'Returns matching values for autocomplete suggestions.' parameters: - in: query name: query description: 'The search query.' example: trans required: true schema: type: string description: 'The search query.' example: trans responses: 200: description: '' content: application/json: schema: type: array items: type: string example: - 'Transport ABC' - 'Transport XYZ' tags: - 'Route Tasks' requestBody: required: true content: application/json: schema: type: object properties: query: type: string description: 'Väli value ei tohi olla pikem kui 255 tähemärki.' example: b required: - query parameters: - in: path name: field description: 'The field to search.' example: carrier required: true schema: type: string /api/opentasks: get: summary: 'Get open tasks' operationId: getOpenTasks description: 'Returns all open (active) tasks for a specific vehicle within a date period.' parameters: - in: query name: datetime description: 'Date period [start, end].' example: - '2025-01-01 00:00:00' - '2025-01-07 23:59:59' required: true schema: type: array description: 'Date period [start, end].' example: - '2025-01-01 00:00:00' - '2025-01-07 23:59:59' items: type: string - in: query name: obj description: 'Vehicle object ID.' example: ABC123 required: true schema: type: string description: 'Vehicle object ID.' example: ABC123 responses: 200: description: '' content: application/json: schema: type: array items: type: object properties: id: type: integer example: 1 object_id: type: string example: ABC123 status: type: integer example: 1 preparation_time: type: string example: '2025-01-01 10:00:00' example: - id: 1 object_id: ABC123 status: 1 preparation_time: '2025-01-01 10:00:00' tags: - 'Route Tasks' requestBody: required: true content: application/json: schema: type: object properties: datetime: type: string description: '' example: architecto obj: type: string description: 'Must contain only letters, numbers, dashes and underscores. Väli value peab olema vähemalt 1 tähemärki. Väli value ei tohi olla pikem kui 10 tähemärki.' example: ngzmiy required: - datetime - obj '/api/routetasksbygroups/{id}': get: summary: 'Get tasks by group' operationId: getTasksByGroup description: 'Returns all tasks belonging to a specific group.' parameters: [] responses: 200: description: '' content: application/json: schema: type: array items: type: object properties: id: type: integer example: 1 group_id: type: integer example: 123 status: type: integer example: 1 example: - id: 1 group_id: 123 status: 1 tags: - 'Route Tasks' put: summary: 'Bulk update tasks in a group' operationId: bulkUpdateTasksInAGroup description: "Updates all tasks in a group with the provided data.\nIf activating tasks, also activates the group and sends a push notification." parameters: [] responses: 200: description: '' content: application/json: schema: type: object example: updated: 5 properties: updated: type: integer example: 5 tags: - 'Route Tasks' requestBody: required: false content: application/json: schema: type: object properties: status: type: integer description: 'Task status.' example: 1 active: type: boolean description: 'Whether tasks are active.' example: true object_id: type: string description: 'Vehicle ID.' example: ABC123 nullable: true parameters: - in: path name: id description: 'The group ID.' example: 123 required: true schema: type: integer '/api/routetasksbygroups/{group_id}': post: summary: 'Create multiple tasks for a group' operationId: createMultipleTasksForAGroup description: "Creates multiple route tasks and assigns them to the specified group.\nReturns all tasks belonging to the group after creation." parameters: [] responses: 201: description: Success content: application/json: schema: type: array items: type: object properties: id: type: integer example: 1 group_id: type: integer example: 5 object_id: type: string example: ABC123 lat: type: number example: 59.437 lon: type: number example: 24.754 status: type: integer example: 1 example: - id: 1 group_id: 5 object_id: ABC123 lat: 59.437 lon: 24.754 status: 1 403: description: Forbidden content: application/json: schema: type: object example: message: Forbidden properties: message: type: string example: Forbidden 404: description: 'Group Not Found' content: application/json: schema: type: object example: message: 'Not Found' properties: message: type: string example: 'Not Found' tags: - 'Route Tasks' requestBody: required: true content: application/json: schema: type: object properties: data: type: array description: 'Array of tasks to create.' example: - [] items: type: object properties: object_id: type: string description: 'Vehicle object ID.' example: ABC123 nullable: true lat: type: number description: 'Destination latitude.' example: 59.437 nullable: true lon: type: number description: 'Destination longitude.' example: 24.754 nullable: true start_time: type: string description: 'Task start time.' example: '2025-01-20 08:00:00' nullable: true stop_time: type: string description: 'Task end time.' example: '2025-01-20 17:00:00' nullable: true order_ref: type: string description: 'Order reference.' example: ORD-001 nullable: true order_details: type: string description: 'Order details.' example: 'Delivery of goods' nullable: true task_address: type: string description: 'Destination address.' example: 'Tartu, Estonia' nullable: true start_lat: type: number description: 'Starting point latitude.' example: 59.395 nullable: true start_lon: type: number description: 'Starting point longitude.' example: 24.662 nullable: true start_address: type: string description: 'Starting address.' example: 'Tallinn, Estonia' nullable: true cancel_reason: type: string description: 'Cancellation reason.' example: 'Customer not available' nullable: true status: type: integer description: 'Task status. Väli value ei tohi olla suurem kui 9.' example: 1 nullable: true contact_name: type: string description: 'Contact person name.' example: 'John Doe' nullable: true contact_country_code: type: string description: 'Phone country code.' example: '+372' nullable: true contact_phone_nr: type: string description: 'Phone number.' example: '5551234' nullable: true amount: type: number description: Amount/quantity. example: 24.0 nullable: true weight: type: integer description: 'Weight in kg.' example: 15000 nullable: true vehicle_type: type: string description: 'Required vehicle type.' example: Curtainsider nullable: true active: type: boolean description: 'Whether task is active.' example: true nullable: true unloading_time: type: integer description: 'Unloading time in minutes.' example: 45 nullable: true required: - data security: [] parameters: - in: path name: group_id description: 'The ID of the group.' example: 16 required: true schema: type: integer - in: path name: group description: 'Task Group ID.' example: 1 required: true schema: type: integer '/api/tasksbywopdf/{id}': get: summary: 'Get tasks PDF by work order' operationId: getTasksPDFByWorkOrder description: 'Generates a PDF report for all tasks associated with a specific work order number.' parameters: [] responses: 200: description: 'PDF file' content: text/plain: schema: type: string example: 'PDF binary content' 404: description: '' content: application/json: schema: type: object example: message: 'Not found' properties: message: type: string example: 'Not found' tags: - 'Route Tasks' parameters: - in: path name: id description: 'The work order number.' example: 12345 required: true schema: type: integer '/api/vsettings/{id}': get: summary: 'Show vehicle settings' operationId: showVehicleSettings description: 'Returns device capabilities, outputs, events, and geo zone configuration for a vehicle.' parameters: [] responses: 200: description: Success content: application/json: schema: type: object example: hasTow: false hasGeo: true hasRepInt: false hasTamperLight: false hasLightSensor: false outputs: - id: 1 name: Lock pinReq: 0 'on': 'ON' 'off': 'OFF' disable_ids: - 2 last_command: 'ON' handled: 1 last_command_time: 1705312200 stop_registration: 0 repInts: [] events: [] alarm: null zones: [] properties: hasTow: type: boolean example: false hasGeo: type: boolean example: true hasRepInt: type: boolean example: false hasTamperLight: type: boolean example: false hasLightSensor: type: boolean example: false outputs: type: array example: - id: 1 name: Lock pinReq: 0 'on': 'ON' 'off': 'OFF' disable_ids: - 2 last_command: 'ON' handled: 1 last_command_time: 1705312200 stop_registration: 0 items: type: object properties: id: type: integer example: 1 name: type: string example: Lock pinReq: type: integer example: 0 'on': type: string example: 'ON' 'off': type: string example: 'OFF' disable_ids: type: array example: - 2 items: type: integer last_command: type: string example: 'ON' handled: type: integer example: 1 last_command_time: type: integer example: 1705312200 stop_registration: type: integer example: 0 repInts: type: array example: [] events: type: array example: [] alarm: type: string example: null nullable: true zones: type: array example: [] tags: - Settings parameters: - in: path name: id description: 'The vehicle object ID.' example: ABC123 required: true schema: type: string /api/geoalarm: post: summary: 'Create geo alarm' operationId: createGeoAlarm description: 'Assigns a geo zone as an alarm zone for a vehicle.' parameters: [] responses: 201: description: Success content: application/json: schema: type: object example: id: 1 geozoneID: 5 object_id: ABC123 geo_id: 1 properties: id: type: integer example: 1 geozoneID: type: integer example: 5 object_id: type: string example: ABC123 geo_id: type: integer example: 1 tags: - Settings requestBody: required: true content: application/json: schema: type: object properties: object_id: type: string description: 'The vehicle object ID.' example: ABC123 geozoneID: type: integer description: 'The geo zone ID to assign as alarm.' example: 5 required: - object_id - geozoneID '/api/geoalarm/{id}': delete: summary: 'Delete geo alarm' operationId: deleteGeoAlarm description: 'Removes a geo alarm zone assignment.' parameters: [] responses: 200: description: Success content: application/json: schema: type: object example: message: Deleted properties: message: type: string example: Deleted 404: description: 'Not found' content: application/json: schema: type: object example: error: Not_Found properties: error: type: string example: Not_Found tags: - Settings parameters: - in: path name: id description: 'The geo alarm record ID.' example: 1 required: true schema: type: integer /api/outputs: post: summary: 'Send output command' operationId: sendOutputCommand description: 'Sends an ON or OFF command to a vehicle output. Splits multi-part commands and queues each as a navi request.' parameters: [] responses: 201: description: Success content: application/json: schema: type: object example: id: 1 object_id: ABC123 handled: 0 disable_ids: - 2 last_command: 'ON' last_command_time: '2025-01-15 08:00:00' stop_registration: 0 pinReq: 0 properties: id: type: integer example: 1 object_id: type: string example: ABC123 handled: type: integer example: 0 disable_ids: type: array example: - 2 items: type: integer last_command: type: string example: 'ON' last_command_time: type: string example: '2025-01-15 08:00:00' stop_registration: type: integer example: 0 pinReq: type: integer example: 0 400: description: '' content: application/json: schema: oneOf: - description: 'Output not found' type: object example: error: No_Output properties: error: type: string example: No_Output - description: 'Dynamic output unavailable' type: object example: error: Output_Not_Available properties: error: type: string example: Output_Not_Available tags: - Settings requestBody: required: true content: application/json: schema: type: object properties: id: type: integer description: 'The output ID.' example: 1 action: type: string description: 'The action to perform (ON or OFF).' example: 'ON' enum: - 'ON' - 'OFF' required: - id - action /api/event: post: summary: 'Create event setting' operationId: createEventSetting description: 'Creates a new vehicle event setting and dispatches the corresponding navi request to the device.' parameters: [] responses: 201: description: Success content: application/json: schema: type: object example: id: 1 handled: 0 description: 'ON' eventDate: '2025-01-15 08:00:00' date: null properties: id: type: integer example: 1 handled: type: integer example: 0 description: type: string example: 'ON' eventDate: type: string example: '2025-01-15 08:00:00' date: type: string example: null nullable: true 400: description: 'Invalid event type' content: application/json: schema: type: object example: error: No_Navi_Request properties: error: type: string example: No_Navi_Request tags: - Settings requestBody: required: true content: application/json: schema: type: object properties: object_id: type: string description: 'The vehicle object ID.' example: ABC123 eventType: type: integer description: 'The event type (1=Valve, 2=Tow, 3=RepInt, 4=TamperLight, 5=LightSensor).' example: 2 enum: - 1 - 2 - 3 - 4 - 5 description: type: string description: 'The event description. For Tow/TamperLight/LightSensor: ON or OFF. For RepInt: interval value.' example: 'ON' enum: - 'ON' - 'OFF' required: - object_id - eventType - description '/api/event/{id}': delete: summary: 'Delete event setting' operationId: deleteEventSetting description: 'Deletes a vehicle event setting and cleans up unhandled navi requests.' parameters: [] responses: 200: description: Success content: application/json: schema: type: object example: message: Deleted properties: message: type: string example: Deleted 404: description: 'Not found' content: application/json: schema: type: object example: error: Not_Found properties: error: type: string example: Not_Found tags: - Settings parameters: - in: path name: id description: 'The event record ID.' example: 1 required: true schema: type: integer /api/techcard: get: summary: 'List tech cards' operationId: listTechCards description: 'Returns all vehicles with tech card data, maintenance dates and odometer readings.' parameters: - in: query name: object_id description: 'Filter by vehicle object ID. Väli value ei tohi olla pikem kui 10 tähemärki.' example: ABC123 required: false schema: type: string description: 'Filter by vehicle object ID. Väli value ei tohi olla pikem kui 10 tähemärki.' example: ABC123 nullable: true - in: query name: mark description: 'Filter by vehicle mark (partial match). Väli value ei tohi olla pikem kui 255 tähemärki.' example: Volvo required: false schema: type: string description: 'Filter by vehicle mark (partial match). Väli value ei tohi olla pikem kui 255 tähemärki.' example: Volvo nullable: true - in: query name: model description: 'Filter by vehicle model (partial match).' example: FH16 required: false schema: type: string description: 'Filter by vehicle model (partial match).' example: FH16 nullable: true - in: query name: department description: 'Filter by department (partial match).' example: Transport required: false schema: type: string description: 'Filter by department (partial match).' example: Transport nullable: true - in: query name: year description: 'Filter by year of manufacture. Must be a valid date in the format Y.' example: '2023' required: false schema: type: string description: 'Filter by year of manufacture. Must be a valid date in the format Y.' example: '2023' nullable: true - in: query name: fuelType description: 'Filter by fuel type ID.' example: 1 required: false schema: type: integer description: 'Filter by fuel type ID.' example: 1 nullable: true responses: 200: description: Success content: application/json: schema: type: array items: type: object properties: id: type: string example: ABC123 mark: type: string example: Volvo model: type: string example: FH16 department: type: string example: Transport fuelType: type: integer example: 1 vin: type: string example: YV2A4C2A1PB123456 year: type: string example: '2023' techCardId: type: integer example: 1 calcByM: type: integer example: 0 Odo: type: integer example: 150000 MotoHrs: type: integer example: 2500 next_inspection_by_date: type: integer example: 1 next_inspection_date: type: string example: '2025-06-15' alias: type: string example: 'Truck 1' work_dates: type: object properties: { } next_planned_dates: type: object properties: { } next_planned_km: type: object properties: { } next_planned_mh: type: object properties: { } example: - id: ABC123 mark: Volvo model: FH16 department: Transport fuelType: 1 vin: YV2A4C2A1PB123456 year: '2023' techCardId: 1 calcByM: 0 Odo: 150000 MotoHrs: 2500 next_inspection_by_date: 1 next_inspection_date: '2025-06-15' alias: 'Truck 1' work_dates: { } next_planned_dates: { } next_planned_km: { } next_planned_mh: { } tags: - 'Tech Card' '/api/techcard/{id}': get: summary: 'Get tech card' operationId: getTechCard description: 'Returns tech card settings and work records for a single vehicle.' parameters: [] responses: 200: description: Success content: application/json: schema: type: object example: settings: next_inspection_period: 12 next_maintenance_period: 12 next_maintenance_km: 15000 works: [] properties: settings: type: object properties: next_inspection_period: type: integer example: 12 next_maintenance_period: type: integer example: 12 next_maintenance_km: type: integer example: 15000 works: type: array example: [] 403: description: 'Object not allowed' content: application/json: schema: type: object example: message: ObjectNotAllowed properties: message: type: string example: ObjectNotAllowed tags: - 'Tech Card' put: summary: 'Update tech card' operationId: updateTechCard description: 'Updates or creates a tech card for a vehicle. Also updates tank volume in objects table.' parameters: [] responses: 200: description: Success content: application/json: schema: type: object example: settings: next_inspection_period: 12 next_maintenance_period: 12 next_maintenance_km: 15000 works: [] properties: settings: type: object properties: next_inspection_period: type: integer example: 12 next_maintenance_period: type: integer example: 12 next_maintenance_km: type: integer example: 15000 works: type: array example: [] 403: description: 'Object not allowed' content: application/json: schema: type: object example: message: ObjectNotAllowed properties: message: type: string example: ObjectNotAllowed tags: - 'Tech Card' requestBody: required: false content: application/json: schema: type: object properties: mark: type: string description: 'Vehicle mark/brand. Väli value ei tohi olla pikem kui 255 tähemärki.' example: Volvo nullable: true model: type: string description: 'Vehicle model.' example: FH16 nullable: true department: type: string description: 'Department name.' example: Transport nullable: true fuelType: type: integer description: 'Fuel type ID.' example: 1 nullable: true year: type: string description: 'Year of manufacture. Must be a valid date in the format Y.' example: '2023' nullable: true vin: type: string description: 'Vehicle identification number. Must match the regex /^[a-zA-Z0-9\-_]+$/.' example: YV2A4C2A1PB123456 nullable: true next_inspection_date: type: string description: 'Must be a valid date in the format Y-m-d.' example: '2026-02-26' nullable: true next_inspection_period: type: integer description: 'Väli value peab olema vähemalt 1.' example: 16 nullable: true next_maintenance_period: type: integer description: 'Väli value peab olema vähemalt 1.' example: 22 nullable: true next_maintenance_km: type: integer description: '' example: 16 nullable: true next_alcolock_period: type: integer description: 'Väli value peab olema vähemalt 1.' example: 22 nullable: true next_tacho_period: type: integer description: 'Väli value peab olema vähemalt 1.' example: 67 nullable: true next_inspection_by_date: type: boolean description: '' example: true nullable: true pto_purpose: type: string description: 'Must match the regex /^[a-zA-Z0-9\-_]+$/.' example: 1m0 nullable: true curb_weight: type: string description: 'Must match the regex /^[a-zA-Z0-9\-_]+$/.' example: 1m0 nullable: true norm_spend: type: number description: '' example: 4326.41688 nullable: true tank_vol: type: integer description: 'Fuel tank volume in liters.' example: 400 nullable: true parameters: - in: path name: id description: 'The vehicle object ID.' example: ABC123 required: true schema: type: string /api/techcardwork: get: summary: 'List tech card works' operationId: listTechCardWorks description: 'Returns all tech card work records with optional filtering.' parameters: - in: query name: object_id description: 'Filter by vehicle object ID. Väli value ei tohi olla pikem kui 10 tähemärki.' example: ABC123 required: false schema: type: string description: 'Filter by vehicle object ID. Väli value ei tohi olla pikem kui 10 tähemärki.' example: ABC123 nullable: true - in: query name: work_date description: '' example: - architecto required: false schema: type: array description: '' example: - architecto items: type: string nullable: true - in: query name: done_comment description: 'Filter by done comment (partial match).' example: 'Oil change' required: false schema: type: string description: 'Filter by done comment (partial match).' example: 'Oil change' nullable: true - in: query name: work_type_id description: 'Filter by work type ID.' example: 1 required: false schema: type: integer description: 'Filter by work type ID.' example: 1 nullable: true responses: 200: description: Success content: application/json: schema: type: array items: type: object properties: id: type: integer example: 1 object_id: type: string example: ABC123 work_date: type: string example: '2025-01-15 08:00:00' book_comment: type: string example: Scheduled done_comment: type: string example: null nullable: true completed: type: integer example: 0 Odo: type: integer example: 150000 MotoHrs: type: string example: null nullable: true works: type: array example: - 1 - 2 items: type: integer files: type: string example: null nullable: true example: - id: 1 object_id: ABC123 work_date: '2025-01-15 08:00:00' book_comment: Scheduled done_comment: null completed: 0 Odo: 150000 MotoHrs: null works: - 1 - 2 files: null tags: - 'Tech Card' post: summary: 'Create tech card work' operationId: createTechCardWork description: 'Creates a new tech card work record with work type rows.' parameters: [] responses: 201: description: Success content: application/json: schema: type: object example: id: 1 object_id: ABC123 work_date: '2025-01-15 08:00:00' book_comment: Scheduled done_comment: null completed: 0 Odo: null MotoHrs: null rows: [] files: [] log: [] properties: id: type: integer example: 1 object_id: type: string example: ABC123 work_date: type: string example: '2025-01-15 08:00:00' book_comment: type: string example: Scheduled done_comment: type: string example: null nullable: true completed: type: integer example: 0 Odo: type: string example: null nullable: true MotoHrs: type: string example: null nullable: true rows: type: array example: [] files: type: array example: [] log: type: array example: [] tags: - 'Tech Card' requestBody: required: true content: application/json: schema: type: object properties: object_id: type: string description: 'The vehicle object ID. Väli value ei tohi olla pikem kui 10 tähemärki.' example: ABC123 work_date: type: string description: 'The work date in Y-m-d H:i:s format. Must be a valid date in the format Y-m-d H:i:s.' example: '2025-01-15 08:00:00' book_comment: type: string description: 'Booking comment.' example: 'Scheduled maintenance' nullable: true work_types: type: array description: '' example: - 16 items: type: integer required: - object_id - work_date - work_types '/api/techcardwork/{id}': get: summary: 'Get tech card work' operationId: getTechCardWork description: 'Returns a single tech card work record with rows, files, and decoded log.' parameters: [] responses: 200: description: Success content: application/json: schema: type: object example: id: 1 object_id: ABC123 work_date: '2025-01-15 08:00:00' book_comment: Scheduled done_comment: null completed: 0 Odo: 150000 MotoHrs: null rows: [] files: [] log: [] properties: id: type: integer example: 1 object_id: type: string example: ABC123 work_date: type: string example: '2025-01-15 08:00:00' book_comment: type: string example: Scheduled done_comment: type: string example: null nullable: true completed: type: integer example: 0 Odo: type: integer example: 150000 MotoHrs: type: string example: null nullable: true rows: type: array example: [] files: type: array example: [] log: type: array example: [] 404: description: 'Not found' content: application/json: schema: type: object example: message: Not_Found properties: message: type: string example: Not_Found tags: - 'Tech Card' put: summary: 'Update tech card work' operationId: updateTechCardWork description: 'Completes or updates a tech card work record with logging, odometer/motor hours, and row corrections.' parameters: [] responses: 200: description: Success content: application/json: schema: type: object example: id: 1 object_id: ABC123 work_date: '2025-01-15 08:00:00' book_comment: Scheduled done_comment: Done completed: 1 Odo: 151000 MotoHrs: null rows: [] files: [] log: [] properties: id: type: integer example: 1 object_id: type: string example: ABC123 work_date: type: string example: '2025-01-15 08:00:00' book_comment: type: string example: Scheduled done_comment: type: string example: Done completed: type: integer example: 1 Odo: type: integer example: 151000 MotoHrs: type: string example: null nullable: true rows: type: array example: [] files: type: array example: [] log: type: array example: [] 404: description: 'Not found' content: application/json: schema: type: object example: message: Not_Found properties: message: type: string example: Not_Found tags: - 'Tech Card' requestBody: required: false content: application/json: schema: type: object properties: work_date: type: string description: 'The work date in Y-m-d H:i:s format. Must be a valid date in the format Y-m-d H:i:s.' example: '2025-01-15 08:00:00' nullable: true book_comment: type: string description: 'Booking comment.' example: 'Updated schedule' nullable: true done_comment: type: string description: 'Done/completion comment.' example: 'Oil changed successfully' nullable: true rows: type: array description: '' example: null items: type: object nullable: true MotoHrs: type: integer description: 'Motor hours value.' example: 2500 nullable: true Odo: type: integer description: 'Odometer value.' example: 150000 nullable: true parameters: - in: path name: id description: 'The work record ID.' example: 1 required: true schema: type: integer '/api/techcardbooking/{id}': put: summary: 'Update tech card booking' operationId: updateTechCardBooking description: 'Updates booking fields (work_date, book_comment) with change logging and row diff tracking.' parameters: [] responses: 200: description: Success content: application/json: schema: type: object example: id: 1 object_id: ABC123 work_date: '2025-01-15 08:00:00' book_comment: Rescheduled done_comment: null completed: 0 Odo: null MotoHrs: null rows: [] files: [] log: [] properties: id: type: integer example: 1 object_id: type: string example: ABC123 work_date: type: string example: '2025-01-15 08:00:00' book_comment: type: string example: Rescheduled done_comment: type: string example: null nullable: true completed: type: integer example: 0 Odo: type: string example: null nullable: true MotoHrs: type: string example: null nullable: true rows: type: array example: [] files: type: array example: [] log: type: array example: [] 404: description: 'Not found' content: application/json: schema: type: object example: message: Not_Found properties: message: type: string example: Not_Found tags: - 'Tech Card' requestBody: required: false content: application/json: schema: type: object properties: work_date: type: string description: 'The work date in Y-m-d H:i:s format. Must be a valid date in the format Y-m-d H:i:s.' example: '2025-01-15 08:00:00' nullable: true book_comment: type: string description: 'Booking comment.' example: 'Rescheduled maintenance' nullable: true rows: type: array description: '' example: null items: type: object nullable: true delete: summary: 'Cancel tech card booking' operationId: cancelTechCardBooking description: 'Cancels a booking by setting completed to 2. If the work was already completed, also cancels rows and clears odometer/motor hours.' parameters: [] responses: 200: description: Success content: application/json: schema: type: object example: id: 1 object_id: ABC123 work_date: '2025-01-15 08:00:00' book_comment: Scheduled done_comment: null completed: 2 Odo: null MotoHrs: null rows: [] files: [] log: [] properties: id: type: integer example: 1 object_id: type: string example: ABC123 work_date: type: string example: '2025-01-15 08:00:00' book_comment: type: string example: Scheduled done_comment: type: string example: null nullable: true completed: type: integer example: 2 Odo: type: string example: null nullable: true MotoHrs: type: string example: null nullable: true rows: type: array example: [] files: type: array example: [] log: type: array example: [] 404: description: 'Not found' content: application/json: schema: type: object example: message: Not_Found properties: message: type: string example: Not_Found tags: - 'Tech Card' parameters: - in: path name: id description: 'The work record ID.' example: 1 required: true schema: type: integer /api/maintenanceinit: post: summary: 'Initialize maintenance' operationId: initializeMaintenance description: 'Creates an initial maintenance work record for a vehicle with calculated next planned dates, kilometers, and motor hours.' parameters: [] responses: 201: description: Success content: application/json: schema: type: object example: id: 1 object_id: ABC123 work_date: '2025-01-15 08:00:00' book_comment: Initial done_comment: Initial completed: 1 Odo: 150000 MotoHrs: null rows: [] files: null log: [] properties: id: type: integer example: 1 object_id: type: string example: ABC123 work_date: type: string example: '2025-01-15 08:00:00' book_comment: type: string example: Initial done_comment: type: string example: Initial completed: type: integer example: 1 Odo: type: integer example: 150000 MotoHrs: type: string example: null nullable: true rows: type: array example: [] files: type: string example: null nullable: true log: type: array example: [] 400: description: 'Already initialized' content: application/json: schema: type: object example: message: Already_initialized properties: message: type: string example: Already_initialized 403: description: 'No access' content: application/json: schema: type: object example: message: ObjectNotAllowed properties: message: type: string example: ObjectNotAllowed tags: - 'Tech Card' requestBody: required: true content: application/json: schema: type: object properties: object_id: type: string description: 'The vehicle object ID. Väli value ei tohi olla pikem kui 10 tähemärki.' example: ABC123 work_date: type: string description: 'The work date in Y-m-d H:i:s format. Must be a valid date in the format Y-m-d H:i:s.' example: '2025-01-15 08:00:00' OdoMoto: type: integer description: 'Odometer or motor hours value depending on vehicle settings.' example: 150000 next_mh_diff: type: integer description: 'Next motor hours difference for planned maintenance.' example: 500 required: - object_id - work_date - OdoMoto - next_mh_diff '/api/odomotobydate/{id}': get: summary: 'Get odo/moto by date' operationId: getOdomotoByDate description: 'Returns the odometer or motor hours value for a vehicle at the given work date, based on vehicle settings.' parameters: - in: query name: work_date description: 'The work date in Y-m-d H:i:s format. Defaults to current time if not provided or in the future. Must be a valid date in the format Y-m-d H:i:s.' example: '2025-01-15 08:00:00' required: false schema: type: string description: 'The work date in Y-m-d H:i:s format. Defaults to current time if not provided or in the future. Must be a valid date in the format Y-m-d H:i:s.' example: '2025-01-15 08:00:00' nullable: true responses: 200: description: '' content: application/json: schema: oneOf: - description: Odometer type: object example: key: Odo value: 150000 properties: key: type: string example: Odo value: type: integer example: 150000 - description: 'Motor hours' type: object example: key: MotoHrs value: 2500 properties: key: type: string example: MotoHrs value: type: integer example: 2500 tags: - 'Tech Card' parameters: - in: path name: id description: 'The vehicle object ID.' example: ABC123 required: true schema: type: string /api/fueltypes: get: summary: 'List fuel types' operationId: listFuelTypes description: 'Returns all available CO2/fuel types.' parameters: [] responses: 200: description: Success content: application/json: schema: type: array items: type: object properties: id: type: integer example: 1 name: type: string example: Diesel unit: type: string example: l co2_quantity_per_unit_in_grams: type: integer example: 2640 refId: type: integer example: 1 example: - id: 1 name: Diesel unit: l co2_quantity_per_unit_in_grams: 2640 refId: 1 tags: - 'Tech Card' /api/worktypes: get: summary: 'List work types' operationId: listWorkTypes description: 'Returns all available tech card work types.' parameters: [] responses: 200: description: Success content: application/json: schema: type: array items: type: object properties: id: type: integer example: 1 name: type: string example: Maintenance hasNext: type: integer example: 1 example: - id: 1 name: Maintenance hasNext: 1 tags: - 'Tech Card' /api/departments: get: summary: 'List departments' operationId: listDepartments description: 'Returns all distinct department names from tech card records.' parameters: [] responses: 200: description: Success content: application/json: schema: type: array items: type: object properties: department: type: string example: 'Fleet A' example: - department: 'Fleet A' tags: - 'Tech Card' /api/username: get: summary: 'Get an authenticated user' operationId: getAnAuthenticatedUser description: "Returns the authenticated user's identifier and access level." parameters: [] responses: 200: description: '' content: application/json: schema: type: object example: oid: john_doe access: 2 properties: oid: type: string example: john_doe access: type: integer example: 2 tags: - Users security: [] /api/user: get: summary: 'List owner accounts' operationId: listOwnerAccounts description: 'Returns paginated list of owner accounts.' parameters: - in: query name: offset description: 'Pagination offset. Use -1 to disable pagination.' example: 0 required: false schema: type: integer description: 'Pagination offset. Use -1 to disable pagination.' example: 0 nullable: true - in: query name: limit description: 'Number of records to return.' example: 30 required: false schema: type: integer description: 'Number of records to return.' example: 30 nullable: true responses: 200: description: Success content: application/json: schema: type: array items: type: object properties: id: type: string example: owner1 name: type: string example: 'Company A' access: type: integer example: 1 tehnEmail: type: string example: tech@example.com modul: type: string example: '110' defLang: type: string example: en email: type: string example: info@example.com phone_nr: type: string example: '+37255512345' contact_name: type: string example: John example: - id: owner1 name: 'Company A' access: 1 tehnEmail: tech@example.com modul: '110' defLang: en email: info@example.com phone_nr: '+37255512345' contact_name: John tags: - Users '/api/user/{id}': get: summary: 'Get owner account' operationId: getOwnerAccount description: 'Returns a single owner account with modules, files, logos, and decoded route task address.' parameters: [] responses: 200: description: Success content: application/json: schema: type: object example: id: owner1 oid: owner1 name: 'Company A' access: 1 modul: - 1 - 2 - 3 files: [] logos: [] route_task_address: null properties: id: type: string example: owner1 oid: type: string example: owner1 name: type: string example: 'Company A' access: type: integer example: 1 modul: type: array example: - 1 - 2 - 3 items: type: integer files: type: array example: [] logos: type: array example: [] route_task_address: type: string example: null nullable: true 404: description: 'Not found' content: application/json: schema: type: object example: message: Not_Found properties: message: type: string example: Not_Found tags: - Users put: summary: 'Update owner account' operationId: updateOwnerAccount description: 'Updates owner account settings and preferences.' parameters: [] responses: 200: description: Success content: application/json: schema: type: object example: id: owner1 oid: owner1 name: 'Company A' defLang: en properties: id: type: string example: owner1 oid: type: string example: owner1 name: type: string example: 'Company A' defLang: type: string example: en 404: description: 'Not found' content: application/json: schema: type: object example: message: Not_Found properties: message: type: string example: Not_Found tags: - Users requestBody: required: false content: application/json: schema: type: object properties: defLang: type: string description: 'Default language code.' example: en nullable: true geoQtyAlert: type: boolean description: 'Enable geozone quantity alerts.' example: true nullable: true poiColorNr: type: integer description: 'POI color number.' example: 1 nullable: true showPoi: type: boolean description: 'Show POI on map.' example: true nullable: true logistic_emails: type: string description: 'Logistic notification emails.' example: logistics@example.com nullable: true is_objects_clustered: type: boolean description: 'Cluster objects on map.' example: false nullable: true address: type: string description: 'Primary address.' example: '123 Main St' nullable: true address1: type: string description: '' example: architecto nullable: true address2: type: string description: '' example: architecto nullable: true address3: type: string description: '' example: architecto nullable: true county: type: string description: '' example: architecto nullable: true postal_code: type: string description: '' example: architecto nullable: true kmkr: type: string description: '' example: architecto nullable: true regNr: type: string description: '' example: architecto nullable: true tehnEmail: type: string description: 'Technical email address. Väli value peab olema kehtiv e-posti aadress.' example: tech@example.com nullable: true phone_nr: type: string description: 'Phone number.' example: '+37255512345' nullable: true website: type: string description: '' example: architecto nullable: true company_bank_account: type: string description: '' example: architecto nullable: true route_task_address: type: object description: 'Default route task address object.' example: city: Tallinn street: 'Main St 1' properties: { } nullable: true route_task_comment: type: string description: 'Default route task comment.' example: 'Default pickup point' nullable: true parameters: - in: path name: id description: 'The owner account OID.' example: owner1 required: true schema: type: string /api/userprofile: get: summary: 'Get a user profile' operationId: getAUserProfile description: "Returns the authenticated user's profile with modules and files." parameters: [] responses: 200: description: Success content: application/json: schema: type: object example: id: user1 tehnEmail: tech@example.com access: 1 modul: - 1 - 2 - 3 files: [] properties: id: type: string example: user1 tehnEmail: type: string example: tech@example.com access: type: integer example: 1 modul: type: array example: - 1 - 2 - 3 items: type: integer files: type: array example: [] tags: - Users '/api/userprofile/{id}': put: summary: 'Update user profile' operationId: updateUserProfile description: "Updates the authenticated user's technical email address." parameters: [] responses: 200: description: Success content: application/json: schema: type: object example: id: user1 tehnEmail: newemail@example.com access: 1 modul: - 1 - 2 - 3 files: [] properties: id: type: string example: user1 tehnEmail: type: string example: newemail@example.com access: type: integer example: 1 modul: type: array example: - 1 - 2 - 3 items: type: integer files: type: array example: [] 404: description: 'Not own profile' content: application/json: schema: type: object example: message: Not_Found properties: message: type: string example: Not_Found tags: - Users requestBody: required: true content: application/json: schema: type: object properties: tehnEmail: type: string description: 'Technical email address. Väli value peab olema kehtiv e-posti aadress.' example: tech@example.com required: - tehnEmail parameters: - in: path name: id description: 'The user OID. Must match the authenticated user.' example: user1 required: true schema: type: string /api/subuser: get: summary: 'List sub-users' operationId: listSubUsers description: 'Returns all sub-user accounts for the current owner.' parameters: [] responses: 200: description: Success content: application/json: schema: type: array items: type: object properties: id: type: string example: subuser1 name: type: string example: 'John Doe' access: type: integer example: 3 tehnEmail: type: string example: john@example.com modul: type: string example: '1010' defLang: type: string example: en email: type: string example: john@example.com tehnKontakt: type: string example: 'John +37255512345' memo: type: string example: null nullable: true allobj: type: string example: '1' object_id: type: string example: null nullable: true refId: type: string example: null nullable: true example: - id: subuser1 name: 'John Doe' access: 3 tehnEmail: john@example.com modul: '1010' defLang: en email: john@example.com tehnKontakt: 'John +37255512345' memo: null allobj: '1' object_id: null refId: null tags: - Users post: summary: 'Create sub-user' operationId: createSubUser description: 'Creates a new sub-user account with optional driver linking and password generation.' parameters: [] responses: 201: description: Success content: application/json: schema: type: object example: id: subuser1 properties: id: type: string example: subuser1 400: description: 'Duplicate ID' content: application/json: schema: type: object example: message: Not_Unique_User_Id properties: message: type: string example: Not_Unique_User_Id tags: - Users requestBody: required: true content: application/json: schema: type: object properties: access: type: integer description: 'Access level ID.' example: 3 allobj: type: boolean description: '' example: false defLang: type: string description: '' example: architecto geoQtyAlert: type: boolean description: '' example: true memo: type: string description: '' example: architecto nullable: true oid: type: string description: 'Unique user identifier. Must match the regex /^[\w\d_\-@\.]+$/u. Väli value peab olema vähemalt 3 tähemärki. Väli value ei tohi olla pikem kui 100 tähemärki.' example: subuser1 modul: type: array description: '' example: - 16 items: type: integer name: type: string description: 'Full name of the user.' example: 'John Doe' object_id: type: array description: '' example: - architecto items: type: string nullable: true password: type: string description: 'Password (min 6 chars). Auto-generated if not provided. Väli value peab olema vähemalt 6 tähemärki.' example: secret123 nullable: true poiAccess: type: boolean description: '' example: true one_device_login: type: boolean description: '' example: false poiColorNr: type: integer description: '' example: 16 showPoi: type: boolean description: '' example: false tehnEmail: type: string description: 'Technical email address. Väli value peab olema kehtiv e-posti aadress.' example: john@example.com key_id: type: integer description: '' example: 16 nullable: true is_objects_clustered: type: boolean description: '' example: true nullable: true company_name: type: string description: '' example: architecto nullable: true company_nr: type: string description: '' example: architecto nullable: true legal_address: type: string description: '' example: architecto nullable: true company_vat_no: type: string description: '' example: architecto nullable: true fish_document_number: type: integer description: '' example: 16 nullable: true required: - access - allobj - defLang - geoQtyAlert - oid - modul - name - poiAccess - one_device_login - poiColorNr - showPoi - tehnEmail '/api/subuser/{id}': get: summary: 'Get sub-user' operationId: getSubUser description: 'Returns a single sub-user record by ID with decoded modules, object IDs, and attached files.' parameters: [] responses: 200: description: Success content: application/json: schema: type: object example: id: subuser1 oid: subuser1 name: 'John Doe' access: 3 tehnEmail: john@example.com modul: - 1 - 2 defLang: en email: john@example.com tehnKontakt: 'John +37255512345' memo: null allobj: '1' object_id: - ABC123 refId: null showPoi: '1' geoQtyAlert: '0' password: '' poiColorNr: 1 fish_document_number: null poiAccess: '1' sendHashByMail: null is_objects_clustered: null key_id: null company_name: null company_nr: null legal_address: null company_vat_no: null one_device_login: '0' files: [] properties: id: type: string example: subuser1 oid: type: string example: subuser1 name: type: string example: 'John Doe' access: type: integer example: 3 tehnEmail: type: string example: john@example.com modul: type: array example: - 1 - 2 items: type: integer defLang: type: string example: en email: type: string example: john@example.com tehnKontakt: type: string example: 'John +37255512345' memo: type: string example: null nullable: true allobj: type: string example: '1' object_id: type: array example: - ABC123 items: type: string refId: type: string example: null nullable: true showPoi: type: string example: '1' geoQtyAlert: type: string example: '0' password: type: string example: '' poiColorNr: type: integer example: 1 fish_document_number: type: string example: null nullable: true poiAccess: type: string example: '1' sendHashByMail: type: string example: null nullable: true is_objects_clustered: type: string example: null nullable: true key_id: type: string example: null nullable: true company_name: type: string example: null nullable: true company_nr: type: string example: null nullable: true legal_address: type: string example: null nullable: true company_vat_no: type: string example: null nullable: true one_device_login: type: string example: '0' files: type: array example: [] 404: description: 'Not found' content: application/json: schema: type: object example: message: Not_Found properties: message: type: string example: Not_Found tags: - Users put: summary: 'Update sub-user' operationId: updateSubUser description: 'Updates a sub-user account. Handles driver-to-non-driver transitions, key synchronization, and password changes.' parameters: [] responses: 200: description: Success content: application/json: schema: type: object example: message: Updated properties: message: type: string example: Updated 404: description: 'Not found' content: application/json: schema: type: object example: message: Not_Found properties: message: type: string example: Not_Found tags: - Users requestBody: required: true content: application/json: schema: type: object properties: access: type: integer description: 'Access level ID.' example: 3 allobj: type: boolean description: '' example: false defLang: type: string description: '' example: architecto geoQtyAlert: type: boolean description: '' example: true memo: type: string description: '' example: architecto nullable: true modul: type: array description: '' example: - 16 items: type: integer name: type: string description: 'Full name of the user.' example: 'John Doe' object_id: type: array description: '' example: - architecto items: type: string nullable: true password: type: string description: 'New password (min 6 chars). Omit to keep current. Väli value peab olema vähemalt 6 tähemärki.' example: newpass123 nullable: true poiAccess: type: boolean description: '' example: true one_device_login: type: boolean description: '' example: true poiColorNr: type: integer description: '' example: 16 showPoi: type: boolean description: '' example: false tehnEmail: type: string description: 'Technical email address. Väli value peab olema kehtiv e-posti aadress.' example: john@example.com key_id: type: integer description: '' example: 16 nullable: true is_objects_clustered: type: boolean description: '' example: false nullable: true company_name: type: string description: '' example: architecto nullable: true company_nr: type: string description: '' example: architecto nullable: true legal_address: type: string description: '' example: architecto nullable: true company_vat_no: type: string description: '' example: architecto nullable: true fish_document_number: type: integer description: '' example: 16 nullable: true required: - access - allobj - defLang - geoQtyAlert - modul - name - poiAccess - one_device_login - poiColorNr - showPoi - tehnEmail delete: summary: 'Delete sub-user' operationId: deleteSubUser description: 'Deletes a sub-user account. If the user is a driver, archives the associated driver record.' parameters: [] responses: 200: description: Success content: application/json: schema: type: object example: message: Deleted properties: message: type: string example: Deleted 404: description: 'Not found' content: application/json: schema: type: object example: message: Not_Found properties: message: type: string example: Not_Found tags: - Users parameters: - in: path name: id description: 'The sub-user OID.' example: subuser1 required: true schema: type: string /api/auser: get: summary: 'List owner accounts (admin)' operationId: listOwnerAccountsadmin description: 'Returns a paginated list of owner accounts with optional filtering. Admin access is required.' parameters: - in: query name: offset description: 'Pagination offset. Use -1 for all records.' example: 0 required: false schema: type: integer description: 'Pagination offset. Use -1 for all records.' example: 0 - in: query name: seclev description: 'Filter by security level.' example: 500 required: false schema: type: integer description: 'Filter by security level.' example: 500 - in: query name: oid description: 'Filter by OID (partial match).' example: company1 required: false schema: type: string description: 'Filter by OID (partial match).' example: company1 - in: query name: name description: 'Filter by name (partial match).' example: John required: false schema: type: string description: 'Filter by name (partial match).' example: John - in: query name: access description: 'Filter by access level.' example: 2 required: false schema: type: integer description: 'Filter by access level.' example: 2 responses: 200: description: Success content: application/json: schema: type: array items: type: object properties: id: type: string example: owner1 name: type: string example: 'Company A' access: type: integer example: 2 tehnEmail: type: string example: tech@example.com modul: type: array example: - 1 - 2 items: type: integer defLang: type: string example: en example: - id: owner1 name: 'Company A' access: 2 tehnEmail: tech@example.com modul: - 1 - 2 defLang: en tags: - Users requestBody: required: false content: application/json: schema: type: object properties: offset: type: integer description: 'Pagination offset. Use -1 to get all records.' example: 0 nullable: true seclev: type: integer description: 'Filter by security level.' example: 500 nullable: true oid: type: string description: 'Filter by OID (partial match). Must match the regex /^[\w\d_\-@\.]+$/u. Väli value peab olema vähemalt 3 tähemärki. Väli value ei tohi olla pikem kui 100 tähemärki.' example: company1 nullable: true name: type: string description: '' example: architecto nullable: true access: type: integer description: '' example: 16 nullable: true post: summary: 'Create an owner account (admin)' operationId: createAnOwnerAccountadmin description: 'Creates a new owner account with DDD integration, sends a welcome email, and syncs with Merit. Admin access is required.' parameters: [] responses: 201: description: Success content: application/json: schema: type: object example: id: newowner1 oid: newowner1 name: 'New Company' properties: id: type: string example: newowner1 oid: type: string example: newowner1 name: type: string example: 'New Company' 400: description: 'Duplicate ID' content: application/json: schema: type: object example: message: Not_Unique_User_Id properties: message: type: string example: Not_Unique_User_Id tags: - Users requestBody: required: true content: application/json: schema: type: object properties: Price1: type: number description: '' example: 4326.41688 nullable: true Price2: type: number description: '' example: 4326.41688 nullable: true Price3: type: number description: '' example: 4326.41688 nullable: true Price4: type: number description: '' example: 4326.41688 nullable: true Price5: type: number description: '' example: 4326.41688 nullable: true Price6: type: number description: '' example: 4326.41688 nullable: true Support_id: type: string description: '' example: architecto nullable: true access: type: integer description: 'Access level ID.' example: 2 address: type: string description: '' example: architecto nullable: true address1: type: string description: '' example: architecto nullable: true address2: type: string description: '' example: architecto nullable: true address3: type: string description: '' example: architecto nullable: true county: type: string description: '' example: architecto nullable: true postal_code: type: string description: '' example: architecto nullable: true credit: type: integer description: '' example: 16 nullable: true defLang: type: string description: '' example: architecto email: type: string description: 'Väli value peab olema kehtiv e-posti aadress.' example: zbailey@example.net nullable: true geoQtyAlert: type: boolean description: '' example: true kmkr: type: string description: '' example: architecto nullable: true lang: type: string description: '' example: architecto manager: type: string description: '' example: architecto nullable: true memo: type: string description: '' example: architecto nullable: true oid: type: string description: 'Unique owner account identifier. Must match the regex /^[\w\d_\-@\.]+$/u. Väli value peab olema vähemalt 3 tähemärki. Väli value ei tohi olla pikem kui 100 tähemärki.' example: company1 modul: type: array description: '' example: - 16 items: type: integer name: type: string description: '' example: architecto nullable: true password: type: string description: 'Väli value peab olema vähemalt 6 tähemärki.' example: ']|{+-0pBNvYg' nullable: true refreshInterval: type: integer description: '' example: 16 poiAccess: type: boolean description: '' example: false nullable: true poiColorNr: type: integer description: '' example: 16 regNr: type: string description: '' example: architecto nullable: true seclev: type: integer description: 'Security level.' example: 500 showPoi: type: boolean description: '' example: false tehnEmail: type: string description: 'Väli value peab olema kehtiv e-posti aadress.' example: zbailey@example.net contact_name: type: string description: '' example: architecto phone_nr: type: string description: '' example: architecto timeZone: type: string description: '' example: Asia/Yekaterinburg nullable: true ddd_id: type: integer description: '' example: 16 nullable: true ATR: type: string description: '' example: architecto nullable: true CardCode: type: string description: '' example: architecto nullable: true ExpiryDate: type: string description: 'Must be a valid date in the format Y-m-d.' example: '2026-02-26' nullable: true routeTaskProfileId: type: integer description: '' example: 16 nullable: true dateFormat: type: string description: 'Must match the regex /(DD|MM|YYYY)(-|\/|\.)(DD|MM|YYYY)(-|\/|\.)(DD|MM|YYYY)/.' example: DD.YYYY/DD nullable: true gdpr: type: boolean description: '' example: true nullable: true payment_deadline: type: integer description: '' example: 16 nullable: true per_len: type: integer description: '' example: 16 nullable: true e_invoice: type: boolean description: '' example: true nullable: true is_objects_clustered: type: boolean description: '' example: true nullable: true inv_ref_nr: type: integer description: '' example: 16 nullable: true country_code: type: string description: '' example: architecto nullable: true default_tilelayer: type: integer description: '' example: 16 nullable: true logistic_emails: type: string description: '' example: architecto nullable: true website: type: string description: '' example: architecto nullable: true company_bank_account: type: string description: '' example: architecto nullable: true route_task_address: type: string description: '' example: null nullable: true route_task_comment: type: string description: '' example: architecto nullable: true required: - access - defLang - geoQtyAlert - lang - oid - modul - refreshInterval - poiColorNr - seclev - showPoi - tehnEmail - contact_name - phone_nr '/api/auser/{id}': get: summary: 'Get owner account (admin)' operationId: getOwnerAccountadmin description: 'Returns a single owner account with modules, files, logos, and decoded route task address. Admin access is required.' parameters: [] responses: 200: description: Success content: application/json: schema: type: object example: id: owner1 oid: owner1 name: 'Company A' access: 2 modul: - 1 - 2 - 3 files: [] logos: [] route_task_address: null properties: id: type: string example: owner1 oid: type: string example: owner1 name: type: string example: 'Company A' access: type: integer example: 2 modul: type: array example: - 1 - 2 - 3 items: type: integer files: type: array example: [] logos: type: array example: [] route_task_address: type: string example: null nullable: true 404: description: 'Not found' content: application/json: schema: type: object example: message: Not_Found properties: message: type: string example: Not_Found tags: - Users put: summary: 'Update owner account (admin)' operationId: updateOwnerAccountadmin description: 'Updates an owner account. Cascades shared settings to sub-accounts. Admin access is required.' parameters: [] responses: 200: description: Success content: application/json: schema: type: object example: id: owner1 oid: owner1 name: 'Company A' properties: id: type: string example: owner1 oid: type: string example: owner1 name: type: string example: 'Company A' 404: description: 'Not found' content: application/json: schema: type: object example: message: Not_Found properties: message: type: string example: Not_Found tags: - Users requestBody: required: true content: application/json: schema: type: object properties: Price1: type: number description: '' example: 4326.41688 nullable: true Price2: type: number description: '' example: 4326.41688 nullable: true Price3: type: number description: '' example: 4326.41688 nullable: true Price4: type: number description: '' example: 4326.41688 nullable: true Price5: type: number description: '' example: 4326.41688 nullable: true Price6: type: number description: '' example: 4326.41688 nullable: true Support_id: type: string description: '' example: architecto nullable: true access: type: integer description: 'Access level ID.' example: 2 address: type: string description: '' example: architecto nullable: true address1: type: string description: '' example: architecto nullable: true address2: type: string description: '' example: architecto nullable: true address3: type: string description: '' example: architecto nullable: true county: type: string description: '' example: architecto nullable: true postal_code: type: string description: '' example: architecto nullable: true credit: type: integer description: '' example: 16 nullable: true defLang: type: string description: '' example: architecto email: type: string description: 'Väli value peab olema kehtiv e-posti aadress.' example: zbailey@example.net nullable: true geoQtyAlert: type: boolean description: '' example: false kmkr: type: string description: '' example: architecto nullable: true lang: type: string description: '' example: architecto manager: type: string description: '' example: architecto nullable: true memo: type: string description: '' example: architecto nullable: true modul: type: array description: '' example: - 16 items: type: integer name: type: string description: '' example: architecto nullable: true password: type: string description: 'Väli value peab olema vähemalt 6 tähemärki.' example: ']|{+-0pBNvYg' nullable: true refreshInterval: type: integer description: '' example: 16 poiAccess: type: boolean description: '' example: false nullable: true poiColorNr: type: integer description: '' example: 16 regNr: type: string description: '' example: architecto nullable: true seclev: type: integer description: 'Security level.' example: 500 showPoi: type: boolean description: '' example: true tehnEmail: type: string description: 'Väli value peab olema kehtiv e-posti aadress.' example: zbailey@example.net contact_name: type: string description: '' example: architecto phone_nr: type: string description: '' example: architecto timeZone: type: string description: '' example: Asia/Yekaterinburg nullable: true ddd_id: type: integer description: '' example: 16 nullable: true ATR: type: string description: '' example: architecto nullable: true CardCode: type: string description: '' example: architecto nullable: true ExpiryDate: type: string description: 'Must be a valid date in the format Y-m-d.' example: '2026-02-26' nullable: true routeTaskProfileId: type: integer description: '' example: 16 nullable: true dateFormat: type: string description: 'Must match the regex /(DD|MM|YYYY)(-|\/|\.)(DD|MM|YYYY)(-|\/|\.)(DD|MM|YYYY)/.' example: DD.YYYY/DD nullable: true gdpr: type: boolean description: '' example: true nullable: true payment_deadline: type: integer description: '' example: 16 nullable: true per_len: type: integer description: '' example: 16 nullable: true e_invoice: type: boolean description: '' example: true nullable: true is_objects_clustered: type: boolean description: '' example: true nullable: true inv_ref_nr: type: integer description: '' example: 16 nullable: true country_code: type: string description: '' example: architecto nullable: true default_tilelayer: type: integer description: '' example: 16 nullable: true logistic_emails: type: string description: '' example: architecto nullable: true website: type: string description: '' example: architecto nullable: true company_bank_account: type: string description: '' example: architecto nullable: true route_task_address: type: string description: '' example: null nullable: true poi_profile_id: type: string description: 'POI profile type (0=General, 1=ContactInformation, 2=Vkg).' example: 0 enum: - 0 - 1 - 2 nullable: true route_task_comment: type: string description: '' example: architecto nullable: true required: - access - defLang - geoQtyAlert - lang - modul - refreshInterval - poiColorNr - seclev - showPoi - tehnEmail - contact_name - phone_nr parameters: - in: path name: id description: 'The owner account OID.' example: owner1 required: true schema: type: string /api/auth-logs: get: summary: 'Get authentication logs report' operationId: getAuthenticationLogsReport description: '' parameters: - in: query name: datetime description: '' example: [] required: false schema: type: object description: '' example: [] properties: { } - in: query name: datetime.0 description: 'Start date (must be before or equal to end date). Väli value peab olema kehtiv kuupäev. Väli value peab olema kuupäev enne või võrdne kuupäevaga datetime.1.' example: '2025-01-01' required: true schema: type: string description: 'Start date (must be before or equal to end date). Väli value peab olema kehtiv kuupäev. Väli value peab olema kuupäev enne või võrdne kuupäevaga datetime.1.' example: '2025-01-01' - in: query name: datetime.1 description: 'End date (must be after or equal to start date). Väli value peab olema kehtiv kuupäev. Väli value peab olema kuupäev pärast või võrdne kuupäevaga datetime.0.' example: '2025-12-31' required: true schema: type: string description: 'End date (must be after or equal to start date). Väli value peab olema kehtiv kuupäev. Väli value peab olema kuupäev pärast või võrdne kuupäevaga datetime.0.' example: '2025-12-31' - in: query name: filter description: '' example: [] required: false schema: type: object description: '' example: [] properties: { } - in: query name: filter.oid description: 'Filter by username. Väli value ei tohi olla pikem kui 255 tähemärki.' example: metrotec required: false schema: type: string description: 'Filter by username. Väli value ei tohi olla pikem kui 255 tähemärki.' example: metrotec nullable: true - in: query name: filter.user_agent description: 'Filter by user agent. Väli value ei tohi olla pikem kui 255 tähemärki.' example: Mozilla/5.0 required: false schema: type: string description: 'Filter by user agent. Väli value ei tohi olla pikem kui 255 tähemärki.' example: Mozilla/5.0 nullable: true - in: query name: filter.ip_address description: 'Filter by IP address. Väli value ei tohi olla pikem kui 255 tähemärki.' example: 192.168.1.1 required: false schema: type: string description: 'Filter by IP address. Väli value ei tohi olla pikem kui 255 tähemärki.' example: 192.168.1.1 nullable: true responses: 200: description: '' content: application/json: schema: type: object example: data: - id: 1 authenticatable_type: App\Models\User authenticatable_id: 123 ip_address: 192.168.1.1 user_agent: Mozilla/5.0 login_at: '2025-11-28T10:00:00.000000Z' login_successful: true logout_at: null cleared_by_user: false location: city: Tallinn country: Estonia per_page: 15 current_page: 1 next_page_url: null prev_page_url: null properties: data: type: array example: - id: 1 authenticatable_type: App\Models\User authenticatable_id: 123 ip_address: 192.168.1.1 user_agent: Mozilla/5.0 login_at: '2025-11-28T10:00:00.000000Z' login_successful: true logout_at: null cleared_by_user: false location: city: Tallinn country: Estonia items: type: object properties: id: type: integer example: 1 authenticatable_type: type: string example: App\Models\User authenticatable_id: type: integer example: 123 ip_address: type: string example: 192.168.1.1 user_agent: type: string example: Mozilla/5.0 login_at: type: string example: '2025-11-28T10:00:00.000000Z' login_successful: type: boolean example: true logout_at: type: string example: null nullable: true cleared_by_user: type: boolean example: false location: type: object properties: city: type: string example: Tallinn country: type: string example: Estonia per_page: type: integer example: 15 current_page: type: integer example: 1 next_page_url: type: string example: null nullable: true prev_page_url: type: string example: null nullable: true tags: - Users /api/tokens: get: summary: "Get User's current active sessions" operationId: getUsersCurrentActiveSessions description: '' parameters: [] responses: 200: description: '' content: application/json: schema: type: array items: type: object properties: id: type: integer example: 1 oid: type: string example: metrotec name: type: string example: web platform: type: string example: iOS ip: type: string example: 192.168.1.1 location: type: object properties: country: type: string example: EE city: type: string example: Tallinn last_used_at: type: string example: '2025-11-28T10:00:00.000000Z' created_at: type: string example: '2025-11-28T08:00:00.000000Z' expires_at: type: string example: '2025-12-28T10:00:00.000000Z' updated_at: type: string example: '2025-11-28T10:00:00.000000Z' example: - id: 1 oid: metrotec name: web platform: iOS ip: 192.168.1.1 location: country: EE city: Tallinn last_used_at: '2025-11-28T10:00:00.000000Z' created_at: '2025-11-28T08:00:00.000000Z' expires_at: '2025-12-28T10:00:00.000000Z' updated_at: '2025-11-28T10:00:00.000000Z' tags: - Users parameters: - in: path name: user_oid description: Username example: metrotec required: true schema: type: string /api/api-tokens: get: summary: 'Get API tokens for all users owned by current user' operationId: getAPITokensForAllUsersOwnedByCurrentUser description: '' parameters: [] responses: 200: description: '' content: application/json: schema: type: array items: type: object properties: id: type: integer example: 1 oid: type: string example: metrotec name: type: string example: 'API token' created_at: type: string example: '2025-01-01T00:00:00.000000Z' expires_at: type: string example: null nullable: true updated_at: type: string example: '2025-11-28T10:00:00.000000Z' example: - id: 1 oid: metrotec name: 'API token' created_at: '2025-01-01T00:00:00.000000Z' expires_at: null updated_at: '2025-11-28T10:00:00.000000Z' tags: - Users post: summary: 'Create an API token for given user' operationId: createAnAPITokenForGivenUser description: '' parameters: [] responses: 201: description: '' content: application/json: schema: type: object example: id: 1 tokenable_type: App\Models\User tokenable_id: 123 name: 'API token' abilities: - api last_used_at: null expires_at: '2026-12-31T00:00:00.000000Z' created_at: '2025-11-28T10:00:00.000000Z' updated_at: '2025-11-28T10:00:00.000000Z' plainTextToken: 1|abc123def456... properties: id: type: integer example: 1 tokenable_type: type: string example: App\Models\User tokenable_id: type: integer example: 123 name: type: string example: 'API token' abilities: type: array example: - api items: type: string last_used_at: type: string example: null nullable: true expires_at: type: string example: '2026-12-31T00:00:00.000000Z' created_at: type: string example: '2025-11-28T10:00:00.000000Z' updated_at: type: string example: '2025-11-28T10:00:00.000000Z' plainTextToken: type: string example: 1|abc123def456... tags: - Users requestBody: required: true content: application/json: schema: type: object properties: oid: type: string description: 'The username for token' example: metrotec token_name: type: string description: 'The name or purpose of the token' example: 'API token' expires_at: type: date description: 'Optional expiration date' example: '2026-12-31' nullable: true required: - oid - token_name '/api/api-tokens/{id}': delete: summary: 'Delete the specific API token' operationId: deleteTheSpecificAPIToken description: '' parameters: [] responses: 204: description: success content: text/plain: schema: type: string example: '' tags: - Users parameters: - in: path name: id description: 'The ID of the api token.' example: 88 required: true schema: type: integer - in: path name: token_id description: 'Token ID' example: '1234' required: true schema: type: string '/api/{user_oid}/tokens': get: summary: 'Get sessions for all users owned by current user' operationId: getSessionsForAllUsersOwnedByCurrentUser description: '' parameters: [] responses: 200: description: '' content: application/json: schema: type: array items: type: object properties: id: type: integer example: 1 oid: type: string example: metrotec name: type: string example: 'API token' created_at: type: string example: '2025-01-01T00:00:00.000000Z' expires_at: type: string example: null nullable: true updated_at: type: string example: '2025-11-28T10:00:00.000000Z' example: - id: 1 oid: metrotec name: 'API token' created_at: '2025-01-01T00:00:00.000000Z' expires_at: null updated_at: '2025-11-28T10:00:00.000000Z' tags: - Users parameters: - in: path name: user_oid description: '' example: architecto required: true schema: type: string '/api/{user_oid}/tokens/{id}': delete: summary: 'Delete the specific token' operationId: deleteTheSpecificToken description: '' parameters: [] responses: 204: description: success content: text/plain: schema: type: string example: '' tags: - Users parameters: - in: path name: user_oid description: Username example: metrotec required: true schema: type: string - in: path name: id description: 'The ID of the token.' example: 88 required: true schema: type: integer - in: path name: token_id description: 'Token ID' example: '90' required: true schema: type: string '/api/{user_oid}/auth-logs': get: summary: 'Get User authentication logs' operationId: getUserAuthenticationLogs description: '' parameters: [] responses: 200: description: '' content: application/json: schema: type: object example: data: - id: 1 authenticatable_type: App\Models\User authenticatable_id: 123 ip_address: 192.168.1.1 user_agent: Mozilla/5.0 login_at: '2025-11-28T10:00:00.000000Z' login_successful: true logout_at: null cleared_by_user: false location: city: Tallinn country: Estonia per_page: 30 current_page: 1 next_page_url: null prev_page_url: null properties: data: type: array example: - id: 1 authenticatable_type: App\Models\User authenticatable_id: 123 ip_address: 192.168.1.1 user_agent: Mozilla/5.0 login_at: '2025-11-28T10:00:00.000000Z' login_successful: true logout_at: null cleared_by_user: false location: city: Tallinn country: Estonia items: type: object properties: id: type: integer example: 1 authenticatable_type: type: string example: App\Models\User authenticatable_id: type: integer example: 123 ip_address: type: string example: 192.168.1.1 user_agent: type: string example: Mozilla/5.0 login_at: type: string example: '2025-11-28T10:00:00.000000Z' login_successful: type: boolean example: true logout_at: type: string example: null nullable: true cleared_by_user: type: boolean example: false location: type: object properties: city: type: string example: Tallinn country: type: string example: Estonia per_page: type: integer example: 30 current_page: type: integer example: 1 next_page_url: type: string example: null nullable: true prev_page_url: type: string example: null nullable: true tags: - Users parameters: - in: path name: user_oid description: Username example: metrotec required: true schema: type: string /api/clients: get: summary: 'List clients' operationId: listClients description: 'Returns all client subuser accounts for the current owner.' parameters: [] responses: 200: description: Success content: application/json: schema: type: array items: type: object properties: id: type: string example: client1 name: type: string example: 'Client A' access: type: integer example: 5 tehnEmail: type: string example: client@example.com phone: type: string example: '+37255512345' defLang: type: string example: en email: type: string example: client@example.com tehnKontakt: type: string example: 'John +37255512345' fish_document_number: type: string example: null nullable: true company_name: type: string example: Company company_nr: type: string example: '12345' legal_address: type: string example: 'Main St 1' company_vat_no: type: string example: EE123456 example: - id: client1 name: 'Client A' access: 5 tehnEmail: client@example.com phone: '+37255512345' defLang: en email: client@example.com tehnKontakt: 'John +37255512345' fish_document_number: null company_name: Company company_nr: '12345' legal_address: 'Main St 1' company_vat_no: EE123456 tags: - Users /api/vehfaultstypes: get: summary: 'List all fault types' operationId: listAllFaultTypes description: 'Returns all vehicle fault types ordered by their ordering value.' parameters: [] responses: 200: description: Success content: application/json: schema: type: array items: type: object properties: id: type: integer example: 1 name: type: string example: Engine descriptions: type: array example: - 'Oil leak' - Overheating items: type: string description: type: string example: 'Engine related faults' ordering: type: integer example: 10 example: - id: 1 name: Engine descriptions: - 'Oil leak' - Overheating description: 'Engine related faults' ordering: 10 tags: - 'Vehicle Faults' post: summary: 'Create fault type' operationId: createFaultType description: 'Creates a new vehicle fault type definition.' parameters: [] responses: 201: description: Success content: application/json: schema: type: object example: id: 1 name: Engine descriptions: - 'Oil leak' - Overheating description: 'Engine related faults' ordering: 10 properties: id: type: integer example: 1 name: type: string example: Engine descriptions: type: array example: - 'Oil leak' - Overheating items: type: string description: type: string example: 'Engine related faults' ordering: type: integer example: 10 tags: - 'Vehicle Faults' requestBody: required: true content: application/json: schema: type: object properties: name: type: string description: 'Fault type name.' example: Engine descriptions: type: array description: '' example: - architecto items: type: string description: type: string description: 'Single description text.' example: 'Engine related faults' nullable: true ordering: type: integer description: 'Sort order (0-100). Väli value peab olema vahemikus 0 kuni 100.' example: 10 required: - name - ordering '/api/vehfaultstypes/{id}': get: summary: 'Show fault type' operationId: showFaultType description: 'Returns a single vehicle fault type by its ID.' parameters: [] responses: 200: description: Success content: application/json: schema: type: object example: id: 1 name: Engine descriptions: - 'Oil leak' - Overheating description: 'Engine related faults' ordering: 10 properties: id: type: integer example: 1 name: type: string example: Engine descriptions: type: array example: - 'Oil leak' - Overheating items: type: string description: type: string example: 'Engine related faults' ordering: type: integer example: 10 404: description: 'Not found' content: application/json: schema: type: object example: message: Not_Found properties: message: type: string example: Not_Found tags: - 'Vehicle Faults' put: summary: 'Update fault type' operationId: updateFaultType description: 'Updates an existing vehicle fault type definition.' parameters: [] responses: 200: description: Success content: application/json: schema: type: object example: id: 1 name: Engine descriptions: - 'Oil leak' - Overheating description: 'Engine related faults' ordering: 10 properties: id: type: integer example: 1 name: type: string example: Engine descriptions: type: array example: - 'Oil leak' - Overheating items: type: string description: type: string example: 'Engine related faults' ordering: type: integer example: 10 404: description: 'Not found' content: application/json: schema: type: object example: message: Not_Found properties: message: type: string example: Not_Found tags: - 'Vehicle Faults' requestBody: required: false content: application/json: schema: type: object properties: name: type: string description: 'Fault type name.' example: Engine descriptions: type: array description: '' example: - architecto items: type: string description: type: string description: 'Single description text.' example: 'Engine related faults' nullable: true ordering: type: integer description: 'Sort order (0-100). Väli value peab olema vahemikus 0 kuni 100.' example: 10 delete: summary: 'Delete fault type' operationId: deleteFaultType description: 'Deletes a vehicle fault type. Fails if the type is still in use by any faults.' parameters: [] responses: 200: description: Success content: application/json: schema: type: object example: message: Deleted properties: message: type: string example: Deleted 400: description: 'In use' content: application/json: schema: type: object example: message: Vehicle_Faults_Type_Used properties: message: type: string example: Vehicle_Faults_Type_Used 404: description: 'Not found' content: application/json: schema: type: object example: message: Not_Found properties: message: type: string example: Not_Found tags: - 'Vehicle Faults' parameters: - in: path name: id description: 'The fault type ID.' example: 1 required: true schema: type: integer /api/transferacceptance: get: summary: 'Show transfer acceptance act' operationId: showTransferAcceptanceAct description: 'Returns the active transfer acceptance act for the current driver. If no act exists, one is automatically created.' parameters: [] responses: 200: description: Success content: application/json: schema: type: object example: id: 1 object_id: ABC123 owner: OWN1 accepted_by: USR1 accepted_at: null vehicle_drivers_id: 5 properties: id: type: integer example: 1 object_id: type: string example: ABC123 owner: type: string example: OWN1 accepted_by: type: string example: USR1 accepted_at: type: string example: null nullable: true vehicle_drivers_id: type: integer example: 5 400: description: 'Not registered' content: application/json: schema: type: object example: message: Driver_Not_Registered_To_A_Vehicle properties: message: type: string example: Driver_Not_Registered_To_A_Vehicle 403: description: 'Not a driver' content: application/json: schema: type: object example: message: Not_A_Driver properties: message: type: string example: Not_A_Driver tags: - 'Vehicle Faults' '/api/transferacceptance/{id}': put: summary: 'Accept transfer' operationId: acceptTransfer description: 'Marks the transfer acceptance act as accepted by setting the accepted_at timestamp to the current UTC time.' parameters: [] responses: 200: description: Success content: application/json: schema: type: object example: id: 1 object_id: ABC123 owner: OWN1 accepted_by: USR1 accepted_at: '2024-01-15 12:00:00' vehicle_drivers_id: 5 properties: id: type: integer example: 1 object_id: type: string example: ABC123 owner: type: string example: OWN1 accepted_by: type: string example: USR1 accepted_at: type: string example: '2024-01-15 12:00:00' vehicle_drivers_id: type: integer example: 5 404: description: 'Not found' content: application/json: schema: type: object example: message: Not_Found properties: message: type: string example: Not_Found tags: - 'Vehicle Faults' parameters: - in: path name: id description: 'The transfer acceptance act ID.' example: 1 required: true schema: type: integer /api/vehfaults: get: summary: 'List all faults' operationId: listAllFaults description: 'Returns all open (unsolved) vehicle fault records for the current user.' parameters: [] responses: 200: description: Success content: application/json: schema: type: array items: type: object properties: id: type: integer example: 1 object_id: type: string example: ABC123 vehicle_faults_type_id: type: integer example: 1 descriptions: type: array example: - 'Oil leak' items: type: string registered_at: type: string example: '2026-01-15 10:00:00' registered_by: type: string example: USR1 solved_at: type: string example: null nullable: true solved_by: type: string example: null nullable: true transfer_acceptance_act_id: type: integer example: 1 previous_driver_id: type: integer example: 5 owner: type: string example: OWN1 example: - id: 1 object_id: ABC123 vehicle_faults_type_id: 1 descriptions: - 'Oil leak' registered_at: '2026-01-15 10:00:00' registered_by: USR1 solved_at: null solved_by: null transfer_acceptance_act_id: 1 previous_driver_id: 5 owner: OWN1 tags: - 'Vehicle Faults' post: summary: 'Create fault' operationId: createFault description: 'Creates a new vehicle fault record. Requires an active transfer acceptance act for the current driver. Supports file uploads.' parameters: [] responses: 201: description: Success content: application/json: schema: type: object example: id: 1 object_id: ABC123 vehicle_faults_type_id: 1 descriptions: - 'Oil leak' registered_at: '2026-01-15 10:00:00' registered_by: USR1 solved_at: null solved_by: null transfer_acceptance_act_id: 1 previous_driver_id: 5 owner: OWN1 files: [] properties: id: type: integer example: 1 object_id: type: string example: ABC123 vehicle_faults_type_id: type: integer example: 1 descriptions: type: array example: - 'Oil leak' items: type: string registered_at: type: string example: '2026-01-15 10:00:00' registered_by: type: string example: USR1 solved_at: type: string example: null nullable: true solved_by: type: string example: null nullable: true transfer_acceptance_act_id: type: integer example: 1 previous_driver_id: type: integer example: 5 owner: type: string example: OWN1 files: type: array example: [] 404: description: 'No act' content: application/json: schema: type: object example: message: No_Transfer_Acceptance_Act properties: message: type: string example: No_Transfer_Acceptance_Act tags: - 'Vehicle Faults' requestBody: required: true content: multipart/form-data: schema: type: object properties: vehicle_faults_type_id: type: integer description: 'The fault type ID.' example: 1 descriptions: type: string description: 'JSON-encoded descriptions string.' example: '["Oil leak", "Overheating"]' nullable: true file: type: array description: 'Must be a file.' items: type: string format: binary required: - vehicle_faults_type_id '/api/vehfaults/{id}': get: summary: 'Show fault' operationId: showFault description: 'Returns a single vehicle fault record with attached files.' parameters: [] responses: 200: description: Success content: application/json: schema: type: object example: id: 1 object_id: ABC123 vehicle_faults_type_id: 1 descriptions: - 'Oil leak' registered_at: '2026-01-15 10:00:00' registered_by: USR1 solved_at: null solved_by: null transfer_acceptance_act_id: 1 previous_driver_id: 5 owner: OWN1 files: [] properties: id: type: integer example: 1 object_id: type: string example: ABC123 vehicle_faults_type_id: type: integer example: 1 descriptions: type: array example: - 'Oil leak' items: type: string registered_at: type: string example: '2026-01-15 10:00:00' registered_by: type: string example: USR1 solved_at: type: string example: null nullable: true solved_by: type: string example: null nullable: true transfer_acceptance_act_id: type: integer example: 1 previous_driver_id: type: integer example: 5 owner: type: string example: OWN1 files: type: array example: [] 404: description: 'Not found' content: application/json: schema: type: object example: message: Not_Found properties: message: type: string example: Not_Found tags: - 'Vehicle Faults' put: summary: 'Update fault' operationId: updateFault description: 'Marks a vehicle fault as solved. Supports additional file uploads.' parameters: [] responses: 200: description: Success content: application/json: schema: type: object example: id: 1 object_id: ABC123 vehicle_faults_type_id: 1 descriptions: - 'Oil leak' registered_at: '2026-01-15 10:00:00' registered_by: USR1 solved_at: '2026-01-16 08:00:00' solved_by: USR1 transfer_acceptance_act_id: 1 previous_driver_id: 5 owner: OWN1 files: [] properties: id: type: integer example: 1 object_id: type: string example: ABC123 vehicle_faults_type_id: type: integer example: 1 descriptions: type: array example: - 'Oil leak' items: type: string registered_at: type: string example: '2026-01-15 10:00:00' registered_by: type: string example: USR1 solved_at: type: string example: '2026-01-16 08:00:00' solved_by: type: string example: USR1 transfer_acceptance_act_id: type: integer example: 1 previous_driver_id: type: integer example: 5 owner: type: string example: OWN1 files: type: array example: [] 404: description: 'Not found' content: application/json: schema: type: object example: message: Not_Found properties: message: type: string example: Not_Found tags: - 'Vehicle Faults' requestBody: required: true content: multipart/form-data: schema: type: object properties: is_solved: type: boolean description: 'Whether to mark the fault as solved.' example: true file: type: array description: 'Must be a file.' items: type: string format: binary required: - is_solved delete: summary: 'Delete fault' operationId: deleteFault description: 'Deletes a vehicle fault record.' parameters: [] responses: 200: description: Success content: application/json: schema: type: object example: message: Deleted properties: message: type: string example: Deleted 404: description: 'Not found' content: application/json: schema: type: object example: message: Not_Found properties: message: type: string example: Not_Found tags: - 'Vehicle Faults' parameters: - in: path name: id description: 'The fault record ID.' example: 1 required: true schema: type: integer /api/vehfaultsrep: get: summary: 'List faults report' operationId: listFaultsReport description: 'Returns an aggregated vehicle faults report grouped by vehicle, with unsolved and solved faults.' parameters: - in: query name: registered_at description: 'Date range filter [from, to].' example: - '2026-01-01' - '2026-01-31' required: false schema: type: array description: 'Date range filter [from, to].' example: - '2026-01-01' - '2026-01-31' items: type: string nullable: true - in: query name: registered_at.0 description: 'This field is required when registered_at is present. Väli value peab olema kehtiv kuupäev.' example: '2026-01-01' required: false schema: type: string description: 'This field is required when registered_at is present. Väli value peab olema kehtiv kuupäev.' example: '2026-01-01' - in: query name: registered_at.1 description: 'This field is required when registered_at is present. Väli value peab olema kehtiv kuupäev.' example: '2026-01-31' required: false schema: type: string description: 'This field is required when registered_at is present. Väli value peab olema kehtiv kuupäev.' example: '2026-01-31' - in: query name: object_id description: 'Filter by vehicle object ID.' example: ABC123 required: false schema: type: string description: 'Filter by vehicle object ID.' example: ABC123 nullable: true - in: query name: not_solved description: 'Filter by solved status (true = only unsolved).' example: 'true' required: false schema: type: string description: 'Filter by solved status (true = only unsolved).' example: 'true' nullable: true responses: 200: description: Success content: application/json: schema: type: array items: type: object properties: object_id: type: string example: ABC123 faults: type: array example: - id: 1 name: Engine descriptions: 'Oil leak' date: '2026-01-15' items: type: object properties: id: type: integer example: 1 name: type: string example: Engine descriptions: type: string example: 'Oil leak' date: type: string example: '2026-01-15' solved: type: array example: [] example: - object_id: ABC123 faults: - id: 1 name: Engine descriptions: 'Oil leak' date: '2026-01-15' solved: [] tags: - 'Vehicle Faults' '/api/vehfaultsrep/{id}': get: summary: 'Show vehicle faults' operationId: showVehicleFaults description: 'Returns all fault records for a specific vehicle, including attached files.' parameters: - in: query name: registered_at description: 'Date range filter [from, to].' example: - '2026-01-01' - '2026-01-31' required: false schema: type: array description: 'Date range filter [from, to].' example: - '2026-01-01' - '2026-01-31' items: type: string nullable: true - in: query name: registered_at.0 description: 'This field is required when registered_at is present. Väli value peab olema kehtiv kuupäev.' example: '2026-01-01' required: false schema: type: string description: 'This field is required when registered_at is present. Väli value peab olema kehtiv kuupäev.' example: '2026-01-01' - in: query name: registered_at.1 description: 'This field is required when registered_at is present. Väli value peab olema kehtiv kuupäev.' example: '2026-01-31' required: false schema: type: string description: 'This field is required when registered_at is present. Väli value peab olema kehtiv kuupäev.' example: '2026-01-31' - in: query name: object_id description: 'Filter by vehicle object ID. Must contain only letters, numbers, dashes and underscores. Väli value ei tohi olla pikem kui 10 tähemärki.' example: ABC123 required: false schema: type: string description: 'Filter by vehicle object ID. Must contain only letters, numbers, dashes and underscores. Väli value ei tohi olla pikem kui 10 tähemärki.' example: ABC123 nullable: true - in: query name: not_solved description: 'Filter unsolved only.' example: 'true' required: false schema: type: string description: 'Filter unsolved only.' example: 'true' nullable: true responses: 200: description: Success content: application/json: schema: type: array items: type: object properties: id: type: integer example: 1 object_id: type: string example: ABC123 name: type: string example: Engine descriptions: type: array example: - 'Oil leak' items: type: string registered_at: type: string example: '2026-01-15' registered_by: type: string example: USR1 solved_at: type: string example: null nullable: true solved_by: type: string example: null nullable: true transfer_acceptance_act_id: type: integer example: 1 driver_name: type: string example: 'John Doe' files: type: array example: [] example: - id: 1 object_id: ABC123 name: Engine descriptions: - 'Oil leak' registered_at: '2026-01-15' registered_by: USR1 solved_at: null solved_by: null transfer_acceptance_act_id: 1 driver_name: 'John Doe' files: [] tags: - 'Vehicle Faults' parameters: - in: path name: id description: 'The vehicle object ID.' example: ABC123 required: true schema: type: string /api/vehfaultchecks: get: summary: 'List all checks' operationId: listAllChecks description: 'Returns all vehicle status check records.' parameters: [] responses: 200: description: Success content: application/json: schema: type: array items: type: object properties: id: type: integer example: 1 object_id: type: string example: ABC123 created_at: type: string example: '2026-01-15 10:00:00' status: type: integer example: 0 data: type: array example: - fault_id: 1 checked: true comment: '' items: type: object properties: fault_id: type: integer example: 1 checked: type: boolean example: true comment: type: string example: '' sender: type: string example: USR1 example: - id: 1 object_id: ABC123 created_at: '2026-01-15 10:00:00' status: 0 data: - fault_id: 1 checked: true comment: '' sender: USR1 tags: - 'Vehicle Faults' post: summary: 'Create check' operationId: createCheck description: 'Creates a vehicle status check. Fault records are automatically created for unchecked items. Supports file uploads grouped by fault_id.' parameters: [] responses: 201: description: Success content: application/json: schema: type: object example: id: 1 object_id: ABC123 created_at: '2026-01-15 10:00:00' status: 1 data: - fault_id: 1 checked: false comment: 'Oil leak' sender: USR1 faults: [] properties: id: type: integer example: 1 object_id: type: string example: ABC123 created_at: type: string example: '2026-01-15 10:00:00' status: type: integer example: 1 data: type: array example: - fault_id: 1 checked: false comment: 'Oil leak' items: type: object properties: fault_id: type: integer example: 1 checked: type: boolean example: false comment: type: string example: 'Oil leak' sender: type: string example: USR1 faults: type: array example: [] tags: - 'Vehicle Faults' requestBody: required: true content: application/json: schema: type: object properties: object_id: type: string description: 'Vehicle object ID. Must contain only letters, numbers, dashes and underscores. Väli value ei tohi olla pikem kui 10 tähemärki.' example: ABC123 data: type: string description: 'JSON-encoded array of check items with fault_id, checked (bool), and comment.' example: '[{"fault_id":1,"checked":true,"comment":""},{"fault_id":2,"checked":false,"comment":"Oil leak"}]' file: type: object description: 'Files grouped by fault_id. Use file[fault_id][] for multiple files per fault.' example: null properties: { } nullable: true required: - object_id - data '/api/vehfaultchecks/{id}': get: summary: 'Show check' operationId: showCheck description: 'Returns a single vehicle status check with its associated faults and files.' parameters: [] responses: 200: description: Success content: application/json: schema: type: object example: id: 1 object_id: ABC123 created_at: '2026-01-15 10:00:00' status: 1 data: - fault_id: 1 checked: false comment: 'Oil leak' sender: USR1 faults: [] properties: id: type: integer example: 1 object_id: type: string example: ABC123 created_at: type: string example: '2026-01-15 10:00:00' status: type: integer example: 1 data: type: array example: - fault_id: 1 checked: false comment: 'Oil leak' items: type: object properties: fault_id: type: integer example: 1 checked: type: boolean example: false comment: type: string example: 'Oil leak' sender: type: string example: USR1 faults: type: array example: [] 404: description: 'Not found' content: application/json: schema: type: object example: message: Not_Found properties: message: type: string example: Not_Found tags: - 'Vehicle Faults' parameters: - in: path name: id description: 'The check record ID.' example: 1 required: true schema: type: integer '/api/vehstatus/{id}': get: summary: 'Get vehicle status' operationId: getVehicleStatus description: 'Returns the current status of a vehicle with related record data.' parameters: [] responses: 200: description: '' content: application/json: schema: oneOf: - description: Work type: object example: driver_id: 1 type_id: null log: null status: work id: 1 object_id: ABC123 startUse: '2025-01-15 08:00:00' stopUse: null name: 'John Doe' properties: driver_id: type: integer example: 1 type_id: type: string example: null nullable: true log: type: string example: null nullable: true status: type: string example: work id: type: integer example: 1 object_id: type: string example: ABC123 startUse: type: string example: '2025-01-15 08:00:00' stopUse: type: string example: null nullable: true name: type: string example: 'John Doe' - description: Repair type: object example: driver_id: null type_id: 1 log: [] status: repair id: 1 object_id: ABC123 start: '2025-01-15 08:00:00' stop: null name: 'Engine repair' properties: driver_id: type: string example: null nullable: true type_id: type: integer example: 1 log: type: array example: [] status: type: string example: repair id: type: integer example: 1 object_id: type: string example: ABC123 start: type: string example: '2025-01-15 08:00:00' stop: type: string example: null nullable: true name: type: string example: 'Engine repair' - description: Reserve type: object example: driver_id: null type_id: null log: null status: reserve id: 1 start: '2025-01-15 12:00:00' prev_status: work properties: driver_id: type: string example: null nullable: true type_id: type: string example: null nullable: true log: type: string example: null nullable: true status: type: string example: reserve id: type: integer example: 1 start: type: string example: '2025-01-15 12:00:00' prev_status: type: string example: work 404: description: 'Not found' content: application/json: schema: type: object example: message: Not_Found properties: message: type: string example: Not_Found tags: - 'Vehicle Status' put: summary: 'Close repair status' operationId: closeRepairStatus description: 'Closes the active repair record for a vehicle by setting its stop time to now.' parameters: [] responses: 204: description: Success content: text/plain: schema: type: string example: '' 403: description: 'Object not allowed' content: application/json: schema: type: object example: message: ObjectNotAllowed properties: message: type: string example: ObjectNotAllowed tags: - 'Vehicle Status' parameters: - in: path name: id description: 'The vehicle object ID.' example: ABC123 required: true schema: type: string /api/vehstatusreport: get: summary: 'List vehicle status report' operationId: listVehicleStatusReport description: 'Returns all vehicles with calculated work, repair and own repair time periods.' parameters: - in: query name: datetime description: '' example: - architecto required: true schema: type: array description: '' example: - architecto items: type: string responses: 200: description: Success content: application/json: schema: type: array items: type: object properties: id: type: string example: ABC123 alias: type: string example: 'Truck 1' work: type: integer example: 3600 repair: type: integer example: 1800 own_repair: type: integer example: 900 example: - id: ABC123 alias: 'Truck 1' work: 3600 repair: 1800 own_repair: 900 tags: - 'Vehicle Status' '/api/vehstatusreport/{id}': get: summary: 'Get vehicle status report' operationId: getVehicleStatusReport description: 'Returns repair and work records for a single vehicle within the given period.' parameters: - in: query name: datetime description: '' example: - architecto required: true schema: type: array description: '' example: - architecto items: type: string responses: 200: description: Success content: application/json: schema: type: array items: type: object properties: id: type: integer example: 1 object_id: type: string example: ABC123 start: type: string example: '2025-01-15 08:00:00' stop: type: string example: '2025-01-15 12:00:00' type_id: type: string example: null nullable: true name: type: string example: 'John Doe' status: type: string example: work driver_id: type: integer example: 1 startTimestamp: type: integer example: 1736928000 stopTimestamp: type: integer example: 1736942400 example: - id: 1 object_id: ABC123 start: '2025-01-15 08:00:00' stop: '2025-01-15 12:00:00' type_id: null name: 'John Doe' status: work driver_id: 1 startTimestamp: 1736928000 stopTimestamp: 1736942400 tags: - 'Vehicle Status' parameters: - in: path name: id description: 'The vehicle object ID.' example: ABC123 required: true schema: type: string '/api/vehstatusrepair/{id}': get: summary: 'Get repair record' operationId: getRepairRecord description: 'Returns a single vehicle repair record by ID with decoded log.' parameters: [] responses: 200: description: Success content: application/json: schema: type: object example: id: 1 object_id: ABC123 type_id: 1 isOwn: 0 start: '2025-01-15 08:00:00' stop: null log: [] oid: owner1 properties: id: type: integer example: 1 object_id: type: string example: ABC123 type_id: type: integer example: 1 isOwn: type: integer example: 0 start: type: string example: '2025-01-15 08:00:00' stop: type: string example: null nullable: true log: type: array example: [] oid: type: string example: owner1 404: description: 'Not found' content: application/json: schema: type: object example: message: Not_Found properties: message: type: string example: Not_Found tags: - 'Vehicle Status' put: summary: 'Update (close) repair record' operationId: updatecloseRepairRecord description: 'Closes an active repair record by setting its stop time to now.' parameters: [] responses: 200: description: Success content: application/json: schema: type: object example: id: 1 object_id: ABC123 type_id: 1 isOwn: 0 start: '2025-01-15 08:00:00' stop: '2025-01-15 17:00:00' log: [] oid: owner1 properties: id: type: integer example: 1 object_id: type: string example: ABC123 type_id: type: integer example: 1 isOwn: type: integer example: 0 start: type: string example: '2025-01-15 08:00:00' stop: type: string example: '2025-01-15 17:00:00' log: type: array example: [] oid: type: string example: owner1 400: description: 'Already closed' content: application/json: schema: type: object example: message: Closed_Record properties: message: type: string example: Closed_Record 404: description: 'Not found' content: application/json: schema: type: object example: message: Not_Found properties: message: type: string example: Not_Found tags: - 'Vehicle Status' delete: summary: 'Delete repair record' operationId: deleteRepairRecord description: 'Deletes an active (unclosed) repair record.' parameters: [] responses: 200: description: Success content: application/json: schema: type: object example: message: Deleted properties: message: type: string example: Deleted 400: description: 'Already closed' content: application/json: schema: type: object example: message: Closed_Record properties: message: type: string example: Closed_Record 404: description: 'Not found' content: application/json: schema: type: object example: message: Not_Found properties: message: type: string example: Not_Found tags: - 'Vehicle Status' parameters: - in: path name: id description: 'The repair record ID.' example: 1 required: true schema: type: integer /api/vehstatusrepair: post: summary: 'Create repair record' operationId: createRepairRecord description: 'Creates a new vehicle repair record. Closes any active driver vehicle registration for the vehicle first.' parameters: [] responses: 201: description: Success content: application/json: schema: type: object example: id: 1 object_id: ABC123 type_id: 1 isOwn: 0 start: '2025-01-15 08:00:00' stop: null log: [] oid: owner1 properties: id: type: integer example: 1 object_id: type: string example: ABC123 type_id: type: integer example: 1 isOwn: type: integer example: 0 start: type: string example: '2025-01-15 08:00:00' stop: type: string example: null nullable: true log: type: array example: [] oid: type: string example: owner1 400: description: 'Already in repair' content: application/json: schema: type: object example: message: Vehicle_Already_In_Repair properties: message: type: string example: Vehicle_Already_In_Repair tags: - 'Vehicle Status' requestBody: required: true content: application/json: schema: type: object properties: object_id: type: string description: 'The vehicle object ID. Väli value ei tohi olla pikem kui 10 tähemärki.' example: ABC123 type_id: type: integer description: 'The status type ID.' example: 1 isOwn: type: boolean description: 'Whether this is an own repair.' example: false nullable: true required: - object_id - type_id /api/vehstatustype: get: summary: 'List status types' operationId: listStatusTypes description: 'Returns all vehicle status types for the current owner.' parameters: [] responses: 200: description: Success content: application/json: schema: type: array items: type: object properties: id: type: integer example: 1 name: type: string example: 'Engine repair' example: - id: 1 name: 'Engine repair' - id: 2 name: 'Body repair' tags: - 'Vehicle Status' post: summary: 'Create status type' operationId: createStatusType description: 'Creates a new vehicle status type.' parameters: [] responses: 201: description: Success content: application/json: schema: type: object example: id: 1 name: 'Engine repair' properties: id: type: integer example: 1 name: type: string example: 'Engine repair' tags: - 'Vehicle Status' requestBody: required: true content: application/json: schema: type: object properties: name: type: string description: 'The status type name. Väli value ei tohi olla pikem kui 255 tähemärki.' example: 'Engine repair' required: - name '/api/vehstatustype/{id}': get: summary: 'Get status type' operationId: getStatusType description: 'Returns a single vehicle status type by ID.' parameters: [] responses: 200: description: Success content: application/json: schema: type: object example: id: 1 name: 'Engine repair' properties: id: type: integer example: 1 name: type: string example: 'Engine repair' 404: description: 'Not found' content: application/json: schema: type: object example: message: Not_Found properties: message: type: string example: Not_Found tags: - 'Vehicle Status' put: summary: 'Update status type' operationId: updateStatusType description: 'Updates an existing vehicle status type.' parameters: [] responses: 200: description: Success content: application/json: schema: type: object example: id: 1 name: 'Body repair' properties: id: type: integer example: 1 name: type: string example: 'Body repair' 404: description: 'Not found' content: application/json: schema: type: object example: message: Not_Found properties: message: type: string example: Not_Found tags: - 'Vehicle Status' requestBody: required: true content: application/json: schema: type: object properties: name: type: string description: 'The status type name. Väli value ei tohi olla pikem kui 255 tähemärki.' example: 'Engine repair' required: - name delete: summary: 'Delete status type' operationId: deleteStatusType description: 'Deletes a vehicle status type.' parameters: [] responses: 200: description: Success content: application/json: schema: type: object example: message: Deleted properties: message: type: string example: Deleted 404: description: 'Not found' content: application/json: schema: type: object example: message: Not_Found properties: message: type: string example: Not_Found tags: - 'Vehicle Status' parameters: - in: path name: id description: 'The status type ID.' example: 1 required: true schema: type: integer /api/objects: get: summary: 'List all objects' operationId: listAllObjects description: 'Returns all vehicle objects for the current user. Admin users receive a limited set (max 5).' parameters: [] responses: 200: description: Success content: application/json: schema: type: array items: type: object properties: object_id: type: string example: ABC123 oid: type: string example: metrotec Serial_Nr: type: string example: '123456789' GSM_NR: type: string example: '+37255555555' Manufacture: type: integer example: 1 odometer: type: integer example: 150000 T1max: type: integer example: 30 T2max: type: integer example: 30 T1min: type: integer example: 0 T2min: type: integer example: 0 odometer_day: type: string example: '2025-01-01 00:00:00' description: type: string example: 'Delivery truck' tank_vol: type: number example: 200.5 x_coord: type: number example: 24.7536 y_coord: type: number example: 59.437 is_fixed_gps: type: integer example: 0 account_type: type: integer example: 1 categoryID: type: integer example: 1 extraDevices: type: integer example: 0 naviseade: type: string example: ABC123 deviceName: type: string example: FMB120 isPercent: type: integer example: 0 example: - object_id: ABC123 oid: metrotec Serial_Nr: '123456789' GSM_NR: '+37255555555' Manufacture: 1 odometer: 150000 T1max: 30 T2max: 30 T1min: 0 T2min: 0 odometer_day: '2025-01-01 00:00:00' description: 'Delivery truck' tank_vol: 200.5 x_coord: 24.7536 y_coord: 59.437 is_fixed_gps: 0 account_type: 1 categoryID: 1 extraDevices: 0 naviseade: ABC123 deviceName: FMB120 isPercent: 0 tags: - Vehicles post: summary: 'Create object' operationId: createObject description: 'Creates a new vehicle object. Requires installer-level access.' parameters: [] responses: 201: description: Success content: application/json: schema: type: object example: object_id: ABC123 oid: metrotec Serial_Nr: '123456789' properties: object_id: type: string example: ABC123 oid: type: string example: metrotec Serial_Nr: type: string example: '123456789' 400: description: '' content: application/json: schema: oneOf: - description: 'Duplicate serial' type: object example: error: Not_Unique_Serial_Nr properties: error: type: string example: Not_Unique_Serial_Nr - description: 'Duplicate object ID' type: object example: error: Not_Unique_Object_Id properties: error: type: string example: Not_Unique_Object_Id tags: - Vehicles requestBody: required: true content: application/json: schema: type: object properties: object_id: type: string description: 'Unique vehicle identifier. Must contain only letters, numbers, dashes and underscores. Väli value ei tohi olla pikem kui 10 tähemärki.' example: ABC123 oid: type: string description: 'Organization ID. Must contain only letters and numbers. Väli value ei tohi olla pikem kui 30 tähemärki.' example: metrotec Serial_Nr: type: string description: 'Device serial number. Must match the regex /^[0-9_]+$/. Väli value peab olema vähemalt 3 tähemärki.' example: '123456789' GSM_NR: type: string description: 'GSM phone number. Must match the regex /^[0-9+]+$/. Väli value peab olema vähemalt 3 tähemärki.' example: '+37255555555' Manufacture: type: integer description: 'Manufacturer ID.' example: 1 odometer: type: integer description: 'Current odometer reading in km.' example: 150000 T1max: type: integer description: 'Temperature 1 max threshold.' example: 30 T2max: type: integer description: 'Temperature 2 max threshold.' example: 30 odometer_day: type: string description: 'Date when odometer was set. Must be a valid date in the format Y-m-d H:i:s.' example: '2025-01-01 00:00:00' description: type: string description: 'Vehicle description.' example: 'Delivery truck' nullable: true tank_vol: type: number description: 'Fuel tank volume in liters.' example: 200.5 nullable: true x_coord: type: number description: 'Fixed GPS X coordinate (longitude).' example: 24.7536 nullable: true y_coord: type: number description: 'Fixed GPS Y coordinate (latitude).' example: 59.437 nullable: true is_fixed_gps: type: boolean description: 'Whether the vehicle has a fixed GPS position.' example: false nullable: true required: - object_id - oid - Serial_Nr - GSM_NR - Manufacture - odometer - T1max - T2max - odometer_day /api/objects-query: get: summary: 'Search objects' operationId: searchObjects description: 'Searches vehicle objects by object ID or serial number. Requires installer-level access.' parameters: - in: query name: q description: 'Search term (object_id or Serial_Nr). Min 2 chars.' example: ABC123 required: true schema: type: string description: 'Search term (object_id or Serial_Nr). Min 2 chars.' example: ABC123 responses: 200: description: Success content: application/json: schema: type: array items: type: object properties: object_id: type: string example: ABC123 oid: type: string example: metrotec Serial_Nr: type: string example: '123456789' GSM_NR: type: string example: '+37255555555' Manufacture: type: integer example: 1 example: - object_id: ABC123 oid: metrotec Serial_Nr: '123456789' GSM_NR: '+37255555555' Manufacture: 1 tags: - Vehicles requestBody: required: true content: application/json: schema: type: object properties: q: type: string description: 'Must match the regex /^[a-zA-Z0-9_]+$/. Väli value peab olema vähemalt 2 tähemärki. Väli value ei tohi olla pikem kui 50 tähemärki.' example: b required: - q '/api/objects/{id}': get: summary: 'Show object' operationId: showObject description: 'Returns a single vehicle object by ID.' parameters: [] responses: 200: description: Success content: application/json: schema: type: object example: object_id: ABC123 oid: metrotec Serial_Nr: '123456789' GSM_NR: '+37255555555' Manufacture: 1 odometer: 150000 T1max: 30 T2max: 30 T1min: 0 T2min: 0 odometer_day: '2025-01-01 00:00:00' description: 'Delivery truck' tank_vol: 200.5 x_coord: 24.7536 y_coord: 59.437 is_fixed_gps: 0 account_type: 1 categoryID: 1 extraDevices: 0 naviseade: ABC123 deviceName: FMB120 isPercent: 0 properties: object_id: type: string example: ABC123 oid: type: string example: metrotec Serial_Nr: type: string example: '123456789' GSM_NR: type: string example: '+37255555555' Manufacture: type: integer example: 1 odometer: type: integer example: 150000 T1max: type: integer example: 30 T2max: type: integer example: 30 T1min: type: integer example: 0 T2min: type: integer example: 0 odometer_day: type: string example: '2025-01-01 00:00:00' description: type: string example: 'Delivery truck' tank_vol: type: number example: 200.5 x_coord: type: number example: 24.7536 y_coord: type: number example: 59.437 is_fixed_gps: type: integer example: 0 account_type: type: integer example: 1 categoryID: type: integer example: 1 extraDevices: type: integer example: 0 naviseade: type: string example: ABC123 deviceName: type: string example: FMB120 isPercent: type: integer example: 0 404: description: 'Not found' content: application/json: schema: type: object example: error: Vehicle_Not_Found properties: error: type: string example: Vehicle_Not_Found tags: - Vehicles put: summary: 'Update object' operationId: updateObject description: 'Updates an existing vehicle object. Requires installer-level access.' parameters: [] responses: 200: description: Success content: application/json: schema: type: object example: object_id: ABC123 oid: metrotec Serial_Nr: '123456789' properties: object_id: type: string example: ABC123 oid: type: string example: metrotec Serial_Nr: type: string example: '123456789' 400: description: 'Duplicate serial' content: application/json: schema: type: object example: error: Not_Unique_Serial_Nr properties: error: type: string example: Not_Unique_Serial_Nr tags: - Vehicles requestBody: required: false content: application/json: schema: type: object properties: object_id: type: string description: 'Unique vehicle identifier. Must contain only letters, numbers, dashes and underscores. Väli value ei tohi olla pikem kui 10 tähemärki.' example: ABC123 oid: type: string description: 'Organization ID. Must contain only letters and numbers. Väli value ei tohi olla pikem kui 30 tähemärki.' example: metrotec Serial_Nr: type: string description: 'Device serial number. Must match the regex /^[0-9_]+$/. Väli value peab olema vähemalt 3 tähemärki.' example: '123456789' GSM_NR: type: string description: 'GSM phone number. Must match the regex /^[0-9+]+$/. Väli value peab olema vähemalt 3 tähemärki.' example: '+37255555555' Manufacture: type: integer description: 'Manufacturer ID.' example: 1 odometer: type: integer description: 'Current odometer reading in km.' example: 150000 T1max: type: integer description: 'Temperature 1 max threshold.' example: 30 T2max: type: integer description: 'Temperature 2 max threshold.' example: 30 odometer_day: type: string description: 'Date when odometer was set. Must be a valid date in the format Y-m-d H:i:s.' example: '2025-01-01 00:00:00' description: type: string description: 'Vehicle description.' example: 'Delivery truck' nullable: true tank_vol: type: number description: 'Fuel tank volume in liters.' example: 200.5 nullable: true x_coord: type: number description: 'Fixed GPS X coordinate (longitude).' example: 24.7536 nullable: true y_coord: type: number description: 'Fixed GPS Y coordinate (latitude).' example: 59.437 nullable: true is_fixed_gps: type: boolean description: 'Whether the vehicle has a fixed GPS position.' example: false nullable: true delete: summary: 'Delete object' operationId: deleteObject description: 'Deletes a vehicle object. Only objects with account_type=-1 can be deleted. Requires installer-level access.' parameters: [] responses: 200: description: Success content: application/json: schema: type: object example: message: Deleted properties: message: type: string example: Deleted 404: description: 'Not found' content: application/json: schema: type: object example: error: Vehicle_Not_Found properties: error: type: string example: Vehicle_Not_Found tags: - Vehicles parameters: - in: path name: id description: 'The vehicle object ID.' example: ABC123 required: true schema: type: string '/api/odometer/{id}': get: summary: 'Get odometer by date' operationId: getOdometerByDate description: 'Returns the calculated odometer value for a vehicle at a specific date.' parameters: - in: query name: d description: 'Date in Y-m-d H:i:s format.' example: '2025-01-15 08:00:00' required: true schema: type: string description: 'Date in Y-m-d H:i:s format.' example: '2025-01-15 08:00:00' responses: 200: description: Success content: application/json: schema: type: object example: odometer: 150234.5 properties: odometer: type: number example: 150234.5 tags: - Vehicles requestBody: required: true content: application/json: schema: type: object properties: d: type: string description: 'Must be a valid date in the format Y-m-d H:i:s.' example: '2026-02-26 15:34:38' required: - d parameters: - in: path name: id description: 'The vehicle object ID.' example: ABC123 required: true schema: type: string '/api/odomoto/{id}': get: summary: 'Get odometer / motohours' operationId: getOdometerMotohours description: "Returns the current odometer value or motohours for a vehicle,\ndepending on whether it is configured to calculate by hours." parameters: [] responses: 200: description: '' content: application/json: schema: oneOf: - description: Odometer type: object example: object_id: ABC123 odometer: 150234 motoHours: null dateTimeUTC: '2025-01-15 08:00:00' properties: object_id: type: string example: ABC123 odometer: type: integer example: 150234 motoHours: type: string example: null nullable: true dateTimeUTC: type: string example: '2025-01-15 08:00:00' - description: MotoHours type: object example: object_id: ABC123 odometer: null motoHours: 1234.5 dateTimeUTC: '2025-01-15 08:00:00' properties: object_id: type: string example: ABC123 odometer: type: string example: null nullable: true motoHours: type: number example: 1234.5 dateTimeUTC: type: string example: '2025-01-15 08:00:00' tags: - Vehicles parameters: - in: path name: id description: 'The vehicle object ID.' example: ABC123 required: true schema: type: string /api/objectsingeo: get: summary: 'Get objects in geo area' operationId: getObjectsInGeoArea description: 'Returns a list of vehicle object IDs located within the given polygon coordinates.' parameters: - in: query name: coordinates description: 'JSON-encoded array of polygon coordinate pairs. Väli value peab olema kehtiv JSON string.' example: '[[24.7,59.4],[24.8,59.4],[24.8,59.5],[24.7,59.5],[24.7,59.4]]' required: true schema: type: string description: 'JSON-encoded array of polygon coordinate pairs. Väli value peab olema kehtiv JSON string.' example: '[[24.7,59.4],[24.8,59.4],[24.8,59.5],[24.7,59.5],[24.7,59.4]]' responses: 200: description: Success content: application/json: schema: type: array items: type: string example: - ABC123 - DEF456 - GHI789 403: description: Forbidden content: application/json: schema: type: object example: message: Forbidden properties: message: type: string example: Forbidden tags: - Vehicles /api/vehicles: get: summary: 'List all vehicles' operationId: listAllVehicles description: 'Returns all vehicles for the current user with device info, booking status, and categories.' parameters: [] responses: 200: description: Success content: application/json: schema: type: array items: type: object properties: id: type: string example: ABC123 alias: type: string example: 'Truck 1' isOwn: type: integer example: 1 extraDevices: type: integer example: 0 categoryID: type: integer example: 1 categoryName: type: string example: Trucks naviseade: type: string example: ABC123 isDDD: type: integer example: 0 account_type: type: integer example: 1 Manufacture: type: integer example: 1 calcByM: type: string example: '0' has_route_tasks: type: string example: '1' T1min: type: integer example: 0 T1max: type: integer example: 30 T2min: type: integer example: 0 T2max: type: integer example: 30 tank_vol: type: integer example: 200 barrel_type: type: integer example: 0 isPercent: type: integer example: 0 isBookable: type: integer example: 1 next_maintenance_km: type: integer example: 200000 odometer_day: type: string example: '2025-01-01 00:00:00' odometer: type: integer example: 150000 fuel_card_nr: type: string example: FC-12345 gps_refresh_interval: type: integer example: 30 is_fuel_as_pressure: type: integer example: 0 example: - id: ABC123 alias: 'Truck 1' isOwn: 1 extraDevices: 0 categoryID: 1 categoryName: Trucks naviseade: ABC123 isDDD: 0 account_type: 1 Manufacture: 1 calcByM: '0' has_route_tasks: '1' T1min: 0 T1max: 30 T2min: 0 T2max: 30 tank_vol: 200 barrel_type: 0 isPercent: 0 isBookable: 1 next_maintenance_km: 200000 odometer_day: '2025-01-01 00:00:00' odometer: 150000 fuel_card_nr: FC-12345 gps_refresh_interval: 30 is_fuel_as_pressure: 0 tags: - Vehicles '/api/vehicles/{id}': get: summary: 'Show vehicle' operationId: showVehicle description: 'Returns detailed vehicle data. Own vehicles include leasing data; shared vehicles return minimal info.' parameters: [] responses: 200: description: '' content: application/json: schema: oneOf: - description: 'Own vehicle' type: object example: id: ABC123 alias: 'Truck 1' isOwn: 1 fuel_card_nr: FC-12345 categoryID: 1 categoryName: Trucks btime: 300 next_maintenance_km: 200000 next_inspection_day: '2025-06-15' next_insurance_day: '2025-12-31' odometer: 150000 odometer_day: '2025-01-15 08:00:00' idle_rpm: 800 min_rpm: 500 isBookable: 1 calcByM: '0' has_route_tasks: '1' leasing_id: 1 kontraktNr: 12345 model: Volvo-FH16 period: 36 leasing_startDate: '2024-01-01' leasing_endDate: '2027-01-01' res_value: 15000.5 properties: id: type: string example: ABC123 alias: type: string example: 'Truck 1' isOwn: type: integer example: 1 fuel_card_nr: type: string example: FC-12345 categoryID: type: integer example: 1 categoryName: type: string example: Trucks btime: type: integer example: 300 next_maintenance_km: type: integer example: 200000 next_inspection_day: type: string example: '2025-06-15' next_insurance_day: type: string example: '2025-12-31' odometer: type: integer example: 150000 odometer_day: type: string example: '2025-01-15 08:00:00' idle_rpm: type: integer example: 800 min_rpm: type: integer example: 500 isBookable: type: integer example: 1 calcByM: type: string example: '0' has_route_tasks: type: string example: '1' leasing_id: type: integer example: 1 kontraktNr: type: integer example: 12345 model: type: string example: Volvo-FH16 period: type: integer example: 36 leasing_startDate: type: string example: '2024-01-01' leasing_endDate: type: string example: '2027-01-01' res_value: type: number example: 15000.5 - description: 'Shared vehicle' type: object example: id: ABC123 alias: 'Truck 1' isOwn: 0 properties: id: type: string example: ABC123 alias: type: string example: 'Truck 1' isOwn: type: integer example: 0 404: description: 'Not found' content: application/json: schema: type: object example: message: Not_Found properties: message: type: string example: Not_Found tags: - Vehicles put: summary: 'Update vehicle' operationId: updateVehicle description: "Updates a vehicle's settings, alias, leasing data, and booking status.\nOnly own vehicles can have their full data updated." parameters: [] responses: 200: description: Success content: application/json: schema: type: object example: message: OK properties: message: type: string example: OK 404: description: 'Not found' content: application/json: schema: type: object example: message: Not_Found properties: message: type: string example: Not_Found tags: - Vehicles requestBody: required: false content: application/json: schema: type: object properties: fuel_card_nr: type: string description: 'Fuel card number. Must contain only letters, numbers, dashes and underscores. Väli value ei tohi olla pikem kui 30 tähemärki.' example: FC-12345 nullable: true categoryID: type: integer description: 'Vehicle category ID.' example: 1 nullable: true btime: type: integer description: 'Business time threshold in seconds.' example: 300 nullable: true next_maintenance_km: type: integer description: 'Next maintenance odometer reading in km.' example: 200000 nullable: true next_inspection_day: type: string description: 'Next vehicle inspection date. Must be a valid date in the format Y-m-d.' example: '2025-06-15' nullable: true next_insurance_day: type: string description: 'Next insurance expiration date. Must be a valid date in the format Y-m-d.' example: '2025-12-31' nullable: true odometer: type: integer description: 'Current odometer reading in km.' example: 150000 nullable: true idle_rpm: type: integer description: 'Idle RPM threshold.' example: 800 nullable: true min_rpm: type: integer description: 'Minimum RPM threshold.' example: 500 nullable: true odometer_day: type: string description: 'Date when odometer was set. Must be a valid date in the format Y-m-d H:i:s.' example: '2025-01-15 08:00:00' nullable: true isBookable: type: boolean description: 'Whether the vehicle can be booked.' example: true nullable: true has_route_tasks: type: boolean description: 'Whether the vehicle has route tasks enabled.' example: true nullable: true calcByM: type: boolean description: 'Calculate by motohours instead of odometer.' example: false nullable: true alias: type: string description: 'Vehicle display name alias.' example: 'Truck 1' nullable: true kontraktNr: type: integer description: 'Leasing contract number.' example: 12345 nullable: true model: type: string description: 'Vehicle model name. Must contain only letters, numbers, dashes and underscores.' example: Volvo-FH16 nullable: true period: type: integer description: 'Leasing period in months.' example: 36 nullable: true leasing_startDate: type: string description: 'Leasing start date. Must be a valid date in the format Y-m-d.' example: '2024-01-01' nullable: true leasing_endDate: type: string description: 'Leasing end date. Must be a valid date in the format Y-m-d.' example: '2027-01-01' nullable: true res_value: type: number description: 'Residual value.' example: 15000.5 nullable: true p1: type: string description: 'Custom parameter 1.' example: 'Value 1' nullable: true p2: type: string description: 'Custom parameter 2.' example: 'Value 2' nullable: true p3: type: string description: 'Custom parameter 3.' example: 'Value 3' nullable: true p4: type: string description: 'Custom parameter 4.' example: 'Value 4' nullable: true p5: type: string description: 'Custom parameter 5.' example: 'Value 5' nullable: true parameters: - in: path name: id description: 'The vehicle object ID.' example: ABC123 required: true schema: type: string '/api/alias/{id}': put: summary: 'Update alias' operationId: updateAlias description: 'Creates, updates, or removes a vehicle alias. Pass null to remove the alias.' parameters: [] responses: 200: description: Success content: application/json: schema: type: object example: ID: 1 object_id: ABC123 alias: 'Truck 1' properties: ID: type: integer example: 1 object_id: type: string example: ABC123 alias: type: string example: 'Truck 1' 403: description: Forbidden content: application/json: schema: type: object example: message: ObjectNotAllowed properties: message: type: string example: ObjectNotAllowed tags: - Vehicles requestBody: required: false content: application/json: schema: type: object properties: alias: type: string description: 'Vehicle display name alias. Pass null to remove.' example: 'Truck 1' nullable: true parameters: - in: path name: id description: 'The vehicle object ID.' example: ABC123 required: true schema: type: string /api/categories: get: summary: 'List all categories' operationId: listAllCategories description: 'Returns all vehicle categories for the current user.' parameters: [] responses: 200: description: Success content: application/json: schema: type: array items: type: object properties: id: type: integer example: 1 name: type: string example: Trucks calcByKm: type: string example: '1' calcByM: type: string example: '0' shift: type: string example: '0' example: - id: 1 name: Trucks calcByKm: '1' calcByM: '0' shift: '0' tags: - Vehicles post: summary: 'Create category' operationId: createCategory description: 'Creates a new vehicle category.' parameters: [] responses: 201: description: Success content: application/json: schema: type: object example: id: 2 name: Vans calcByKm: '1' calcByM: '0' shift: '0' properties: id: type: integer example: 2 name: type: string example: Vans calcByKm: type: string example: '1' calcByM: type: string example: '0' shift: type: string example: '0' tags: - Vehicles requestBody: required: true content: application/json: schema: type: object properties: name: type: string description: 'Category name.' example: Trucks calcByKm: type: boolean description: 'Calculate by kilometers.' example: true calcByM: type: boolean description: 'Calculate by motohours.' example: false shift: type: boolean description: 'Shift mode enabled.' example: false required: - name - calcByKm - calcByM - shift '/api/categories/{id}': get: summary: 'Show category' operationId: showCategory description: 'Returns a single category with its assigned vehicles.' parameters: [] responses: 200: description: Success content: application/json: schema: type: object example: id: 1 name: Trucks calcByKm: '1' calcByM: '0' shift: '0' vehicles: - object_id: ABC123 alias: 'Truck 1' properties: id: type: integer example: 1 name: type: string example: Trucks calcByKm: type: string example: '1' calcByM: type: string example: '0' shift: type: string example: '0' vehicles: type: array example: - object_id: ABC123 alias: 'Truck 1' items: type: object properties: object_id: type: string example: ABC123 alias: type: string example: 'Truck 1' 404: description: 'Not found' content: application/json: schema: type: object example: message: Not_Found properties: message: type: string example: Not_Found tags: - Vehicles put: summary: 'Update category' operationId: updateCategory description: 'Updates an existing vehicle category.' parameters: [] responses: 200: description: Success content: application/json: schema: type: object example: id: 1 name: 'Heavy Trucks' calcByKm: '1' calcByM: '0' shift: '0' properties: id: type: integer example: 1 name: type: string example: 'Heavy Trucks' calcByKm: type: string example: '1' calcByM: type: string example: '0' shift: type: string example: '0' 404: description: 'Not found' content: application/json: schema: type: object example: message: Not_Found properties: message: type: string example: Not_Found tags: - Vehicles requestBody: required: false content: application/json: schema: type: object properties: name: type: string description: 'Category name.' example: Trucks calcByKm: type: boolean description: 'Calculate by kilometers.' example: true calcByM: type: boolean description: 'Calculate by motohours.' example: false shift: type: boolean description: 'Shift mode enabled.' example: false delete: summary: 'Delete category' operationId: deleteCategory description: 'Deletes a vehicle category. Fails if vehicles are still assigned to it.' parameters: [] responses: 200: description: Success content: application/json: schema: type: object example: message: Deleted properties: message: type: string example: Deleted 400: description: 'In use' content: application/json: schema: type: object example: message: No_Delete properties: message: type: string example: No_Delete 404: description: 'Not found' content: application/json: schema: type: object example: message: Not_Found properties: message: type: string example: Not_Found tags: - Vehicles parameters: - in: path name: id description: 'The category ID.' example: 1 required: true schema: type: integer /api/trailers: get: summary: 'List all trailers' operationId: listAllTrailers description: "Returns all trailers for the current user's organization.\nBy default, only active trailers are returned." parameters: - in: query name: archived description: 'Include archived (inactive) trailers.' example: true required: false schema: type: boolean description: 'Include archived (inactive) trailers.' example: true - in: query name: 'filter[object_id]' description: 'Filter by vehicle object ID.' example: ABC123 required: false schema: type: string description: 'Filter by vehicle object ID.' example: ABC123 responses: 200: description: '' content: application/json: schema: type: object example: data: - id: 1 object_id: ABC123 trailer_object_id: TRL001 trailer_nr: 123ABC mark: Schmitz trailer_model: Cargobull active: true vehicle: object_id: ABC123 mark: Volvo model: FH16 trailer: object_id: TRL001 mark: Schmitz model: Cargobull properties: data: type: array example: - id: 1 object_id: ABC123 trailer_object_id: TRL001 trailer_nr: 123ABC mark: Schmitz trailer_model: Cargobull active: true vehicle: object_id: ABC123 mark: Volvo model: FH16 trailer: object_id: TRL001 mark: Schmitz model: Cargobull items: type: object properties: id: type: integer example: 1 object_id: type: string example: ABC123 trailer_object_id: type: string example: TRL001 trailer_nr: type: string example: 123ABC mark: type: string example: Schmitz trailer_model: type: string example: Cargobull active: type: boolean example: true vehicle: type: object properties: object_id: type: string example: ABC123 mark: type: string example: Volvo model: type: string example: FH16 trailer: type: object properties: object_id: type: string example: TRL001 mark: type: string example: Schmitz model: type: string example: Cargobull tags: - Vehicles post: summary: 'Create a trailer' operationId: createATrailer description: "Creates a new trailer for the current user's organization." parameters: [] responses: 201: description: Success content: application/json: schema: type: object example: data: id: 1 object_id: ABC123 trailer_object_id: TRL001 trailer_nr: 123ABC mark: Schmitz trailer_model: Cargobull active: true vehicle: null trailer: null properties: data: type: object properties: id: type: integer example: 1 object_id: type: string example: ABC123 trailer_object_id: type: string example: TRL001 trailer_nr: type: string example: 123ABC mark: type: string example: Schmitz trailer_model: type: string example: Cargobull active: type: boolean example: true vehicle: type: string example: null nullable: true trailer: type: string example: null nullable: true tags: - Vehicles requestBody: required: true content: application/json: schema: type: object properties: object_id: type: string description: 'The vehicle object ID to attach trailer to.' example: ABC123 trailer_object_id: type: string description: "The trailer's object ID." example: TRL001 nullable: true trailer_nr: type: string description: 'The trailer registration number.' example: 123ABC nullable: true mark: type: string description: 'The trailer manufacturer/brand.' example: Schmitz nullable: true trailer_model: type: string description: 'The trailer model.' example: Cargobull nullable: true active: type: boolean description: 'Whether the trailer is active.' example: true nullable: true required: - object_id '/api/trailers/{id}': get: summary: 'Get a trailer' operationId: getATrailer description: 'Returns a single trailer by ID.' parameters: [] responses: 200: description: '' content: application/json: schema: type: object example: data: id: 1 object_id: ABC123 trailer_object_id: TRL001 trailer_nr: 123ABC mark: Schmitz trailer_model: Cargobull active: true vehicle: object_id: ABC123 mark: Volvo model: FH16 trailer: object_id: TRL001 mark: Schmitz model: Cargobull properties: data: type: object properties: id: type: integer example: 1 object_id: type: string example: ABC123 trailer_object_id: type: string example: TRL001 trailer_nr: type: string example: 123ABC mark: type: string example: Schmitz trailer_model: type: string example: Cargobull active: type: boolean example: true vehicle: type: object properties: object_id: type: string example: ABC123 mark: type: string example: Volvo model: type: string example: FH16 trailer: type: object properties: object_id: type: string example: TRL001 mark: type: string example: Schmitz model: type: string example: Cargobull 403: description: '' content: application/json: schema: type: object example: message: Forbidden properties: message: type: string example: Forbidden tags: - Vehicles put: summary: 'Update a trailer' operationId: updateATrailer description: 'Updates an existing trailer.' parameters: [] responses: 200: description: '' content: application/json: schema: type: object example: data: id: 1 object_id: ABC123 trailer_object_id: TRL001 trailer_nr: 123ABC mark: Schmitz trailer_model: Cargobull active: true vehicle: object_id: ABC123 mark: Volvo model: FH16 trailer: object_id: TRL001 mark: Schmitz model: Cargobull properties: data: type: object properties: id: type: integer example: 1 object_id: type: string example: ABC123 trailer_object_id: type: string example: TRL001 trailer_nr: type: string example: 123ABC mark: type: string example: Schmitz trailer_model: type: string example: Cargobull active: type: boolean example: true vehicle: type: object properties: object_id: type: string example: ABC123 mark: type: string example: Volvo model: type: string example: FH16 trailer: type: object properties: object_id: type: string example: TRL001 mark: type: string example: Schmitz model: type: string example: Cargobull 403: description: '' content: application/json: schema: type: object example: message: Forbidden properties: message: type: string example: Forbidden tags: - Vehicles requestBody: required: true content: application/json: schema: type: object properties: object_id: type: string description: 'The vehicle object ID.' example: ABC123 trailer_object_id: type: string description: "The trailer's object ID." example: TRL001 nullable: true trailer_nr: type: string description: 'The trailer registration number.' example: 123ABC nullable: true mark: type: string description: 'The trailer manufacturer/brand.' example: Schmitz nullable: true trailer_model: type: string description: 'The trailer model.' example: Cargobull nullable: true active: type: boolean description: 'Whether the trailer is active.' example: true nullable: true required: - object_id delete: summary: 'Delete a trailer' operationId: deleteATrailer description: 'Permanently deletes a trailer.' parameters: [] responses: 204: description: Success content: application/json: schema: type: string example: '' 403: description: '' content: application/json: schema: type: object example: message: Forbidden properties: message: type: string example: Forbidden tags: - Vehicles parameters: - in: path name: id description: 'The ID of the trailer.' example: 1 required: true schema: type: integer - in: path name: trailer description: 'The trailer ID.' example: 1 required: true schema: type: integer '/api/rfid/{id}': get: summary: '' operationId: getApiRfidId description: '' parameters: [] responses: 401: description: '' content: application/json: schema: type: object example: message: Unauthenticated. properties: message: type: string example: Unauthenticated. tags: - Vehicles security: [] parameters: - in: path name: id description: 'The ID of the rfid.' example: architecto required: true schema: type: string '/api/navilist/{id}': get: summary: '' operationId: getApiNavilistId description: '' parameters: [] responses: 401: description: '' content: application/json: schema: type: object example: message: Unauthenticated. properties: message: type: string example: Unauthenticated. tags: - Vehicles security: [] parameters: - in: path name: id description: 'The ID of the navilist.' example: architecto required: true schema: type: string /api/navireq: post: summary: '' operationId: postApiNavireq description: '' parameters: [] responses: { } tags: - Vehicles requestBody: required: true content: application/json: schema: type: object properties: object_id: type: string description: 'Vehicle object ID. Väli value ei tohi olla pikem kui 10 tähemärki.' example: ABC123 content: type: string description: 'Message content to send.' example: 'Please return to base' required: - object_id - content security: [] '/api/smslist/{id}': get: summary: '' operationId: getApiSmslistId description: '' parameters: [] responses: 401: description: '' content: application/json: schema: type: object example: message: Unauthenticated. properties: message: type: string example: Unauthenticated. tags: - Vehicles security: [] parameters: - in: path name: id description: 'The ID of the smslist.' example: architecto required: true schema: type: string /api/smsreq: post: summary: '' operationId: postApiSmsreq description: '' parameters: [] responses: { } tags: - Vehicles requestBody: required: true content: application/json: schema: type: object properties: object_id: type: string description: 'Vehicle object ID. Väli value ei tohi olla pikem kui 10 tähemärki.' example: ABC123 content: type: string description: 'Message content to send.' example: 'Please return to base' required: - object_id - content security: [] '/api/vehicles-rudus/{typeId}/{id}': get: summary: 'Get Rudus vehicles for a task' operationId: getRudusVehiclesForATask description: "Returns vehicles related to a Rudus task. Only available for drivers with Rudus profile.\nFor mixer type, returns the other vehicle from the task.\nFor other types, returns all unique vehicles from related tasks with the same work order." parameters: [] responses: 200: description: Success content: application/json: schema: type: array items: type: object properties: object_id: type: string example: ABC123 mark: type: string example: Volvo model: type: string example: FH16 example: - object_id: ABC123 mark: Volvo model: FH16 403: description: '' content: application/json: schema: type: object example: error: Rudus_Drivers_Only properties: error: type: string example: Rudus_Drivers_Only tags: - Vehicles parameters: - in: path name: typeId description: 'The Rudus object type ID (1=Mixer, 2=Pump, etc).' example: 1 required: true schema: type: integer - in: path name: id description: 'The route task ID.' example: 123 required: true schema: type: integer /api/wbtypes: get: summary: 'List waybill types' operationId: listWaybillTypes description: 'Returns all waybill types for the current organization.' parameters: [] responses: 401: description: '' content: application/json: schema: type: object example: message: Unauthenticated. properties: message: type: string example: Unauthenticated. tags: - Waybills post: summary: 'Create a waybill type' operationId: createAWaybillType description: 'Creates a new waybill type.' parameters: [] responses: { } tags: - Waybills requestBody: required: true content: application/json: schema: type: object properties: name: type: string description: 'The waybill type name. Väli value ei tohi olla pikem kui 255 tähemärki.' example: Standard hasRides: type: boolean description: 'Whether this type tracks rides.' example: true nullable: true required: - name '/api/wbtypes/{id}': get: summary: 'Get waybill type' operationId: getWaybillType description: 'Returns a single waybill type.' parameters: [] responses: 401: description: '' content: application/json: schema: type: object example: message: Unauthenticated. properties: message: type: string example: Unauthenticated. tags: - Waybills put: summary: 'Update waybill type' operationId: updateWaybillType description: 'Updates an existing waybill type.' parameters: [] responses: { } tags: - Waybills requestBody: required: false content: application/json: schema: type: object properties: name: type: string description: 'The waybill type name. Väli value ei tohi olla pikem kui 255 tähemärki.' example: Standard hasRides: type: boolean description: 'Whether this type tracks rides.' example: true nullable: true delete: summary: 'Delete a waybill type' operationId: deleteAWaybillType description: 'Deletes a waybill type.' parameters: [] responses: { } tags: - Waybills parameters: - in: path name: id description: 'The ID of the wbtype.' example: architecto required: true schema: type: string /api/wbtypeobj: get: summary: 'List waybill type objects' operationId: listWaybillTypeObjects description: 'Returns all waybill type-object assignments for the current organization.' parameters: [] responses: 401: description: '' content: application/json: schema: type: object example: message: Unauthenticated. properties: message: type: string example: Unauthenticated. tags: - Waybills post: summary: 'Create a waybill type object' operationId: createAWaybillTypeObject description: 'Assigns a waybill type to an object. Validates that both the object and type exist.' parameters: [] responses: 404: description: 'Invalid type' content: application/json: schema: type: object example: message: Invalid_WB_Type properties: message: type: string example: Invalid_WB_Type tags: - Waybills requestBody: required: true content: application/json: schema: type: object properties: object_id: type: string description: 'The vehicle/object ID. Must contain only letters and numbers. Väli value ei tohi olla pikem kui 10 tähemärki.' example: ABC123 typeId: type: integer description: 'The waybill type ID.' example: 1 project_id: type: integer description: 'The waybill project ID.' example: 1 nullable: true required: - object_id - typeId '/api/wbtypeobj/{id}': get: summary: 'Get waybill type object' operationId: getWaybillTypeObject description: 'Returns a single waybill type-object assignment.' parameters: [] responses: 401: description: '' content: application/json: schema: type: object example: message: Unauthenticated. properties: message: type: string example: Unauthenticated. 404: description: 'Not found' content: application/json: schema: type: object example: message: Not_Found properties: message: type: string example: Not_Found tags: - Waybills put: summary: 'Update waybill type object' operationId: updateWaybillTypeObject description: 'Updates a waybill type-object assignment.' parameters: [] responses: 404: description: '' content: application/json: schema: oneOf: - description: 'Not found' type: object example: message: Not_Found properties: message: type: string example: Not_Found - description: 'Invalid type' type: object example: message: Invalid_WB_Type properties: message: type: string example: Invalid_WB_Type tags: - Waybills requestBody: required: true content: application/json: schema: type: object properties: object_id: type: string description: 'The vehicle/object ID. Must contain only letters and numbers. Väli value ei tohi olla pikem kui 10 tähemärki.' example: ABC123 typeId: type: integer description: 'The waybill type ID.' example: 1 project_id: type: integer description: 'The waybill project ID.' example: 1 nullable: true required: - object_id - typeId delete: summary: 'Delete a waybill type object' operationId: deleteAWaybillTypeObject description: 'Deletes a waybill type-object assignment.' parameters: [] responses: 200: description: Deleted content: application/json: schema: type: object example: message: Deleted properties: message: type: string example: Deleted 404: description: 'Not found' content: application/json: schema: type: object example: message: Not_Found properties: message: type: string example: Not_Found tags: - Waybills parameters: - in: path name: id description: 'The assignment ID.' example: 1 required: true schema: type: integer /api/wbjobs: get: summary: 'List waybill jobs' operationId: listWaybillJobs description: 'Returns all waybill jobs for the current organization.' parameters: [] responses: 200: description: Success content: application/json: schema: type: array items: type: object properties: id: type: integer example: 1 name: type: string example: Delivery trackAddress: type: integer example: 1 type_data: type: array example: - typeId: 1 items: type: object properties: typeId: type: integer example: 1 example: - id: 1 name: Delivery trackAddress: 1 type_data: - typeId: 1 tags: - Waybills post: summary: 'Create waybill job' operationId: createWaybillJob description: 'Creates a new waybill job with associated type data.' parameters: [] responses: 201: description: Created content: application/json: schema: type: object example: id: 1 name: Delivery trackAddress: 1 type_data: - typeId: 1 properties: id: type: integer example: 1 name: type: string example: Delivery trackAddress: type: integer example: 1 type_data: type: array example: - typeId: 1 items: type: object properties: typeId: type: integer example: 1 tags: - Waybills requestBody: required: true content: application/json: schema: type: object properties: name: type: string description: 'The job name. Väli value ei tohi olla pikem kui 255 tähemärki.' example: Delivery external_id: type: string description: 'External system identifier.' example: EXT-001 nullable: true trackAddress: type: integer description: 'Whether to track addresses (0 or 1).' example: 1 enum: - 0 - 1 nullable: true type_data: type: array description: 'Array of type assignments.' example: - typeId: 1 external_id: null items: type: object properties: typeId: type: integer description: '' example: 16 external_id: type: string description: '' example: architecto nullable: true required: - typeId required: - name - type_data '/api/wbjobs/{id}': get: summary: 'Get waybill job' operationId: getWaybillJob description: 'Returns a single waybill job.' parameters: [] responses: 401: description: '' content: application/json: schema: type: object example: message: Unauthenticated. properties: message: type: string example: Unauthenticated. 404: description: 'Not found' content: application/json: schema: type: object example: message: Not_Found properties: message: type: string example: Not_Found tags: - Waybills put: summary: 'Update waybill job' operationId: updateWaybillJob description: 'Updates a waybill job and replaces its type data.' parameters: [] responses: 404: description: 'Not found' content: application/json: schema: type: object example: message: Not_Found properties: message: type: string example: Not_Found tags: - Waybills requestBody: required: true content: application/json: schema: type: object properties: name: type: string description: 'The job name. Väli value ei tohi olla pikem kui 255 tähemärki.' example: Delivery external_id: type: string description: 'External system identifier.' example: EXT-001 nullable: true trackAddress: type: integer description: 'Whether to track addresses (0 or 1).' example: 1 enum: - 0 - 1 nullable: true type_data: type: array description: 'Array of type assignments.' example: - typeId: 1 external_id: null items: type: object properties: typeId: type: integer description: '' example: 16 external_id: type: string description: '' example: architecto nullable: true required: - typeId required: - name - type_data delete: summary: 'Delete waybill job' operationId: deleteWaybillJob description: 'Deletes a waybill job.' parameters: [] responses: 200: description: Deleted content: application/json: schema: type: object example: message: Deleted properties: message: type: string example: Deleted 404: description: 'Not found' content: application/json: schema: type: object example: message: Not_Found properties: message: type: string example: Not_Found tags: - Waybills parameters: - in: path name: id description: 'The waybill job ID.' example: 1 required: true schema: type: integer /api/wbprojects: get: summary: 'List waybill projects' operationId: listWaybillProjects description: 'Returns all waybill projects for the current organization.' parameters: [] responses: 401: description: '' content: application/json: schema: type: object example: message: Unauthenticated. properties: message: type: string example: Unauthenticated. tags: - Waybills post: summary: 'Create waybill project' operationId: createWaybillProject description: 'Creates a new waybill project.' parameters: [] responses: { } tags: - Waybills requestBody: required: true content: application/json: schema: type: object properties: name: type: string description: 'The project name. Väli value ei tohi olla pikem kui 255 tähemärki.' example: 'Construction Site A' required: - name '/api/wbprojects/{id}': get: summary: 'Get waybill project' operationId: getWaybillProject description: 'Returns a single waybill project.' parameters: [] responses: 401: description: '' content: application/json: schema: type: object example: message: Unauthenticated. properties: message: type: string example: Unauthenticated. 404: description: 'Not found' content: application/json: schema: type: object example: message: Not_Found properties: message: type: string example: Not_Found tags: - Waybills put: summary: 'Update waybill project' operationId: updateWaybillProject description: 'Updates a waybill project.' parameters: [] responses: 404: description: 'Not found' content: application/json: schema: type: object example: message: Not_Found properties: message: type: string example: Not_Found tags: - Waybills requestBody: required: true content: application/json: schema: type: object properties: name: type: string description: 'The project name. Väli value ei tohi olla pikem kui 255 tähemärki.' example: 'Construction Site A' required: - name delete: summary: 'Delete waybill project' operationId: deleteWaybillProject description: 'Deletes a waybill project.' parameters: [] responses: 200: description: Deleted content: application/json: schema: type: object example: message: Deleted properties: message: type: string example: Deleted 404: description: 'Not found' content: application/json: schema: type: object example: message: Not_Found properties: message: type: string example: Not_Found tags: - Waybills parameters: - in: path name: id description: 'The waybill project ID.' example: 1 required: true schema: type: integer /api/openedwaybills: get: summary: 'List opened waybills' operationId: listOpenedWaybills description: 'Returns all waybills that have not been closed (no stop time).' parameters: [] responses: 200: description: Success content: application/json: schema: type: array items: type: object properties: id: type: integer example: 1 object_id: type: string example: ABC123 jobName: type: string example: Delivery start: type: string example: '2025-01-15 08:00:00' stop: type: string example: null nullable: true driverName: type: string example: 'John Doe' alias: type: string example: 'Truck 1' example: - id: 1 object_id: ABC123 jobName: Delivery start: '2025-01-15 08:00:00' stop: null driverName: 'John Doe' alias: 'Truck 1' tags: - Waybills /api/rides: get: summary: 'Get rides count' operationId: getRidesCount description: 'Returns the number of rides grouped by object ID for the given period.' parameters: - in: query name: datetime description: '' example: - architecto required: true schema: type: array description: '' example: - architecto items: type: string responses: 200: description: Success content: application/json: schema: type: array items: type: object properties: key: type: string example: ABC123 rides: type: integer example: 5 example: - key: ABC123 rides: 5 tags: - Waybills /api/wbreport: get: summary: 'Get waybill report' operationId: getWaybillReport description: "Returns aggregated driver-vehicle records by default, or detailed waybill records when `all=true`.\nSupports filtering by object, type, department, and driver." parameters: - in: query name: datetime description: '' example: - architecto required: true schema: type: array description: '' example: - architecto items: type: string - in: query name: object_id description: 'Filter by object ID. Must contain only letters, numbers, dashes and underscores. Väli value ei tohi olla pikem kui 10 tähemärki.' example: ABC123 required: false schema: type: string description: 'Filter by object ID. Must contain only letters, numbers, dashes and underscores. Väli value ei tohi olla pikem kui 10 tähemärki.' example: ABC123 nullable: true - in: query name: driver_id description: 'Filter by driver ID. Use `false` for records without a driver.' example: 5 required: false schema: type: string description: 'Filter by driver ID. Use `false` for records without a driver.' example: 5 nullable: true - in: query name: typeId description: 'Filter by waybill type ID.' example: 1 required: false schema: type: integer description: 'Filter by waybill type ID.' example: 1 nullable: true - in: query name: department description: 'Filter by department name.' example: Logistics required: false schema: type: string description: 'Filter by department name.' example: Logistics nullable: true - in: query name: all description: 'When true, returns detailed waybill records instead of aggregated data.' example: true required: false schema: type: string description: 'When true, returns detailed waybill records instead of aggregated data.' example: true nullable: true - in: query name: jobs description: 'Filter by job presence: true = only with jobs, false = only without jobs.' example: true required: false schema: type: string description: 'Filter by job presence: true = only with jobs, false = only without jobs.' example: true nullable: true responses: 200: description: '' content: application/json: schema: oneOf: - description: Aggregated type: array items: type: object properties: id: type: integer example: 1 object_id: type: string example: ABC123 full_name: type: string example: 'John Doe' start_use: type: string example: '2025-01-15 08:00:00' stop_use: type: string example: '2025-01-15 17:00:00' rides: type: integer example: 5 job_count: type: integer example: 3 example: - id: 1 object_id: ABC123 full_name: 'John Doe' start_use: '2025-01-15 08:00:00' stop_use: '2025-01-15 17:00:00' rides: 5 job_count: 3 - description: Detailed type: array items: type: object properties: id: type: integer example: 1 object_id: type: string example: ABC123 start: type: string example: '2025-01-15 08:00:00' stop: type: string example: '2025-01-15 09:00:00' name: type: string example: Delivery km: type: number example: 25.3 tdiff: type: string example: '01:00:00' example: - id: 1 object_id: ABC123 start: '2025-01-15 08:00:00' stop: '2025-01-15 09:00:00' name: Delivery km: 25.3 tdiff: '01:00:00' tags: - Waybills '/api/wbreportdetails/{id}': get: summary: 'Get waybill report details' operationId: getWaybillReportDetails description: "Returns detailed waybill data for a driver-vehicle record, including fuel calculations,\nodometer/motohour data, individual waybill items, and the latest audit log entry." parameters: [] responses: 200: description: Success content: application/json: schema: type: object example: item: id: 123 object_id: ABC123 fuel_spend: 15.2 norm_spend: 8.5 odo_moto: 180.5 average_spend: 8.4 calc_end: 35.0 calc_spend: 15.3 items: [] latest_audit: null properties: item: type: object properties: id: type: integer example: 123 object_id: type: string example: ABC123 fuel_spend: type: number example: 15.2 norm_spend: type: number example: 8.5 odo_moto: type: number example: 180.5 average_spend: type: number example: 8.4 calc_end: type: number example: 35.0 calc_spend: type: number example: 15.3 items: type: array example: [] latest_audit: type: string example: null nullable: true 404: description: 'Not found' content: application/json: schema: type: object example: message: Not_Found properties: message: type: string example: Not_Found tags: - Waybills parameters: - in: path name: id description: 'The driver-vehicle record ID.' example: 123 required: true schema: type: integer /api/waybills/edit: post: summary: 'Create waybill (edit mode)' operationId: createWaybilleditMode description: "Creates a waybill manually with specified times. Requires extended user access.\nValidates that times fall within the driver-vehicle session and do not overlap existing waybills." parameters: [] responses: 201: description: Created content: application/json: schema: type: object example: id: 1 object_id: ABC123 start: '2025-01-15 08:00:00' stop: '2025-01-15 09:00:00' properties: id: type: integer example: 1 object_id: type: string example: ABC123 start: type: string example: '2025-01-15 08:00:00' stop: type: string example: '2025-01-15 09:00:00' 400: description: 'Invalid times' content: application/json: schema: type: object example: message: 'Waybill times overlap' properties: message: type: string example: 'Waybill times overlap' 403: description: 'Not allowed' content: application/json: schema: type: object example: message: NotAllowed properties: message: type: string example: NotAllowed tags: - Waybills requestBody: required: true content: application/json: schema: type: object properties: drv_id: type: integer description: 'The driver-vehicle session ID.' example: 10 jobId: type: integer description: 'The waybill job ID.' example: 1 driverId: type: integer description: 'The driver ID.' example: 5 nullable: true object_id: type: string description: 'The vehicle/object ID. Must contain only letters, numbers, dashes and underscores. Väli value ei tohi olla pikem kui 10 tähemärki.' example: ABC123 route: type: string description: 'The route description.' example: 'Vilnius - Kaunas' nullable: true km: type: number description: 'Distance in kilometers.' example: 102.5 nullable: true project_id: type: integer description: 'The waybill project ID.' example: 1 nullable: true start: type: string description: 'Start time in Y-m-d H:i:s format. Must be a valid date in the format Y-m-d H:i:s.' example: '2025-01-15 08:00:00' stop: type: string description: 'Stop time in Y-m-d H:i:s format. Must be a valid date in the format Y-m-d H:i:s.' example: '2025-01-15 17:00:00' required: - drv_id - jobId - object_id - start - stop '/api/waybills/edit/{id}': put: summary: 'Update waybill (edit mode)' operationId: updateWaybilleditMode description: 'Updates a waybill with new times and details. Requires extended user access. Changes are audit-logged.' parameters: [] responses: 403: description: 'Not allowed' content: application/json: schema: type: object example: message: NotAllowed properties: message: type: string example: NotAllowed 404: description: 'Not found' content: application/json: schema: type: object example: message: Not_Found properties: message: type: string example: Not_Found tags: - Waybills requestBody: required: false content: application/json: schema: type: object properties: jobId: type: integer description: 'The waybill job ID.' example: 1 nullable: true start: type: string description: 'Start time in Y-m-d H:i:s format. Must be a valid date in the format Y-m-d H:i:s.' example: '2025-01-15 08:00:00' nullable: true stop: type: string description: 'Stop time in Y-m-d H:i:s format. Must be a valid date in the format Y-m-d H:i:s.' example: '2025-01-15 17:00:00' nullable: true km: type: number description: 'Distance in kilometers.' example: 102.5 nullable: true project_id: type: integer description: 'The waybill project ID.' example: 1 nullable: true parameters: - in: path name: id description: 'The waybill ID.' example: 1 required: true schema: type: integer /api/waybills: get: summary: 'List waybills' operationId: listWaybills description: 'Returns waybills for the given object. If the driver has an active session, returns records from the session start.' parameters: [] responses: 200: description: '' content: application/json: schema: oneOf: - description: Success type: array items: type: object properties: id: type: integer example: 1 object_id: type: string example: ABC123 name: type: string example: Delivery start: type: string example: '2025-01-15 08:00:00' stop: type: string example: '2025-01-15 09:00:00' example: - id: 1 object_id: ABC123 name: Delivery start: '2025-01-15 08:00:00' stop: '2025-01-15 09:00:00' - description: 'No object' type: array items: type: object example: [] tags: - Waybills post: summary: 'Create waybill' operationId: createWaybill description: 'Creates a new waybill for the authenticated driver. The driver must have an active vehicle session.' parameters: [] responses: 201: description: Created content: application/json: schema: type: object example: id: 1 object_id: ABC123 start: '2025-01-15 08:00:00' properties: id: type: integer example: 1 object_id: type: string example: ABC123 start: type: string example: '2025-01-15 08:00:00' 403: description: '' content: application/json: schema: oneOf: - description: 'Not a driver' type: object example: message: Drivers_Only properties: message: type: string example: Drivers_Only - description: 'Already opened' type: object example: message: Driver_Has_Job_Opened properties: message: type: string example: Driver_Has_Job_Opened tags: - Waybills requestBody: required: true content: application/json: schema: type: object properties: object_id: type: string description: 'The vehicle/object ID. Must contain only letters, numbers, dashes and underscores. Väli value ei tohi olla pikem kui 10 tähemärki.' example: ABC123 jobId: type: integer description: 'The waybill job ID.' example: 1 taskId: type: integer description: 'The route task ID.' example: 10 nullable: true comment: type: string description: 'A comment for the waybill.' example: 'Urgent delivery' nullable: true startAddress: type: string description: 'The starting address.' example: 'Vilnius, Main St. 1' nullable: true route: type: string description: 'The route description.' example: 'Vilnius - Kaunas' nullable: true required: - object_id - jobId '/api/waybills/{id}': get: summary: 'Get waybill' operationId: getWaybill description: 'Returns a single waybill record.' parameters: [] responses: 401: description: '' content: application/json: schema: type: object example: message: Unauthenticated. properties: message: type: string example: Unauthenticated. 404: description: 'Not found' content: application/json: schema: type: object example: message: Not_Found properties: message: type: string example: Not_Found tags: - Waybills put: summary: 'Update waybill' operationId: updateWaybill description: 'Updates a waybill. If the waybill is still open and `edit` is not set, it will be closed with the current time.' parameters: [] responses: 404: description: 'Not found' content: application/json: schema: type: object example: message: Not_Found properties: message: type: string example: Not_Found tags: - Waybills requestBody: required: false content: application/json: schema: type: object properties: comment: type: string description: 'A comment for the waybill.' example: 'Updated delivery note' nullable: true startAddress: type: string description: 'The starting address.' example: 'Vilnius, Main St. 1' nullable: true stopAddress: type: string description: 'The ending address.' example: 'Kaunas, Oak St. 5' nullable: true delete: summary: 'Delete waybill' operationId: deleteWaybill description: 'Deletes a waybill.' parameters: [] responses: 200: description: Deleted content: application/json: schema: type: object example: message: Deleted properties: message: type: string example: Deleted 404: description: 'Not found' content: application/json: schema: type: object example: message: Not_Found properties: message: type: string example: Not_Found tags: - Waybills parameters: - in: path name: id description: 'The waybill ID.' example: 1 required: true schema: type: integer