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

# BRP activation status for one DSO/MGA

> How far the market-communication setup with one Netzbetreiber has
progressed — everything your systems need to answer "is the BRP
(Bilanzkreisverantwortlicher) active in this grid area yet?".

**Addressing the partner**: pass either the Netzbetreiber's MP-ID or
the EIC of any of its Bilanzierungsgebiete (MGA) — `queried.
resolved_by` in the answer says which one matched, and the answer
always describes the whole partner with all of its MGAs.

**Reading the answer**: `status` is the derived overall state (see the
field's value list). The four blocks explain it: `erstkontakt` (the
plain-mail first contact), `partin` (master-data exchange, both
directions), `zuordnung` (the Zuordnungsermächtigung stream) and `nrr`
(AS4 transport receipts). Timestamps are message dates; an empty
string means that signal has not been seen. When `status` is
`rejected`, the `ack_negative_*` fields name the stream and carry the
partner's own reason. `bilanzierungsgebiete` lists every MGA with the
Zuordnungsermächtigung sent for it (`null` while none went out).

The verdicts are derived live from the MakoFlow outbox and inbox with
exactly the same rules as the operator console, so this endpoint and
the console can never disagree. A read-only **report key** is
sufficient.



## OpenAPI

````yaml /api-reference/openapi.json get /v1/process/market-partners/{key}/brp-status
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/process/market-partners/{key}/brp-status:
    get:
      summary: BRP activation status for one DSO/MGA
      description: |-
        How far the market-communication setup with one Netzbetreiber has
        progressed — everything your systems need to answer "is the BRP
        (Bilanzkreisverantwortlicher) active in this grid area yet?".

        **Addressing the partner**: pass either the Netzbetreiber's MP-ID or
        the EIC of any of its Bilanzierungsgebiete (MGA) — `queried.
        resolved_by` in the answer says which one matched, and the answer
        always describes the whole partner with all of its MGAs.

        **Reading the answer**: `status` is the derived overall state (see the
        field's value list). The four blocks explain it: `erstkontakt` (the
        plain-mail first contact), `partin` (master-data exchange, both
        directions), `zuordnung` (the Zuordnungsermächtigung stream) and `nrr`
        (AS4 transport receipts). Timestamps are message dates; an empty
        string means that signal has not been seen. When `status` is
        `rejected`, the `ack_negative_*` fields name the stream and carry the
        partner's own reason. `bilanzierungsgebiete` lists every MGA with the
        Zuordnungsermächtigung sent for it (`null` while none went out).

        The verdicts are derived live from the MakoFlow outbox and inbox with
        exactly the same rules as the operator console, so this endpoint and
        the console can never disagree. A read-only **report key** is
        sufficient.
      operationId: >-
        get_brp_activation_status_v1_process_market_partners__key__brp_status_get
      parameters:
        - name: key
          in: path
          required: true
          schema:
            type: string
            description: >-
              The partner's MP-ID (BDEW code or GLN), or the EIC Y code of any
              of its Bilanzierungsgebiete (MGA) — e.g. `9900146000008` or
              `11YR00000002325T`
            title: Key
          description: >-
            The partner's MP-ID (BDEW code or GLN), or the EIC Y code of any of
            its Bilanzierungsgebiete (MGA) — e.g. `9900146000008` or
            `11YR00000002325T`
        - name: lookback_days
          in: query
          required: false
          schema:
            type: integer
            maximum: 730
            minimum: 1
            description: >-
              How far back the MakoFlow outbox and inbox are evaluated for
              messages and acknowledgments
            default: 90
            title: Lookback Days
          description: >-
            How far back the MakoFlow outbox and inbox are evaluated for
            messages and acknowledgments
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BrpStatusResponse'
        '404':
          description: >-
            The key is neither a Netzbetreiber MP-ID, a Bilanzierungsgebiet EIC,
            nor a partner with market traffic in the lookback window.
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
        '502':
          description: >-
            MakoFlow (the market-communication gateway) did not answer; retry
            once it recovers.
      security:
        - APIKeyHeader: []
        - HTTPBearer: []
components:
  schemas:
    BrpStatusResponse:
      properties:
        queried:
          $ref: '#/components/schemas/BrpQueried'
        mp_id:
          type: string
          title: Mp Id
          description: The partner's MP-ID (BDEW code or GLN)
        name:
          type: string
          title: Name
          description: The partner's name
        status:
          type: string
          enum:
            - complete
            - established
            - pending
            - rejected
            - contacted
            - none
          title: Status
          description: >-
            Derived overall state - identical to the Marktpartner overview.
            `complete`: PARTIN out, business confirmation in,
            Zuordnungsermächtigung out. `established`: confirmed, Zuordnung
            still missing. `pending`: traffic without a confirmation yet.
            `rejected`: a rejection stands unanswered in one of the streams (see
            the ack fields for which and why). `contacted`: only the Erstkontakt
            mail so far. `none`: no contact at all
        control_areas:
          items:
            type: string
          type: array
          title: Control Areas
          description: Control areas the partner's MGAs belong to
        erstkontakt:
          $ref: '#/components/schemas/BrpErstkontakt'
        partin:
          $ref: '#/components/schemas/BrpPartin'
        zuordnung:
          $ref: '#/components/schemas/BrpZuordnung'
        nrr:
          $ref: '#/components/schemas/BrpNrr'
        bilanzierungsgebiete:
          items:
            $ref: '#/components/schemas/BrpBilanzierungsgebiet'
          type: array
          title: Bilanzierungsgebiete
          description: >-
            Every MGA of the partner from the BDEW registry; empty for partners
            outside the registry (BIKO, ÜNB)
        lookback_days:
          type: integer
          title: Lookback Days
          description: Evaluated MakoFlow window size
        window:
          $ref: '#/components/schemas/BrpWindow'
        stand:
          additionalProperties:
            type: string
          type: object
          title: Stand
          description: Edition of the underlying BDEW registry data, per source
      type: object
      required:
        - queried
        - mp_id
        - name
        - status
        - control_areas
        - erstkontakt
        - partin
        - zuordnung
        - nrr
        - bilanzierungsgebiete
        - lookback_days
        - window
        - stand
      title: BrpStatusResponse
      description: Activation state of the n:lead BKV with one Netzbetreiber.
      example:
        bilanzierungsgebiete:
          - control_area: Amprion
            eic: 11YR00000002325T
            name: ''
            zuordnung:
              sent_at: '2026-08-25T15:30:39+02:00'
              valid_from: '2026-09-01'
              zeitreihentypen:
                - LGS
                - EGS
                - SLS
                - SES
        control_areas:
          - Amprion
        erstkontakt:
          at: '2026-08-22T10:12:00+02:00'
          status: confirmed
        lookback_days: 90
        mp_id: '9900146000008'
        name: Stadtwerke Dreieich GmbH
        nrr:
          error: ''
          error_at: ''
          ok_at: '2026-08-25T15:15:09+02:00'
        partin:
          ack_negative_at: ''
          ack_negative_reason: ''
          ack_positive_at: '2026-08-25T15:22:40+02:00'
          received_at: '2026-08-25T15:20:11+02:00'
          sent_at: '2026-08-25T15:15:07+02:00'
        queried:
          key: 11YR00000002325T
          resolved_by: bilanzierungsgebiet
        stand:
          BDEW: 'Stand: 15.08.2026'
        status: complete
        window:
          begin: '2026-05-29T15:00:00'
          end: '2026-08-27T15:00:00'
        zuordnung:
          ack_negative_at: ''
          ack_negative_reason: ''
          ack_positive_at: '2026-08-25T15:41:02+02:00'
          sent_at: '2026-08-25T15:30:39+02:00'
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    BrpQueried:
      properties:
        key:
          type: string
          title: Key
          description: The key exactly as queried
        resolved_by:
          type: string
          enum:
            - mp_id
            - bilanzierungsgebiet
          title: Resolved By
          description: >-
            How the key matched: the partner's own MP-ID, or the EIC of one of
            its Bilanzierungsgebiete (MGA)
      type: object
      required:
        - key
        - resolved_by
      title: BrpQueried
    BrpErstkontakt:
      properties:
        at:
          type: string
          title: At
          description: >-
            When the Erstkontakt mail went out (or its first reply was seen).
            Empty string: never contacted by mail
        status:
          type: string
          title: Status
          description: >-
            Mail-side state, e.g. `sent`, `answered`, `confirmed`,
            `unzustellbar`, `wiedervorlage`. Empty when no Erstkontakt is
            recorded
      type: object
      required:
        - at
        - status
      title: BrpErstkontakt
      description: The plain-mail first contact, tracked outside the EDIFACT channel.
    BrpPartin:
      properties:
        sent_at:
          type: string
          title: Sent At
          description: Our PARTIN datasheet went out
        received_at:
          type: string
          title: Received At
          description: The partner's own PARTIN arrived
        ack_positive_at:
          type: string
          title: Ack Positive At
          description: Positive acknowledgment (CONTRL/APERAK) bound to our PARTIN
        ack_negative_at:
          type: string
          title: Ack Negative At
          description: >-
            Rejection bound to our PARTIN - stands while no newer positive
            signal exists in this stream
        ack_negative_reason:
          type: string
          title: Ack Negative Reason
          description: >-
            The partner's own rejection text (CONTRL syntax error or APERAK
            error code with free text)
      type: object
      required:
        - sent_at
        - received_at
        - ack_positive_at
        - ack_negative_at
        - ack_negative_reason
      title: BrpPartin
      description: |-
        The PARTIN exchange (partner master data), both directions.

        All timestamps are the partner's MakoFlow message dates; an empty
        string means that signal has not been seen in the lookback window.
    BrpZuordnung:
      properties:
        sent_at:
          type: string
          title: Sent At
          description: Latest Zuordnungsermächtigung sent
        ack_positive_at:
          type: string
          title: Ack Positive At
          description: Positive acknowledgment
        ack_negative_at:
          type: string
          title: Ack Negative At
          description: Rejection bound to a Zuordnungsermächtigung of ours
        ack_negative_reason:
          type: string
          title: Ack Negative Reason
          description: The partner's reason
      type: object
      required:
        - sent_at
        - ack_positive_at
        - ack_negative_at
        - ack_negative_reason
      title: BrpZuordnung
      description: The Zuordnungsermächtigung (UTILMD PID 55071) stream.
    BrpNrr:
      properties:
        ok_at:
          type: string
          title: Ok At
          description: Latest signed delivery receipt
        error_at:
          type: string
          title: Error At
          description: Latest transport failure
        error:
          type: string
          title: Error
          description: The transport error text
      type: object
      required:
        - ok_at
        - error_at
        - error
      title: BrpNrr
      description: AS4 transport receipts (non-repudiation of receipt).
    BrpBilanzierungsgebiet:
      properties:
        eic:
          type: string
          title: Eic
          description: EIC Y code of the Bilanzierungsgebiet (MGA)
        name:
          type: string
          title: Name
          description: MGA name from the BDEW list, often empty
        control_area:
          type: string
          title: Control Area
          description: Control area (50Hertz, Amprion, TenneT, TransnetBW)
        valid_until:
          anyOf:
            - type: string
            - type: 'null'
          title: Valid Until
          description: End of validity per the BDEW list; null = open-ended
        zuordnung:
          anyOf:
            - $ref: '#/components/schemas/BrpMgaZuordnung'
            - type: 'null'
          description: >-
            The Zuordnungsermächtigung sent for this MGA; null while none went
            out yet
      type: object
      required:
        - eic
        - name
        - control_area
        - valid_until
        - zuordnung
      title: BrpBilanzierungsgebiet
    BrpWindow:
      properties:
        begin:
          type: string
          title: Begin
          description: Start of the evaluated MakoFlow window
        end:
          type: string
          title: End
          description: End of the evaluated window (now)
      type: object
      required:
        - begin
        - end
      title: BrpWindow
    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
    BrpMgaZuordnung:
      properties:
        sent_at:
          type: string
          title: Sent At
          description: When this MGA's Zuordnung went out
        valid_from:
          type: string
          title: Valid From
          description: Effective date (delivery day)
        zeitreihentypen:
          items:
            type: string
          type: array
          title: Zeitreihentypen
          description: Granted summary time-series types, e.g. LGS/EGS/SLS/SES
      type: object
      required:
        - sent_at
        - valid_from
        - zeitreihentypen
      title: BrpMgaZuordnung
  securitySchemes:
    APIKeyHeader:
      type: apiKey
      in: header
      name: X-API-Key
    HTTPBearer:
      type: http
      description: OIDC access token (Auth0 M2M)
      scheme: bearer

````