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

# Regelzonen, partners, contracts, customers and series

> The console's Marktrollen for the app: per Regelzone the BIKO, the
ÜNB and every Netzbetreiber with customers, an open point or a
contract not active, with their contracts' states, the customers by
group and per Zeitreihentyp its most pressing state. No Zählpunkt, no
note, no partner text. Shared between callers for 5 minutes.



## OpenAPI

````yaml /setup/internal-openapi.json get /v1/mobile/marktrollen
openapi: 3.1.0
info:
  title: n:lead Scheduling Bridge — Internal API
  version: 0.4.0
  description: >-
    Internal API of the n:lead scheduling bridge: the process endpoints that
    drive the day-ahead pipeline (aggregate, publish the open position, submit
    schedules, generate forecasts, orchestrate), the operator console endpoints,
    and the read-only operator-app endpoints under /v1/mobile. The process and
    console endpoints require the process API key, /v1/mobile a device key of
    the mobile scope; not for customer use.
servers:
  - url: https://{host}
    description: Deployed service
    variables:
      host:
        default: api.energy.nlead.ch
        description: >-
          The service hostname - n:lead provides it (see the Base URL on the API
          introduction page)
  - url: http://localhost:8000
    description: Local development
security: []
paths:
  /v1/mobile/marktrollen:
    get:
      tags:
        - mobile
      summary: Regelzonen, partners, contracts, customers and series
      description: |-
        The console's Marktrollen for the app: per Regelzone the BIKO, the
        ÜNB and every Netzbetreiber with customers, an open point or a
        contract not active, with their contracts' states, the customers by
        group and per Zeitreihentyp its most pressing state. No Zählpunkt, no
        note, no partner text. Shared between callers for 5 minutes.
      operationId: get_marktrollen_v1_mobile_marktrollen_get
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Marktrollen'
        '401':
          description: Missing or unknown device key.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MobileError'
        '403':
          description: A valid key of another scope - only device keys open /v1/mobile.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MobileError'
        '429':
          description: Rate limit exceeded; wait the seconds in `Retry-After`.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MobileError'
        '500':
          description: Unexpected server error.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MobileError'
        '503':
          description: MakoFlow could not be read; try again later.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MobileError'
      security:
        - APIKeyHeader: []
components:
  schemas:
    Marktrollen:
      properties:
        generated_at:
          type: string
          format: date-time
          title: Generated At
        bkv_mp_id:
          type: string
          title: Bkv Mp Id
        bkv_eic:
          type: string
          title: Bkv Eic
        lieferant_mp_id:
          type: string
          title: Lieferant Mp Id
        bilanzkreise:
          items:
            $ref: '#/components/schemas/BalanceGroup'
          type: array
          title: Bilanzkreise
        kunden:
          $ref: '#/components/schemas/CustomerGroups'
        zeitreihen:
          $ref: '#/components/schemas/SeriesCounts'
        vertraege:
          $ref: '#/components/schemas/ContractCounts'
        regelzonen:
          items:
            $ref: '#/components/schemas/RoleZone'
          type: array
          title: Regelzonen
      additionalProperties: false
      type: object
      required:
        - generated_at
        - bkv_mp_id
        - bkv_eic
        - lieferant_mp_id
        - bilanzkreise
        - kunden
        - zeitreihen
        - vertraege
        - regelzonen
      title: Marktrollen
    MobileError:
      properties:
        error:
          type: string
          enum:
            - unauthorized
            - forbidden
            - invalid_request
            - rate_limited
            - upstream_unavailable
            - internal
          title: Error
      additionalProperties: false
      type: object
      required:
        - error
      title: MobileError
      description: |-
        Every error under /v1/mobile: a code, nothing else - no detail text,
        no echo of the request.
    BalanceGroup:
      properties:
        eic:
          type: string
          title: Eic
        rolle:
          type: string
          enum:
            - haupt
            - unter
          title: Rolle
        name:
          type: string
          title: Name
        control_areas:
          items:
            type: string
            enum:
              - 50Hertz
              - Amprion
              - TenneT
              - TransnetBW
          type: array
          title: Control Areas
      additionalProperties: false
      type: object
      required:
        - eic
        - rolle
        - name
        - control_areas
      title: BalanceGroup
    CustomerGroups:
      properties:
        anzahl:
          type: integer
          title: Anzahl
        imsys:
          type: integer
          title: Imsys
          description: smart meter, quarter-hourly
        rlm:
          type: integer
          title: Rlm
          description: conventionally measured load profile
        slp:
          type: integer
          title: Slp
          description: standard load profile
        tlp:
          type: integer
          title: Tlp
          description: temperature-dependent profile
        ohne_typ:
          type: integer
          title: Ohne Typ
          description: the sheet names no usable type
      additionalProperties: false
      type: object
      required:
        - anzahl
        - imsys
        - rlm
        - slp
        - tlp
        - ohne_typ
      title: CustomerGroups
      description: Confirmed customers by how they are balanced.
    SeriesCounts:
      properties:
        erwartet:
          type: integer
          title: Erwartet
        aktiv:
          type: integer
          title: Aktiv
        fehlt:
          type: integer
          title: Fehlt
        unerwartet:
          type: integer
          title: Unerwartet
      additionalProperties: false
      type: object
      required:
        - erwartet
        - aktiv
        - fehlt
        - unerwartet
      title: SeriesCounts
      description: |-
        Sum time series of ours: expected (granted, expected on Regelzone
        level or needed for customers), of those active, of those missing for
        customers; and activations nobody asked for.
    ContractCounts:
      properties:
        angefragt:
          type: integer
          title: Angefragt
        aktiv:
          type: integer
          title: Aktiv
        gekuendigt:
          type: integer
          title: Gekuendigt
        fehlt:
          type: integer
          title: Fehlt
      additionalProperties: false
      type: object
      required:
        - angefragt
        - aktiv
        - gekuendigt
        - fehlt
      title: ContractCounts
    RoleZone:
      properties:
        control_area:
          type: string
          enum:
            - 50Hertz
            - Amprion
            - TenneT
            - TransnetBW
          title: Control Area
        aktiv:
          type: boolean
          title: Aktiv
          description: schedules run for this Regelzone
        uenb:
          type: string
          title: Uenb
          description: the ÜNB's name
        biko:
          type: string
          title: Biko
          description: the BIKO's name
        bilanzkreisvertrag:
          anyOf:
            - type: string
              enum:
                - angefragt
                - aktiv
                - gekuendigt
                - fehlt
            - type: 'null'
          title: Bilanzkreisvertrag
        kunden:
          $ref: '#/components/schemas/CustomerGroups'
        zeitreihen:
          $ref: '#/components/schemas/SeriesCounts'
        partner:
          items:
            $ref: '#/components/schemas/RoleParty'
          type: array
          title: Partner
          description: >-
            BIKO, ÜNB, then every Netzbetreiber with customers, an open point or
            a contract not active - open points first
        weitere:
          type: integer
          title: Weitere
          description: 'Netzbetreiber left out: nothing open'
      additionalProperties: false
      type: object
      required:
        - control_area
        - aktiv
        - uenb
        - biko
        - bilanzkreisvertrag
        - kunden
        - zeitreihen
        - partner
        - weitere
      title: RoleZone
    RoleParty:
      properties:
        rolle:
          type: string
          enum:
            - BIKO
            - ÜNB
            - NB
          title: Rolle
        mp_id:
          type: string
          title: Mp Id
        name:
          type: string
          title: Name
        vertraege:
          items:
            $ref: '#/components/schemas/Contract'
          type: array
          title: Vertraege
        kunden:
          $ref: '#/components/schemas/CustomerGroups'
        zeitreihen:
          $ref: '#/components/schemas/SeriesCounts'
        typen:
          items:
            $ref: '#/components/schemas/SeriesType'
          type: array
          title: Typen
      additionalProperties: false
      type: object
      required:
        - rolle
        - mp_id
        - name
        - vertraege
        - kunden
        - zeitreihen
        - typen
      title: RoleParty
    Contract:
      properties:
        art:
          type: string
          enum:
            - bilanzkreisvertrag
            - lieferantenrahmenvertrag
            - zuordnungsvereinbarung
            - messstellenbetreiberrahmenvertrag
          title: Art
        status:
          type: string
          enum:
            - angefragt
            - aktiv
            - gekuendigt
            - fehlt
          title: Status
      additionalProperties: false
      type: object
      required:
        - art
        - status
      title: Contract
    SeriesType:
      properties:
        zeitreihentyp:
          type: string
          title: Zeitreihentyp
          examples:
            - SLS
            - LGS
            - Z98
        zustand:
          type: string
          enum:
            - erwartet
            - aktiv
            - deaktiviert
            - fehlt
            - unerwartet
          title: Zustand
          description: >-
            the most pressing state across the party's MGAs and aggregates:
            fehlt, unerwartet, erwartet, deaktiviert, aktiv
      additionalProperties: false
      type: object
      required:
        - zeitreihentyp
        - zustand
      title: SeriesType
  securitySchemes:
    APIKeyHeader:
      type: apiKey
      in: header
      name: X-API-Key

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.