Energy Model Response Contracts
This page documents the current public response contract for/energymodels,
including the saved-input update/rerun flow on existing rows.
POST /energymodels
Execution modes:
- Default (
asyncomitted or?async=false): synchronous attempt ?async=true: queued async execution- sync fan-out can also return a queued
200response when block work is queued before completion
output.queryis rejected with422.output.blockIndexis the canonical selected-block filter and preserves zero-based original block numbering in public responses.output.blockResultscontrolsblockTimeSeriesvisibility and is mutually exclusive withoutput.fullTimeSeries.output.lossBreakdownTimestampsis a top-level boolean again and implies block-level results are surfaced.- object-shaped
output.lossBreakdownTimestampsvalues are rejected with422. output.irradianceLossDetailis an additive annual-detail flag that may surfacelosses.irradianceLossDetaileven whenoutput.fullOutputis false.- Deprecated top-level
blockQuery+blockQueryIndexremain compatibility aliases to top-leveloutput.blockIndex; conflicting canonical and legacy block selectors return422.
200 OK
Sync-completed responses keep legacy-compatible top-level flattened result
sections.
titleenergyYieldSummarylocationSummaryplantSummarylossesblockSummarysettingsmonthlySummarytimeSeriesblockTimeSeries
blockTimeSeries notes:
- surfaced when block-level results are effectively requested by
output.blockResults=true,output.lossBreakdownTimestamps=true, or deprecated?blockresults=true - returns all available blocks when
output.blockIndexis omitted - returns only the selected block when
output.blockIndexis provided - preserves original zero-based block numbering in public keys
- timestamped loss breakdowns live under
blockTimeSeries[<blockIndex>].lossBreakdown blockTimeSeries[<blockIndex>].gridACPoweris the block inverter-output series after block-level (deprecated) AC losses only. When AC losses are configured throughplant.acChain, block-level AC losses are zero, so it equalsinverterOutACPowerand the block series sum to the plant potential inverter output (EOutInv). Plant-scope chain, auxiliary, availability, and POI-limit effects appear exclusively in the planttimeSeries— the sole post-limit surface.
- If the request uses
output.fullTimeSeries=true, the immediate sync POST response filterstimeSeriesback to:date,arraySTCDCPower,arrayDCPower,inverterOutACPower,gridACPower,poiACPower
- When
output.irradianceLossDetail=true, public responses may includelosses.irradianceLossDetailwithout requiringoutput.fullOutput=true. - The detail payload reports annual fractions on the same stage basis as the
scalar
losses.irradianceLossesentries. - Stage keys include
transpositionOnPoaLoss,farShadingLoss,nearShadingLoss,aoiIrradianceLoss,soilingIrradianceLoss, andgroundReflectedOnFront. - The component fields are
direct,circumsolar,diffuse, andalbedo.
200 OK (Queued)
Canonical taskDetails fields
Notes:
- Warnings are always exposed as strings.
- If runtime code generates structured warnings, the API surfaces only their
messagetext. - GET/list/detail task details are backed by persisted summary metadata for the run.
output.queryanddebug_blockare not supported on the public request surface; the API returns422and directs callers tooutput.blockIndex.
GET /energymodels
List responses remain a light flattened summary shape.
include=summaryis accepted as a no-op compatibility token on this endpoint.
GET /energymodels/{energy_model_id}
Default detail responses omit optional result sections unless requested with
include.
With include=summary,inputs,fulltimeseries,blocktimeseries, detail responses
can additionally expose:
titleenergyYieldSummarylocationSummaryplantSummarylossesblockSummarysettingsmonthlySummaryinputsnormalizedInputstimeSeriesblockTimeSeries
include=inputs, detail responses also expose the persisted saved input
JSON needed for edit/rerun workflows.
PUT /energymodels/{energy_model_id}
PUT /energymodels/{energy_model_id} accepts a full EnergyModelInput body,
replaces the saved input JSON on that same row, clears stale outputs, and
returns an EnergyModelDetailResponse.
Typical update response:
- This updates the existing energy-model row instead of creating a new one.
- The returned
inputspayload is the saved JSON after hydration/validation. - Rows in
pending,queued, orrunningstate return409 Conflict.
POST /energymodels/{energy_model_id}/run
POST /energymodels/{energy_model_id}/run executes the currently saved input
JSON on the same energy-model row in place.
Behavior:
?async=falseor omitted attempts sync execution first.?async=truequeues background execution and returns a queued200.- Multi-block reruns can still return queued
200fan-out responses from the sync path. - The response envelopes match
POST /energymodels, butenergyModelIdremains the existing row instead of a newly created row.
- Poll
GET /tasks/{task_id}usingtaskDetails.taskId. - Fetch final results from
GET /energymodels/{energy_model_id}. - The rerun updates the same saved row; it does not create a second model row.
Include token behavior
Legacy query parameters such as
summary and fullresults are rejected with
endpoint-specific 422 guidance.