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
- 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
| Field | Type | Description |
|---|---|---|
message | string | null | Run/task status message. |
taskId | integer | null | Workspace-scoped task index for /tasks/{task_id}. |
schemaMode | "legacy" | "multi_mppt" | "hybrid" | null | Detected input schema mode. |
executionMode | "sync_in_process" | "sync_fanout" | "async_fanout" | null | Run execution path. |
calculationTime | number | null | Runtime in seconds for completed runs. |
createdAtUtc | string | null | Resource creation timestamp (UTC ISO-8601). |
warnings | string[] | null | Human-readable warning messages. |
normalizationWarnings | string[] | null | Input-normalization warnings. |
- 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
| Endpoint | Allowed tokens | Current behavior |
|---|---|---|
GET /energymodels | summary | Accepted no-op compatibility token |
GET /energymodels/{energy_model_id} | summary, inputs, fulltimeseries, blocktimeseries | Gates optional detail sections |
PUT /energymodels/{energy_model_id} | none | Request body is the full saved input JSON |
POST /energymodels/{energy_model_id}/run | none | Runs the currently saved JSON in place |
POST /energymodels | none | Query-based include control is unsupported |
summary and fullresults are rejected with
endpoint-specific 422 guidance.