API Reference
Complete endpoint documentation with request schemas, response examples, and notes.
https://rca-backend-5jlv.onrender.comInclude your API key as a header: Authorization: Bearer YOUR_API_KEY. API keys are generated in Settings → API Keys after sign up.
Sensor
/api/sensor/ingestIngest a single sensor reading. Returns ensemble score, severity, is_anomaly flag, and workflow_id if RCA was triggered.
{
"machine_id": "eq-001", // string, required
"air_temperature": 298.1, // number (K), required
"process_temperature": 308.6, // number (K), required
"rotational_speed": 1551, // number (RPM), required
"torque": 42.8, // number (Nm), required
"tool_wear": 0, // number (min), required
"machine_type": "M" // "H" | "L" | "M", required
}{
"reading_id": "rdg_abc123",
"ensemble_score": 0.73,
"is_anomaly": true,
"severity": "high",
"workflow_id": "wf_def456", // present if RCA triggered
"timestamp": "2026-05-05T10:22:00Z"
}/api/sensors/historyRetrieve reading history for a given equipment ID. Supports limit and hours query parameters.
GET /api/sensors/history?machine_id=eq-001&hours=24&limit=100
{
"readings": [
{
"reading_id": "rdg_abc123",
"ensemble_score": 0.73,
"is_anomaly": true,
"severity": "high",
"timestamp": "2026-05-05T10:22:00Z"
}
],
"total": 47
}Equipment
/api/equipmentList all registered equipment with current health scores, anomaly counts, and status.
GET /api/equipment
{
"equipment": [
{
"id": "eq-001",
"name": "CNC Mill 01",
"machine_type": "M",
"health_score": 82,
"status": "warning",
"anomaly_count": 3,
"last_reading": "2026-05-05T10:22:00Z"
}
]
}/api/equipmentRegister a new piece of equipment.
{
"name": "CNC Mill 01",
"machine_type": "M", // "H" | "L" | "M"
"location": "Bay 3" // optional
}{
"id": "eq-001",
"name": "CNC Mill 01",
"machine_type": "M",
"health_score": 100,
"status": "normal",
"created_at": "2026-05-05T09:00:00Z"
}Alerts
/api/alertsList active alerts. Filter by severity (critical | high | medium) and acknowledged status.
GET /api/alerts?severity=critical&acknowledged=false
{
"alerts": [
{
"id": "alt_xyz789",
"machine_id": "eq-001",
"severity": "critical",
"ensemble_score": 0.91,
"message": "Probable heat dissipation failure",
"acknowledged": false,
"timestamp": "2026-05-05T10:22:00Z"
}
],
"total": 1
}/api/alerts/{id}/acknowledgeAcknowledge an alert by ID. Removes it from the active alerts count.
PATCH /api/alerts/alt_xyz789/acknowledge
{
"id": "alt_xyz789",
"acknowledged": true,
"acknowledged_at": "2026-05-05T10:35:00Z"
}Dashboard
/api/dashboard/summaryFleet overview — total equipment, active alerts by severity, anomalies in last 24h, open maintenance tasks.
GET /api/dashboard/summary
{
"total_equipment": 12,
"active_alerts": {
"critical": 1,
"high": 3,
"medium": 7
},
"anomalies_24h": 14,
"open_maintenance_tasks": 5,
"fleet_health_avg": 78
}Maintenance
/api/maintenance/tasksList all maintenance tasks with status. Filter by status (open | in_progress | done) and machine_id.
GET /api/maintenance/tasks?status=open
{
"tasks": [
{
"id": "tsk_001",
"machine_id": "eq-001",
"title": "Inspect bearing — probable wear",
"priority": "high",
"status": "open",
"rca_id": "wf_def456",
"created_at": "2026-05-05T10:23:00Z"
}
]
}/api/maintenance/historyLog a completed maintenance event. Feeds the Learning Agent for continuous improvement.
{
"machine_id": "eq-001",
"task_id": "tsk_001",
"action_taken": "Replaced bearing unit B-12",
"confirmed_root_cause": "bearing_wear",
"technician": "J. Smith",
"completed_at": "2026-05-05T14:00:00Z"
}{
"history_id": "hst_001",
"status": "logged",
"learning_agent_updated": true
}