{"openapi":"3.1.0","info":{"title":"GridLoss AI API","description":"Feeder-level AT&C loss attribution and field-action prioritisation for DISCOMs. PoC mode: synthetic DISCOM dataset with known injected anomaly scenarios.","version":"1.0.0"},"paths":{"/ledger/network":{"get":{"tags":["ledger"],"summary":"Ledger Network","description":"Network revenue loss and its breakup, plus every feeder and substation that sums to it.","operationId":"ledger_network_ledger_network_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/ledger/feeders/{feeder_id}":{"get":{"tags":["ledger"],"summary":"Ledger Feeder","description":"One feeder, split into line, HT consumers and every transformer. Parts add to the feeder.","operationId":"ledger_feeder_ledger_feeders__feeder_id__get","parameters":[{"name":"feeder_id","in":"path","required":true,"schema":{"type":"string","title":"Feeder Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/ledger/nodes/{node_id}/consumers":{"get":{"tags":["ledger"],"summary":"Ledger Node Consumers","description":"The meters behind one transformer (or the HT consumers on a feeder), with the loss each owns.","operationId":"ledger_node_consumers_ledger_nodes__node_id__consumers_get","parameters":[{"name":"node_id","in":"path","required":true,"schema":{"type":"string","title":"Node Id"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":500,"minimum":1,"default":60,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/energy/flow":{"get":{"tags":["network"],"summary":"Energy Flow","description":"Generation to revenue as nodes and links, with the conservation checks that prove it.","operationId":"energy_flow_energy_flow_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/data/tables":{"get":{"tags":["data"],"summary":"Data Tables","operationId":"data_tables_data_tables_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/data/tables/{name}":{"get":{"tags":["data"],"summary":"Data Table","operationId":"data_table_data_tables__name__get","parameters":[{"name":"name","in":"path","required":true,"schema":{"type":"string","title":"Name"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"default":0,"title":"Offset"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":500,"minimum":1,"default":50,"title":"Limit"}},{"name":"search","in":"query","required":false,"schema":{"type":"string","default":"","title":"Search"}},{"name":"sort","in":"query","required":false,"schema":{"type":"string","default":"","title":"Sort"}},{"name":"descending","in":"query","required":false,"schema":{"type":"boolean","default":false,"title":"Descending"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/data/tables/{name}/download":{"get":{"tags":["data"],"summary":"Data Download","operationId":"data_download_data_tables__name__download_get","parameters":[{"name":"name","in":"path","required":true,"schema":{"type":"string","title":"Name"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/forecast/overview":{"get":{"tags":["forecast"],"summary":"Forecast Overview","description":"Headline KPIs, accuracy summary, top congestion, top growth and cost of forecast error. Computed lazily once, then memoised.","operationId":"forecast_overview_forecast_overview_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/forecast/series":{"get":{"tags":["forecast"],"summary":"Forecast Series","description":"Hourly history, 168 h forecast with 80% band, the capacity line and the backtest forecast for the last week, all in kW of metered demand.\n\nThe capacity line is given twice: as rated kW and as 'metered-equivalent kW' (rating divided by k), which is\nthe rating expressed on the same metered basis as the plotted series.","operationId":"forecast_series_forecast_series_get","parameters":[{"name":"level","in":"query","required":false,"schema":{"type":"string","pattern":"^(substation|feeder|dt|category)$","default":"feeder","title":"Level"}},{"name":"node_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Node Id"}},{"name":"history_hours","in":"query","required":false,"schema":{"type":"integer","maximum":1440,"minimum":24,"default":168,"title":"History Hours"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/forecast/accuracy":{"get":{"tags":["forecast"],"summary":"Forecast Accuracy","description":"Rolling-origin backtest (train before the final 168 h, test on it) per level and horizon bucket, model versus seasonal-naive baselines.","operationId":"forecast_accuracy_forecast_accuracy_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/forecast/congestion":{"get":{"tags":["forecast"],"summary":"Forecast Congestion","description":"Ranked congestion watchlist for the next 7 days: overload probability, expected overload hours, first breach, peak loading with 80% band, action and owner.","operationId":"forecast_congestion_forecast_congestion_get","parameters":[{"name":"level","in":"query","required":false,"schema":{"type":"string","pattern":"^(all|substation|feeder|dt)$","default":"all","title":"Level"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":200,"minimum":1,"default":15,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/forecast/growth":{"get":{"tags":["forecast"],"summary":"Forecast Growth","description":"Augmentation priority list: robust (Theil-Sen) trend of daily peak demand projected 90 days ahead with an uncertainty band, flagged against rated capacity.","operationId":"forecast_growth_forecast_growth_get","parameters":[{"name":"level","in":"query","required":false,"schema":{"type":"string","pattern":"^(all|feeder|dt)$","default":"all","title":"Level"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":200,"minimum":1,"default":15,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/supply/renewables/overview":{"get":{"tags":["supply"],"summary":"Renewables Overview","description":"Headline accuracy, DSM and variability figures for renewable generation (final-7-day backtest, 15-minute blocks).","operationId":"renewables_overview_supply_renewables_overview_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/supply/renewables/forecast":{"get":{"tags":["supply"],"summary":"Renewables Forecast","description":"Day-ahead forecast for one source type: actual versus model, persistence and same-time-yesterday on a test day,\nthe DSM tolerance band around the schedule, and a recursive forward forecast of `hours` hours.","operationId":"renewables_forecast_supply_renewables_forecast_get","parameters":[{"name":"source_type","in":"query","required":false,"schema":{"type":"string","description":"SOLAR, WIND, HYDRO, SMALL_HYDRO or BIOMASS","default":"SOLAR","title":"Source Type"},"description":"SOLAR, WIND, HYDRO, SMALL_HYDRO or BIOMASS"},{"name":"hours","in":"query","required":false,"schema":{"type":"integer","maximum":168,"minimum":24,"description":"Hours of forward forecast beyond the data","default":96,"title":"Hours"},"description":"Hours of forward forecast beyond the data"},{"name":"day","in":"query","required":false,"schema":{"type":"integer","maximum":6,"minimum":0,"description":"Backtest day to chart (0-6)","default":6,"title":"Day"},"description":"Backtest day to chart (0-6)"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/supply/renewables/dsm":{"get":{"tags":["supply"],"summary":"Renewables Dsm","description":"DSM deviation energy and penalty exposure (Rs) for the test week and annualised, by source type and fleet, for the\nmodel, the flat persistence schedule and the same-time-yesterday schedule; plus the corrective schedule revision table.","operationId":"renewables_dsm_supply_renewables_dsm_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/supply/renewables/variability":{"get":{"tags":["supply"],"summary":"Renewables Variability","description":"Ramp rates (p95 MW per 15 minutes), coefficient of variation, capacity factor, renewable share of generation by hour\nof day, and the residual (net) load profile with wind and solar removed.","operationId":"renewables_variability_supply_renewables_variability_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/supply/load-shedding/scenario":{"get":{"tags":["supply"],"summary":"Loadshed Scenario","description":"Optimise load curtailment for a supply shortfall in a window of the next day and compare it with blind rotation.\nReturns demand profile, feeder x hour schedules (kW and on/off), rotation baseline, comparison metrics, feasibility and rationale.\nThe default scenario is memoised; others are solved on request (MILP, 1 s limit).","operationId":"loadshed_scenario_supply_load_shedding_scenario_get","parameters":[{"name":"shortfall_pct","in":"query","required":false,"schema":{"type":"number","maximum":25,"minimum":0,"description":"Supply shortfall as percent of demand","default":8.0,"title":"Shortfall Pct"},"description":"Supply shortfall as percent of demand"},{"name":"start_hour","in":"query","required":false,"schema":{"type":"integer","maximum":23,"minimum":0,"description":"First hour of the window (hour of day, next day)","default":18,"title":"Start Hour"},"description":"First hour of the window (hour of day, next day)"},{"name":"duration_h","in":"query","required":false,"schema":{"type":"integer","maximum":24,"minimum":1,"description":"Window length in hours","default":4,"title":"Duration H"},"description":"Window length in hours"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/supply/load-shedding/critical-loads":{"get":{"tags":["supply"],"summary":"Loadshed Critical Loads","description":"Synthetic critical-load register (hospitals, water works, traction, telecom) by feeder, sized against real feeder demand.","operationId":"loadshed_critical_loads_supply_load_shedding_critical_loads_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/assets/failure-risk":{"get":{"tags":["assets"],"summary":"Failure Risk","description":"Transformers ranked by expected cost avoided: calibrated probability of failure within 30 days,\nrisk band, likely mode, top driver in words, expected cost (Rs), recommended action, owner and timeframe.\nFailure labels are synthetic (see `note`). Filters: band, feeder_id, mode, min_probability.","operationId":"failure_risk_assets_failure_risk_get","parameters":[{"name":"band","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"HIGH, MEDIUM or LOW","title":"Band"},"description":"HIGH, MEDIUM or LOW"},{"name":"feeder_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Feeder Id"}},{"name":"mode","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"WINDING_OVERHEATING, BUSHING_OIL, MECHANICAL_VIBRATION, OVERLOAD","title":"Mode"},"description":"WINDING_OVERHEATING, BUSHING_OIL, MECHANICAL_VIBRATION, OVERLOAD"},{"name":"min_probability","in":"query","required":false,"schema":{"type":"number","maximum":1.0,"minimum":0.0,"default":0.0,"title":"Min Probability"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":200,"minimum":1,"default":50,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/assets/failure-risk/{dt_id}":{"get":{"tags":["assets"],"summary":"Failure Risk Detail","description":"One transformer: probability, band, drivers in words (top three, from tree contributions of the fold model that did not\ntrain on this unit), recommended action, cost build-up, engineered features against the fleet median and the daily signal\nhistory (hotspot rise, winding temperature, vibration) with the fleet median.","operationId":"failure_risk_detail_assets_failure_risk__dt_id__get","parameters":[{"name":"dt_id","in":"path","required":true,"schema":{"type":"string","title":"Dt Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/assets/failure-evaluation":{"get":{"tags":["assets"],"summary":"Failure Evaluation","description":"Honest evaluation of the failure model: pooled out-of-fold and strict time-split ROC-AUC, PR-AUC, precision and recall at\nK = 5 and 10, Brier score against the base rate, reliability bins, lead time, bootstrap interval, and the comparison with a\nhotspot threshold and with the existing condition score. Labels are synthetic.","operationId":"failure_evaluation_assets_failure_evaluation_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/leakage/summary":{"get":{"tags":["leakage"],"summary":"Leakage Summary","description":"Meter -> bill -> cash reconciliation for the network, by feeder and by consumer category (kWh and Rs, 60-day window),\nthe leakage breakdown by type, and the tie-out to the core ledger (`tie_out.reconciles_to_ledger` and the difference per\nbucket). Billing and collection totals equal the ledger buckets.","operationId":"leakage_summary_leakage_summary_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/leakage/accounts":{"get":{"tags":["leakage"],"summary":"Leakage Accounts","description":"Accounts ranked by expected leakage in Rs: leakage probability, estimated Rs for the 60-day window and annualised,\nplain-language reason, recommended action and owner. Filter by leakage type and feeder.","operationId":"leakage_accounts_leakage_accounts_get","parameters":[{"name":"type","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"BILLING_MISMATCH, STOPPED_METER, TARIFF_MISMATCH, COLLECTION or UNMETERED","title":"Type"},"description":"BILLING_MISMATCH, STOPPED_METER, TARIFF_MISMATCH, COLLECTION or UNMETERED"},{"name":"feeder_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Feeder Id"}},{"name":"flagged_only","in":"query","required":false,"schema":{"type":"boolean","description":"Only accounts with leakage probability of at least 0.5 on some type","default":true,"title":"Flagged Only"},"description":"Only accounts with leakage probability of at least 0.5 on some type"},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":500,"minimum":1,"default":100,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/leakage/accounts/{consumer_id}":{"get":{"tags":["leakage"],"summary":"Leakage Account Detail","description":"One account: leakage scores per type, every flagged reason, and the bill-by-bill reconciliation\n(metered, billed, collected, status, days to pay, dispute, flags).","operationId":"leakage_account_detail_leakage_accounts__consumer_id__get","parameters":[{"name":"consumer_id","in":"path","required":true,"schema":{"type":"string","title":"Consumer Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/leakage/evaluation":{"get":{"tags":["leakage"],"summary":"Leakage Evaluation","description":"Out-of-fold evaluation against ground_truth BILLING_MISMATCH and METER_FAILURE: precision@K, recall, ROC-AUC, PR-AUC,\nthe Rs found in the top 100 against the total, the naive ratio rule (billed/metered < 0.92) side by side, a no-ratio variant,\ncalibration bins and limitations. Ground truth is used only as the evaluation target.","operationId":"leakage_evaluation_leakage_evaluation_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/submission/dataset":{"get":{"tags":["submission"],"summary":"Submission Dataset","description":"Dataset description: source, size, key features, composition and limitations.","operationId":"submission_dataset_submission_dataset_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/submission/testing":{"get":{"tags":["submission"],"summary":"Submission Testing","description":"Testing report: accuracy per module with baselines, performance on the target host, and automated-test inventory.","operationId":"submission_testing_submission_testing_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/submission/documentation":{"get":{"tags":["submission"],"summary":"Submission Documentation","description":"Documentation pack: approach, technical implementation, tools and APIs, data-privacy compliance.","operationId":"submission_documentation_submission_documentation_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/submission/all":{"get":{"tags":["submission"],"summary":"Submission All","description":"Dataset, testing report and documentation in one response.","operationId":"submission_all_submission_all_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/submission/ai-engine":{"get":{"tags":["submission"],"summary":"Submission Ai Engine","description":"Inventory of every model: technique, inputs, outputs, how much is learned, human role; plus the Responsible AI framework.","operationId":"submission_ai_engine_submission_ai_engine_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/submission/checklist":{"get":{"tags":["submission"],"summary":"Submission Checklist","description":"Challenge requirements and judging criteria mapped to evidence in the product, with gaps stated.","operationId":"submission_checklist_submission_checklist_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/copilot/ask":{"post":{"tags":["copilot"],"summary":"Copilot Ask","description":"Ask a question about the current dataset.\n\nGrounded by construction: the question is parsed into an intent, the intent\nis answered by calling the same analytics layer that produces the screens,\nand the response carries a ``trace`` naming the query and the figures read.\nAn LLM may rephrase the finished answer but never supplies a number, and\nnone is required.","operationId":"copilot_ask_copilot_ask_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AskRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/copilot/selftest":{"get":{"tags":["copilot"],"summary":"Copilot Selftest","description":"One small live call to the model, to show whether key, model name and tool calling work, or the provider's error.","operationId":"copilot_selftest_copilot_selftest_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/copilot/status":{"get":{"tags":["copilot"],"summary":"Copilot Status","description":"Whether the optional language-model pass is configured.","operationId":"copilot_status_copilot_status_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/health":{"get":{"tags":["system"],"summary":"Health","operationId":"health_health_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/overview":{"get":{"tags":["dashboard"],"summary":"Overview","description":"Command-centre KPIs: network, energy, risk and data-quality blocks.","operationId":"overview_overview_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/feeders":{"get":{"tags":["feeders"],"summary":"Feeders","operationId":"feeders_feeders_get","parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":200,"minimum":1,"default":50,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/feeders/{feeder_id}":{"get":{"tags":["feeders"],"summary":"Feeder","operationId":"feeder_feeders__feeder_id__get","parameters":[{"name":"feeder_id","in":"path","required":true,"schema":{"type":"string","title":"Feeder Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/feeders/{feeder_id}/diagnosis":{"get":{"tags":["feeders"],"summary":"Feeder Diagnosis","description":"Why this feeder specifically is losing energy, and what to do about it.\n\n\"Technical loss is high\" is not actionable. This names the transformers and\nmeters responsible, in kWh and rupees, with the owner and the timeframe.","operationId":"feeder_diagnosis_feeders__feeder_id__diagnosis_get","parameters":[{"name":"feeder_id","in":"path","required":true,"schema":{"type":"string","title":"Feeder Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/feeders/{feeder_id}/trend":{"get":{"tags":["feeders"],"summary":"Feeder Trend","operationId":"feeder_trend_feeders__feeder_id__trend_get","parameters":[{"name":"feeder_id","in":"path","required":true,"schema":{"type":"string","title":"Feeder Id"}},{"name":"days","in":"query","required":false,"schema":{"type":"integer","maximum":400,"minimum":1,"default":90,"title":"Days"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/dts":{"get":{"tags":["distribution transformers"],"summary":"Dts","operationId":"dts_dts_get","parameters":[{"name":"feeder_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Feeder Id"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":500,"minimum":1,"default":200,"title":"Limit"}},{"name":"min_risk","in":"query","required":false,"schema":{"type":"number","maximum":100.0,"minimum":0.0,"default":0.0,"title":"Min Risk"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/dts/{dt_id}":{"get":{"tags":["distribution transformers"],"summary":"Dt","operationId":"dt_dts__dt_id__get","parameters":[{"name":"dt_id","in":"path","required":true,"schema":{"type":"string","title":"Dt Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/dts/{dt_id}/trend":{"get":{"tags":["distribution transformers"],"summary":"Dt Trend","operationId":"dt_trend_dts__dt_id__trend_get","parameters":[{"name":"dt_id","in":"path","required":true,"schema":{"type":"string","title":"Dt Id"}},{"name":"days","in":"query","required":false,"schema":{"type":"integer","maximum":400,"minimum":1,"default":90,"title":"Days"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/investigations":{"get":{"tags":["investigations"],"summary":"Investigations","description":"The ranked queue - the actual product output for a field team.","operationId":"investigations_investigations_get","parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":500,"minimum":1,"default":50,"title":"Limit"}},{"name":"min_risk","in":"query","required":false,"schema":{"type":"number","maximum":100.0,"minimum":0.0,"default":0.0,"title":"Min Risk"}},{"name":"feeder_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Feeder Id"}},{"name":"dt_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Dt Id"}},{"name":"priority","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Priority"}},{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Status"}},{"name":"owner","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Owner"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/investigations/{consumer_id}":{"get":{"tags":["investigations"],"summary":"Investigation","operationId":"investigation_investigations__consumer_id__get","parameters":[{"name":"consumer_id","in":"path","required":true,"schema":{"type":"string","title":"Consumer Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"patch":{"tags":["investigations"],"summary":"Update Case","operationId":"update_case_investigations__consumer_id__patch","parameters":[{"name":"consumer_id","in":"path","required":true,"schema":{"type":"string","title":"Consumer Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CaseUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/investigations/{consumer_id}/feedback":{"post":{"tags":["investigations"],"summary":"Add Feedback","description":"Capture what the field visit found. This is the loop the pilot needs.","operationId":"add_feedback_investigations__consumer_id__feedback_post","parameters":[{"name":"consumer_id","in":"path","required":true,"schema":{"type":"string","title":"Consumer Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Feedback"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/feedback":{"get":{"tags":["investigations"],"summary":"Feedback","operationId":"feedback_feedback_get","parameters":[{"name":"consumer_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Consumer Id"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":1000,"minimum":1,"default":200,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/outcomes":{"get":{"tags":["investigations"],"summary":"Outcomes","operationId":"outcomes_outcomes_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/consumers/{consumer_id}/profile":{"get":{"tags":["consumers"],"summary":"Consumer Profile","operationId":"consumer_profile_consumers__consumer_id__profile_get","parameters":[{"name":"consumer_id","in":"path","required":true,"schema":{"type":"string","title":"Consumer Id"}},{"name":"days","in":"query","required":false,"schema":{"type":"integer","maximum":400,"minimum":1,"default":90,"title":"Days"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/consumers/{consumer_id}/peers":{"get":{"tags":["consumers"],"summary":"Consumer Peers","operationId":"consumer_peers_consumers__consumer_id__peers_get","parameters":[{"name":"consumer_id","in":"path","required":true,"schema":{"type":"string","title":"Consumer Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/consumers/{consumer_id}/events":{"get":{"tags":["consumers"],"summary":"Consumer Events","operationId":"consumer_events_consumers__consumer_id__events_get","parameters":[{"name":"consumer_id","in":"path","required":true,"schema":{"type":"string","title":"Consumer Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/evaluation":{"get":{"tags":["evaluation"],"summary":"Evaluation","operationId":"evaluation_evaluation_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/evaluation/curve":{"get":{"tags":["evaluation"],"summary":"Evaluation Curve","operationId":"evaluation_curve_evaluation_curve_get","parameters":[{"name":"max_k","in":"query","required":false,"schema":{"type":"integer","maximum":1000,"minimum":20,"default":200,"title":"Max K"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/success-tests":{"get":{"tags":["evaluation"],"summary":"Success Tests","operationId":"success_tests_success_tests_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/data-quality":{"get":{"tags":["system"],"summary":"Data Quality","operationId":"data_quality_data_quality_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/contracts":{"get":{"tags":["system"],"summary":"Contracts","description":"The schema a DISCOM / IES-compatible feed has to satisfy.","operationId":"contracts_contracts_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/ingest/validate":{"post":{"tags":["system"],"summary":"Ingest Validate","description":"Dry-run a candidate data source against the contracts.\n\nThis is what makes the IES integration story concrete: a utility posts its\nown extract, the platform reports exactly which contract violations would\nblock onboarding, and nothing is written until they are fixed.","operationId":"ingest_validate_ingest_validate_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/IngestPayload"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/assets/maintenance":{"get":{"tags":["assets"],"summary":"Assets Maintenance","description":"Predictive maintenance: which transformer is degrading, and by when.\n\nReads IoT/SCADA condition telemetry rather than a fixed schedule, and\nnormalises temperature for duty so a busy week is not called degradation.","operationId":"assets_maintenance_assets_maintenance_get","parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":200,"minimum":1,"default":40,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/inspection/triage":{"get":{"tags":["assets"],"summary":"Inspection Triage","description":"Which line to inspect next, and which defect to fix first.","operationId":"inspection_triage_inspection_triage_get","parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"default":20,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/collections/risk":{"get":{"tags":["collections"],"summary":"Collections Risk","description":"Propensity to pay, receivables segments and the action for each.","operationId":"collections_risk_collections_risk_get","parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":200,"minimum":1,"default":40,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/subsidy/reconciliation":{"get":{"tags":["collections"],"summary":"Subsidy Reconciliation","description":"Authorised consumption against subsidy disbursed, with chain verification.","operationId":"subsidy_reconciliation_subsidy_reconciliation_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/network/load-transfer":{"get":{"tags":["network"],"summary":"Network Load Transfer","description":"Where a hot feeder could shed load, and the I2R that saves.","operationId":"network_load_transfer_network_load_transfer_get","parameters":[{"name":"feeder_id","in":"query","required":true,"schema":{"type":"string","description":"e.g. F003","title":"Feeder Id"},"description":"e.g. F003"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/loss/breakdown":{"get":{"tags":["dashboard"],"summary":"Loss Breakdown","description":"Technical, commercial, billing and collection loss, kept distinct.\n\nEach of these is a different quantity with a different denominator, so\ncollapsing them into one AT&C headline is what makes a loss figure\nunactionable. The response carries the identity check that lets a reader\nconfirm the arithmetic independently.","operationId":"loss_breakdown_loss_breakdown_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/generation/conventional":{"get":{"tags":["network"],"summary":"Generation Conventional","description":"The conventional fleet, decomposed. Shares sum to 100% by construction.","operationId":"generation_conventional_generation_conventional_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/network/topology":{"get":{"tags":["network"],"summary":"Network Topology","description":"The asset hierarchy: substations, feeds and the voltage ladder.","operationId":"network_topology_network_topology_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/generation/mix":{"get":{"tags":["network"],"summary":"Generation Mix","description":"Conventional and renewable circuits, by capacity and by actual output.","operationId":"generation_mix_generation_mix_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/generation/renewable-profile":{"get":{"tags":["network"],"summary":"Renewable Profile","description":"Renewable output shape over the day - the forecasting target.\n\nSolar is zero overnight by construction, so the ramp a forecaster has to\npredict is a real one rather than a smooth synthetic curve.","operationId":"renewable_profile_generation_renewable_profile_get","parameters":[{"name":"source_type","in":"query","required":false,"schema":{"type":"string","default":"SOLAR","title":"Source Type"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/network/congestion":{"get":{"tags":["network"],"summary":"Network Congestion","description":"Where the network is running hot, by feeder and transformer.","operationId":"network_congestion_network_congestion_get","parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":200,"minimum":1,"default":20,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/energy/balance":{"get":{"tags":["network"],"summary":"Energy Balance","description":"The whole chain in one place: generation down to energy collected.\n\nEvery stage must be non-increasing downwards. If it is not, something is\nbeing counted twice and every published loss figure is wrong.","operationId":"energy_balance_energy_balance_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/model/features":{"get":{"tags":["evaluation"],"summary":"Model Features","description":"Which signals the supervised model actually leans on.","operationId":"model_features_model_features_get","parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":40,"minimum":1,"default":12,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}}},"components":{"schemas":{"AskRequest":{"properties":{"question":{"type":"string","maxLength":500,"minLength":2,"title":"Question"}},"type":"object","required":["question"],"title":"AskRequest"},"CaseUpdate":{"properties":{"status":{"type":"string","title":"Status","description":"Open | Assigned | Inspection scheduled | In progress | Resolved | Closed - no action"},"assigned_to":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Assigned To"}},"type":"object","required":["status"],"title":"CaseUpdate"},"Feedback":{"properties":{"outcome":{"type":"string","title":"Outcome","description":"What the field team actually found"},"confirmed_cause":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Confirmed Cause"},"recovered_kwh":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Recovered Kwh"},"recovered_amount":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Recovered Amount"},"inspector":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Inspector"},"note":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Note"},"status":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Status"},"event_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Event Id"}},"type":"object","required":["outcome"],"title":"Feedback"},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"IngestPayload":{"properties":{"datasets":{"additionalProperties":true,"type":"object","title":"Datasets","description":"dataset name -> list of records"}},"type":"object","required":["datasets"],"title":"IngestPayload","description":"Validate an IES-style upload without persisting it."},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"},"input":{"title":"Input"},"ctx":{"type":"object","title":"Context"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"}}}}