> ## Documentation Index
> Fetch the complete documentation index at: https://docs.energy.nlead.ch/llms.txt
> Use this file to discover all available pages before exploring further.

# Submit the portfolio forecast for one delivery day

> Validates the day's series and acknowledges immediately, echoing the
daily totals in MWh as a plausibility check.

One call covers one delivery day. Re-submitting the same day
**replaces** the previous submission and everything downstream re-runs
automatically; sending an identical payload changes nothing (same
`input_hash`), so retries are safe.

Set `validate_only: true` to run the full validation **without storing
anything** - the safe way to test the integration against the live
service. The response then carries `status: "validated"`. Calls made
with a **sandbox key** behave as if `validate_only` were set, whatever
the payload says.



## OpenAPI

````yaml /api-reference/openapi.json post /v1/forecasts
openapi: 3.1.0
info:
  title: n:lead Scheduling Bridge — Data Delivery API
  version: 0.4.0
  description: >-
    API for delivering portfolio data to the n:lead scheduling bridge. Send a
    portfolio forecast per delivery day, or — if no forecast is available — the
    market-location master data, metered data and rolled-out profiles the bridge
    needs to build the consumption forecast for you. Everything downstream
    (positions, trader handoff, schedule submission to the TSOs) is operated by
    n:lead. A read-only status endpoint reports the BRP activation state per
    DSO/MGA.
servers:
  - url: >-
      https://nleadbridge-app.lemonisland-7d6503d3.germanywestcentral.azurecontainerapps.io
    description: Deployed service
  - url: http://localhost:8000
    description: Local development
security: []
paths:
  /v1/forecasts:
    post:
      summary: Submit the portfolio forecast for one delivery day
      description: |-
        Validates the day's series and acknowledges immediately, echoing the
        daily totals in MWh as a plausibility check.

        One call covers one delivery day. Re-submitting the same day
        **replaces** the previous submission and everything downstream re-runs
        automatically; sending an identical payload changes nothing (same
        `input_hash`), so retries are safe.

        Set `validate_only: true` to run the full validation **without storing
        anything** - the safe way to test the integration against the live
        service. The response then carries `status: "validated"`. Calls made
        with a **sandbox key** behave as if `validate_only` were set, whatever
        the payload says.
      operationId: post_forecast_v1_forecasts_post
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ForecastRequest'
        required: true
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ForecastAck'
        '401':
          description: Missing, wrong or expired credential.
        '413':
          description: Body larger than the request-size limit.
        '422':
          description: >-
            Validation failure. `detail` names the offending series/entry and
            the rule it broke - see the troubleshooting page for every message
            and its fix.
        '429':
          description: >-
            Rate limit exceeded - retry after the number of seconds in the
            `Retry-After` header.
      security:
        - APIKeyHeader: []
        - HTTPBearer: []
components:
  schemas:
    ForecastRequest:
      properties:
        delivery_day:
          type: string
          format: date
          title: Delivery Day
          description: >-
            The day the energy is delivered (`YYYY-MM-DD`, a Europe/Berlin
            calendar day)
        unit:
          type: string
          enum:
            - MW
            - MWH
          title: Unit
          description: >-
            `MW`: average power per quarter-hour (default). `MWH`: energy per
            quarter-hour
          default: MW
        series:
          items:
            $ref: '#/components/schemas/ForecastSeries'
          type: array
          minItems: 1
          title: Series
          description: >-
            The day's series. Several series per area and kind are allowed and
            summed; omitted control areas count as zero
        malo_mapping:
          anyOf:
            - patternProperties:
                ^\d{11}$:
                  $ref: '#/components/schemas/ControlArea'
              type: object
            - type: 'null'
          title: Malo Mapping
          description: >-
            MaLo -> control area mapping; required if any series is tagged by
            MaLo
        validate_only:
          type: boolean
          title: Validate Only
          description: >-
            True runs the full validation and returns the acknowledgment with
            its totals - but stores nothing and starts nothing. Safe for
            integration testing against the live service; the returned
            `input_hash` equals the one a real submission of the same payload
            would get
          default: false
      type: object
      required:
        - delivery_day
        - series
      title: ForecastRequest
      description: |-
        Portfolio forecast for one delivery day: production and consumption
        time series per control area (or per market location).
      example:
        delivery_day: '2026-09-01'
        series:
          - control_area: TenneT
            kind: production
            values:
              - 0.5
              - 0.5
              - 0.5
              - 0.5
              - 0.5
              - 0.5
              - 0.5
              - 0.5
              - 0.5
              - 0.5
              - 0.5
              - 0.5
              - 0.5
              - 0.5
              - 0.5
              - 0.5
              - 0.5
              - 0.5
              - 0.5
              - 0.5
              - 0.5
              - 0.5
              - 0.5
              - 0.5
              - 0.5
              - 0.6
              - 0.7
              - 0.8
              - 0.9
              - 1
              - 1.1
              - 1.2
              - 1.3
              - 1.4
              - 1.5
              - 1.6
              - 1.7
              - 1.8
              - 1.9
              - 2
              - 2.1
              - 2.2
              - 2.3
              - 2.4
              - 2.5
              - 2.6
              - 2.7
              - 2.8
              - 2.9
              - 3
              - 3.1
              - 3.2
              - 3.3
              - 3.2
              - 3.1
              - 3
              - 2.9
              - 2.8
              - 2.7
              - 2.6
              - 2.5
              - 2.4
              - 2.3
              - 2.2
              - 2.1
              - 2
              - 1.9
              - 1.8
              - 1.7
              - 1.6
              - 1.5
              - 1.4
              - 1.3
              - 1.2
              - 1.1
              - 1
              - 0.9
              - 0.8
              - 0.7
              - 0.6
              - 0.5
              - 0.5
              - 0.5
              - 0.5
              - 0.5
              - 0.5
              - 0.5
              - 0.5
              - 0.5
              - 0.5
              - 0.5
              - 0.5
              - 0.5
              - 0.5
              - 0.5
              - 0.5
          - control_area: TenneT
            kind: consumption
            values:
              - 1.2
              - 1.2
              - 1.2
              - 1.2
              - 1.2
              - 1.2
              - 1.2
              - 1.2
              - 1.2
              - 1.2
              - 1.2
              - 1.2
              - 1.2
              - 1.2
              - 1.2
              - 1.2
              - 1.2
              - 1.2
              - 1.2
              - 1.2
              - 1.2
              - 1.2
              - 1.2
              - 1.2
              - 1.2
              - 1.2
              - 1.2
              - 1.2
              - 1.2
              - 1.2
              - 1.2
              - 1.2
              - 1.2
              - 1.2
              - 1.2
              - 1.2
              - 1.2
              - 1.2
              - 1.2
              - 1.2
              - 1.2
              - 1.2
              - 1.2
              - 1.2
              - 1.2
              - 1.2
              - 1.2
              - 1.2
              - 1.2
              - 1.2
              - 1.2
              - 1.2
              - 1.2
              - 1.23
              - 1.26
              - 1.29
              - 1.32
              - 1.35
              - 1.38
              - 1.41
              - 1.44
              - 1.47
              - 1.5
              - 1.53
              - 1.56
              - 1.59
              - 1.62
              - 1.65
              - 1.68
              - 1.71
              - 1.74
              - 1.77
              - 1.8
              - 1.77
              - 1.74
              - 1.71
              - 1.68
              - 1.65
              - 1.62
              - 1.59
              - 1.56
              - 1.53
              - 1.5
              - 1.47
              - 1.44
              - 1.41
              - 1.38
              - 1.35
              - 1.32
              - 1.29
              - 1.26
              - 1.23
              - 1.2
              - 1.2
              - 1.2
              - 1.2
        unit: MW
        validate_only: true
    ForecastAck:
      properties:
        delivery_day:
          type: string
          format: date
          title: Delivery Day
        interval_count:
          type: integer
          title: Interval Count
          description: Quarter-hours the delivery day has (96 / 92 / 100)
        series_received:
          type: integer
          title: Series Received
        total_production_mwh:
          type: number
          title: Total Production Mwh
          description: >-
            Total production energy submitted for the delivery day, in MWh -
            compare against your own daily total as a plausibility check
        total_consumption_mwh:
          type: number
          title: Total Consumption Mwh
          description: >-
            Total consumption energy submitted for the delivery day, in MWh -
            compare against your own daily total as a plausibility check
        input_hash:
          type: string
          title: Input Hash
          description: >-
            Content hash of the submission - quote it when asking about a
            delivery day; identical payloads produce identical hashes
        status:
          type: string
          enum:
            - received
            - validated
          title: Status
          description: >-
            `received`: stored, the pipeline picks the day up. `validated`: the
            payload passed every check but nothing was stored (`validate_only`
            was true)
          default: received
      type: object
      required:
        - delivery_day
        - interval_count
        - series_received
        - total_production_mwh
        - total_consumption_mwh
        - input_hash
      title: ForecastAck
      description: |-
        Acknowledgment of an accepted forecast submission, including the
        total daily volumes as received and a reference for the submission.
      example:
        delivery_day: '2026-09-01'
        input_hash: 391597ffe339f0c056c28e317498bd0ae473cd5482…
        interval_count: 96
        series_received: 2
        status: received
        total_consumption_mwh: 65.588
        total_production_mwh: 69.968
    ForecastSeries:
      properties:
        kind:
          type: string
          enum:
            - production
            - consumption
          title: Kind
          description: >-
            What the series describes; production and consumption are always
            separate series, both sent as positive values
        control_area:
          anyOf:
            - $ref: '#/components/schemas/ControlArea'
            - type: 'null'
          description: >-
            Control area (Regelzone) the series is pre-aggregated for:
            `50Hertz`, `Amprion`, `TenneT` or `TransnetBW` (case-sensitive).
            Alternative to `malo` - set exactly one of the two
        malo:
          anyOf:
            - type: string
              pattern: ^\d{11}$
            - type: 'null'
          title: Malo
          description: >-
            Market location ID (MaLo) — exactly 11 digits. Requires a
            `malo_mapping` entry on the request. Alternative to `control_area` -
            set exactly one of the two
        values:
          items:
            type: number
          type: array
          title: Values
          description: >-
            One value per quarter-hour, local (Europe/Berlin) midnight to
            midnight: 96 values on a normal day, 92 on the spring-forward day,
            100 on the fall-back day
      type: object
      required:
        - kind
        - values
      title: ForecastSeries
      description: |-
        One forecast time series for the delivery day.

        Tag either with ``control_area`` (pre-aggregated input) or with ``malo``
        (a market location, resolved to a control area via ``malo_mapping`` on
        the request). Exactly one of the two must be set.
    ControlArea:
      type: string
      enum:
        - 50Hertz
        - Amprion
        - TenneT
        - TransnetBW
      title: ControlArea
      description: The four German TSO control areas (Regelzonen).
  securitySchemes:
    APIKeyHeader:
      type: apiKey
      in: header
      name: X-API-Key
    HTTPBearer:
      type: http
      description: OIDC access token (Auth0 M2M)
      scheme: bearer

````