openapi: 3.2.0 info: title: Operations Hub Resource Mobilization.vehicles API version: 0.1.1 description: '' servers: [] tags: - name: resource-mobilization.vehicles paths: /api/resource-mobilization/v1/vehicles/summary: get: operationId: get_vehicle_fleet_summary summary: Get Vehicle Fleet Summary parameters: - in: query name: vehicle_source schema: anyOf: - type: string - type: 'null' title: Vehicle Source required: false - in: query name: location_id schema: anyOf: - type: integer - type: 'null' title: Location Id required: false responses: '200': description: OK content: application/json: schema: $ref: '#/components/schemas/VehicleFleetSummary' tags: - resource-mobilization.vehicles security: - APIKeyAuth: [] - CookieAuth: [] /api/resource-mobilization/v1/vehicles: get: operationId: resource_mobilization_endpoints_vehicles_list_vehicles summary: List Vehicles parameters: - in: query name: search schema: anyOf: - type: string - type: 'null' description: Search by license plate, make, or model title: Search required: false description: Search by license plate, make, or model - 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: type schema: anyOf: - type: string - type: 'null' description: Filter by vehicle type title: Type required: false description: Filter by vehicle type - in: query name: vehicle_source schema: anyOf: - type: string - type: 'null' description: Filter by vehicle source title: Vehicle Source required: false description: Filter by vehicle source - in: query name: location_id schema: anyOf: - type: integer - type: 'null' description: Filter by office location title: Location Id required: false description: Filter by office location - in: query name: include_archived schema: anyOf: - type: boolean - type: 'null' description: Include archived vehicles title: Include Archived required: false description: Include archived vehicles - 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/VehicleResponse' title: Response type: array '400': description: Bad Request content: application/json: schema: $ref: '#/components/schemas/Error' tags: - resource-mobilization.vehicles security: - APIKeyAuth: [] - CookieAuth: [] post: operationId: resource_mobilization_endpoints_vehicles_create_vehicle summary: Create Vehicle parameters: [] responses: '200': description: OK content: application/json: schema: $ref: '#/components/schemas/VehicleResponse' tags: - resource-mobilization.vehicles requestBody: content: application/json: schema: $ref: '#/components/schemas/VehicleCreate' required: true security: - APIKeyAuth: [] - CookieAuth: [] /api/resource-mobilization/v1/vehicles/{id}/archive: post: operationId: resource_mobilization_endpoints_vehicles_archive_vehicle summary: Archive Vehicle parameters: - in: path name: id schema: title: Id type: integer required: true responses: '200': description: OK content: application/json: schema: $ref: '#/components/schemas/VehicleResponse' tags: - resource-mobilization.vehicles security: - APIKeyAuth: [] - CookieAuth: [] /api/resource-mobilization/v1/vehicles/{id}/unarchive: post: operationId: resource_mobilization_endpoints_vehicles_unarchive_vehicle summary: Unarchive Vehicle parameters: - in: path name: id schema: title: Id type: integer required: true responses: '200': description: OK content: application/json: schema: $ref: '#/components/schemas/VehicleResponse' tags: - resource-mobilization.vehicles security: - APIKeyAuth: [] - CookieAuth: [] /api/resource-mobilization/v1/vehicles/{id}: get: operationId: resource_mobilization_endpoints_vehicles_get_vehicle summary: Get Vehicle parameters: - in: path name: id schema: title: Id type: integer required: true responses: '200': description: OK content: application/json: schema: $ref: '#/components/schemas/VehicleResponse' tags: - resource-mobilization.vehicles security: - APIKeyAuth: [] - CookieAuth: [] patch: operationId: resource_mobilization_endpoints_vehicles_update_vehicle summary: Update Vehicle parameters: - in: path name: id schema: title: Id type: integer required: true responses: '200': description: OK content: application/json: schema: $ref: '#/components/schemas/VehicleResponse' tags: - resource-mobilization.vehicles requestBody: content: application/json: schema: $ref: '#/components/schemas/VehicleUpdate' required: true security: - APIKeyAuth: [] - CookieAuth: [] delete: operationId: resource_mobilization_endpoints_vehicles_delete_vehicle summary: Delete Vehicle 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.vehicles security: - APIKeyAuth: [] - CookieAuth: [] /api/resource-mobilization/v1/vehicles/{id}/insurances: get: operationId: resource_mobilization_endpoints_vehicles_list_vehicle_insurances summary: List Vehicle Insurances parameters: - in: path name: id schema: title: Id type: integer required: true responses: '200': description: OK content: application/json: schema: items: $ref: '#/components/schemas/VehicleInsuranceResponse' title: Response type: array tags: - resource-mobilization.vehicles security: - APIKeyAuth: [] - CookieAuth: [] post: operationId: resource_mobilization_endpoints_vehicles_create_vehicle_insurance summary: Create Vehicle Insurance parameters: - in: path name: id schema: title: Id type: integer required: true responses: '200': description: OK content: application/json: schema: $ref: '#/components/schemas/VehicleInsuranceResponse' tags: - resource-mobilization.vehicles requestBody: content: application/json: schema: $ref: '#/components/schemas/VehicleInsuranceCreate' required: true security: - APIKeyAuth: [] - CookieAuth: [] /api/resource-mobilization/v1/vehicles/{id}/insurances/{insurance_id}: patch: operationId: resource_mobilization_endpoints_vehicles_update_vehicle_insurance summary: Update Vehicle Insurance parameters: - in: path name: id schema: title: Id type: integer required: true - in: path name: insurance_id schema: title: Insurance Id type: integer required: true responses: '200': description: OK content: application/json: schema: $ref: '#/components/schemas/VehicleInsuranceResponse' tags: - resource-mobilization.vehicles requestBody: content: application/json: schema: $ref: '#/components/schemas/VehicleInsuranceUpdate' required: true security: - APIKeyAuth: [] - CookieAuth: [] delete: operationId: resource_mobilization_endpoints_vehicles_delete_vehicle_insurance summary: Delete Vehicle Insurance parameters: - in: path name: id schema: title: Id type: integer required: true - in: path name: insurance_id schema: title: Insurance Id type: integer required: true responses: '200': description: OK content: application/json: schema: $ref: '#/components/schemas/Success' tags: - resource-mobilization.vehicles security: - APIKeyAuth: [] - CookieAuth: [] components: schemas: VehicleInsuranceResponse: additionalProperties: false properties: id: title: Id type: integer type: title: Type type: string date_from: anyOf: - type: string - type: 'null' title: Date From date_to: anyOf: - type: string - type: 'null' title: Date To insurance_number: title: Insurance Number type: string required: - id - type - insurance_number title: VehicleInsuranceResponse 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 VehicleUpdate: additionalProperties: false properties: license_plate: anyOf: - type: string - type: 'null' title: License Plate make: anyOf: - type: string - type: 'null' title: Make model: anyOf: - type: string - type: 'null' title: Model type: anyOf: - type: string - type: 'null' title: Type country_id: anyOf: - type: integer - type: 'null' title: Country Id location_id: anyOf: - type: integer - type: 'null' title: Location Id vehicle_source: anyOf: - type: string - type: 'null' title: Vehicle Source telematics_provider: anyOf: - enum: - NAVIREC - MOTIVE type: string - type: 'null' title: Telematics Provider telematics_device_id: anyOf: - type: string - type: 'null' title: Telematics Device Id rental_company: anyOf: - type: string - type: 'null' title: Rental Company rental_agreement_no: anyOf: - type: string - type: 'null' title: Rental Agreement No inspection_to: anyOf: - type: string - type: 'null' title: Inspection To title: VehicleUpdate type: object VehicleInsuranceUpdate: additionalProperties: false properties: type: anyOf: - type: string - type: 'null' title: Type date_from: anyOf: - type: string - type: 'null' title: Date From date_to: anyOf: - type: string - type: 'null' title: Date To insurance_number: anyOf: - type: string - type: 'null' title: Insurance Number title: VehicleInsuranceUpdate type: object VehicleFleetSummary: additionalProperties: false description: Summary counts for the fleet vehicles dashboard. properties: total: description: Total non-archived vehicles title: Total type: integer in_project: description: Vehicles with an accepted assignment title: In Project type: integer planned: description: Vehicles with a planned (not yet accepted) assignment title: Planned type: integer available: description: Vehicles available for assignment title: Available type: integer vor: description: Vehicles off road (expired inspection or no active insurance) title: Vor type: integer required: - total - in_project - planned - available - vor title: VehicleFleetSummary 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 VehicleCreate: additionalProperties: false properties: license_plate: anyOf: - type: string - type: 'null' title: License Plate make: title: Make type: string model: title: Model type: string type: title: Type type: string country_id: anyOf: - type: integer - type: 'null' title: Country Id location_id: title: Location Id type: integer vehicle_source: anyOf: - type: string - type: 'null' title: Vehicle Source telematics_provider: anyOf: - enum: - NAVIREC - MOTIVE type: string - type: 'null' title: Telematics Provider telematics_device_id: anyOf: - type: string - type: 'null' title: Telematics Device Id rental_company: anyOf: - type: string - type: 'null' title: Rental Company rental_agreement_no: anyOf: - type: string - type: 'null' title: Rental Agreement No inspection_to: anyOf: - type: string - type: 'null' title: Inspection To required: - make - model - type - location_id title: VehicleCreate type: object VehicleResponse: 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 type: title: Type type: string country_id: anyOf: - type: integer - type: 'null' title: Country Id location_id: title: Location Id type: integer vehicle_source: title: Vehicle Source type: string telematics_provider: title: Telematics Provider type: string telematics_device_id: anyOf: - type: string - type: 'null' title: Telematics Device Id rental_company: anyOf: - type: string - type: 'null' title: Rental Company rental_agreement_no: anyOf: - type: string - type: 'null' title: Rental Agreement No inspection_to: anyOf: - type: string - type: 'null' title: Inspection To active_insurances: items: $ref: '#/components/schemas/VehicleInsuranceResponse' title: Active Insurances type: array insurance_count: default: 0 title: Insurance Count type: integer is_archived: default: false title: Is Archived type: boolean updated_at: anyOf: - type: string - type: 'null' title: Updated At navirec: anyOf: - $ref: '#/components/schemas/NavirecLiveState' - type: 'null' required: - id - license_plate - make - model - type - location_id - vehicle_source - telematics_provider title: VehicleResponse 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 ErrorCode: description: Error codes for API errors. enum: - validation - server - auth - unknown - external - generic title: ErrorCode type: string VehicleInsuranceCreate: additionalProperties: false properties: type: title: Type type: string date_from: title: Date From type: string date_to: anyOf: - type: string - type: 'null' title: Date To insurance_number: title: Insurance Number type: string required: - type - date_from - insurance_number title: VehicleInsuranceCreate type: object securitySchemes: APIKeyAuth: type: http scheme: bearer CookieAuth: type: apiKey in: cookie name: opshub_prod_sessionid AuthBearer: type: http scheme: bearer