> ## 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.

# Post Forecast

> Submit the portfolio forecast for one delivery day.

The forecast is validated and acknowledged immediately. Re-submitting
for the same delivery day replaces the previous submission.



## 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.
servers:
  - url: https://{your-service-host}
    description: Deployed service
  - url: http://localhost:8000
    description: Local development
security: []
paths:
  /v1/forecasts:
    post:
      summary: Post Forecast
      description: |-
        Submit the portfolio forecast for one delivery day.

        The forecast is validated and acknowledged immediately. Re-submitting
        for the same delivery day replaces the previous submission.
      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'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - APIKeyHeader: []
components:
  schemas:
    ForecastRequest:
      properties:
        delivery_day:
          type: string
          format: date
          title: Delivery Day
        unit:
          type: string
          enum:
            - MW
            - MWH
          title: Unit
          default: MW
        series:
          items:
            $ref: '#/components/schemas/ForecastSeries'
          type: array
          minItems: 1
          title: Series
        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
      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).
    ForecastAck:
      properties:
        delivery_day:
          type: string
          format: date
          title: Delivery Day
        interval_count:
          type: integer
          title: Interval Count
        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
        total_consumption_mwh:
          type: number
          title: Total Consumption Mwh
          description: Total consumption energy submitted for the delivery day, in MWh
        input_hash:
          type: string
          title: Input Hash
          description: Content hash used for change detection
        status:
          type: string
          const: received
          title: Status
          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.
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    ForecastSeries:
      properties:
        kind:
          type: string
          enum:
            - production
            - consumption
          title: Kind
        control_area:
          anyOf:
            - $ref: '#/components/schemas/ControlArea'
            - type: 'null'
        malo:
          anyOf:
            - type: string
              pattern: ^\d{11}$
            - type: 'null'
          title: Malo
          description: Market location ID (MaLo) — 11 digits
        values:
          items:
            type: number
          type: array
          title: Values
          description: One value per quarter-hour, local midnight to midnight
      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.
    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
    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

````