openapi: 3.2.0 info: title: Operations Hub Resource Mobilization.obd Gps Devices API version: 0.1.1 description: '' servers: [] tags: - name: resource-mobilization.obd-gps-devices paths: /api/resource-mobilization/v1/obd-gps-devices: get: operationId: resource_mobilization_endpoints_obd_gps_devices_list_devices summary: List Devices parameters: - in: query name: search schema: anyOf: - type: string - type: 'null' description: Search by IMEI title: Search required: false description: Search by IMEI - in: query name: sort schema: anyOf: - type: string - type: 'null' description: Sort by field (prefix with - for descending) title: Sort required: false description: Sort by field (prefix with - for descending) - in: query name: paginate schema: default: true description: Enable pagination (false returns all results) title: Paginate type: boolean required: false description: Enable pagination (false returns all results) - in: query name: page schema: default: 1 description: Page number minimum: 1 title: Page type: integer required: false description: Page number - in: query name: page_size schema: default: 50 description: Number of items per page maximum: 1000 minimum: 1 title: Page Size type: integer required: false description: Number of items per page responses: '200': description: OK content: application/json: schema: items: $ref: '#/components/schemas/ObdGpsDeviceResponse' title: Response type: array '400': description: Bad Request content: application/json: schema: $ref: '#/components/schemas/Error' tags: - resource-mobilization.obd-gps-devices security: - APIKeyAuth: [] - CookieAuth: [] post: operationId: resource_mobilization_endpoints_obd_gps_devices_create_device summary: Create Device parameters: [] responses: '200': description: OK content: application/json: schema: $ref: '#/components/schemas/ObdGpsDeviceResponse' tags: - resource-mobilization.obd-gps-devices requestBody: content: application/json: schema: $ref: '#/components/schemas/ObdGpsDeviceCreate' required: true security: - APIKeyAuth: [] - CookieAuth: [] /api/resource-mobilization/v1/obd-gps-devices/{id}/assign: post: operationId: resource_mobilization_endpoints_obd_gps_devices_assign_device summary: Assign Device parameters: - in: path name: id schema: title: Id type: integer required: true responses: '200': description: OK content: application/json: schema: $ref: '#/components/schemas/ObdGpsDeviceResponse' tags: - resource-mobilization.obd-gps-devices requestBody: content: application/json: schema: $ref: '#/components/schemas/ObdGpsDeviceAssignSchema' required: true security: - APIKeyAuth: [] - CookieAuth: [] /api/resource-mobilization/v1/obd-gps-devices/{id}/end-assignment: post: operationId: resource_mobilization_endpoints_obd_gps_devices_end_assignment summary: End Assignment parameters: - in: path name: id schema: title: Id type: integer required: true responses: '200': description: OK content: application/json: schema: $ref: '#/components/schemas/ObdGpsDeviceResponse' tags: - resource-mobilization.obd-gps-devices requestBody: content: application/json: schema: $ref: '#/components/schemas/ObdGpsDeviceEndAssignmentSchema' required: true security: - APIKeyAuth: [] - CookieAuth: [] /api/resource-mobilization/v1/obd-gps-devices/sync-navirec: post: operationId: resource_mobilization_endpoints_obd_gps_devices_sync_navirec summary: Sync Navirec parameters: [] responses: '200': description: OK content: application/json: schema: $ref: '#/components/schemas/NavirecSyncResponse' description: 'Push assignee names to Navirec for every device with an active assignment. Matches by IMEI ↔ Navirec vehicle.registration; sets the vehicle name ("Transportlīdzekļa nosaukums") to "{assignee} {imei}". Unmatched IMEIs are skipped.' tags: - resource-mobilization.obd-gps-devices security: - APIKeyAuth: [] - CookieAuth: [] /api/resource-mobilization/v1/obd-gps-devices/{id}/assignments: get: operationId: resource_mobilization_endpoints_obd_gps_devices_list_device_assignments summary: List Device Assignments parameters: - in: path name: id schema: title: Id type: integer required: true responses: '200': description: OK content: application/json: schema: items: $ref: '#/components/schemas/ObdGpsDeviceAssignmentFullResponse' title: Response type: array tags: - resource-mobilization.obd-gps-devices security: - APIKeyAuth: [] - CookieAuth: [] /api/resource-mobilization/v1/obd-gps-devices/{id}: get: operationId: resource_mobilization_endpoints_obd_gps_devices_get_device summary: Get Device parameters: - in: path name: id schema: title: Id type: integer required: true responses: '200': description: OK content: application/json: schema: $ref: '#/components/schemas/ObdGpsDeviceResponse' tags: - resource-mobilization.obd-gps-devices security: - APIKeyAuth: [] - CookieAuth: [] patch: operationId: resource_mobilization_endpoints_obd_gps_devices_update_device summary: Update Device parameters: - in: path name: id schema: title: Id type: integer required: true responses: '200': description: OK content: application/json: schema: $ref: '#/components/schemas/ObdGpsDeviceResponse' tags: - resource-mobilization.obd-gps-devices requestBody: content: application/json: schema: $ref: '#/components/schemas/ObdGpsDeviceUpdate' required: true security: - APIKeyAuth: [] - CookieAuth: [] delete: operationId: resource_mobilization_endpoints_obd_gps_devices_delete_device summary: Delete Device parameters: - in: path name: id schema: title: Id type: integer required: true responses: '200': description: OK content: application/json: schema: $ref: '#/components/schemas/Success' tags: - resource-mobilization.obd-gps-devices security: - APIKeyAuth: [] - CookieAuth: [] components: schemas: ObdGpsDeviceUpdate: additionalProperties: false properties: imei: anyOf: - type: string - type: 'null' title: Imei location_id: anyOf: - type: integer - type: 'null' title: Location Id telematics_provider: anyOf: - enum: - NAVIREC - MOTIVE type: string - type: 'null' title: Telematics Provider title: ObdGpsDeviceUpdate type: object NavirecLiveState: additionalProperties: false description: Live tracking snapshot for a vehicle, joined from Navirec by plate. properties: status: description: 'Derived status: ACTIVE (ignition on), PARKED (ignition off but reported ≤10min ago), OFFLINE (no recent report).' title: Status type: string is_active: description: Convenience flag — true when status is ACTIVE or PARKED. title: Is Active type: boolean ignition: anyOf: - type: boolean - type: 'null' title: Ignition speed_kmh: anyOf: - type: integer - type: 'null' title: Speed Kmh last_seen: anyOf: - format: date-time type: string - type: 'null' title: Last Seen latitude: anyOf: - type: number - type: 'null' title: Latitude longitude: anyOf: - type: number - type: 'null' title: Longitude vehicle_uuid: anyOf: - type: string - type: 'null' title: Vehicle Uuid required: - status - is_active title: NavirecLiveState type: object UserObject: additionalProperties: false description: Nested user object for responses (no timestamps). properties: id: title: Id type: integer username: title: Username type: string email: anyOf: - type: string - type: 'null' title: Email first_name: anyOf: - type: string - type: 'null' title: First Name last_name: anyOf: - type: string - type: 'null' title: Last Name required: - id - username title: UserObject type: object NavirecSyncResponse: additionalProperties: false properties: synced: title: Synced type: integer skipped: title: Skipped type: integer errors: default: [] items: $ref: '#/components/schemas/NavirecSyncErrorItem' title: Errors type: array disabled: anyOf: - type: boolean - type: 'null' title: Disabled required: - synced - skipped title: NavirecSyncResponse type: object ObdGpsDeviceAssignSchema: additionalProperties: false properties: assignee_user_id: anyOf: - type: integer - type: 'null' title: Assignee User Id vehicle_id: anyOf: - type: integer - type: 'null' title: Vehicle Id start_date: anyOf: - type: string - type: 'null' title: Start Date required: - start_date title: ObdGpsDeviceAssignSchema type: object ObdGpsAssignmentVehicle: additionalProperties: false properties: id: title: Id type: integer license_plate: title: License Plate type: string make: title: Make type: string model: title: Model type: string required: - id - license_plate - make - model title: ObdGpsAssignmentVehicle type: object NavirecSyncErrorItem: additionalProperties: false properties: imei: title: Imei type: string reason: title: Reason type: string required: - imei - reason title: NavirecSyncErrorItem type: object ObdGpsDeviceAssignmentFullResponse: additionalProperties: false properties: id: title: Id type: integer device_id: title: Device Id type: integer assignee_user: anyOf: - $ref: '#/components/schemas/UserObject' - type: 'null' vehicle: anyOf: - $ref: '#/components/schemas/ObdGpsAssignmentVehicle' - type: 'null' start_date: title: Start Date type: string end_date: anyOf: - type: string - type: 'null' title: End Date created_at: format: date-time title: Created At type: string required: - id - device_id - start_date - created_at title: ObdGpsDeviceAssignmentFullResponse type: object Error: additionalProperties: false description: Error response schema. properties: code: $ref: '#/components/schemas/ErrorCode' message: title: Message type: string required: - code - message title: Error type: object ObdGpsDeviceResponse: additionalProperties: false properties: id: title: Id type: integer imei: title: Imei type: string location_id: title: Location Id type: integer telematics_provider: title: Telematics Provider type: string current_assignment: anyOf: - $ref: '#/components/schemas/ObdGpsDeviceAssignmentResponse' - type: 'null' live_state: anyOf: - $ref: '#/components/schemas/NavirecLiveState' - type: 'null' updated_at: anyOf: - type: string - type: 'null' title: Updated At required: - id - imei - location_id - telematics_provider title: ObdGpsDeviceResponse type: object ObdGpsDeviceAssignmentResponse: additionalProperties: false properties: id: title: Id type: integer assignee_user: anyOf: - $ref: '#/components/schemas/UserObject' - type: 'null' vehicle: anyOf: - $ref: '#/components/schemas/ObdGpsAssignmentVehicle' - type: 'null' start_date: title: Start Date type: string end_date: anyOf: - type: string - type: 'null' title: End Date required: - id - start_date title: ObdGpsDeviceAssignmentResponse type: object Success: additionalProperties: false description: 'Schema returned for successful operations. The `success` field is always ``true`` in this schema. Failed operations are represented by the :class:`Error` schema instead, so a ``false`` value does not occur in practice. The field is included for consistency across responses and to make the contract explicit for clients.' properties: success: default: true description: Always true for this schema. Errors are represented by a separate Error schema, so false is never returned. title: Success type: boolean title: Success type: object ObdGpsDeviceEndAssignmentSchema: additionalProperties: false properties: end_date: anyOf: - type: string - type: 'null' title: End Date required: - end_date title: ObdGpsDeviceEndAssignmentSchema type: object ObdGpsDeviceCreate: additionalProperties: false properties: imei: title: Imei type: string location_id: title: Location Id type: integer telematics_provider: anyOf: - enum: - NAVIREC - MOTIVE type: string - type: 'null' title: Telematics Provider required: - imei - location_id title: ObdGpsDeviceCreate type: object ErrorCode: description: Error codes for API errors. enum: - validation - server - auth - unknown - external - generic title: ErrorCode type: string securitySchemes: APIKeyAuth: type: http scheme: bearer CookieAuth: type: apiKey in: cookie name: opshub_prod_sessionid AuthBearer: type: http scheme: bearer