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

# Put Master Data

> Mirror of the market locations' master data (GPKE/UTILMD content).



## OpenAPI

````yaml /api-reference/openapi.json put /v1/master-data
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/master-data:
    put:
      summary: Put Master Data
      description: Mirror of the market locations' master data (GPKE/UTILMD content).
      operationId: put_master_data_v1_master_data_put
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/MasterDataUpsertRequest'
        required: true
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MasterDataUpsertResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - APIKeyHeader: []
components:
  schemas:
    MasterDataUpsertRequest:
      properties:
        locations:
          items:
            $ref: '#/components/schemas/MarketLocationIn'
          type: array
          minItems: 1
          title: Locations
      type: object
      required:
        - locations
      title: MasterDataUpsertRequest
    MasterDataUpsertResponse:
      properties:
        upserted:
          type: integer
          title: Upserted
      type: object
      required:
        - upserted
      title: MasterDataUpsertResponse
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    MarketLocationIn:
      properties:
        malo:
          type: string
          pattern: ^\d{11}$
          title: Malo
          description: Market location ID (MaLo) — 11 digits
        slices:
          anyOf:
            - items:
                $ref: '#/components/schemas/MasterDataSliceIn'
              type: array
            - type: 'null'
          title: Slices
        control_area:
          anyOf:
            - $ref: '#/components/schemas/ControlArea'
            - type: 'null'
        mga:
          anyOf:
            - type: string
            - type: 'null'
          title: Mga
        metering_type:
          anyOf:
            - type: string
              enum:
                - profiled
                - quarter_hourly
            - type: 'null'
          title: Metering Type
        delivery_start:
          anyOf:
            - type: string
              format: date
            - type: 'null'
          title: Delivery Start
        delivery_end:
          anyOf:
            - type: string
              format: date
            - type: 'null'
          title: Delivery End
          description: Exclusive; null = open-ended
        profile_code:
          anyOf:
            - type: string
            - type: 'null'
          title: Profile Code
        annual_consumption_kwh:
          anyOf:
            - type: number
              minimum: 0
            - type: 'null'
          title: Annual Consumption Kwh
      type: object
      required:
        - malo
      title: MarketLocationIn
      description: >-
        Master data of one market location (UTILMD mirror), as time slices.


        Either send ``slices`` (the full form, supporting changes over time and

        supply gaps), or the flat fields for the simple case of one
        uninterrupted

        period — the flat form is shorthand for a single slice.
    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
    MasterDataSliceIn:
      properties:
        valid_from:
          type: string
          format: date
          title: Valid From
          description: First day this data applies (inclusive)
        valid_to:
          anyOf:
            - type: string
              format: date
            - type: 'null'
          title: Valid To
          description: First day it no longer applies (exclusive); null = open-ended
        active:
          type: boolean
          title: Active
          description: >-
            False marks a period without supply (de-registration); supply may
            resume with a later active slice
          default: true
        control_area:
          anyOf:
            - $ref: '#/components/schemas/ControlArea'
            - type: 'null'
        mga:
          anyOf:
            - type: string
            - type: 'null'
          title: Mga
          description: Metering grid area / Bilanzierungsgebiet
        metering_type:
          anyOf:
            - type: string
              enum:
                - profiled
                - quarter_hourly
            - type: 'null'
          title: Metering Type
        profile_code:
          anyOf:
            - type: string
            - type: 'null'
          title: Profile Code
          description: Load profile code (H0, G0, TLP code, ...)
        annual_consumption_kwh:
          anyOf:
            - type: number
              minimum: 0
            - type: 'null'
          title: Annual Consumption Kwh
          description: Jahresverbrauchsprognose in kWh
      type: object
      required:
        - valid_from
      title: MasterDataSliceIn
      description: |-
        Master data of a market location, valid for one period in time.

        Send one slice per change: supply start, a profile or balancing-regime
        change, a revised annual consumption forecast, a move to another
        metering grid area, or the end of supply (``active: false``). Slices
        that overlap stored ones win for their own window; the rest of the
        history is preserved.
    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

````