{"openapi":"3.1.0","info":{"title":"Medical Equipment Device API","description":"API for embedded devices to interact with the medical equipment inspection system","version":"2.27.5"},"paths":{"/health":{"get":{"summary":"Health Check","operationId":"health_check_health_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"HTTPBearer":[]}]}},"/health/database":{"get":{"summary":"Database Health Check","description":"Check database connectivity and connection pool status","operationId":"database_health_check_health_database_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"HTTPBearer":[]}]}},"/api/v1/medical-equipment/equipment-types":{"get":{"tags":["Medical Equipment"],"summary":"List Equipment Types","description":"Allowed equipment_type values — a picklist, not scoped to any company.\n\nRead-only passthrough to the same EquipmentType table admin-api's\nsystem-admin-only GET /equipment-types already serves; this one is\nreachable by any authenticated user, since a bulk-import row validator\nand a frontend dropdown both need it and neither is VerifyAI staff.","operationId":"list_equipment_types_api_v1_medical_equipment_equipment_types_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/EquipmentTypeInfo"},"type":"array","title":"Response List Equipment Types Api V1 Medical Equipment Equipment Types Get"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/v1/medical-equipment/bulk":{"post":{"tags":["Medical Equipment"],"summary":"Bulk Create Medical Equipment","description":"Bulk-register medical equipment from a CSV, matching\ndocs/_templates/inventory_template.xlsx: equipment_type, producer, model,\nserial, property_tag, short_comment, company, department, length_cm.\n\nSame auth as the single-create endpoint above — this just loops that\nendpoint's per-row logic, it isn't new authorization ground. `company`\nresolves by name to one the caller already has access to (blank = own\ncompany); `department` resolves by name within that company and is\ncreated if missing.\n`length_cm` is stored as-is in `length_mm`: despite its name that column\nholds centimetres everywhere it is read (dashboard, ui-api, the S1 kiosk's\nstepper). Row failures don't abort the batch; only a structurally bad file\n422s the whole request.","operationId":"bulk_create_medical_equipment_api_v1_medical_equipment_bulk_post","requestBody":{"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_bulk_create_medical_equipment_api_v1_medical_equipment_bulk_post"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MedicalEquipmentBulkResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/v1/medical-equipment/":{"post":{"tags":["Medical Equipment"],"summary":"Create Medical Equipment","description":"Create new medical equipment.\n\n`company_id` is the company the item belongs to, `department_id` an\noptional department of that company. Sending only `department_id` uses the\ndepartment's company.","operationId":"create_medical_equipment_api_v1_medical_equipment__post","security":[{"HTTPBearer":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MedicalEquipmentCreate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MedicalEquipmentResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"tags":["Medical Equipment"],"summary":"List Medical Equipment For User Company","description":"All medical equipment the caller can see, as one flat list.\n\nUnifies the four ways an item can hang off a company tree — filed\ndirectly against the caller's own company, against one of that company's\ndepartments, against a customer company, or against a customer company's\ndepartment. `owner_company_id` / `owner_department_id` on each item say\nwhich case it was; a department-owned item reports the department's\ncompany as its owner company, so the caller can group by company without\ncaring how the row was filed.\n\nScope comes from get_accessible_company_ids(), which mirrors the\nper-item rule in check_equipment_access() — see that helper.","operationId":"list_medical_equipment_for_user_company_api_v1_medical_equipment__get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"company_id","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"description":"Narrow the result to a single accessible company (and its departments). Omit for the caller's full scope.","title":"Company Id"},"description":"Narrow the result to a single accessible company (and its departments). Omit for the caller's full scope."},{"name":"equipment_type","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter by equipment type","title":"Equipment Type"},"description":"Filter by equipment type"},{"name":"producer","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter by producer","title":"Producer"},"description":"Filter by producer"},{"name":"model","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter by model","title":"Model"},"description":"Filter by model"},{"name":"serial","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter by serial number","title":"Serial"},"description":"Filter by serial number"},{"name":"property_tag","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter by property tag","title":"Property Tag"},"description":"Filter by property tag"},{"name":"special_info","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter by special info (JSON search)","title":"Special Info"},"description":"Filter by special info (JSON search)"},{"name":"updated_after","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Return only records updated after this ISO-8601 UTC timestamp","title":"Updated After"},"description":"Return only records updated after this ISO-8601 UTC timestamp"},{"name":"page","in":"query","required":false,"schema":{"type":"integer","minimum":1,"default":1,"title":"Page"}},{"name":"per_page","in":"query","required":false,"schema":{"type":"integer","maximum":1000,"minimum":1,"default":50,"title":"Per Page"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/medical-equipment/inspected":{"get":{"tags":["Medical Equipment"],"summary":"List Inspected Equipment","description":"Get list of medical equipment that was previously inspected by the company","operationId":"list_inspected_equipment_api_v1_medical_equipment_inspected_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"page","in":"query","required":false,"schema":{"type":"integer","minimum":1,"default":1,"title":"Page"}},{"name":"per_page","in":"query","required":false,"schema":{"type":"integer","maximum":1000,"minimum":1,"default":50,"title":"Per Page"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/medical-equipment/endoscopes/db":{"get":{"tags":["Medical Equipment"],"summary":"List Endoscopes","description":"Get list of active endoscopes from the endoscopes_db reference table.\n\nAll authenticated users can access this endpoint.\nOptionally filter by searching in OEM and model fields.","operationId":"list_endoscopes_api_v1_medical_equipment_endoscopes_db_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"search","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Search in OEM and model fields","title":"Search"},"description":"Search in OEM and model fields"},{"name":"updated_after","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Return only records updated after this ISO-8601 UTC timestamp","title":"Updated After"},"description":"Return only records updated after this ISO-8601 UTC timestamp"},{"name":"page","in":"query","required":false,"schema":{"type":"integer","minimum":1,"default":1,"title":"Page"}},{"name":"per_page","in":"query","required":false,"schema":{"type":"integer","maximum":1000,"minimum":1,"default":50,"title":"Per Page"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/medical-equipment/company/{company_id}":{"get":{"tags":["Medical Equipment"],"summary":"List Medical Equipment","description":"Get list of medical equipment for the specified company and its customer companies","operationId":"list_medical_equipment_api_v1_medical_equipment_company__company_id__get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"company_id","in":"path","required":true,"schema":{"type":"integer","title":"Company Id"}},{"name":"equipment_type","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter by equipment type","title":"Equipment Type"},"description":"Filter by equipment type"},{"name":"producer","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter by producer","title":"Producer"},"description":"Filter by producer"},{"name":"model","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter by model","title":"Model"},"description":"Filter by model"},{"name":"serial","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter by serial number","title":"Serial"},"description":"Filter by serial number"},{"name":"property_tag","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter by property tag","title":"Property Tag"},"description":"Filter by property tag"},{"name":"special_info","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter by special info (JSON search)","title":"Special Info"},"description":"Filter by special info (JSON search)"},{"name":"page","in":"query","required":false,"schema":{"type":"integer","minimum":1,"default":1,"title":"Page"}},{"name":"per_page","in":"query","required":false,"schema":{"type":"integer","maximum":1000,"minimum":1,"default":50,"title":"Per Page"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/medical-equipment/{equipment_id}":{"get":{"tags":["Medical Equipment"],"summary":"Get Medical Equipment","description":"Get specific medical equipment by ID, or list equipment for a company if the ID is a company ID.","operationId":"get_medical_equipment_api_v1_medical_equipment__equipment_id__get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"equipment_id","in":"path","required":true,"schema":{"type":"integer","title":"Equipment Id"}},{"name":"page","in":"query","required":false,"schema":{"type":"integer","minimum":1,"default":1,"title":"Page"}},{"name":"per_page","in":"query","required":false,"schema":{"type":"integer","maximum":1000,"minimum":1,"default":50,"title":"Per Page"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"tags":["Medical Equipment"],"summary":"Update Medical Equipment","description":"Update medical equipment","operationId":"update_medical_equipment_api_v1_medical_equipment__equipment_id__put","security":[{"HTTPBearer":[]}],"parameters":[{"name":"equipment_id","in":"path","required":true,"schema":{"type":"integer","title":"Equipment Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MedicalEquipmentUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MedicalEquipmentResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["Medical Equipment"],"summary":"Delete Medical Equipment","description":"Delete medical equipment (technicians cannot delete)","operationId":"delete_medical_equipment_api_v1_medical_equipment__equipment_id__delete","security":[{"HTTPBearer":[]}],"parameters":[{"name":"equipment_id","in":"path","required":true,"schema":{"type":"integer","title":"Equipment Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/medical-equipment/endoscopes/db/upload":{"post":{"tags":["Medical Equipment"],"summary":"Upload Endoscopes Csv","description":"Upload endoscopes from CSV file. Only accessible to system-admins.\n\nCSV Format: oem, model, length (in cm)\n\nThe endpoint will:\n- Validate each row (OEM and model non-empty, length > 0 and <= 1000)\n- Normalize OEM (title case) and model (uppercase with hyphens)\n- Compare normalized CSV data directly with database values\n- Add new records or update existing ones based on update_existing flag\n\nReturns detailed list of actions for each row plus summary statistics.","operationId":"upload_endoscopes_csv_api_v1_medical_equipment_endoscopes_db_upload_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"update_existing","in":"query","required":false,"schema":{"type":"boolean","description":"Update length for existing records","default":true,"title":"Update Existing"},"description":"Update length for existing records"}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_upload_endoscopes_csv_api_v1_medical_equipment_endoscopes_db_upload_post"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EndoscopeCSVUploadResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/devices/":{"post":{"tags":["Hardware Devices"],"summary":"Create Device","description":"Create new hardware device","operationId":"create_device_api_v1_devices__post","security":[{"HTTPBearer":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/HardwareDeviceCreate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HardwareDeviceResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"tags":["Hardware Devices"],"summary":"List Devices","description":"Get list of hardware devices for the user's company","operationId":"list_devices_api_v1_devices__get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/DeviceStatus"},{"type":"null"}],"description":"Filter by device status","title":"Status"},"description":"Filter by device status"},{"name":"hardware_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter by hardware ID","title":"Hardware Id"},"description":"Filter by hardware ID"},{"name":"page","in":"query","required":false,"schema":{"type":"integer","minimum":1,"default":1,"title":"Page"}},{"name":"per_page","in":"query","required":false,"schema":{"type":"integer","maximum":1000,"minimum":1,"default":50,"title":"Per Page"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/devices/{device_id}":{"get":{"tags":["Hardware Devices"],"summary":"Get Device","description":"Get specific hardware device","operationId":"get_device_api_v1_devices__device_id__get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"device_id","in":"path","required":true,"schema":{"type":"integer","title":"Device Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HardwareDeviceResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"tags":["Hardware Devices"],"summary":"Update Device","description":"Update hardware device (company-admin/company-user for own company; system-admin for any device)","operationId":"update_device_api_v1_devices__device_id__put","security":[{"HTTPBearer":[]}],"parameters":[{"name":"device_id","in":"path","required":true,"schema":{"type":"integer","title":"Device Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/HardwareDeviceUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HardwareDeviceResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["Hardware Devices"],"summary":"Delete Device","description":"Delete hardware device (company-admin for own company; system-admin for any device)","operationId":"delete_device_api_v1_devices__device_id__delete","security":[{"HTTPBearer":[]}],"parameters":[{"name":"device_id","in":"path","required":true,"schema":{"type":"integer","title":"Device Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/devices/hardware-id/{hardware_id}":{"get":{"tags":["Hardware Devices"],"summary":"Get Device By Hardware Id","description":"Get device by hardware ID (useful for device self-identification)","operationId":"get_device_by_hardware_id_api_v1_devices_hardware_id__hardware_id__get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"hardware_id","in":"path","required":true,"schema":{"type":"string","title":"Hardware Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HardwareDeviceResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/devices/heartbeat":{"post":{"tags":["Hardware Devices"],"summary":"Device Checkin","description":"Accept a heartbeat from any device, registered or not, logged in or not.\n\nThe session heartbeat below is addressed by hardware_devices.id and needs a\nuser token, so a unit only reports while somebody is logged into it. A box\nthat is racked, powered and perfectly healthy but sitting at a login screen\nis silent - and so is a unit on its very first boot, which is the one people\nask about most.\n\nA first-boot unit is in neither table: it has not been registered with a\ncustomer, and the factory registry only learns a board when somebody\nregisters it under POLYMEDIA-FACTORY, which has not happened yet either. It\ncan still say who it is - the factory tech typed its serial into the setup\nscreen, and the hostname has carried it in every heartbeat since.\n\n  - a deployed device -> both rows are kept current. The device row gets the\n    heartbeat, and the registry row - if the board has one - gets the MAC\n    the device confirmed and the check-in stamp.\n  - no device row -> the registry alone. The serial it is filed under comes\n    off the unit's own hostname, which the factory setup screen set from the\n    sticker before anything else ran. No hardware_devices row is created:\n    department_id is NOT NULL there, so an unassigned device cannot exist on\n    that table, and inventing one would collide with the registration the\n    unit is still waiting for.\n\nAuth is optional. A token changes nothing about what is recorded; it only\nlifts the rate limits, since an authenticated caller is already accountable.","operationId":"device_checkin_api_v1_devices_heartbeat_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeviceCheckinIn"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HeartbeatOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/v1/devices/{device_id}/heartbeat":{"post":{"tags":["Hardware Devices"],"summary":"Device Heartbeat","description":"Record device heartbeat and store telemetry snapshot.","operationId":"device_heartbeat_api_v1_devices__device_id__heartbeat_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"device_id","in":"path","required":true,"schema":{"type":"integer","title":"Device Id"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/HeartbeatIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HeartbeatOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/devices/{device_id}/emails":{"get":{"tags":["Hardware Devices"],"summary":"Get Device Emails","description":"Get all emails for a specific device","operationId":"get_device_emails_api_v1_devices__device_id__emails_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"device_id","in":"path","required":true,"schema":{"type":"integer","title":"Device Id"}},{"name":"updated_after","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"description":"Return only records updated after this ISO-8601 UTC timestamp","title":"Updated After"},"description":"Return only records updated after this ISO-8601 UTC timestamp"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["Hardware Devices"],"summary":"Add Device Email","description":"Add an email to the device email list\n\nQuery Parameters:\n- response_type: Controls what additional data is returned after adding the email\n  - 'added_email' (default): Returns only the newly added email information\n  - 'device_emails': Returns the added email plus all emails for the specific device\n  - 'company_emails': Returns the added email plus all emails for all devices owned by the company","operationId":"add_device_email_api_v1_devices__device_id__emails_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"device_id","in":"path","required":true,"schema":{"type":"integer","title":"Device Id"}},{"name":"response_type","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Response type: 'added_email' (default), 'device_emails', or 'company_emails'","default":"added_email","title":"Response Type"},"description":"Response type: 'added_email' (default), 'device_emails', or 'company_emails'"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeviceEmailListCreate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeviceEmailAddResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/devices/{device_id}/emails/{email_id}":{"put":{"tags":["Hardware Devices"],"summary":"Update Device Email","description":"Update an email in the device email list","operationId":"update_device_email_api_v1_devices__device_id__emails__email_id__put","security":[{"HTTPBearer":[]}],"parameters":[{"name":"device_id","in":"path","required":true,"schema":{"type":"integer","title":"Device Id"}},{"name":"email_id","in":"path","required":true,"schema":{"type":"integer","title":"Email Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeviceEmailListUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeviceEmailListResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["Hardware Devices"],"summary":"Remove Device Email","description":"Remove an email from the device email list","operationId":"remove_device_email_api_v1_devices__device_id__emails__email_id__delete","security":[{"HTTPBearer":[]}],"parameters":[{"name":"device_id","in":"path","required":true,"schema":{"type":"integer","title":"Device Id"}},{"name":"email_id","in":"path","required":true,"schema":{"type":"integer","title":"Email Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/devices/{device_id}/alerts":{"post":{"tags":["Alerts"],"summary":"Raise Alert As User","description":"ALERT from a signed-in user. Emails the frame to the company's flagged addresses.","operationId":"raise_alert_as_user_api_v1_devices__device_id__alerts_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"device_id","in":"path","required":true,"schema":{"type":"integer","title":"Device Id"}}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_raise_alert_as_user_api_v1_devices__device_id__alerts_post"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AlertOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/devices/alerts":{"post":{"tags":["Alerts"],"summary":"Raise Alert As Device","description":"ALERT from a unit with nobody signed in, identified by hardware_id.","operationId":"raise_alert_as_device_api_v1_devices_alerts_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"x-device-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Device-Key"}}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_raise_alert_as_device_api_v1_devices_alerts_post"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AlertOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/onboarding/cases/{case_id}/devices":{"post":{"tags":["Onboarding"],"summary":"Add Case Device","description":"Attach a device to the case's approved company, by factory serial.","operationId":"add_case_device_api_v1_onboarding_cases__case_id__devices_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"case_id","in":"path","required":true,"schema":{"type":"integer","title":"Case Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OnboardingDeviceCreate"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HardwareDeviceResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"tags":["Onboarding"],"summary":"List Case Devices","description":"Devices already attached by this case — what the wizard shows as done.","operationId":"list_case_devices_api_v1_onboarding_cases__case_id__devices_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"case_id","in":"path","required":true,"schema":{"type":"integer","title":"Case Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/HardwareDeviceResponse"},"title":"Response List Case Devices Api V1 Onboarding Cases  Case Id  Devices Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/onboarding/cases/{case_id}/company-devices":{"get":{"tags":["Onboarding"],"summary":"List Company Devices","description":"Every active device already on the case's target company, across all\ndepartments and every case that ever added one — not just this case.\n\nShown at the top of the continue-onboarding device step so a distributor\nregistering several devices for the same company can see what is already\nthere instead of guessing or double-adding.","operationId":"list_company_devices_api_v1_onboarding_cases__case_id__company_devices_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"case_id","in":"path","required":true,"schema":{"type":"integer","title":"Case Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/HardwareDeviceResponse"},"title":"Response List Company Devices Api V1 Onboarding Cases  Case Id  Company Devices Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/company/info":{"get":{"tags":["Company"],"summary":"Get Company Info","description":"Get information about the company to which the device belongs","operationId":"get_company_info_api_v1_company_info_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CompanyResponse"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/v1/company/departments":{"get":{"tags":["Company"],"summary":"Get Company Departments","description":"Get list of departments for the user's company","operationId":"get_company_departments_api_v1_company_departments_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"HTTPBearer":[]}]}},"/api/v1/company/{company_id}/customers":{"get":{"tags":["Company"],"summary":"Get Customer Companies","description":"Get all customer companies (regular companies) for the specified service company","operationId":"get_customer_companies_api_v1_company__company_id__customers_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"company_id","in":"path","required":true,"schema":{"type":"integer","title":"Company Id"}},{"name":"updated_after","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Return only records updated after this ISO-8601 UTC timestamp","title":"Updated After"},"description":"Return only records updated after this ISO-8601 UTC timestamp"},{"name":"page","in":"query","required":false,"schema":{"type":"integer","minimum":1,"default":1,"title":"Page"}},{"name":"per_page","in":"query","required":false,"schema":{"type":"integer","maximum":1000,"minimum":1,"default":50,"title":"Per Page"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/company/{company_id}":{"get":{"tags":["Company"],"summary":"Get Company Details","description":"Get details of a specific company","operationId":"get_company_details_api_v1_company__company_id__get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"company_id","in":"path","required":true,"schema":{"type":"integer","title":"Company Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CompanyResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/company/{service_company_id}/customers":{"post":{"tags":["Company"],"summary":"Create Customer Company","description":"Create a new customer company for the specified service company","operationId":"create_customer_company_api_v1_company__service_company_id__customers_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"service_company_id","in":"path","required":true,"schema":{"type":"integer","title":"Service Company Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CompanyCreate"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CompanyResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/company/{service_company_id}/customers/{customer_company_id}":{"put":{"tags":["Company"],"summary":"Update Customer Company","description":"Update a customer company for the specified service company","operationId":"update_customer_company_api_v1_company__service_company_id__customers__customer_company_id__put","security":[{"HTTPBearer":[]}],"parameters":[{"name":"service_company_id","in":"path","required":true,"schema":{"type":"integer","title":"Service Company Id"}},{"name":"customer_company_id","in":"path","required":true,"schema":{"type":"integer","title":"Customer Company Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CompanyUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CompanyResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["Company"],"summary":"Delete Customer Company","description":"Delete (deactivate) a customer company for the specified service company","operationId":"delete_customer_company_api_v1_company__service_company_id__customers__customer_company_id__delete","security":[{"HTTPBearer":[]}],"parameters":[{"name":"service_company_id","in":"path","required":true,"schema":{"type":"integer","title":"Service Company Id"}},{"name":"customer_company_id","in":"path","required":true,"schema":{"type":"integer","title":"Customer Company Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/company/{company_id}/emails":{"get":{"tags":["Company"],"summary":"Get Company Device Emails","description":"Get all device emails for all active devices registered under a company","operationId":"get_company_device_emails_api_v1_company__company_id__emails_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"company_id","in":"path","required":true,"schema":{"type":"integer","title":"Company Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/departments/":{"get":{"tags":["Departments"],"summary":"List Departments","description":"Get list of departments for the user's company","operationId":"list_departments_api_v1_departments__get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"company_id","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"description":"Filter by company ID","title":"Company Id"},"description":"Filter by company ID"},{"name":"updated_after","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Return only records updated after this ISO-8601 UTC timestamp","title":"Updated After"},"description":"Return only records updated after this ISO-8601 UTC timestamp"},{"name":"page","in":"query","required":false,"schema":{"type":"integer","minimum":1,"default":1,"title":"Page"}},{"name":"per_page","in":"query","required":false,"schema":{"type":"integer","maximum":1000,"minimum":1,"default":50,"title":"Per Page"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["Departments"],"summary":"Create Department","description":"Create new department","operationId":"create_department_api_v1_departments__post","security":[{"HTTPBearer":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DepartmentCreate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DepartmentResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/departments/{department_id}":{"put":{"tags":["Departments"],"summary":"Update Department","description":"Update department details (cannot change company)","operationId":"update_department_api_v1_departments__department_id__put","security":[{"HTTPBearer":[]}],"parameters":[{"name":"department_id","in":"path","required":true,"schema":{"type":"integer","title":"Department Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DepartmentUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DepartmentResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["Departments"],"summary":"Delete Department","description":"Delete department (only company admins can delete)","operationId":"delete_department_api_v1_departments__department_id__delete","security":[{"HTTPBearer":[]}],"parameters":[{"name":"department_id","in":"path","required":true,"schema":{"type":"integer","title":"Department Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"tags":["Departments"],"summary":"Get Department","description":"Get specific department details","operationId":"get_department_api_v1_departments__department_id__get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"department_id","in":"path","required":true,"schema":{"type":"integer","title":"Department Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DepartmentResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/videos/upload/initiate":{"post":{"tags":["Videos"],"summary":"Initiate Video Upload","description":"Initiate chunked video upload","operationId":"initiate_video_upload_api_v1_videos_upload_initiate_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UploadInitiateRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UploadInitiateResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/v1/videos/upload/{upload_id}/chunk/{chunk_index}":{"post":{"tags":["Videos"],"summary":"Confirm Chunk Upload","description":"Confirm that a chunk has been uploaded successfully.\n\nKept for the existing client contract, but no longer server state: the\nchunk object in GCS is the record, and /upload/complete reads it back. This\nused to 404 with \"Upload session not found\" whenever the confirm reached a\ndifferent Cloud Run instance than the initiate, failing uploads whose\nchunks had in fact all arrived.","operationId":"confirm_chunk_upload_api_v1_videos_upload__upload_id__chunk__chunk_index__post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"upload_id","in":"path","required":true,"schema":{"type":"string","title":"Upload Id"}},{"name":"chunk_index","in":"path","required":true,"schema":{"type":"integer","title":"Chunk Index"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/videos/upload/complete":{"post":{"tags":["Videos"],"summary":"Complete Video Upload","description":"Complete video upload by combining chunks","operationId":"complete_video_upload_api_v1_videos_upload_complete_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UploadCompleteRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/v1/videos/":{"get":{"tags":["Videos"],"summary":"List Videos","description":"Get list of videos recorded and uploaded by devices in the user's company","operationId":"list_videos_api_v1_videos__get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"device_id","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"description":"Filter by device ID","title":"Device Id"},"description":"Filter by device ID"},{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/VideoStatus"},{"type":"null"}],"description":"Filter by video status","title":"Status"},"description":"Filter by video status"},{"name":"recording_started_after","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"description":"Filter videos recorded after this date","title":"Recording Started After"},"description":"Filter videos recorded after this date"},{"name":"page","in":"query","required":false,"schema":{"type":"integer","minimum":1,"default":1,"title":"Page"}},{"name":"per_page","in":"query","required":false,"schema":{"type":"integer","maximum":1000,"minimum":1,"default":50,"title":"Per Page"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/videos/device/{device_id}":{"get":{"tags":["Videos"],"summary":"List Device Videos","description":"Get list of videos recorded by a specific device","operationId":"list_device_videos_api_v1_videos_device__device_id__get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"device_id","in":"path","required":true,"schema":{"type":"integer","title":"Device Id"}},{"name":"recording_started_after","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"description":"Filter videos recorded after this date","title":"Recording Started After"},"description":"Filter videos recorded after this date"},{"name":"page","in":"query","required":false,"schema":{"type":"integer","minimum":1,"default":1,"title":"Page"}},{"name":"per_page","in":"query","required":false,"schema":{"type":"integer","maximum":1000,"minimum":1,"default":50,"title":"Per Page"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/videos/{video_id}":{"get":{"tags":["Videos"],"summary":"Get Video","description":"Get specific video information","operationId":"get_video_api_v1_videos__video_id__get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"video_id","in":"path","required":true,"schema":{"type":"integer","title":"Video Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/VideoResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/videos/{video_id}/status":{"put":{"tags":["Videos"],"summary":"Update Video Status","description":"Update video status and other fields","operationId":"update_video_status_api_v1_videos__video_id__status_put","security":[{"HTTPBearer":[]}],"parameters":[{"name":"video_id","in":"path","required":true,"schema":{"type":"integer","title":"Video Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/VideoUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/VideoResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/videos/{video_id}/download-url":{"get":{"tags":["Videos"],"summary":"Get Video Download Url","description":"Get signed download URL for video","operationId":"get_video_download_url_api_v1_videos__video_id__download_url_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"video_id","in":"path","required":true,"schema":{"type":"integer","title":"Video Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/videos/check-status":{"post":{"tags":["Videos"],"summary":"Check Videos Status","description":"Check video status for multiple filenames.\n\nThis endpoint is only available for device-authenticated tokens.\nIt returns the status of videos matching the provided filenames for the specific device.\n\nArgs:\n    request: List of filenames to check\n    current_user: Authenticated user (must have device info in token)\n    db: Database session\n\nReturns:\n    Dictionary mapping each filename to its status (or None if not found)\n\nRaises:\n    403: If token doesn't contain device information\n    404: If device not found or not associated with a company","operationId":"check_videos_status_api_v1_videos_check_status_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CheckVideosStatusRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":{"anyOf":[{"type":"string"},{"type":"null"}]},"type":"object","title":"Response Check Videos Status Api V1 Videos Check Status Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/v1/support/request":{"post":{"tags":["Support"],"summary":"Create Support Request","description":"Create a support request and send email to support team.\n\nThis endpoint can be accessed with or without authentication:\n- With token: User information is extracted from token and email copy is sent to user\n- Without token: Only support team receives the email with provided session data\n\nAccepts multipart/form-data with:\n- request: JSON string containing support request data (user_comment, instance, session, operation)\n- log_file: Optional file attachment\n\nAll models support additional fields beyond those explicitly defined.","operationId":"create_support_request_api_v1_support_request_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"HTTPBearer":[]}]}},"/api/v1/models/manifest":{"get":{"tags":["Models"],"summary":"Get Model Manifest","description":"Return the full list of model variants accessible to the calling user.\n\nThis is a lightweight endpoint — no model bytes are transferred.  The client\nuses it to decide whether its IndexedDB cache is up-to-date before making a\n/models/download request.\n\nEach entry in the response contains:\n  model_name    — registered name in MLflow (used as the `model_name` param in /download)\n  version       — MLflow version number\n  model_family  — logical role: \"classifier\" | \"detector-spiral\" | ...\n  resolution    — input resolution the model expects, e.g. \"416x416\"\n  format        — execution format: \"onnx\" | \"webgl\" | \"openvino\"\n  precision     — numeric precision: \"fp32\" | \"fp16\" | \"int8\"\n  hash          — sha256 hex digest of the model file (cache key for the client)\n  size_bytes    — file size in bytes (optional, used by the client for progress bars)\n\nRequired MLflow tags on each model version:\n  model_family, resolution, format, precision, hash\nOptional MLflow tags:\n  size_bytes","operationId":"get_model_manifest_api_v1_models_manifest_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"HTTPBearer":[]}]}},"/api/v1/models/download":{"get":{"tags":["Models"],"summary":"Download Model","description":"Download a model variant, encrypted with AES-256-GCM.\n\nRBAC is enforced: the caller's subscription tier (plus any company-level\noverrides) must allow the requested combination of model_family, resolution,\nformat and precision.  The latest matching MLflow version is served.\n\nResponse body: raw AES-256-GCM ciphertext (plaintext + 16-byte auth tag).\n\nDecryption metadata is in response headers (must be in CORS expose_headers):\n  X-Model-Key      — base64-encoded 32-byte AES-256 key  (one-time, per request)\n  X-Model-Nonce    — base64-encoded 12-byte GCM nonce\n  X-Model-Hash     — sha256 hex digest of the plaintext  (matches manifest hash)\n  X-Model-Version  — MLflow version number that was served\n  X-Model-Name     — model_name as registered in MLflow\n\nThe key is generated fresh for every request, so caching this response at any\nintermediate layer is blocked via Cache-Control: no-store.\n\nClient-side caching strategy:\n  1. On page load call /models/manifest to get hashes without downloading bytes.\n  2. For each model, compare the manifest hash against what is stored in IndexedDB.\n  3. Only call /models/download when the hash is absent or has changed.\n  4. Store the ciphertext + key + nonce in IndexedDB keyed by hash.\n  5. On subsequent visits, decrypt from IndexedDB — no network request needed.","operationId":"download_model_api_v1_models_download_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"model_name","in":"query","required":true,"schema":{"type":"string","description":"Registered model name in MLflow","title":"Model Name"},"description":"Registered model name in MLflow"},{"name":"model_family","in":"query","required":true,"schema":{"type":"string","description":"Model family tag, e.g. 'classifier', 'detector-spiral'","title":"Model Family"},"description":"Model family tag, e.g. 'classifier', 'detector-spiral'"},{"name":"resolution","in":"query","required":true,"schema":{"type":"string","description":"Input resolution tag, e.g. '416x416'","title":"Resolution"},"description":"Input resolution tag, e.g. '416x416'"},{"name":"format","in":"query","required":true,"schema":{"type":"string","description":"Execution format tag: onnx | webgl | openvino","title":"Format"},"description":"Execution format tag: onnx | webgl | openvino"},{"name":"precision","in":"query","required":true,"schema":{"type":"string","description":"Numeric precision tag: fp32 | fp16 | int8","title":"Precision"},"description":"Numeric precision tag: fp32 | fp16 | int8"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/audit/network":{"post":{"tags":["Audit"],"summary":"Submit Network Audit","description":"Accepts network connectivity diagnostic reports from devices.\nAuth is optional — if a valid bearer token is provided the record is enriched\nwith user_id + confirmed device_id and flagged is_authenticated=1.\n\nUnauthenticated submissions are accepted but subject to two restrictions:\n  - mac_address must be included in the payload (provides a second identifier)\n  - max 10 requests per IP per hour (prevents flooding)","operationId":"submit_network_audit_api_v1_audit_network_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/NetworkAuditIn"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NetworkAuditOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/v1/inference/predict":{"post":{"tags":["Image Inference"],"summary":"Predict Images","description":"Predict on 1-5 images.\n\nReturns, per image in upload order: `tube_type` (clear | spiral | white |\noutside - \"outside\" meaning no tube in view, as opposed to a clean one),\n`detections` with coordinates relative to the image (0-1) and severity\nfields where the detector grades severity, plus the `model_versions` that\nproduced them and the service's `inference_ms`.\n\n403 when the device belongs to another company or is not licensed for\nbackend detection; 503 when the inference service is unavailable - the\ndevice should offer a retry.","operationId":"predict_images_api_v1_inference_predict_post","requestBody":{"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_predict_images_api_v1_inference_predict_post"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/":{"get":{"summary":"Root","operationId":"root__get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"HTTPBearer":[]}]}}},"components":{"schemas":{"AlertOut":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"alert_id":{"type":"string","title":"Alert Id"},"recipients":{"type":"integer","title":"Recipients"},"duplicate":{"type":"boolean","title":"Duplicate","default":false}},"type":"object","required":["alert_id","recipients"],"title":"AlertOut","description":"What a unit gets back for an accepted ALERT.\n\n`recipients` is how many addresses were emailed; 0 when nobody in the\ncompany is flagged, which the kiosk tells the technician. `duplicate` is\nTrue when this alert_id had already been handled and nothing was re-sent."},"Body_bulk_create_medical_equipment_api_v1_medical_equipment_bulk_post":{"properties":{"file":{"type":"string","format":"binary","title":"File"}},"type":"object","required":["file"],"title":"Body_bulk_create_medical_equipment_api_v1_medical_equipment_bulk_post"},"Body_predict_images_api_v1_inference_predict_post":{"properties":{"device_id":{"type":"integer","title":"Device Id","description":"The device the images were taken on"},"images":{"items":{"type":"string","format":"binary"},"type":"array","title":"Images","description":"1-5 JPEG or PNG images"}},"type":"object","required":["device_id","images"],"title":"Body_predict_images_api_v1_inference_predict_post"},"Body_raise_alert_as_device_api_v1_devices_alerts_post":{"properties":{"hardware_id":{"type":"string","maxLength":100,"minLength":1,"title":"Hardware Id"},"alert_id":{"type":"string","title":"Alert Id"},"captured_at":{"type":"string","title":"Captured At"},"alias":{"type":"string","title":"Alias"},"factory_serial":{"type":"string","title":"Factory Serial"},"image":{"type":"string","format":"binary","title":"Image"},"user_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"User Name"},"equipment_serial":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Equipment Serial"},"equipment_model":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Equipment Model"},"recording_position_s":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Recording Position S"},"recording_filename":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Recording Filename"},"video_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Video Id"},"note":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Note"},"source":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Source"},"timezone":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Timezone"}},"type":"object","required":["hardware_id","alert_id","captured_at","alias","factory_serial","image"],"title":"Body_raise_alert_as_device_api_v1_devices_alerts_post"},"Body_raise_alert_as_user_api_v1_devices__device_id__alerts_post":{"properties":{"alert_id":{"type":"string","title":"Alert Id"},"captured_at":{"type":"string","title":"Captured At"},"alias":{"type":"string","title":"Alias"},"factory_serial":{"type":"string","title":"Factory Serial"},"image":{"type":"string","format":"binary","title":"Image"},"user_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"User Name"},"equipment_serial":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Equipment Serial"},"equipment_model":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Equipment Model"},"recording_position_s":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Recording Position S"},"recording_filename":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Recording Filename"},"video_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Video Id"},"note":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Note"},"source":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Source"},"timezone":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Timezone"}},"type":"object","required":["alert_id","captured_at","alias","factory_serial","image"],"title":"Body_raise_alert_as_user_api_v1_devices__device_id__alerts_post"},"Body_upload_endoscopes_csv_api_v1_medical_equipment_endoscopes_db_upload_post":{"properties":{"file":{"type":"string","format":"binary","title":"File","description":"CSV file with columns: oem, model, length"}},"type":"object","required":["file"],"title":"Body_upload_endoscopes_csv_api_v1_medical_equipment_endoscopes_db_upload_post"},"CheckVideosStatusRequest":{"properties":{"filenames":{"items":{"type":"string"},"type":"array","title":"Filenames","description":"List of video filenames to check"}},"type":"object","required":["filenames"],"title":"CheckVideosStatusRequest"},"CompanyCreate":{"properties":{"name":{"type":"string","title":"Name"},"address":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Address"},"phone":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Phone"},"email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Email"},"website":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Website"},"company_type":{"$ref":"#/components/schemas/CompanyType","default":"regular"},"service_company_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Service Company Id"},"representative_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Representative Name"},"comment":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Comment"}},"type":"object","required":["name"],"title":"CompanyCreate"},"CompanyResponse":{"properties":{"name":{"type":"string","title":"Name"},"address":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Address"},"phone":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Phone"},"email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Email"},"website":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Website"},"company_type":{"$ref":"#/components/schemas/CompanyType","default":"regular"},"service_company_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Service Company Id"},"representative_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Representative Name"},"comment":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Comment"},"id":{"type":"integer","title":"Id"},"company_network_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Company Network Id"},"is_active":{"type":"boolean","title":"Is Active"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"}},"type":"object","required":["name","id","is_active","created_at","updated_at"],"title":"CompanyResponse"},"CompanyType":{"type":"string","enum":["regular","service"],"title":"CompanyType"},"CompanyUpdate":{"properties":{"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name"},"address":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Address"},"phone":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Phone"},"email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Email"},"website":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Website"},"company_type":{"anyOf":[{"$ref":"#/components/schemas/CompanyType"},{"type":"null"}]},"service_company_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Service Company Id"},"representative_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Representative Name"},"comment":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Comment"}},"type":"object","title":"CompanyUpdate"},"DepartmentCreate":{"properties":{"name":{"type":"string","title":"Name"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"head_of_department":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Head Of Department"},"contact_email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Contact Email"},"contact_phone":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Contact Phone"},"company_id":{"type":"integer","title":"Company Id"}},"type":"object","required":["name","company_id"],"title":"DepartmentCreate"},"DepartmentResponse":{"properties":{"name":{"type":"string","title":"Name"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"head_of_department":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Head Of Department"},"contact_email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Contact Email"},"contact_phone":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Contact Phone"},"id":{"type":"integer","title":"Id"},"company_id":{"type":"integer","title":"Company Id"},"is_active":{"type":"boolean","title":"Is Active"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"}},"type":"object","required":["name","id","company_id","is_active","created_at","updated_at"],"title":"DepartmentResponse"},"DepartmentUpdate":{"properties":{"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"head_of_department":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Head Of Department"},"contact_email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Contact Email"},"contact_phone":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Contact Phone"}},"type":"object","title":"DepartmentUpdate"},"DeviceCheckinIn":{"properties":{"anydesk_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Anydesk Id"},"firmware_version":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Firmware Version"},"app_version":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"App Version"},"hostname":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Hostname"},"ip_lan":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ip Lan"},"ip_wan":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ip Wan"},"os_release":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Os Release"},"anydesk_version":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Anydesk Version"},"anydesk_running":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Anydesk Running"},"anydesk_session_active":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Anydesk Session Active"},"uptime_s":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Uptime S"},"load_1m":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Load 1M"},"load_5m":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Load 5M"},"disk_free_gb":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Disk Free Gb"},"disk_total_gb":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Disk Total Gb"},"env":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Env"},"mode":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Mode"},"hardware_id":{"type":"string","maxLength":100,"minLength":1,"title":"Hardware Id"},"mac_address":{"anyOf":[{"type":"string","maxLength":17},{"type":"null"}],"title":"Mac Address"},"mac_addresses":{"anyOf":[{"items":{},"type":"array"},{"type":"null"}],"title":"Mac Addresses"},"factory_serial":{"anyOf":[{"type":"string","maxLength":100},{"type":"null"}],"title":"Factory Serial"}},"additionalProperties":true,"type":"object","required":["hardware_id"],"title":"DeviceCheckinIn","description":"A heartbeat that identifies the device instead of relying on a session.\n\nThe authenticated heartbeat is addressed by hardware_devices.id, which only\nexists once somebody has registered and logged into the unit. A device that\nis powered on and healthy but not logged in has no such id to quote, so this\nvariant carries the identifiers the device knows about itself and lets the\nserver resolve them.\n\nhardware_id is what the board reports; the appliance already sends it (and\nmac_addresses) on every cycle, where it currently lands in the telemetry\nblob unread."},"DeviceEmailAddResponse":{"properties":{"full_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Full Name"},"email":{"type":"string","title":"Email"},"receive_alerts":{"type":"boolean","title":"Receive Alerts","default":false},"receive_reports":{"type":"boolean","title":"Receive Reports","default":true},"id":{"type":"integer","title":"Id"},"device_id":{"type":"integer","title":"Device Id"},"device_alias":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Device Alias"},"is_active":{"type":"boolean","title":"Is Active"},"added_by":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Added By"},"added_at":{"type":"string","format":"date-time","title":"Added At"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"},"emails":{"anyOf":[{"items":{"$ref":"#/components/schemas/DeviceEmailListResponse"},"type":"array"},{"type":"null"}],"title":"Emails"}},"type":"object","required":["email","id","device_id","is_active","added_at","updated_at"],"title":"DeviceEmailAddResponse","description":"Response for adding a device email with optional additional email lists"},"DeviceEmailListCreate":{"properties":{"full_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Full Name"},"email":{"type":"string","title":"Email"},"receive_alerts":{"type":"boolean","title":"Receive Alerts","default":false},"receive_reports":{"type":"boolean","title":"Receive Reports","default":true},"device_id":{"type":"integer","title":"Device Id"}},"type":"object","required":["email","device_id"],"title":"DeviceEmailListCreate"},"DeviceEmailListResponse":{"properties":{"full_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Full Name"},"email":{"type":"string","title":"Email"},"receive_alerts":{"type":"boolean","title":"Receive Alerts","default":false},"receive_reports":{"type":"boolean","title":"Receive Reports","default":true},"id":{"type":"integer","title":"Id"},"device_id":{"type":"integer","title":"Device Id"},"device_alias":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Device Alias"},"is_active":{"type":"boolean","title":"Is Active"},"added_by":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Added By"},"added_at":{"type":"string","format":"date-time","title":"Added At"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"}},"type":"object","required":["email","id","device_id","is_active","added_at","updated_at"],"title":"DeviceEmailListResponse"},"DeviceEmailListUpdate":{"properties":{"full_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Full Name"},"email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Email"},"receive_alerts":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Receive Alerts"},"receive_reports":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Receive Reports"}},"type":"object","title":"DeviceEmailListUpdate"},"DeviceStatus":{"type":"string","enum":["online","offline","maintenance","disabled"],"title":"DeviceStatus"},"EndoscopeCSVRowResult":{"properties":{"row_number":{"type":"integer","title":"Row Number"},"oem":{"type":"string","title":"Oem"},"model":{"type":"string","title":"Model"},"length_cm":{"type":"number","title":"Length Cm"},"action":{"type":"string","title":"Action"},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"record_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Record Id"}},"type":"object","required":["row_number","oem","model","length_cm","action"],"title":"EndoscopeCSVRowResult","description":"Result for a single row from CSV upload"},"EndoscopeCSVUploadResponse":{"properties":{"total_rows":{"type":"integer","title":"Total Rows"},"added":{"type":"integer","title":"Added"},"updated":{"type":"integer","title":"Updated"},"skipped":{"type":"integer","title":"Skipped"},"errors":{"type":"integer","title":"Errors"},"details":{"items":{"$ref":"#/components/schemas/EndoscopeCSVRowResult"},"type":"array","title":"Details"}},"type":"object","required":["total_rows","added","updated","skipped","errors","details"],"title":"EndoscopeCSVUploadResponse","description":"Response for bulk endoscope CSV upload"},"EquipmentTypeInfo":{"properties":{"id":{"type":"integer","title":"Id"},"name":{"type":"string","title":"Name"}},"type":"object","required":["id","name"],"title":"EquipmentTypeInfo"},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"HardwareDeviceCreate":{"properties":{"hardware_id":{"type":"string","title":"Hardware Id"},"mac_address":{"type":"string","title":"Mac Address"},"alias":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Alias"},"factory_serial":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Factory Serial"},"operation_mode":{"$ref":"#/components/schemas/OperationMode","default":"manual"},"representative_email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Representative Email"},"representative_first_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Representative First Name"},"representative_last_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Representative Last Name"},"representative_phone":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Representative Phone"},"hardware_parameters":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Hardware Parameters"},"department_id":{"type":"integer","title":"Department Id"}},"type":"object","required":["hardware_id","mac_address","department_id"],"title":"HardwareDeviceCreate"},"HardwareDeviceResponse":{"properties":{"hardware_id":{"type":"string","title":"Hardware Id"},"mac_address":{"type":"string","title":"Mac Address"},"alias":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Alias"},"factory_serial":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Factory Serial"},"operation_mode":{"$ref":"#/components/schemas/OperationMode","default":"manual"},"representative_email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Representative Email"},"representative_first_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Representative First Name"},"representative_last_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Representative Last Name"},"representative_phone":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Representative Phone"},"hardware_parameters":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Hardware Parameters"},"id":{"type":"integer","title":"Id"},"department_id":{"type":"integer","title":"Department Id"},"label":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Label"},"firmware_version":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Firmware Version"},"last_seen":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Last Seen"},"status":{"$ref":"#/components/schemas/DeviceStatus"},"installation_date":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Installation Date"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"},"is_active":{"type":"boolean","title":"Is Active"}},"type":"object","required":["hardware_id","mac_address","id","department_id","status","created_at","updated_at","is_active"],"title":"HardwareDeviceResponse"},"HardwareDeviceUpdate":{"properties":{"alias":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Alias"},"factory_serial":{"anyOf":[{"type":"string","maxLength":100},{"type":"null"}],"title":"Factory Serial"},"department_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Department Id"},"operation_mode":{"anyOf":[{"$ref":"#/components/schemas/OperationMode"},{"type":"null"}]},"representative_email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Representative Email"},"representative_first_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Representative First Name"},"representative_last_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Representative Last Name"},"representative_phone":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Representative Phone"},"status":{"anyOf":[{"$ref":"#/components/schemas/DeviceStatus"},{"type":"null"}]},"hardware_parameters":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Hardware Parameters"}},"type":"object","title":"HardwareDeviceUpdate"},"HeartbeatIn":{"properties":{"anydesk_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Anydesk Id"},"firmware_version":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Firmware Version"},"app_version":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"App Version"},"hostname":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Hostname"},"ip_lan":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ip Lan"},"ip_wan":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ip Wan"},"os_release":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Os Release"},"anydesk_version":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Anydesk Version"},"anydesk_running":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Anydesk Running"},"anydesk_session_active":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Anydesk Session Active"},"uptime_s":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Uptime S"},"load_1m":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Load 1M"},"load_5m":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Load 5M"},"disk_free_gb":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Disk Free Gb"},"disk_total_gb":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Disk Total Gb"},"env":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Env"},"mode":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Mode"}},"additionalProperties":true,"type":"object","title":"HeartbeatIn"},"HeartbeatOut":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"last_seen":{"type":"string","format":"date-time","title":"Last Seen"},"commands":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Commands"},"registered":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Registered","description":"True if this hardware_id has a deployed device row"},"device_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Device Id","description":"The deployed device this check-in matched, if any"},"recorded":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Recorded","description":"False when the check-in was accepted but had nowhere to land - an unknown board that sent no factory serial"}},"type":"object","required":["last_seen"],"title":"HeartbeatOut"},"ListResponse":{"properties":{"items":{"items":{},"type":"array","title":"Items"},"total":{"type":"integer","title":"Total"},"page":{"type":"integer","title":"Page"},"per_page":{"type":"integer","title":"Per Page"},"total_pages":{"type":"integer","title":"Total Pages"},"last_updated":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Last Updated"}},"type":"object","required":["items","total","page","per_page","total_pages"],"title":"ListResponse"},"MedicalEquipmentBulkResponse":{"properties":{"created":{"type":"integer","title":"Created"},"failed":{"type":"integer","title":"Failed"},"results":{"items":{"$ref":"#/components/schemas/MedicalEquipmentBulkRowResult"},"type":"array","title":"Results"}},"type":"object","required":["created","failed","results"],"title":"MedicalEquipmentBulkResponse"},"MedicalEquipmentBulkRowResult":{"properties":{"row":{"type":"integer","title":"Row"},"success":{"type":"boolean","title":"Success"},"model":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Model"},"error":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error"}},"type":"object","required":["row","success"],"title":"MedicalEquipmentBulkRowResult"},"MedicalEquipmentCreate":{"properties":{"equipment_type":{"type":"string","title":"Equipment Type"},"producer":{"type":"string","title":"Producer"},"model":{"type":"string","title":"Model"},"serial":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Serial"},"property_tag":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Property Tag"},"length_mm":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Length Mm"},"short_comment":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Short Comment"},"special_info":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Special Info"},"department_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Department Id"},"company_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Company Id"}},"type":"object","required":["equipment_type","producer","model"],"title":"MedicalEquipmentCreate"},"MedicalEquipmentResponse":{"properties":{"equipment_type":{"type":"string","title":"Equipment Type"},"producer":{"type":"string","title":"Producer"},"model":{"type":"string","title":"Model"},"serial":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Serial"},"property_tag":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Property Tag"},"length_mm":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Length Mm"},"short_comment":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Short Comment"},"special_info":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Special Info"},"id":{"type":"integer","title":"Id"},"owner_department_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Owner Department Id"},"owner_department_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Owner Department Name"},"owner_company_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Owner Company Id"},"owner_company_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Owner Company Name"},"date_added_to_system":{"type":"string","format":"date-time","title":"Date Added To System"},"removed_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Removed At"},"removal_reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Removal Reason"},"removed_by":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Removed By"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"},"is_active":{"type":"boolean","title":"Is Active"}},"type":"object","required":["equipment_type","producer","model","id","date_added_to_system","created_at","updated_at","is_active"],"title":"MedicalEquipmentResponse"},"MedicalEquipmentUpdate":{"properties":{"equipment_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Equipment Type"},"producer":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Producer"},"model":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Model"},"serial":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Serial"},"property_tag":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Property Tag"},"length_mm":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Length Mm"},"short_comment":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Short Comment"},"special_info":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Special Info"},"department_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Department Id"},"company_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Company Id"}},"type":"object","title":"MedicalEquipmentUpdate"},"NetworkAuditIn":{"properties":{"hardware_id":{"type":"string","title":"Hardware Id"},"mac_address":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Mac Address"},"schema_version":{"type":"integer","title":"Schema Version","default":1},"audit_run_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Audit Run At"},"app_variant":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"App Variant"},"user_agent":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"User Agent"},"tests":{"items":{"$ref":"#/components/schemas/NetworkAuditTestResult"},"type":"array","title":"Tests"}},"type":"object","required":["hardware_id","tests"],"title":"NetworkAuditIn"},"NetworkAuditOut":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"id":{"type":"integer","title":"Id"},"received_at":{"type":"string","format":"date-time","title":"Received At"},"is_authenticated":{"type":"boolean","title":"Is Authenticated"}},"type":"object","required":["id","received_at","is_authenticated"],"title":"NetworkAuditOut"},"NetworkAuditTestResult":{"properties":{"name":{"type":"string","title":"Name"},"status":{"type":"string","title":"Status"},"expected":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Expected"},"actual":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Actual"},"duration_ms":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Duration Ms"},"action_if_fail":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Action If Fail"}},"additionalProperties":true,"type":"object","required":["name","status"],"title":"NetworkAuditTestResult"},"OnboardingDeviceCreate":{"properties":{"factory_serial":{"type":"string","maxLength":100,"minLength":1,"title":"Factory Serial"},"alias":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Alias"},"label":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Label"},"notes":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Notes"},"department_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Department Id"},"hardware_id":{"anyOf":[{"type":"string","maxLength":100,"minLength":1},{"type":"null"}],"title":"Hardware Id"},"mac_address":{"anyOf":[{"type":"string","maxLength":17,"minLength":1},{"type":"null"}],"title":"Mac Address"}},"type":"object","required":["factory_serial"],"title":"OnboardingDeviceCreate"},"OperationMode":{"type":"string","enum":["automatic","manual"],"title":"OperationMode"},"UploadCompleteRequest":{"properties":{"upload_id":{"type":"string","title":"Upload Id"},"video_id":{"type":"integer","title":"Video Id"},"recording_ended_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Recording Ended At"},"duration_seconds":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Duration Seconds"}},"type":"object","required":["upload_id","video_id"],"title":"UploadCompleteRequest"},"UploadInitiateRequest":{"properties":{"filename":{"type":"string","title":"Filename"},"file_size":{"type":"integer","exclusiveMinimum":0.0,"title":"File Size","description":"Total file size in bytes"},"chunk_size":{"type":"integer","title":"Chunk Size","description":"Requested chunk size in bytes","default":5242880},"device_id":{"type":"integer","title":"Device Id"},"medical_equipment_id":{"type":"integer","title":"Medical Equipment Id"},"recording_started_at":{"type":"string","format":"date-time","title":"Recording Started At"},"recording_parameters":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Recording Parameters"},"recording_comments":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Recording Comments"}},"type":"object","required":["filename","file_size","device_id","medical_equipment_id","recording_started_at"],"title":"UploadInitiateRequest"},"UploadInitiateResponse":{"properties":{"upload_id":{"type":"string","title":"Upload Id"},"video_id":{"type":"integer","title":"Video Id"},"total_chunks":{"type":"integer","title":"Total Chunks"},"chunk_size":{"type":"integer","title":"Chunk Size"},"upload_urls":{"items":{"type":"string"},"type":"array","title":"Upload Urls"}},"type":"object","required":["upload_id","video_id","total_chunks","chunk_size","upload_urls"],"title":"UploadInitiateResponse"},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"},"VideoResponse":{"properties":{"recording_started_at":{"type":"string","format":"date-time","title":"Recording Started At"},"recording_ended_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Recording Ended At"},"duration_seconds":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Duration Seconds"},"filename":{"type":"string","title":"Filename"},"resolution":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Resolution"},"fps":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Fps"},"codec":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Codec"},"recording_parameters":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Recording Parameters"},"recording_comments":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Recording Comments"},"inspection_notes":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Inspection Notes"},"id":{"type":"integer","title":"Id"},"device_id":{"type":"integer","title":"Device Id"},"medical_equipment_id":{"type":"integer","title":"Medical Equipment Id"},"recorded_by":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Recorded By"},"company_id":{"type":"integer","title":"Company Id"},"google_bucket_path":{"type":"string","title":"Google Bucket Path"},"google_bucket_processed_path":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Google Bucket Processed Path"},"file_size_bytes":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"File Size Bytes"},"status":{"$ref":"#/components/schemas/VideoStatus"},"review_comments":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Review Comments"},"reviewed_by":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Reviewed By"},"reviewed_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Reviewed At"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"}},"type":"object","required":["recording_started_at","filename","id","device_id","medical_equipment_id","company_id","google_bucket_path","status","created_at","updated_at"],"title":"VideoResponse"},"VideoStatus":{"type":"string","enum":["recording","uploading","uploaded","processing","processed","failed","upload_failed","rejected"],"title":"VideoStatus"},"VideoUpdate":{"properties":{"status":{"anyOf":[{"$ref":"#/components/schemas/VideoStatus"},{"type":"null"}]},"recording_ended_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Recording Ended At"},"duration_seconds":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Duration Seconds"},"review_comments":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Review Comments"},"inspection_notes":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Inspection Notes"}},"type":"object","title":"VideoUpdate"}},"securitySchemes":{"HTTPBearer":{"type":"http","scheme":"bearer"}}}}