> ## 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 Zuordnung Unterbilanzkreis

> Grant the Zuordnungsermaechtigung of a configured Unterbilanzkreis
(a sub-balance group without schedules, e.g. for the EEG
Marktpraemienmodell) to the named Netzbetreiber: per Bilanzierungsgebiet
in its control areas, with its own Zeitreihentypen, BK = the
Unterbilanzkreis. Same gates as the auto-grant (no exclusion, no
standing rejection, an established PARTIN channel); what is granted
already is not sent again (ledger ``zoe_unterbilanzkreis``). A grant
whose last send failed in transport or was rejected is reported as
such and re-issued only with ``erneut``. ``dry_run`` defaults to true
and sends and writes nothing.



## OpenAPI

````yaml /setup/internal-openapi.json post /v1/process/zuordnungsermaechtigungen/unterbilanzkreis
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/process/zuordnungsermaechtigungen/unterbilanzkreis:
    post:
      summary: Post Zuordnung Unterbilanzkreis
      description: |-
        Grant the Zuordnungsermaechtigung of a configured Unterbilanzkreis
        (a sub-balance group without schedules, e.g. for the EEG
        Marktpraemienmodell) to the named Netzbetreiber: per Bilanzierungsgebiet
        in its control areas, with its own Zeitreihentypen, BK = the
        Unterbilanzkreis. Same gates as the auto-grant (no exclusion, no
        standing rejection, an established PARTIN channel); what is granted
        already is not sent again (ledger ``zoe_unterbilanzkreis``). A grant
        whose last send failed in transport or was rejected is reported as
        such and re-issued only with ``erneut``. ``dry_run`` defaults to true
        and sends and writes nothing.
      operationId: >-
        post_zuordnung_unterbilanzkreis_v1_process_zuordnungsermaechtigungen_unterbilanzkreis_post
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UnterbilanzkreisZoeRequest'
        required: true
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UnterbilanzkreisZoeResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - APIKeyHeader: []
        - HTTPBearer: []
components:
  schemas:
    UnterbilanzkreisZoeRequest:
      properties:
        bilanzkreis_eic:
          type: string
          minLength: 1
          title: Bilanzkreis Eic
          description: EIC of a configured Unterbilanzkreis
        mp_ids:
          items:
            type: string
          type: array
          minItems: 1
          title: Mp Ids
          description: MP-IDs of the Netzbetreiber to grant it to
        bilanzierungsgebiete:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Bilanzierungsgebiete
          description: >-
            Only these Bilanzierungsgebiete (EIC Y); default: every one of the
            named Netzbetreiber in the Unterbilanzkreis' control areas
        erneut:
          type: boolean
          title: Erneut
          description: >-
            Re-issue the Zeitreihentypen whose last activation failed in AS4
            transport or was rejected by the Netzbetreiber (CONTRL/APERAK);
            without it they are only reported in `skipped`
          default: false
        dry_run:
          type: boolean
          title: Dry Run
          default: true
      type: object
      required:
        - bilanzkreis_eic
        - mp_ids
      title: UnterbilanzkreisZoeRequest
      description: |-
        Grant the Zuordnungsermaechtigung of one configured Unterbilanzkreis
        to the named Netzbetreiber: one activation per Bilanzierungsgebiet in
        its control areas, with its own Zeitreihentypen and validity. Manual
        only - never on the timer - and ``dry_run`` unless set to false: a dry
        run lists what would go out and sends and writes nothing.
    UnterbilanzkreisZoeResponse:
      properties:
        dry_run:
          type: boolean
          title: Dry Run
        bilanzkreis_eic:
          type: string
          title: Bilanzkreis Eic
        name:
          type: string
          title: Name
        haupt_bk:
          type: string
          title: Haupt Bk
          description: The main balance group it settles through
        lieferant_mp_id:
          type: string
          title: Lieferant Mp Id
        valid_from:
          type: string
          title: Valid From
        zeitreihentypen:
          items:
            type: string
          type: array
          title: Zeitreihentypen
          description: The Unterbilanzkreis' types
        would_send:
          items:
            $ref: '#/components/schemas/UnterbilanzkreisZoeEintrag'
          type: array
          title: Would Send
          description: 'Dry run: the activations a real run would send'
        sent:
          items:
            $ref: '#/components/schemas/UnterbilanzkreisZoeEintrag'
          type: array
          title: Sent
        skipped:
          items:
            $ref: '#/components/schemas/UnterbilanzkreisZoeEintrag'
          type: array
          title: Skipped
        nachgetragen:
          items:
            $ref: '#/components/schemas/UnterbilanzkreisZoeEintrag'
          type: array
          title: Nachgetragen
          description: >-
            Grants for this Unterbilanzkreis found only in the audit records
            (sent before the ledger knew them), taken into the ledger
      type: object
      required:
        - dry_run
        - bilanzkreis_eic
        - name
        - haupt_bk
        - lieferant_mp_id
        - valid_from
        - zeitreihentypen
        - would_send
        - sent
        - skipped
      title: UnterbilanzkreisZoeResponse
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    UnterbilanzkreisZoeEintrag:
      properties:
        mp_id:
          type: string
          title: Mp Id
        name:
          type: string
          title: Name
          default: ''
        bilanzierungsgebiet_eic:
          type: string
          title: Bilanzierungsgebiet Eic
          description: Empty when the whole partner is skipped
          default: ''
        zeitreihentypen:
          items:
            type: string
          type: array
          title: Zeitreihentypen
          description: The types sent (or that would be)
        reason:
          type: string
          title: Reason
          description: Why it was skipped
          default: ''
      type: object
      required:
        - mp_id
      title: UnterbilanzkreisZoeEintrag
    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
  securitySchemes:
    APIKeyHeader:
      type: apiKey
      in: header
      name: X-API-Key
    HTTPBearer:
      type: http
      description: OIDC access token (Auth0 M2M)
      scheme: bearer

````

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