POST /ingest
Ingest a single sensor event with validation, server-side power computation, and persistence to InfluxDB.
Request
UUID v4 identifier for the event
ISO 8601 timestamp (e.g., 2026-01-12T00:00:00Z)
Asset information
Unique asset identifier (e.g., Motor-01)
Asset type: motor, pump, or compressor
Sensor measurements
Voltage in volts (150-300V)
Current in amperes (1-50A)
Vibration in g-force (0.01-10.0g)
Operational context
Current state: RUNNING, IDLE, STARTING, STOPPING
Data source identifier (e.g., modbus_rtu, opc_ua, manual)
Response
accepted if ingestion succeeded
Echo of the request event_id
Echo of the request timestamp
Signals with computed power_kw
Computed server-side: voltage_v × current_a × power_factor / 1000
Human-readable success message
Example
curl -X POST https://predictive-maintenance-uhlb.onrender.com/ingest \
-H "Content-Type: application/json" \
-d '{
"event_id": "550e8400-e29b-41d4-a716-446655440000",
"timestamp": "2026-03-02T10:30:00Z",
"asset": {
"asset_id": "Motor-01",
"asset_type": "motor"
},
"signals": {
"voltage_v": 230.5,
"current_a": 12.3,
"power_factor": 0.92,
"vibration_g": 0.15
},
"context": {
"operating_state": "RUNNING",
"source": "modbus_rtu"
}
}'
{
"status": "accepted",
"event_id": "550e8400-e29b-41d4-a716-446655440000",
"timestamp": "2026-03-02T10:30:00Z",
"asset": {
"asset_id": "Motor-01",
"asset_type": "motor"
},
"signals": {
"voltage_v": 230.5,
"current_a": 12.3,
"power_factor": 0.92,
"vibration_g": 0.15,
"power_kw": 2.6048
},
"context": {
"operating_state": "RUNNING",
"source": "modbus_rtu"
},
"message": "Event ingested successfully"
}
Status Codes
200 - Event ingested successfully
422 - Validation error (invalid payload)
503 - InfluxDB unavailable
Do NOT include power_kw in the request. The server computes this field. If provided by the client, the request will be rejected with a 422 error.
Server-Side Processing
When you POST to /ingest, the backend:
- Validates all fields against schemas
- Computes
power_kw = voltage_v × current_a × power_factor / 1000
- Persists to InfluxDB
sensor_data measurement
- Triggers feature engineering (rolling means, spike detection)
- Runs anomaly detection if baseline exists
- Updates Cumulative Degradation Index (DI)
See Sensor Ingestion for the complete data flow.