🔌 API Integration
PoolOS API endpoints (Phase 1):
POST /api/iot/devices — Register device
GET /api/iot/devices — List devices
POST /api/iot/sensor-data — Ingest reading
GET /api/iot/sensor-data?deviceId=X&hours=24 — Historical data
GET /api/iot/alerts — List alerts
GET /api/iot/dashboard — Full dashboard summary
POST /api/ml/predict — ML predictions (pH, chlorine, algae)
POST /api/insurance/quote — Insurance quote
GET /api/saas/tiers — Subscription tiers
POST /api/saas/subscribe — Subscribe to tier
📡 Register Your IoT Device
Example: Register an ESP32 pH sensor
curl -X POST https://ivpools.eu/api/iot/devices \
-H "Content-Type: application/json" \
-d '{"deviceId":"esp32-ph-001","name":"Pool pH Sensor","type":"pH","location":"Main Pool","firmware":"1.0.0"}'
Send sensor reading:
curl -X POST https://ivpools.eu/api/iot/sensor-data \
-H "Content-Type: application/json" \
-d '{"deviceId":"esp32-ph-001","type":"pH","value":7.2,"unit":"pH"}'