{
  "openapi": "3.1.0",
  "info": {
    "title": "marktd — Master Data Manager",
    "description": "REST API for the `marktd` master-data daemon (Marktlokation, Messlokation, Verträge, Partner, Webhooks, Process Correlation, VersorgungsStatus, PRICAT).",
    "contact": {
      "name": "hupe1980"
    },
    "license": {
      "name": "MIT OR Apache-2.0",
      "identifier": "MIT OR Apache-2.0"
    },
    "version": "0.49.0"
  },
  "paths": {
    "/api/v1/bilanzierungsgebiete/{eic}/mabis-zp": {
      "get": {
        "tags": [
          "mabis-zp"
        ],
        "summary": "`GET /api/v1/bilanzierungsgebiete/{eic}/mabis-zp`",
        "operationId": "get_mabis_zp",
        "parameters": [
          {
            "name": "eic",
            "in": "path",
            "description": "EIC of the Bilanzierungsgebiet",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "401": {
            "description": "No valid credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "Cedar refused the action",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "mabis-zp"
        ],
        "summary": "`PUT /api/v1/bilanzierungsgebiete/{eic}/mabis-zp` — upsert the assignment.",
        "description": "Requires the `write-mabis-zp` action in the Cedar policy. Idempotent.",
        "operationId": "put_mabis_zp",
        "parameters": [
          {
            "name": "eic",
            "in": "path",
            "description": "EIC of the Bilanzierungsgebiet",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "description": "`PutMabisZpBody`",
          "content": {
            "application/json": {
              "schema": {}
            }
          },
          "required": true
        },
        "responses": {
          "204": {
            "description": "Written"
          },
          "401": {
            "description": "No valid credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "Cedar refused the action",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "422": {
            "description": "The request was refused; `code` names the rule",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/correlations": {
      "get": {
        "tags": [
          "correlation"
        ],
        "summary": "`GET /api/v1/correlations`",
        "operationId": "list_correlations",
        "parameters": [
          {
            "name": "erp_order_id",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "malo_id",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "401": {
            "description": "No valid credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "Cedar refused the action",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/correlations/{id}": {
      "get": {
        "tags": [
          "correlation"
        ],
        "summary": "`GET /api/v1/correlations/:process_id`",
        "operationId": "get_correlation",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Identifier of the resource",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "401": {
            "description": "No valid credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "Cedar refused the action",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/energiemix/{nb_mp_id}": {
      "get": {
        "tags": [
          "nb-energiemix"
        ],
        "summary": "`GET /api/v1/energiemix/{nb_mp_id}`",
        "description": "Retrieve the current (or specific year's) grid-area `Energiemix` for a NB.\n\nUsed by:\n- `productd` to attach NB Reststrommix to STROM products for §42 EnWG disclosure\n- `portald` to display the local grid-area energy mix to customers\n- `agentd` for grid sustainability analytics",
        "operationId": "get_nb_energiemix",
        "parameters": [
          {
            "name": "nb_mp_id",
            "in": "path",
            "description": "13-digit MP-ID of the Netzbetreiber",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "year",
            "in": "query",
            "description": "Calendar year to fetch.  Defaults to the most recent available year.",
            "required": false,
            "schema": {
              "type": [
                "integer",
                "null"
              ],
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "401": {
            "description": "No valid credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "Cedar refused the action",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "nb-energiemix"
        ],
        "summary": "`PUT /api/v1/energiemix/{nb_mp_id}`",
        "description": "Publish or update the annual grid-area `Energiemix` for a Netzbetreiber.\n\nBody: `{ \"energiemix\": <rubo4e::current::Energiemix COM JSON>, \"gueltig_fuer\": 2026 }`\n\nValidation:\n- `energiemix` is deserialized via rubo4e to validate all `Erzeugungsart` enum values.\n- Re-serialised to canonical camelCase before storage.\n- `gueltig_fuer` defaults to the current calendar year.\n\n§42 EnWG: NB must disclose the renewable energy share in their grid area\nto Lieferanten annually.  LFs incorporate this into their §42 Abs. 5\nReststrommix statement on customer bills.",
        "operationId": "put_nb_energiemix",
        "parameters": [
          {
            "name": "nb_mp_id",
            "in": "path",
            "description": "13-digit MP-ID of the Netzbetreiber",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "description": "`PutNbEnergiemixRequest`",
          "content": {
            "application/json": {
              "schema": {}
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "401": {
            "description": "No valid credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "Cedar refused the action",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "422": {
            "description": "The request was refused; `code` names the rule",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/energiemix/{nb_mp_id}/history": {
      "get": {
        "tags": [
          "nb-energiemix"
        ],
        "summary": "`GET /api/v1/energiemix/{nb_mp_id}/history`",
        "description": "Return all available years of grid-area Energiemix for a NB.\nUsed for audit and multi-year trend analysis.",
        "operationId": "get_nb_energiemix_history",
        "parameters": [
          {
            "name": "nb_mp_id",
            "in": "path",
            "description": "13-digit MP-ID of the Netzbetreiber",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "401": {
            "description": "No valid credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "Cedar refused the action",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/esa/consent-check": {
      "get": {
        "tags": [
          "einwilligung"
        ],
        "summary": "`GET /api/v1/esa/consent-check?esa_mp_id=…&msb_mp_id=…&location_id=…&perspective=…`.",
        "description": "Gates an ESA message against the registry. Always answers `200` with a\n[`ConsentDecision`](mako_markt::repository::ConsentDecision) — a revoked\nconsent or an unestablished framework agreement yields `allowed: false`, the\nclearing case the caller answers with an Ablehnung.\n\n`perspective` sets how a *missing* record is read: `msb_inbound` (default)\ntreats it as self-assertion and allows (`BNetzA` forbids form-based\nrejection); `esa_outbound` treats it as no lawful basis and blocks — the ESA\nis the consent holder and must not originate a request it has no consent for.",
        "operationId": "consent_check",
        "parameters": [
          {
            "name": "esa_mp_id",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "msb_mp_id",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "location_id",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "perspective",
            "in": "query",
            "description": "`msb_inbound` (default, lenient) or `esa_outbound` (strict).",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "401": {
            "description": "No valid credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "Cedar refused the action",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/esa/einwilligungen": {
      "get": {
        "tags": [
          "einwilligung"
        ],
        "summary": "`GET /api/v1/esa/einwilligungen?esa_mp_id=…` — list active consents.",
        "operationId": "list_einwilligungen",
        "parameters": [
          {
            "name": "esa_mp_id",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "401": {
            "description": "No valid credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "Cedar refused the action",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "einwilligung"
        ],
        "summary": "`POST /api/v1/esa/einwilligungen` — grant an ESA consent.",
        "operationId": "grant_einwilligung",
        "requestBody": {
          "description": "`GrantBody`",
          "content": {
            "application/json": {
              "schema": {}
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "401": {
            "description": "No valid credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "Cedar refused the action",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "422": {
            "description": "The request was refused; `code` names the rule",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/esa/einwilligungen/{id}": {
      "get": {
        "tags": [
          "einwilligung"
        ],
        "summary": "`GET /api/v1/esa/einwilligungen/:id`.",
        "operationId": "get_einwilligung",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Identifier of the resource",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "401": {
            "description": "No valid credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "Cedar refused the action",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "einwilligung"
        ],
        "summary": "`DELETE /api/v1/esa/einwilligungen/:id` — revoke consent (Art. 7(3) GDPR).",
        "description": "Commits the revocation with its `de.mako.markt.einwilligung.widerrufen` event and\none ORDERS 17008 Abbestellung command per covered location; the outbox\nworker delivers those to makod with retry, so a makod outage delays the stop\nand never loses it.",
        "operationId": "revoke_einwilligung",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Identifier of the resource",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Written"
          },
          "401": {
            "description": "No valid credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "Cedar refused the action",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/esa/framework/{msb_mp_id}/{esa_mp_id}": {
      "get": {
        "tags": [
          "einwilligung"
        ],
        "summary": "`GET /api/v1/esa/framework/:msb_mp_id/:esa_mp_id`.",
        "operationId": "get_framework",
        "parameters": [
          {
            "name": "msb_mp_id",
            "in": "path",
            "description": "13-digit MP-ID of the Messstellenbetreiber",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "esa_mp_id",
            "in": "path",
            "description": "13-digit MP-ID of the Energieserviceanbieter",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "401": {
            "description": "No valid credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "Cedar refused the action",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "einwilligung"
        ],
        "summary": "`PUT /api/v1/esa/framework/:msb_mp_id/:esa_mp_id`.",
        "operationId": "put_framework",
        "parameters": [
          {
            "name": "msb_mp_id",
            "in": "path",
            "description": "13-digit MP-ID of the Messstellenbetreiber",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "esa_mp_id",
            "in": "path",
            "description": "13-digit MP-ID of the Energieserviceanbieter",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "description": "`FrameworkBody`",
          "content": {
            "application/json": {
              "schema": {}
            }
          },
          "required": true
        },
        "responses": {
          "204": {
            "description": "Written"
          },
          "401": {
            "description": "No valid credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "Cedar refused the action",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "422": {
            "description": "The request was refused; `code` names the rule",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/esa/messprodukte/{msb_mp_id}": {
      "put": {
        "tags": [
          "einwilligung"
        ],
        "summary": "`PUT /api/v1/esa/messprodukte/:msb_mp_id` — record which Kapitel-4.6\nMessprodukte this MSB serves an ESA, and in which Abo mode.",
        "description": "Answers `E_0252` Prüfschritt 2 and `E_0256` Prüfschritte 4/5, the one\ncommercial question in those walks that the Codeliste cannot: which of the\n**optional** products this MSB carries. Without it every optional order\nescalates to an operator.\n\nA code outside Kapitel 4.6 is refused here rather than stored: the catalogue\nof orderable products is code (`mako_wim::esa`), not data, and an entry for\na product the Marktrolle may not order could only ever mislead a walk.",
        "operationId": "put_esa_messprodukt_katalog",
        "parameters": [
          {
            "name": "msb_mp_id",
            "in": "path",
            "description": "13-digit MP-ID of the Messstellenbetreiber",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "description": "`Vec<KatalogEintrag>`",
          "content": {
            "application/json": {
              "schema": {}
            }
          },
          "required": true
        },
        "responses": {
          "204": {
            "description": "Written"
          },
          "401": {
            "description": "No valid credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "Cedar refused the action",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "422": {
            "description": "The request was refused; `code` names the rule",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/esa/messprodukte/{msb_mp_id}/{messprodukt}": {
      "get": {
        "tags": [
          "einwilligung"
        ],
        "summary": "`GET /api/v1/esa/messprodukte/:msb_mp_id/:messprodukt?at=YYYY-MM-DD` — does\nthis MSB serve the product on `at`, and in which mode?",
        "description": "The answer folds in the **Pflicht** rule: BNetzA *Mitteilung Nr. 3* makes\nseven Kapitel-4.6 products mandatory from a dated cut-over and §34 Abs. 2\nS. 2 Nr. 10 MsbG makes serving an ESA a mandatory Zusatzleistung, so a\nPflichtprodukt is served whatever the catalogue holds. An operator cannot\nrefuse one by leaving the table empty.",
        "operationId": "get_esa_messprodukt_angebot",
        "parameters": [
          {
            "name": "msb_mp_id",
            "in": "path",
            "description": "13-digit MP-ID of the Messstellenbetreiber",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "messprodukt",
            "in": "path",
            "description": "Messprodukt code (Codeliste der Konfigurationen)",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "at",
            "in": "query",
            "description": "The day the prices must be in force on. Defaults to today.",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "401": {
            "description": "No valid credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "Cedar refused the action",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/esa/preise/{msb_mp_id}/{esa_mp_id}": {
      "get": {
        "tags": [
          "einwilligung"
        ],
        "summary": "`GET /api/v1/esa/preise/:msb_mp_id/:esa_mp_id?at=YYYY-MM-DD` — the prices in\nforce between the pair on `at`.",
        "description": "Across **all** of the pair's subscriptions, deliberately: an INVOIC 31009\nbills a Rahmenvertrag rather than a single Meldepunkt, and its positions name\nArtikel-IDs without saying which subscription each belongs to.",
        "operationId": "get_esa_preise",
        "parameters": [
          {
            "name": "msb_mp_id",
            "in": "path",
            "description": "13-digit MP-ID of the Messstellenbetreiber",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "esa_mp_id",
            "in": "path",
            "description": "13-digit MP-ID of the Energieserviceanbieter",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "401": {
            "description": "No valid credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "Cedar refused the action",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "einwilligung"
        ],
        "summary": "`PUT /api/v1/esa/preise/:msb_mp_id/:esa_mp_id` — record the prices of an\naccepted QUOTES 15003 Angebot.",
        "description": "**The ESA price basis.** `PreisblattMessung` is what an MSB publishes toward\nthe NB and the LF; there is none for the Kapitel-4.6 Messprodukte, because\n§35 MsbG leaves the Entgelt for a Zusatzleistung to be agreed per request.\nSo the offer the ESA ordered against is the agreement, and `invoicd` checks\nthe MSB's INVOIC 31009 positions against exactly these rows — the invoice\nnames the same Artikel-IDs back (`SG26 LIN` DE 7143 `Z09`).\n\nWritten by `makod` when the MSB confirms the Bestellung (ORDRSP 19011),\nwhich is the moment the offer becomes binding.",
        "operationId": "put_esa_preise",
        "parameters": [
          {
            "name": "msb_mp_id",
            "in": "path",
            "description": "13-digit MP-ID of the Messstellenbetreiber",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "esa_mp_id",
            "in": "path",
            "description": "13-digit MP-ID of the Energieserviceanbieter",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "description": "`EsaPreiseBody`",
          "content": {
            "application/json": {
              "schema": {}
            }
          },
          "required": true
        },
        "responses": {
          "204": {
            "description": "Written"
          },
          "401": {
            "description": "No valid credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "Cedar refused the action",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "422": {
            "description": "The request was refused; `code` names the rule",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/esa/subscriptions/{bestellung_ref}": {
      "get": {
        "tags": [
          "einwilligung"
        ],
        "summary": "`GET /api/v1/esa/subscriptions/:bestellung_ref` — which **Messprodukt** an\nORDERS 17007 Belegnummer subscribed to.",
        "description": "`edmd`'s Typ-2 delivery surveillance is the caller. The Codeliste der\nKonfigurationen publishes a delivery cadence **per Messprodukt** — the\nRohdaten products state „unverzüglich, jedoch spätestens bis 9:30 Uhr\", the\naufbereitete-Daten ones defer to WiM Teil 2 Kap. 2.5.5 — but an inbound\nMSCONS 13027 names only the Belegnummer of the ORDERS it belongs to\n(`SG1 RFF+AGI`), never the product. Without this the sweep applies one flat\nthreshold to every subscription and alerts late on the fast ones.\n\n`404` when no accepted Angebot names that Belegnummer — the ordinary state\nfor a delivery whose sender omitted the `RFF+AGI` Muss, and the signal to\nfall back to the configured threshold rather than to invent a cadence.",
        "operationId": "get_esa_subscription",
        "parameters": [
          {
            "name": "bestellung_ref",
            "in": "path",
            "description": "ORDERS Belegnummer of the Bestellung",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "401": {
            "description": "No valid credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "Cedar refused the action",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/events": {
      "get": {
        "tags": [
          "webhooks"
        ],
        "summary": "The service's events within the retention window, in commit order — the\nfeed an integrator polls instead of, or beside, an endpoint. Each item is\nthe CloudEvent as delivered.",
        "operationId": "list_events",
        "parameters": [
          {
            "name": "type",
            "in": "query",
            "description": "A `mako_events::matches` pattern (`de.mako.vertrag.*`); every type when absent.",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "description": "Rows per page, 1–200; 50 when absent.",
            "required": false,
            "schema": {
              "type": "integer",
              "format": "int32",
              "minimum": 0
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "description": "The `next_cursor` of the previous page.",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Page_Value"
                }
              }
            }
          },
          "400": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/geraete/{geraet_id}": {
      "put": {
        "tags": [
          "device"
        ],
        "summary": "`PUT /api/v1/geraete/{geraet_id}`",
        "operationId": "put_geraet",
        "parameters": [
          {
            "name": "geraet_id",
            "in": "path",
            "description": "Gerätenummer",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpsertGeraetRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "204": {
            "description": "Written"
          },
          "401": {
            "description": "No valid credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "Cedar refused the action",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "422": {
            "description": "The request was refused; `code` names the rule",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/grundversorger/{nb_mp_id}": {
      "get": {
        "tags": [
          "grundversorger"
        ],
        "summary": "`GET /api/v1/grundversorger/{nb_mp_id}?sparte=STROM`",
        "operationId": "get_grundversorger",
        "parameters": [
          {
            "name": "nb_mp_id",
            "in": "path",
            "description": "13-digit MP-ID of the Netzbetreiber",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "sparte",
            "in": "query",
            "description": "Commodity: `STROM` (default) or `GAS`.",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "401": {
            "description": "No valid credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "Cedar refused the action",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "grundversorger"
        ],
        "summary": "`PUT /api/v1/grundversorger/{nb_mp_id}` — upsert the Feststellung.",
        "operationId": "put_grundversorger",
        "parameters": [
          {
            "name": "nb_mp_id",
            "in": "path",
            "description": "13-digit MP-ID of the Netzbetreiber",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "description": "`PutGrundversorgerBody`",
          "content": {
            "application/json": {
              "schema": {}
            }
          },
          "required": true
        },
        "responses": {
          "204": {
            "description": "Written"
          },
          "401": {
            "description": "No valid credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "Cedar refused the action",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "422": {
            "description": "The request was refused; `code` names the rule",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/lokationsbuendelstrukturen": {
      "get": {
        "tags": [
          "malo"
        ],
        "summary": "`GET /api/v1/lokationsbuendelstrukturen` — every published\nLokationsbündelstruktur with its Bezeichnung, so a reader names a\n`lokationsbuendelcode` without a copy of the Codeliste.",
        "operationId": "list_lokationsbuendelstrukturen",
        "responses": {
          "200": {
            "description": "The Codeliste der Lokationsbündelstrukturen",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Lokationsbuendelstrukturen"
                }
              }
            }
          },
          "403": {
            "description": "Missing read-utilmd-stammdaten"
          }
        }
      }
    },
    "/api/v1/lokationszuordnungen": {
      "put": {
        "tags": [
          "lokationszuordnung"
        ],
        "summary": "`PUT /api/v1/lokationszuordnungen`",
        "description": "Upserts a directed edge in the location graph.  Idempotent.",
        "operationId": "put_lokationszuordnung",
        "requestBody": {
          "description": "`UpsertEdgeRequest`",
          "content": {
            "application/json": {
              "schema": {}
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "401": {
            "description": "No valid credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "Cedar refused the action",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "422": {
            "description": "The request was refused; `code` names the rule",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/lokationszuordnungen/{von_id}/{nach_id}": {
      "delete": {
        "tags": [
          "lokationszuordnung"
        ],
        "summary": "`DELETE /api/v1/lokationszuordnungen/{von_id}/{nach_id}`",
        "description": "Hard-deletes all temporal variants of an edge pair.",
        "operationId": "delete_lokationszuordnung",
        "parameters": [
          {
            "name": "von_id",
            "in": "path",
            "description": "Lokation the edge starts at",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "nach_id",
            "in": "path",
            "description": "Lokation the edge ends at",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Written"
          },
          "401": {
            "description": "No valid credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "Cedar refused the action",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/mabis-zp": {
      "get": {
        "tags": [
          "mabis-zp"
        ],
        "summary": "`GET /api/v1/mabis-zp` — every assignment for the tenant.",
        "operationId": "list_mabis_zp",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "401": {
            "description": "No valid credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "Cedar refused the action",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/malos": {
      "get": {
        "tags": [
          "malo"
        ],
        "summary": "`GET /api/v1/malos`",
        "operationId": "list_malo",
        "parameters": [
          {
            "name": "sparte",
            "in": "query",
            "required": false,
            "schema": {
              "type": [
                "string",
                "null"
              ]
            },
            "example": "STROM"
          },
          {
            "name": "zuordnungstyp",
            "in": "query",
            "description": "Filter by `zuordnungstyp` in active role assignments (e.g. `NB`, `LF`).",
            "required": false,
            "schema": {
              "type": [
                "string",
                "null"
              ]
            }
          },
          {
            "name": "rollencodenummer",
            "in": "query",
            "description": "Filter by `rollencodenummer` (GLN) in active role assignments.",
            "required": false,
            "schema": {
              "type": [
                "string",
                "null"
              ]
            }
          },
          {
            "name": "fallgruppe",
            "in": "query",
            "description": "Filter by Gas GaBi RLM Fallgruppe (e.g. `GABI_RLM_MIT_TAGESBAND`).\nGas only — Strom MaLos have no Fallgruppe.",
            "required": false,
            "schema": {
              "type": [
                "string",
                "null"
              ]
            }
          },
          {
            "name": "bilanzierungsmethode",
            "in": "query",
            "description": "Filter by billing mode (e.g. `RLM`, `SLP`, `IMS`).",
            "required": false,
            "schema": {
              "type": [
                "string",
                "null"
              ]
            }
          },
          {
            "name": "regelzone",
            "in": "query",
            "description": "Filter by Regelzone EIC code (e.g. `10YDE-EON------1`).",
            "required": false,
            "schema": {
              "type": [
                "string",
                "null"
              ]
            }
          },
          {
            "name": "page",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "format": "int32",
              "minimum": 0
            },
            "example": 0
          },
          {
            "name": "size",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "format": "int32",
              "minimum": 0
            },
            "example": 50
          }
        ],
        "responses": {
          "200": {
            "description": "List of Marktlokationen",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/MaloResponse"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/malos/{id}": {
      "get": {
        "tags": [
          "malo"
        ],
        "summary": "`GET /api/v1/malos/:id`",
        "operationId": "get_malo",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "11-digit MaLo-ID",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MaloResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not found"
          }
        }
      },
      "put": {
        "tags": [
          "malo"
        ],
        "summary": "`PUT /api/v1/malos/:id`",
        "operationId": "put_malo",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "11-digit MaLo-ID",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MaloUpsertRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Updated"
          },
          "201": {
            "description": "Created"
          },
          "409": {
            "description": "Version conflict"
          },
          "422": {
            "description": "Validation error"
          }
        }
      }
    },
    "/api/v1/malos/{id}/buendel": {
      "get": {
        "tags": [
          "lokationszuordnung"
        ],
        "summary": "`GET /api/v1/malos/{id}/buendel`",
        "description": "Returns the first-class [`Lokationsbuendel`] rooted at the given `MaLo-ID`,\nprojected from the typed location graph, together with its structural\nintegrity status (a bundle can be transiently incomplete mid-Einzug, so this\nreports `valid: false` rather than failing the request).",
        "operationId": "get_malo_buendel",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Identifier of the resource",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "at",
            "in": "query",
            "description": "Point-in-time filter (`YYYY-MM-DD`). Omit for all edges regardless of validity.",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "401": {
            "description": "No valid credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "Cedar refused the action",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/malos/{id}/bundesland": {
      "get": {
        "tags": [
          "bundesland"
        ],
        "summary": "The Bundesland of a Marktlokation, from the Postleitzahl of its\n`lokationsadresse` (`crate::bundesland`).",
        "description": "`404` when marktd holds no such MaLo; `422` naming the reason when the\nMaLo has no address with a PLZ, the PLZ is not in the table, or it lies in\nmore than one Land — a Land is never guessed.",
        "operationId": "get_malo_bundesland",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Identifier of the resource",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "401": {
            "description": "No valid credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "Cedar refused the action",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/malos/{id}/grid": {
      "get": {
        "tags": [
          "malo-grid"
        ],
        "summary": "`GET /api/v1/malos/{malo_id}/grid` — fetch the grid topology for a MaLo.",
        "operationId": "get_malo_grid",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Identifier of the resource",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "401": {
            "description": "No valid credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "Cedar refused the action",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "malo-grid"
        ],
        "summary": "`PUT /api/v1/malos/{malo_id}/grid` — upsert the grid topology for a MaLo.",
        "description": "Requires the `write-malo-grid` action in the Cedar policy.\nIdempotent — safe to call repeatedly from `mastr-syncd`.",
        "operationId": "put_malo_grid",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Identifier of the resource",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "description": "`PutMaloGridBody`",
          "content": {
            "application/json": {
              "schema": {}
            }
          },
          "required": true
        },
        "responses": {
          "204": {
            "description": "Written"
          },
          "401": {
            "description": "No valid credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "Cedar refused the action",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "422": {
            "description": "The request was refused; `code` names the rule",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/malos/{id}/lastprofil": {
      "get": {
        "summary": "`GET /api/v1/malos/{id}/lastprofil`",
        "description": "Returns the SLP `Lastprofil` COM array for a MaLo.\n\n## Resolution order\n\n1. If `Marktlokation.lastprofile` is populated in the stored JSONB data, the\n   stored values are returned verbatim (already typed BO4E).\n2. Otherwise a default profile is **derived** from `bilanzierungsmethode` +\n   `sparte` according to §12 StromNZV (bis 31.12.2025) / BDEW SLP registry:\n\n| bilanzierungsmethode | sparte | derived profilschar | profilart |\n|---|---|---|---|\n| `SLP` | `STROM` | `H0` | `ART_STANDARDLASTPROFIL` |\n| `SLP` | `GAS` | `G000` | `ART_STANDARDLASTPROFIL` |\n| `RLM` | any | — | 404 — RLM meters use Lastgang, not SLP |\n| `IMS` | any | — | 404 — iMSys uses measured values, not SLP |\n\n## Motivation\n\n`billingd` uses the SLP profile to:\n- Select the correct NNE tariff zone (H0 vs G0/G1–G6 vs L0 have different\n  NNE rates in some DSO grid areas).\n- Verify Zählerstand plausibility against typical H0/G0 consumption curves.\n\nCalling this endpoint from `billingd` replaces the current hard-coded\n`Eintarif` assumption for all SLP meters.",
        "operationId": "get_malo_lastprofil",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "11-digit MaLo-ID",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Lastprofil array for this MaLo"
          },
          "404": {
            "description": "MaLo not found or RLM/IMS meter (no SLP profile)"
          }
        }
      }
    },
    "/api/v1/malos/{id}/lokationen": {
      "get": {
        "tags": [
          "lokationszuordnung"
        ],
        "summary": "`GET /api/v1/malos/{id}/lokationen`",
        "description": "Recursively traverses the MaKo location graph starting at the given `MaLo-ID`.\nReturns all reachable edges (MaLo → MeLo → NeLo → SR/TR) ordered by depth.\nPass `?at=YYYY-MM-DD` to filter to edges valid on a specific date.",
        "operationId": "get_malo_lokationen",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Identifier of the resource",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "at",
            "in": "query",
            "description": "Point-in-time filter (`YYYY-MM-DD`). Omit for all edges regardless of validity.",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "401": {
            "description": "No valid credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "Cedar refused the action",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/malos/{id}/lokationsbuendel": {
      "get": {
        "tags": [
          "malo"
        ],
        "summary": "`GET /api/v1/malos/{id}/lokationsbuendel?stichtag=YYYY-MM-DD`.",
        "operationId": "get_lokationsbuendel",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "11-digit Marktlokations-ID",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "stichtag",
            "in": "query",
            "description": "The date the bündel is resolved for (YYYY-MM-DD)",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The Lokationsbündel on the Stichtag",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Lokationsbuendel"
                }
              }
            }
          },
          "403": {
            "description": "Missing read-utilmd-stammdaten"
          },
          "404": {
            "description": "`malo_not_found`"
          },
          "422": {
            "description": "`invalid_malo_id` or an invalid `stichtag`"
          }
        }
      }
    },
    "/api/v1/malos/{id}/lokationsbuendel-angaben": {
      "put": {
        "tags": [
          "lokationsbuendel"
        ],
        "summary": "`PUT /api/v1/malos/{malo_id}/lokationsbuendel-angaben` — store one dated\nrow.",
        "operationId": "put_lokationsbuendel_angaben",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Identifier of the resource",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "description": "`PutAngabenBody`",
          "content": {
            "application/json": {
              "schema": {}
            }
          },
          "required": true
        },
        "responses": {
          "204": {
            "description": "Written"
          },
          "401": {
            "description": "No valid credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "Cedar refused the action",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "422": {
            "description": "The request was refused; `code` names the rule",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/malos/{id}/netznutzungsdaten": {
      "put": {
        "tags": [
          "utilmd-stammdaten"
        ],
        "summary": "`PUT /api/v1/malos/{malo_id}/netznutzungsdaten` — store one dated row.",
        "operationId": "put_netznutzungsdaten",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Identifier of the resource",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "description": "`PutNetznutzungsdatenBody`",
          "content": {
            "application/json": {
              "schema": {}
            }
          },
          "required": true
        },
        "responses": {
          "204": {
            "description": "Written"
          },
          "401": {
            "description": "No valid credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "Cedar refused the action",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "422": {
            "description": "The request was refused; `code` names the rule",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/malos/{id}/utilmd-stammdaten": {
      "get": {
        "tags": [
          "utilmd-stammdaten"
        ],
        "summary": "`GET /api/v1/malos/{malo_id}/utilmd-stammdaten?stichtag=YYYY-MM-DD`.",
        "operationId": "get_utilmd_stammdaten",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Identifier of the resource",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "stichtag",
            "in": "query",
            "description": "The date the record is resolved for (`YYYY-MM-DD`). Required: an\nAnmeldung EoG may be retroactive, so „today\" is not a default.",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "401": {
            "description": "No valid credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "Cedar refused the action",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/malos/{malo_id}/bilanzierung": {
      "get": {
        "tags": [
          "bilanzierung"
        ],
        "summary": "`GET /api/v1/malos/{malo_id}/bilanzierung?at=<rfc3339|date>` — point-in-time.",
        "operationId": "get_bilanzierung_at",
        "parameters": [
          {
            "name": "malo_id",
            "in": "path",
            "description": "11-digit Marktlokations-ID",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "at",
            "in": "query",
            "description": "Point-in-time instant (RFC 3339) or date (`YYYY-MM-DD`). Defaults to now.",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "401": {
            "description": "No valid credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "Cedar refused the action",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "bilanzierung"
        ],
        "summary": "`PUT /api/v1/malos/{malo_id}/bilanzierung` — upsert a BO4E Bilanzierung.",
        "description": "The body is a `Bo4e<Bilanzierung>`, so the gate — `_typ`, schema, strict\nenums with their JSON-paths, BO4E rules — runs as `serde` deserialises it.\nEvery typed column is then derived from the **typed** object by\n[`BilanzierungRecord::from_bo4e`], and what is stored is the canonical\nround-trip rather than the request body.",
        "operationId": "put_bilanzierung",
        "parameters": [
          {
            "name": "malo_id",
            "in": "path",
            "description": "11-digit Marktlokations-ID",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "description": "`Bo4e<rubo4e::current::Bilanzierung>`",
          "content": {
            "application/json": {
              "schema": {}
            }
          },
          "required": true
        },
        "responses": {
          "204": {
            "description": "Written"
          },
          "401": {
            "description": "No valid credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "Cedar refused the action",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "422": {
            "description": "The request was refused; `code` names the rule",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/malos/{malo_id}/bilanzierung/history": {
      "get": {
        "tags": [
          "bilanzierung"
        ],
        "summary": "`GET /api/v1/malos/{malo_id}/bilanzierung/history` — full temporal history.",
        "operationId": "get_bilanzierung_history",
        "parameters": [
          {
            "name": "malo_id",
            "in": "path",
            "description": "11-digit Marktlokations-ID",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "401": {
            "description": "No valid credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "Cedar refused the action",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/malos/{malo_id}/technische-ressourcen": {
      "get": {
        "tags": [
          "TechnischeRessource"
        ],
        "summary": "`GET /api/v1/malos/{malo_id}/technische-ressourcen`",
        "operationId": "list_technische_ressourcen_by_malo",
        "parameters": [
          {
            "name": "malo_id",
            "in": "path",
            "description": "MaLo-ID",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "List"
          },
          "403": {
            "description": "Forbidden"
          }
        }
      }
    },
    "/api/v1/melos/{id}": {
      "get": {
        "tags": [
          "melo"
        ],
        "summary": "`GET /api/v1/melos/:id`",
        "operationId": "get_melo",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "MeLo-ID",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MeloResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not found"
          }
        }
      },
      "put": {
        "tags": [
          "melo"
        ],
        "summary": "`PUT /api/v1/melos/:id`",
        "description": "# Single-write-path invariant (MaLo ↔ MeLo)\n\nThis PUT is the only writer of the `melo.malo_id` FK, and the repository\nmaintains the corresponding `melo → malo` edge in the temporal\n`lokationszuordnungen` graph in the same transaction: the graph is always a\nsuperset of the FK (the FK is a derived convenience for \"current parent\"),\nand reparenting closes the previous open edge (`valid_to`). See\n`marktd::pg::melo` for the reconciliation rules.",
        "operationId": "put_melo",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "MeLo-ID (DE + 31 chars)",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MeloUpsertRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Updated"
          },
          "201": {
            "description": "Created"
          },
          "409": {
            "description": "Version conflict"
          }
        }
      }
    },
    "/api/v1/melos/{id}/lokationen": {
      "get": {
        "tags": [
          "lokationszuordnung"
        ],
        "summary": "`GET /api/v1/melos/{id}/lokationen`",
        "description": "Recursively traverses the location graph starting at the given `MeLo-ID`.\nReturns all reachable edges ordered by depth.",
        "operationId": "get_melo_lokationen",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Identifier of the resource",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "at",
            "in": "query",
            "description": "Point-in-time filter (`YYYY-MM-DD`). Omit for all edges regardless of validity.",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "401": {
            "description": "No valid credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "Cedar refused the action",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/melos/{id}/standorteigenschaften": {
      "get": {
        "tags": [
          "melo"
        ],
        "summary": "`GET /api/v1/melos/:id/standorteigenschaften`",
        "description": "Returns the typed BO4E `Standorteigenschaften` for the MeLo — carrying\n`StandorteigenschaftenStrom` (regelzone EIC, bilanzierungsgebietEic) and/or\n`StandorteigenschaftenGas` (druckstufe). Required for Redispatch 2.0\n`NetworkConstraintDocument` cross-references and Gas billing zone routing.\n\nReturns 404 when the MeLo has no `standorteigenschaften` column populated yet.\nUse `PUT /api/v1/melos/{id}` with a `data.standorteigenschaften` field to populate it.",
        "operationId": "get_melo_standorteigenschaften",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "MeLo-ID (DE + 31 chars)",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Standorteigenschaften",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "404": {
            "description": "MeLo not found or no Standorteigenschaften"
          }
        }
      }
    },
    "/api/v1/melos/{melo_id}/msb": {
      "get": {
        "tags": [
          "melo-msb"
        ],
        "summary": "`GET /api/v1/melos/{melo_id}/msb?at=YYYY-MM-DD` — the MSB responsible on a date.",
        "operationId": "get_melo_msb_at",
        "parameters": [
          {
            "name": "melo_id",
            "in": "path",
            "description": "33-character Messlokations-ID",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "at",
            "in": "query",
            "description": "Point-in-time date (ISO `YYYY-MM-DD`). Defaults to today.",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "401": {
            "description": "No valid credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "Cedar refused the action",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "melo-msb"
        ],
        "summary": "`PUT /api/v1/melos/{melo_id}/msb` — record a new dated MSB assignment.",
        "operationId": "put_melo_msb",
        "parameters": [
          {
            "name": "melo_id",
            "in": "path",
            "description": "33-character Messlokations-ID",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "description": "`PutMeloMsbBody`",
          "content": {
            "application/json": {
              "schema": {}
            }
          },
          "required": true
        },
        "responses": {
          "204": {
            "description": "Written"
          },
          "401": {
            "description": "No valid credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "Cedar refused the action",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "422": {
            "description": "The request was refused; `code` names the rule",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/melos/{melo_id}/msb/history": {
      "get": {
        "tags": [
          "melo-msb"
        ],
        "summary": "`GET /api/v1/melos/{melo_id}/msb/history` — full dated MSB timeline.",
        "operationId": "get_melo_msb_history",
        "parameters": [
          {
            "name": "melo_id",
            "in": "path",
            "description": "33-character Messlokations-ID",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "401": {
            "description": "No valid credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "Cedar refused the action",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/melos/{melo_id}/sharing-eligibility": {
      "get": {
        "tags": [
          "device"
        ],
        "operationId": "get_sharing_eligibility",
        "parameters": [
          {
            "name": "melo_id",
            "in": "path",
            "description": "33-character Messlokations-ID",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SharingEligibilityResponse"
                }
              }
            }
          },
          "401": {
            "description": "No valid credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "Cedar refused the action",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/melos/{melo_id}/zaehler": {
      "get": {
        "tags": [
          "device"
        ],
        "summary": "`GET /api/v1/melos/{melo_id}/zaehler`",
        "operationId": "list_zaehler",
        "parameters": [
          {
            "name": "melo_id",
            "in": "path",
            "description": "33-character Messlokations-ID",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "401": {
            "description": "No valid credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "Cedar refused the action",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/mmm-preise/strom/{year}/{month}": {
      "get": {
        "tags": [
          "mmma-preise"
        ],
        "summary": "`GET /api/v1/mmm-preise/strom/{year}/{month}`",
        "operationId": "get_mmm_strom",
        "parameters": [
          {
            "name": "year",
            "in": "path",
            "description": "Calendar year",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "month",
            "in": "path",
            "description": "Calendar month, 1–12",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32",
              "minimum": 0
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "401": {
            "description": "No valid credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "Cedar refused the action",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "mmma-preise"
        ],
        "summary": "`PUT /api/v1/mmm-preise/strom/{year}/{month}`",
        "description": "Upsert the nationwide Strom Mehr-/Mindermengenpreise for an application\nmonth. They are *einheitlich* — § 13 Abs. 3 StromNZV for a period to\n31.12.2025, § 20 Abs. 3 EnWG via BK6-24-174 from 01.01.2026 — and the BDEW\npublishes one series for the whole market, so the month is the entire key:\nthere is no per-Netzbetreiber variant to select.",
        "operationId": "put_mmm_strom",
        "parameters": [
          {
            "name": "year",
            "in": "path",
            "description": "Calendar year",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "month",
            "in": "path",
            "description": "Calendar month, 1–12",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32",
              "minimum": 0
            }
          }
        ],
        "requestBody": {
          "description": "`MmmStromUpsertRequest`",
          "content": {
            "application/json": {
              "schema": {}
            }
          },
          "required": true
        },
        "responses": {
          "204": {
            "description": "Written"
          },
          "401": {
            "description": "No valid credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "Cedar refused the action",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "422": {
            "description": "The request was refused; `code` names the rule",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/mmma-preise/gas": {
      "get": {
        "tags": [
          "mmma-preise"
        ],
        "summary": "`GET /api/v1/mmma-preise/gas` — list all Gas MMM price records (newest first).",
        "operationId": "list_mmma_gas",
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "401": {
            "description": "No valid credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "Cedar refused the action",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/mmma-preise/gas/{year}/{month}": {
      "get": {
        "tags": [
          "mmma-preise"
        ],
        "summary": "`GET /api/v1/mmma-preise/gas/{year}/{month}`",
        "operationId": "get_mmma_gas",
        "parameters": [
          {
            "name": "year",
            "in": "path",
            "description": "Calendar year",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "month",
            "in": "path",
            "description": "Calendar month, 1–12",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32",
              "minimum": 0
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "401": {
            "description": "No valid credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "Cedar refused the action",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "mmma-preise"
        ],
        "summary": "`PUT /api/v1/mmma-preise/gas/{year}/{month}`",
        "description": "Upsert the Gas MMM Abrechnungspreise for a billing month. Published monthly\nby Trading Hub Europe (THE). The `netzbilanzd` billing run auto-fetches these\ninstead of requiring manual ERP input.",
        "operationId": "put_mmma_gas",
        "parameters": [
          {
            "name": "year",
            "in": "path",
            "description": "Calendar year",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "month",
            "in": "path",
            "description": "Calendar month, 1–12",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32",
              "minimum": 0
            }
          }
        ],
        "requestBody": {
          "description": "`MmmaGasUpsertRequest`",
          "content": {
            "application/json": {
              "schema": {}
            }
          },
          "required": true
        },
        "responses": {
          "204": {
            "description": "Written"
          },
          "401": {
            "description": "No valid credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "Cedar refused the action",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "422": {
            "description": "The request was refused; `code` names the rule",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/mmma-preise/import-trigger": {
      "post": {
        "tags": [
          "mmma-preise"
        ],
        "summary": "`POST /api/v1/mmma-preise/import-trigger[?year=YYYY&month=MM]`",
        "description": "Manually trigger a MMMA Gas / MMM Strom price import cycle.\n\nUses the same configurable URLs as the background worker.\nUseful for catch-up after service downtime, testing, or ERP-driven imports.\n\nRequires `write-preisblatt` Cedar action.\n\n## Response\n\n```json\n{\n  \"year\": 2026, \"month\": 7,\n  \"results\": [\n    { \"commodity\": \"gas\",   \"success\": true,  \"error\": null },\n    { \"commodity\": \"strom\", \"success\": false, \"error\": \"HTTP 503 from ...\" }\n  ]\n}\n```",
        "operationId": "post_import_trigger",
        "parameters": [
          {
            "name": "year",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "month",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "format": "int32",
              "minimum": 0
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "401": {
            "description": "No valid credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "Cedar refused the action",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "422": {
            "description": "The request was refused; `code` names the rule",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/msb-rahmenvertraege": {
      "get": {
        "tags": [
          "msb-rahmenvertraege"
        ],
        "summary": "`GET /api/v1/msb-rahmenvertraege` — list conclusion records.",
        "operationId": "list_msb_rv",
        "parameters": [
          {
            "name": "sparte",
            "in": "query",
            "description": "Filter by Sparte (STROM / GAS)",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "nb_mp_id",
            "in": "query",
            "description": "Filter by NB MP-ID",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "msb_mp_id",
            "in": "query",
            "description": "Filter by MSB MP-ID",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "status",
            "in": "query",
            "description": "Filter by lifecycle status",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Conclusion records, newest valid_from first",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/MsbRahmenvertrag"
                  }
                }
              }
            }
          },
          "403": {
            "description": "Missing read-msb-rv scope"
          }
        }
      },
      "put": {
        "tags": [
          "msb-rahmenvertraege"
        ],
        "summary": "`PUT /api/v1/msb-rahmenvertraege` — upsert a conclusion record.",
        "description": "Idempotent on the natural key `(sparte, nb_mp_id, msb_mp_id, valid_from)`;\nthe record id stays stable across re-submits. A non-zero `version` in the\nbody acts as an optimistic-locking guard. The row and its CloudEvent\ncommit in one transaction.",
        "operationId": "upsert_msb_rv",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MsbRvUpsertRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Upserted; returns stable id and new version"
          },
          "403": {
            "description": "Missing write-msb-rv scope"
          },
          "412": {
            "description": "Supplied version does not match the stored version"
          },
          "422": {
            "description": "An invalid window, a Strom row with a Gas-only status, or a window overlapping another contract of the same parties and Sparte"
          }
        }
      }
    },
    "/api/v1/msb-rahmenvertraege/check": {
      "get": {
        "tags": [
          "msb-rahmenvertraege"
        ],
        "summary": "`GET /api/v1/msb-rahmenvertraege/check` — is a contract `abgeschlossen`\nand valid on `datum`?",
        "description": "Always `200` with a Befund: `abgeschlossen: false` names why (no contract,\nonly offered, to be adapted, ended). A database failure is `500`, never a\n`false` — an outage is not evidence that no contract exists.",
        "operationId": "check_msb_rv",
        "parameters": [
          {
            "name": "sparte",
            "in": "query",
            "description": "STROM or GAS",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "nb_mp_id",
            "in": "query",
            "description": "The NB's MP-ID in that Sparte",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "msb_mp_id",
            "in": "query",
            "description": "The MSB's MP-ID",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "datum",
            "in": "query",
            "description": "The day the contract must be valid on (YYYY-MM-DD)",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The Befund for that day",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MsbRvPruefung"
                }
              }
            }
          },
          "400": {
            "description": "A missing or malformed query parameter"
          },
          "403": {
            "description": "Missing read-msb-rv scope"
          }
        }
      }
    },
    "/api/v1/msb-rahmenvertraege/{id}": {
      "get": {
        "tags": [
          "msb-rahmenvertraege"
        ],
        "summary": "`GET /api/v1/msb-rahmenvertraege/{id}` — fetch one record.",
        "operationId": "get_msb_rv",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Record id",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The record",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MsbRahmenvertrag"
                }
              }
            }
          },
          "403": {
            "description": "Missing read-msb-rv scope"
          },
          "404": {
            "description": "Unknown id"
          }
        }
      }
    },
    "/api/v1/nb-contracts": {
      "get": {
        "tags": [
          "nb-contract"
        ],
        "summary": "`GET /api/v1/nb-contracts?nb_mp_id=...`",
        "operationId": "list_nb_contracts",
        "parameters": [
          {
            "name": "nb_mp_id",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "401": {
            "description": "No valid credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "Cedar refused the action",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/nb-contracts/by-malo/{malo_id}": {
      "get": {
        "summary": "`GET /api/v1/nb-contracts/by-malo/{malo_id}?on=YYYY-MM-DD`",
        "description": "The Netznutzungsvertrag in force for a MaLo on a date (default today). Read by\n`processd`, which needs the Netznutzer and its type before it decides an\nAnmeldung: a Selbstzahler („Netznutzer ohne All-Inklusiv-Vertrag\") is an\nordinary LF in GPKE, with one exception — the LF's Lieferantenwechsel-Meldungen\n(GPKE Teil 1, Vorbemerkung).",
        "operationId": "get_nb_contract_by_malo",
        "parameters": [
          {
            "name": "malo_id",
            "in": "path",
            "description": "11-digit Marktlokations-ID",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "on",
            "in": "query",
            "description": "Date the contract must be in force on (default today)",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Contract in force",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NbContractResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden"
          },
          "404": {
            "description": "No contract in force on that date"
          }
        }
      }
    },
    "/api/v1/nb-contracts/{id}": {
      "get": {
        "tags": [
          "nb-contract"
        ],
        "summary": "`GET /api/v1/nb-contracts/:id`",
        "operationId": "get_nb_contract",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Identifier of the resource",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "401": {
            "description": "No valid credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "Cedar refused the action",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "nb-contract"
        ],
        "summary": "`PUT /api/v1/nb-contracts/:id`",
        "operationId": "put_nb_contract",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Identifier of the resource",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/NbContractUpsertRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "401": {
            "description": "No valid credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "Cedar refused the action",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "422": {
            "description": "The request was refused; `code` names the rule",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/nelos": {
      "get": {
        "tags": [
          "nelo"
        ],
        "summary": "GET /api/v1/nelos",
        "description": "List NeLos for this tenant.  Pass `?nb_mp_id=<GLN>` to filter by Netzbetreiber.",
        "operationId": "list_nelos",
        "parameters": [
          {
            "name": "nb_mp_id",
            "in": "query",
            "description": "Filter by owning Netzbetreiber GLN.",
            "required": false,
            "schema": {
              "type": [
                "string",
                "null"
              ]
            }
          },
          {
            "name": "page",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "format": "int32",
              "minimum": 0
            },
            "example": 0
          },
          {
            "name": "size",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "format": "int32",
              "minimum": 0
            },
            "example": 50
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "401": {
            "description": "No valid credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "Cedar refused the action",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/nelos/{id}": {
      "get": {
        "tags": [
          "nelo"
        ],
        "summary": "GET /api/v1/nelos/:id",
        "description": "Retrieve a single NeLo. Returns a typed `NetzlokationResponse` with the\nfull `rubo4e::current::Netzlokation` BO4E payload in the `data` field.",
        "operationId": "get_nelo",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Identifier of the resource",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "401": {
            "description": "No valid credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "Cedar refused the action",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "nelo"
        ],
        "summary": "PUT /api/v1/nelos/:id",
        "description": "Insert or update a Netz-Element-Lokation.\n\nBody must be a valid `rubo4e::current::Netzlokation` JSON object (camelCase).\nReturns 422 on wrong `_typ` or invalid enum values.\nSupply `If-Match` header for optimistic concurrency; omit for unconditional upsert.",
        "operationId": "put_nelo",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Identifier of the resource",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/NeLoUpsertRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "401": {
            "description": "No valid credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "Cedar refused the action",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "422": {
            "description": "The request was refused; `code` names the rule",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/netzbetreiber/{nb_mp_id}/grundzustaendiger-msb": {
      "get": {
        "tags": [
          "malo-grid"
        ],
        "summary": "`GET /api/v1/netzbetreiber/{nb_mp_id}/grundzustaendiger-msb`",
        "operationId": "get_grundzustaendiger_msb",
        "parameters": [
          {
            "name": "nb_mp_id",
            "in": "path",
            "description": "13-digit MP-ID of the Netzbetreiber",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "at",
            "in": "query",
            "description": "The day asked about, `YYYY-MM-DD`; today when absent",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The gMSB MP-ID of the grid that day: `{ nb_mp_id, gmsb_mp_id, valid_from, valid_to }`",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "401": {
            "description": "No valid credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "Cedar refused the action",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "No gMSB recorded for this Netzbetreiber on that day",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "malo-grid"
        ],
        "summary": "`PUT /api/v1/netzbetreiber/{nb_mp_id}/grundzustaendiger-msb` — record it.",
        "operationId": "put_grundzustaendiger_msb",
        "parameters": [
          {
            "name": "nb_mp_id",
            "in": "path",
            "description": "13-digit MP-ID of the Netzbetreiber",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "description": "`PutGrundzustaendigerMsbBody`: `{ gmsb_mp_id, valid_from }`",
          "content": {
            "application/json": {
              "schema": {}
            }
          },
          "required": true
        },
        "responses": {
          "204": {
            "description": "Written"
          },
          "401": {
            "description": "No valid credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "Cedar refused the action",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "422": {
            "description": "`mp_id_ungueltig`: a value is no MP-ID; or `valid_from` is no date",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/netzzugang/antraege": {
      "get": {
        "tags": [
          "netzzugang"
        ],
        "summary": "`GET /api/v1/netzzugang/antraege` — list requests.",
        "operationId": "list_antraege",
        "parameters": [
          {
            "name": "status",
            "in": "query",
            "description": "Filter by lifecycle status",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "netzanschluss_id",
            "in": "query",
            "description": "Filter by Netzanschluss",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Requests incl. version, newest first"
          },
          "403": {
            "description": "Missing read-netzzugang scope"
          }
        }
      },
      "put": {
        "tags": [
          "netzzugang"
        ],
        "summary": "`PUT /api/v1/netzzugang/antraege` — upsert a request (makod adapter).",
        "operationId": "upsert_antrag",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {}
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Upserted; returns id and version"
          },
          "400": {
            "description": "Missing netzanschluss_id / nb_mp_id"
          },
          "403": {
            "description": "Missing write-netzzugang scope"
          }
        }
      }
    },
    "/api/v1/netzzugang/antraege/{id}": {
      "get": {
        "tags": [
          "netzzugang"
        ],
        "summary": "`GET /api/v1/netzzugang/antraege/{id}` — fetch a request.",
        "operationId": "get_antrag",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Request id",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The request incl. version"
          },
          "403": {
            "description": "Missing read-netzzugang scope"
          },
          "404": {
            "description": "Unknown id"
          }
        }
      }
    },
    "/api/v1/netzzugang/antraege/{id}/status": {
      "patch": {
        "tags": [
          "netzzugang"
        ],
        "summary": "`PATCH /api/v1/netzzugang/antraege/{id}/status` — advance the lifecycle.",
        "description": "Used by the makod sender (`uebermittelt`/`fehlgeschlagen`) and by the\noperator or answer channel (`bestaetigt`/`abgelehnt`).",
        "operationId": "set_antrag_status",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Request id",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/StatusBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Updated request incl. new version"
          },
          "403": {
            "description": "Missing write-netzzugang scope"
          },
          "404": {
            "description": "Unknown id"
          },
          "412": {
            "description": "expected_version does not match the stored version"
          }
        }
      }
    },
    "/api/v1/partners": {
      "get": {
        "tags": [
          "partner"
        ],
        "summary": "`GET /api/v1/partners`",
        "operationId": "list_partners",
        "parameters": [
          {
            "name": "marktrolle",
            "in": "query",
            "description": "`LF`, `NB`, `MSB`, … — the BO4E Marktrolle.",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "sparte",
            "in": "query",
            "description": "`STROM` or `GAS`.",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "name",
            "in": "query",
            "description": "A name as a customer types it („stadtwerke münchen\"): every word must\nbegin a word of the partner's name; case, umlauts and legal forms are\nignored. Exact names first. For a front end to show candidates the\ncustomer confirms — a name is never resolved to an MP-ID unasked.",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "401": {
            "description": "No valid credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "Cedar refused the action",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/partners/{mp_id}": {
      "get": {
        "tags": [
          "partner"
        ],
        "summary": "`GET /api/v1/partners/:gln`",
        "operationId": "get_partner",
        "parameters": [
          {
            "name": "mp_id",
            "in": "path",
            "description": "13-digit MP-ID of the Marktpartner",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "401": {
            "description": "No valid credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "Cedar refused the action",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "partner"
        ],
        "summary": "`PUT /api/v1/partners/:gln`",
        "operationId": "put_partner",
        "parameters": [
          {
            "name": "mp_id",
            "in": "path",
            "description": "13-digit MP-ID of the Marktpartner",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PartnerUpsertRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "401": {
            "description": "No valid credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "Cedar refused the action",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "422": {
            "description": "The request was refused; `code` names the rule",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/partners/{mp_id}/as4-address": {
      "get": {
        "tags": [
          "partner"
        ],
        "summary": "`GET /api/v1/partners/{mp_id}/as4-address`",
        "description": "Returns the list of AS4 endpoint URLs (`Marktteilnehmer.makoadresse`) for the\ngiven MP-ID. Used by `makod` for dynamic AS4 destination routing instead of\nstatic config.\n\nReturns 404 when the partner is not registered or has no AS4 addresses.",
        "operationId": "get_as4_address",
        "parameters": [
          {
            "name": "mp_id",
            "in": "path",
            "description": "13-digit MP-ID of the Marktpartner",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "401": {
            "description": "No valid credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "Cedar refused the action",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/partners/{mp_id}/marktteilnehmer": {
      "get": {
        "tags": [
          "partner"
        ],
        "summary": "`GET /api/v1/partners/{mp_id}/marktteilnehmer`",
        "description": "Returns the stored partner as a typed BO4E `Marktteilnehmer`:\n`mp_id` → `rollencodenummer`, plus `marktrolle`, `rollencodetyp`, `sparte`,\n`makoadresse` and `display_name` → `geschaeftspartner.organisationsname`.\n\nReturns 404 when the partner is not registered.",
        "operationId": "get_partner_marktteilnehmer",
        "parameters": [
          {
            "name": "mp_id",
            "in": "path",
            "description": "13-digit MP-ID of the Marktpartner",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "401": {
            "description": "No valid credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "Cedar refused the action",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/preisblaetter-dienstleistung/{msb_mp_id}": {
      "get": {
        "tags": [
          "preisblatt"
        ],
        "operationId": "get_preisblatt_dienstleistung",
        "parameters": [
          {
            "name": "msb_mp_id",
            "in": "path",
            "description": "13-digit MP-ID of the Messstellenbetreiber",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "date",
            "in": "query",
            "description": "Billing date (`YYYY-MM-DD`) used for temporal validity lookup.\nDefaults to today (UTC) when absent.",
            "required": false,
            "schema": {
              "type": [
                "string",
                "null"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "401": {
            "description": "No valid credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "Cedar refused the action",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "preisblatt"
        ],
        "operationId": "put_preisblatt_dienstleistung",
        "parameters": [
          {
            "name": "msb_mp_id",
            "in": "path",
            "description": "13-digit MP-ID of the Messstellenbetreiber",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PreisblattDlUpsertRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "204": {
            "description": "Written"
          },
          "401": {
            "description": "No valid credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "Cedar refused the action",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "422": {
            "description": "The request was refused; `code` names the rule",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/preisblaetter-hardware/{msb_mp_id}": {
      "get": {
        "tags": [
          "preisblatt"
        ],
        "operationId": "get_preisblatt_hardware",
        "parameters": [
          {
            "name": "msb_mp_id",
            "in": "path",
            "description": "13-digit MP-ID of the Messstellenbetreiber",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "date",
            "in": "query",
            "description": "Billing date (`YYYY-MM-DD`) used for temporal validity lookup.\nDefaults to today (UTC) when absent.",
            "required": false,
            "schema": {
              "type": [
                "string",
                "null"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "401": {
            "description": "No valid credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "Cedar refused the action",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "preisblatt"
        ],
        "operationId": "put_preisblatt_hardware",
        "parameters": [
          {
            "name": "msb_mp_id",
            "in": "path",
            "description": "13-digit MP-ID of the Messstellenbetreiber",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PreisblattHwUpsertRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "204": {
            "description": "Written"
          },
          "401": {
            "description": "No valid credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "Cedar refused the action",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "422": {
            "description": "The request was refused; `code` names the rule",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/preisblaetter-ka/{nb_mp_id}": {
      "get": {
        "tags": [
          "preisblatt"
        ],
        "summary": "`GET /api/v1/preisblaetter-ka/{nb_mp_id}?date=YYYY-MM-DD&sparte=STROM&kundengruppe=Tarifkunden`",
        "description": "Returns the `PreisblattKonzessionsabgabe` for the NB valid on `date`.\nUsed by `netzbilanzd` for KA positions in INVOIC 31001/31002 (KAV §2).",
        "operationId": "get_preisblatt_ka",
        "parameters": [
          {
            "name": "nb_mp_id",
            "in": "path",
            "description": "13-digit MP-ID of the Netzbetreiber",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "date",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "kundengruppe",
            "in": "query",
            "description": "Filter by Kundengruppe: `\"Tarifkunden\"` | `\"Sondervertragskunden\"` | omit for both.",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "sparte",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "401": {
            "description": "No valid credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "Cedar refused the action",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "preisblatt"
        ],
        "summary": "`PUT /api/v1/preisblaetter-ka/{nb_mp_id}`",
        "description": "Upsert a `PreisblattKonzessionsabgabe` for the given NB.\nAlways sets `source = \"api\"`. Returns `204 No Content` on success.",
        "operationId": "put_preisblatt_ka",
        "parameters": [
          {
            "name": "nb_mp_id",
            "in": "path",
            "description": "13-digit MP-ID of the Netzbetreiber",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PreisblattKaUpsertRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "204": {
            "description": "Written"
          },
          "401": {
            "description": "No valid credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "Cedar refused the action",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "422": {
            "description": "The request was refused; `code` names the rule",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/preisblaetter-messung/{msb_mp_id}": {
      "get": {
        "summary": "`GET /api/v1/preisblaetter-messung/{msb_mp_id}?date={billing_date}`",
        "description": "Returns the `PreisblattMessung` for the MSB MP-ID valid on `date`.\nWhen `date` is absent, today's UTC date is used.  Returns 404 when not found.\n\nUsed by `invoicd` for PID 31009 tariff plausibility checks (positions 4+5).",
        "operationId": "get_preisblatt_messung",
        "parameters": [
          {
            "name": "msb_mp_id",
            "in": "path",
            "description": "MSB MP-ID (13-digit BDEW code)",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "date",
            "in": "query",
            "description": "Billing date YYYY-MM-DD; defaults to today",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "PreisblattMessung JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PreisblattMessungResponse"
                }
              }
            }
          },
          "404": {
            "description": "No price sheet found"
          }
        }
      },
      "put": {
        "summary": "`PUT /api/v1/preisblaetter-messung/{msb_mp_id}`",
        "description": "Upsert a `PreisblattMessung` for the given MSB MP-ID.\nAlways sets `source = \"api\"`.  Returns `204 No Content` on success.",
        "operationId": "put_preisblatt_messung",
        "parameters": [
          {
            "name": "msb_mp_id",
            "in": "path",
            "description": "MSB MP-ID (13-digit BDEW code)",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PreisblattMessungUpsertRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "204": {
            "description": "Price sheet stored"
          },
          "400": {
            "description": "Bad request"
          },
          "403": {
            "description": "Forbidden"
          }
        }
      }
    },
    "/api/v1/preisblaetter/{nb_mp_id}": {
      "get": {
        "summary": "`GET /api/v1/preisblaetter/{nb_mp_id}?date={billing_date}`",
        "description": "Returns the `PreisblattNetznutzung` for the NB GLN valid on `date`.\nWhen `date` is absent, today's UTC date is used.\nReturns 404 when no matching price sheet is found.",
        "operationId": "get_preisblatt",
        "parameters": [
          {
            "name": "nb_mp_id",
            "in": "path",
            "description": "NB GLN (13-digit BDEW/DVGW code)",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "date",
            "in": "query",
            "description": "Billing date (`YYYY-MM-DD`) used for temporal validity lookup.\nDefaults to today (UTC) when absent.",
            "required": false,
            "schema": {
              "type": [
                "string",
                "null"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "PreisblattNetznutzung JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PreisblattResponse"
                }
              }
            }
          },
          "404": {
            "description": "No price sheet found for this NB on the given date"
          }
        }
      },
      "put": {
        "summary": "`PUT /api/v1/preisblaetter/{nb_mp_id}`",
        "description": "Upsert a `PreisblattNetznutzung` for the given NB GLN.\n\nThis endpoint always writes with `source = \"api\"`.  An API-sourced sheet is\nnever silently overwritten by a later mako engine ingest (operator override\nprotection).  Returns `204 No Content` on success.",
        "operationId": "put_preisblatt",
        "parameters": [
          {
            "name": "nb_mp_id",
            "in": "path",
            "description": "NB GLN (13-digit BDEW/DVGW code)",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PreisblattUpsertRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "204": {
            "description": "Price sheet stored"
          },
          "400": {
            "description": "Bad request"
          },
          "403": {
            "description": "Forbidden"
          }
        }
      }
    },
    "/api/v1/pricat/{nb_mp_id}/dispatch": {
      "post": {
        "summary": "`POST /api/v1/pricat/{nb_mp_id}/dispatch`",
        "description": "Enqueue immediate (re-)dispatch of the latest PRICAT version for the given NB\nto all currently active LF partners.\n\nThe actual dispatch happens asynchronously in the background. Returns `202\nAccepted` with the version ID that was queued.\n\nUse this endpoint to manually trigger dispatch after an AS4 connectivity\nincident, or to force re-distribution to newly on-boarded LF partners without\nwaiting for the next scheduled scan.",
        "operationId": "post_pricat_dispatch",
        "parameters": [
          {
            "name": "nb_mp_id",
            "in": "path",
            "description": "NB GLN to dispatch PRICAT for",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "202": {
            "description": "Dispatch enqueued"
          },
          "403": {
            "description": "Forbidden"
          },
          "404": {
            "description": "No PRICAT version found for this NB"
          }
        }
      }
    },
    "/api/v1/pricat/{nb_mp_id}/dispatch-log/{version_id}": {
      "get": {
        "summary": "`GET /api/v1/pricat/{nb_mp_id}/dispatch-log/{version_id}`",
        "description": "Returns the dispatch audit log for a specific PRICAT version — one entry per\nLF partner that was reached (or attempted).",
        "operationId": "get_dispatch_log",
        "parameters": [
          {
            "name": "nb_mp_id",
            "in": "path",
            "description": "NB GLN",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "version_id",
            "in": "path",
            "description": "PRICAT version UUID",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Dispatch log entries",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/DispatchLogEntry"
                  }
                }
              }
            }
          },
          "403": {
            "description": "Forbidden"
          }
        }
      }
    },
    "/api/v1/pricat/{nb_mp_id}/history": {
      "get": {
        "summary": "`GET /api/v1/pricat/{nb_mp_id}/history`",
        "description": "Returns all versioned PRICAT snapshots for the given NB GLN, newest first.\nEach entry includes dispatch state so operators can monitor the pipeline.",
        "operationId": "get_pricat_history",
        "parameters": [
          {
            "name": "nb_mp_id",
            "in": "path",
            "description": "NB GLN (13-digit BDEW/DVGW code)",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "PRICAT version history",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/PriCatVersionSummary"
                  }
                }
              }
            }
          },
          "403": {
            "description": "Forbidden"
          }
        }
      }
    },
    "/api/v1/referenzreihen": {
      "get": {
        "tags": [
          "referenzreihen"
        ],
        "summary": "`GET /api/v1/referenzreihen`",
        "operationId": "list_referenzreihen",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "401": {
            "description": "No valid credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "Cedar refused the action",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/referenzreihen/{reihe}/import": {
      "post": {
        "tags": [
          "referenzreihen"
        ],
        "summary": "`POST /api/v1/referenzreihen/{reihe}/import`",
        "operationId": "post_import",
        "parameters": [
          {
            "name": "reihe",
            "in": "path",
            "description": "Referenzreihe name",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "format",
            "in": "query",
            "description": "The file's native format.",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/Format"
            }
          },
          {
            "name": "status",
            "in": "query",
            "description": "Whether the file's values are provisional or final.",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "quelle_url",
            "in": "query",
            "description": "Where the file was published (`https://…`).",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "veroeffentlicht_am",
            "in": "query",
            "description": "When the publisher released it.",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "name": "vorschau",
            "in": "query",
            "description": "`true` reports what the import would do and writes nothing.",
            "required": false,
            "schema": {
              "type": "boolean"
            }
          }
        ],
        "requestBody": {
          "description": "The published file itself, in the `format` the query names",
          "content": {
            "application/octet-stream": {
              "schema": {
                "type": "string"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "401": {
            "description": "No valid credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "Cedar refused the action",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "422": {
            "description": "The request was refused; `code` names the rule",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/referenzreihen/{reihe}/wert": {
      "get": {
        "tags": [
          "referenzreihen"
        ],
        "summary": "`GET /api/v1/referenzreihen/{reihe}/wert`",
        "operationId": "get_wert",
        "parameters": [
          {
            "name": "reihe",
            "in": "path",
            "description": "Referenzreihe name",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "von",
            "in": "query",
            "description": "First Berlin calendar day (inclusive).",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "name": "bis",
            "in": "query",
            "description": "Last Berlin calendar day (inclusive).",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "name": "dim",
            "in": "query",
            "description": "Dimension value; all when absent.",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "stand",
            "in": "query",
            "description": "The instant the read is as of; now when absent.",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "description": "At most this many values (default and ceiling 5 000).",
            "required": false,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "401": {
            "description": "No valid credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "Cedar refused the action",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/referenzreihen/{reihe}/werte": {
      "get": {
        "tags": [
          "referenzreihen"
        ],
        "summary": "`GET /api/v1/referenzreihen/{reihe}/werte`",
        "operationId": "get_werte",
        "parameters": [
          {
            "name": "reihe",
            "in": "path",
            "description": "Referenzreihe name",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "von",
            "in": "query",
            "description": "First Berlin calendar day (inclusive).",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "name": "bis",
            "in": "query",
            "description": "Last Berlin calendar day (inclusive).",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "name": "dim",
            "in": "query",
            "description": "Dimension value; all when absent.",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "stand",
            "in": "query",
            "description": "The instant the read is as of; now when absent.",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "description": "At most this many values (default and ceiling 5 000).",
            "required": false,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "401": {
            "description": "No valid credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "Cedar refused the action",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/steuerbare-ressourcen/{sr_id}": {
      "get": {
        "tags": [
          "device"
        ],
        "summary": "`GET /api/v1/steuerbare-ressourcen/{sr_id}`",
        "operationId": "get_steuerbare_ressource",
        "parameters": [
          {
            "name": "sr_id",
            "in": "path",
            "description": "SteuerbareRessource-ID",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "401": {
            "description": "No valid credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "Cedar refused the action",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "device"
        ],
        "summary": "`PUT /api/v1/steuerbare-ressourcen/{sr_id}`",
        "operationId": "put_steuerbare_ressource",
        "parameters": [
          {
            "name": "sr_id",
            "in": "path",
            "description": "SteuerbareRessource-ID",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpsertSrRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "204": {
            "description": "Written"
          },
          "401": {
            "description": "No valid credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "Cedar refused the action",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "422": {
            "description": "The request was refused; `code` names the rule",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/steuerbare-ressourcen/{sr_id}/konfigurationsprodukte": {
      "get": {
        "tags": [
          "device"
        ],
        "summary": "`GET /api/v1/steuerbare-ressourcen/{sr_id}/konfigurationsprodukte`",
        "description": "Returns the contracted iMS control products (`Vec<Konfigurationsprodukt>`)\nfor the given `SteuerbareRessource`.\n\nUsed by `makod` before dispatching `wim.steuerungsauftrag.bestaetigen`:\nthe MSB MUST only confirm a Steuerungsauftrag for products that are actually\nunder contract.  An uncontracted `produktcode` → reject with ablehnen.\n\nReturns `200 []` when the SteuerbareRessource exists but has no products\nconfigured (MSB should reject — no products = no contract).\nReturns `404` when the SteuerbareRessource is unknown.\n\n## Typed response\n\nEach element is deserialized from JSONB and re-serialized as a canonical\n`rubo4e::current::Konfigurationsprodukt`.  Stored JSONB that no longer\nmatches the schema (e.g. from a legacy manual write) is silently filtered\nout and reported in the `schema_drift` counter.",
        "operationId": "get_konfigurationsprodukte",
        "parameters": [
          {
            "name": "sr_id",
            "in": "path",
            "description": "SteuerbareRessource-ID",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "401": {
            "description": "No valid credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "Cedar refused the action",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "device"
        ],
        "summary": "`PUT /api/v1/steuerbare-ressourcen/{sr_id}/konfigurationsprodukte`",
        "description": "Atomically replace the contracted iMS control products\n(`Vec<Konfigurationsprodukt>`) for an existing `SteuerbareRessource`\n(Codeliste der Konfigurationen 1.4 Kap. 4.1–4.3, ordered under GPKE Teil 3\nKap. 1.3).\n\n## Validation\n\nThe body is a [`PutKonfigurationsprodukteRequest`]. Every element must:\n1. Cross the BO4E gate as a `Konfigurationsprodukt`, with no key BO4E does\n   not define\n2. Carry a non-empty `produktcode` — **mandatory** per BDEW AHB\n\n## Idempotency\n\nSupplying the same list twice is safe (version counter increments but\nthe JSONB payload is unchanged).  Pass `{\"konfigurationsprodukte\": []}` to\nclear all products.\n\n## CloudEvent\n\nEmits `de.mako.markt.sr.konfigurationsprodukt.updated` to the durable fan-out\non every successful write so ERP subscribers and `processd` see the change.\n\nReturns `204 No Content` on success.",
        "operationId": "put_konfigurationsprodukte",
        "parameters": [
          {
            "name": "sr_id",
            "in": "path",
            "description": "SteuerbareRessource-ID",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PutKonfigurationsprodukteRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "204": {
            "description": "Written"
          },
          "401": {
            "description": "No valid credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "Cedar refused the action",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "422": {
            "description": "The request was refused; `code` names the rule",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/steuerbare-ressourcen/{sr_id}/konfigurationsprodukte/{produktcode}": {
      "delete": {
        "tags": [
          "device"
        ],
        "summary": "`DELETE /api/v1/steuerbare-ressourcen/{sr_id}/konfigurationsprodukte/{produktcode}`",
        "description": "Remove a single `Konfigurationsprodukt` from the contracted list for an\nexisting `SteuerbareRessource` by its `produktcode`.\n\nThis is an atomic read-modify-write: the current list is fetched, the\nmatching entry removed, and the result written back via\n`replace_sr_konfigurationsprodukte`.\n\nReturns `204 No Content` on success (even when the `produktcode` was not\nin the list — idempotent), `404` when the SR is unknown.",
        "operationId": "delete_konfigurationsprodukt",
        "parameters": [
          {
            "name": "sr_id",
            "in": "path",
            "description": "SteuerbareRessource-ID",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "produktcode",
            "in": "path",
            "description": "Konfigurationsprodukt code",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Written"
          },
          "401": {
            "description": "No valid credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "Cedar refused the action",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/technische-ressourcen/{tr_id}": {
      "get": {
        "tags": [
          "TechnischeRessource"
        ],
        "summary": "`GET /api/v1/technische-ressourcen/{tr_id}`",
        "operationId": "get_technische_ressource",
        "parameters": [
          {
            "name": "tr_id",
            "in": "path",
            "description": "TrId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Found"
          },
          "403": {
            "description": "Forbidden"
          },
          "404": {
            "description": "Not found"
          }
        }
      },
      "put": {
        "tags": [
          "TechnischeRessource"
        ],
        "summary": "`PUT /api/v1/technische-ressourcen/{tr_id}`",
        "operationId": "put_technische_ressource",
        "parameters": [
          {
            "name": "tr_id",
            "in": "path",
            "description": "TrId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpsertTrRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "204": {
            "description": "Upserted"
          },
          "403": {
            "description": "Forbidden"
          }
        }
      }
    },
    "/api/v1/tranchen": {
      "get": {
        "tags": [
          "tranche"
        ],
        "summary": "GET /api/v1/tranchen — list Tranchen (`?malo_id=` filters by parent MaLo).",
        "operationId": "list_tranchen",
        "parameters": [
          {
            "name": "malo_id",
            "in": "query",
            "description": "Filter by parent Marktlokation.",
            "required": false,
            "schema": {
              "type": [
                "string",
                "null"
              ]
            }
          },
          {
            "name": "page",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "format": "int32",
              "minimum": 0
            },
            "example": 0
          },
          {
            "name": "size",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "format": "int32",
              "minimum": 0
            },
            "example": 50
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "401": {
            "description": "No valid credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "Cedar refused the action",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/tranchen/{id}": {
      "get": {
        "tags": [
          "tranche"
        ],
        "summary": "GET /api/v1/tranchen/{id}",
        "operationId": "get_tranche",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Identifier of the resource",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "401": {
            "description": "No valid credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "Cedar refused the action",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "tranche"
        ],
        "summary": "PUT /api/v1/tranchen/{id} — insert or update a Tranche (NB role).",
        "operationId": "put_tranche",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Identifier of the resource",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TrancheUpsertRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "401": {
            "description": "No valid credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "Cedar refused the action",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "422": {
            "description": "The request was refused; `code` names the rule",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/versorgung/{malo_id}": {
      "get": {
        "tags": [
          "versorgung"
        ],
        "summary": "`GET /api/v1/versorgung/{malo_id}` — the current supply state, or with\n`?at=YYYY-MM-DD` the state as of that German calendar day.",
        "operationId": "get_versorgung_at",
        "parameters": [
          {
            "name": "malo_id",
            "in": "path",
            "description": "11-digit Marktlokations-ID",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "at",
            "in": "query",
            "description": "Point-in-time date in `YYYY-MM-DD` format (German local time, i.e. CET/CEST).\n\nWhen present, returns the supply state as it was at end-of-day on this date,\nreconstructed from the history log.  Omit for the current state.",
            "required": false,
            "schema": {
              "type": [
                "string",
                "null"
              ]
            },
            "example": "2025-04-01"
          }
        ],
        "responses": {
          "200": {
            "description": "The supply state; `ETag` carries its version",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VersorgungsStatusResponse"
                }
              }
            }
          },
          "403": {
            "description": "Missing read-versorgungsstatus"
          },
          "404": {
            "description": "`versorgung_not_found`"
          },
          "422": {
            "description": "`invalid_malo_id` or an invalid `at`"
          }
        }
      },
      "put": {
        "tags": [
          "versorgung"
        ],
        "summary": "PUT /api/v1/versorgung/:malo_id",
        "operationId": "put_versorgungsstatus",
        "parameters": [
          {
            "name": "malo_id",
            "in": "path",
            "description": "11-digit Marktlokations-ID",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/VersorgungsStatusUpsertRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "401": {
            "description": "No valid credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "Cedar refused the action",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "422": {
            "description": "The request was refused; `code` names the rule",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/versorgung/{malo_id}/history": {
      "get": {
        "tags": [
          "versorgung"
        ],
        "summary": "`GET /api/v1/versorgung/{malo_id}/history` — the supply-state change\nhistory, newest first, paged.",
        "operationId": "get_versorgungsstatus_history",
        "parameters": [
          {
            "name": "malo_id",
            "in": "path",
            "description": "11-digit Marktlokations-ID",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "page",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "format": "int32",
              "minimum": 0
            },
            "example": 0
          },
          {
            "name": "size",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "format": "int32",
              "minimum": 0
            },
            "example": 50
          }
        ],
        "responses": {
          "200": {
            "description": "One page of the history",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VersorgungsStatusHistorie"
                }
              }
            }
          },
          "403": {
            "description": "Missing read-versorgungsstatus"
          },
          "422": {
            "description": "`invalid_malo_id`"
          }
        }
      }
    },
    "/api/v1/webhooks/deliveries/{id}/replay": {
      "post": {
        "tags": [
          "webhooks"
        ],
        "summary": "Queue one delivery again, whatever its state.",
        "operationId": "replay_delivery",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "The delivery's id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Replayed"
                }
              }
            }
          },
          "404": {
            "description": "`delivery_not_found`",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "415": {
            "description": "`json_required`",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "422": {
            "description": "`outside_retention`",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/webhooks/endpoints": {
      "get": {
        "tags": [
          "webhooks"
        ],
        "summary": "The endpoints, a page ordered by name.",
        "operationId": "list_endpoints",
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "description": "Rows per page, 1–200; 50 when absent.",
            "required": false,
            "schema": {
              "type": "integer",
              "format": "int32",
              "minimum": 0
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "description": "The `next_cursor` of the previous page; absent for the first.",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Page_Endpoint"
                }
              }
            }
          },
          "400": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "webhooks"
        ],
        "summary": "Register an endpoint; the answer shows its secret once.",
        "operationId": "create_endpoint",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/EndpointCreate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EndpointCreated"
                }
              }
            }
          },
          "409": {
            "description": "`endpoint_name_taken`",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "422": {
            "description": "`endpoint_url_not_allowed`, `endpoint_name_reserved`",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/webhooks/endpoints/{id}": {
      "get": {
        "tags": [
          "webhooks"
        ],
        "summary": "One endpoint, with its version as `ETag`.",
        "operationId": "get_endpoint",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "The endpoint's id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Endpoint"
                }
              }
            }
          },
          "404": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "webhooks"
        ],
        "summary": "Replace an endpoint; `If-Match` names the version read.",
        "operationId": "update_endpoint",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "The endpoint's id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/EndpointUpdate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Endpoint"
                }
              }
            }
          },
          "409": {
            "description": "`endpoint_config_owned`",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "412": {
            "description": "`endpoint_version_mismatch`",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "webhooks"
        ],
        "summary": "Delete an endpoint; its pending deliveries are cancelled with it.",
        "operationId": "delete_endpoint",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "The endpoint's id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": ""
          },
          "409": {
            "description": "`endpoint_config_owned`",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "412": {
            "description": "`endpoint_version_mismatch`",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/webhooks/endpoints/{id}/deliveries": {
      "get": {
        "tags": [
          "webhooks"
        ],
        "summary": "The deliveries of one endpoint, newest first.",
        "operationId": "list_deliveries",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "The endpoint's id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "status",
            "in": "query",
            "description": "Which deliveries; every one when absent.",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/DeliveryFilter"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "description": "Rows per page, 1–200; 50 when absent.",
            "required": false,
            "schema": {
              "type": "integer",
              "format": "int32",
              "minimum": 0
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "description": "The `next_cursor` of the previous page.",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Page_Delivery"
                }
              }
            }
          },
          "404": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/webhooks/endpoints/{id}/replay": {
      "post": {
        "tags": [
          "webhooks"
        ],
        "summary": "Queue every event of a time window again for one endpoint, including\nevents that never had a delivery to it.",
        "operationId": "replay_window",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "The endpoint's id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ReplayWindow"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Replayed"
                }
              }
            }
          },
          "422": {
            "description": "`outside_retention` (with `oldest_replayable`), `replay_window_invalid`, `replay_window_too_large`",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/webhooks/endpoints/{id}/rotate-secret": {
      "post": {
        "tags": [
          "webhooks"
        ],
        "summary": "Rotate the secret: the new one signs from now, the previous one beside it\nfor `overlap_hours`. The answer shows the new secret once.",
        "operationId": "rotate_secret",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "The endpoint's id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RotateSecret"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SecretRotated"
                }
              }
            }
          },
          "409": {
            "description": "`endpoint_config_owned`",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "422": {
            "description": "`overlap_too_long`",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/webhooks/endpoints/{id}/test": {
      "post": {
        "tags": [
          "webhooks"
        ],
        "summary": "Send `de.mako.webhook.test` to the endpoint now, signed like a delivery.",
        "operationId": "test_endpoint",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "The endpoint's id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TestDelivery"
                }
              }
            }
          },
          "404": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "415": {
            "description": "`json_required`",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/zaehler-register/{register_id}/saisons": {
      "get": {
        "tags": [
          "device"
        ],
        "summary": "`GET /api/v1/zaehler-register/{register_id}/saisons`",
        "description": "List all `ZaehlzeitSaison` windows for a register.",
        "operationId": "list_zaehler_saisons",
        "parameters": [
          {
            "name": "register_id",
            "in": "path",
            "description": "Identifier of the Zählwerk/register",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "401": {
            "description": "No valid credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "Cedar refused the action",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "device"
        ],
        "summary": "`PUT /api/v1/zaehler-register/{register_id}/saisons`",
        "description": "Create or update the window of a register that `saison` and `zeit_von`\nidentify — e.g. \"HT applies Mon–Fri 07:00–22:00 in WINTER\". A register the\ncaller's tenant does not hold is `404`. Answers `200` with the window as\nstored.",
        "operationId": "put_zaehler_saison",
        "parameters": [
          {
            "name": "register_id",
            "in": "path",
            "description": "Identifier of the Zählwerk/register",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "description": "`ZaehlzeitSaisonUpsert`",
          "content": {
            "application/json": {
              "schema": {}
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "401": {
            "description": "No valid credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "Cedar refused the action",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "422": {
            "description": "The request was refused; `code` names the rule",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/zaehler/{zaehler_id}": {
      "put": {
        "tags": [
          "device"
        ],
        "summary": "`PUT /api/v1/zaehler/{zaehler_id}`",
        "operationId": "put_zaehler",
        "parameters": [
          {
            "name": "zaehler_id",
            "in": "path",
            "description": "Zählernummer",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpsertZaehlerRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "204": {
            "description": "Written"
          },
          "401": {
            "description": "No valid credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "Cedar refused the action",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "422": {
            "description": "The request was refused; `code` names the rule",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/zaehler/{zaehler_id}/geraete": {
      "get": {
        "tags": [
          "device"
        ],
        "summary": "`GET /api/v1/zaehler/{zaehler_id}/geraete`",
        "operationId": "list_geraete",
        "parameters": [
          {
            "name": "zaehler_id",
            "in": "path",
            "description": "Zählernummer",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "401": {
            "description": "No valid credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "Cedar refused the action",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/zaehler/{zaehler_id}/geraete/{geraet_id}": {
      "get": {
        "tags": [
          "device"
        ],
        "summary": "`GET /api/v1/zaehler/{zaehler_id}/geraete/{geraet_id}`",
        "description": "Returns a single `Geraet` record — full BO4E payload + typed `konfigurationen`.\n\nUnlike `GET /api/v1/zaehler/{zaehler_id}/geraete` (list), this endpoint\nreturns a `404 Not Found` if the device doesn't exist and is suitable for\nexact-identity lookup by ERP systems after WiM Geräteübernahme (PIDs 17001, 17002, 17009).",
        "operationId": "get_geraet",
        "parameters": [
          {
            "name": "zaehler_id",
            "in": "path",
            "description": "Zählernummer",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "geraet_id",
            "in": "path",
            "description": "Gerätenummer",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "401": {
            "description": "No valid credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "Cedar refused the action",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/zaehler/{zaehler_id}/geraete/{geraet_id}/konfigurationen": {
      "get": {
        "tags": [
          "device"
        ],
        "summary": "`GET /api/v1/zaehler/{zaehler_id}/geraete/{geraet_id}/konfigurationen`",
        "description": "Returns **only the typed `konfigurationen` list** for a `Geraet` — suitable for\nERP polling loops that monitor firmware versions or certificate expiry without\nfetching the full BO4E payload.\n\n### Response example\n\n```json\n[\n  { \"parameter\": \"FIRMWARE_VERSION\", \"wert\": \"3.1.2\", \"updated_at\": \"2026-07-18T08:00:00Z\", \"notiz\": null },\n  { \"parameter\": \"CLS_FAEHIG\",       \"wert\": \"true\",  \"updated_at\": \"2026-07-18T08:00:00Z\", \"notiz\": null }\n]\n```",
        "operationId": "get_geraet_konfigurationen",
        "parameters": [
          {
            "name": "zaehler_id",
            "in": "path",
            "description": "Zählernummer",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "geraet_id",
            "in": "path",
            "description": "Gerätenummer",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "401": {
            "description": "No valid credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "Cedar refused the action",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "device"
        ],
        "summary": "`PUT /api/v1/zaehler/{zaehler_id}/geraete/{geraet_id}/konfigurationen`",
        "description": "**Atomically replace** all configuration entries for a `Geraet`.\n\n- Server-side deduplication: last entry wins for duplicate `parameter` values.\n- `updated_at` on each stored entry is set server-side (UTC now).\n- Emits `de.mako.markt.geraet.konfiguration.updated` via the durable fan-out. Its\n  subscribers are the ERP and `agentd`'s `smgw-diagnostics-agent`; neither\n  `edmd` nor `processd` consumes it.\n\n### `SmgwTlsCertFingerprint` and `SmgwCertAblaufdatum`\n\nBoth are master data here. `edmd`'s daily certificate-expiry worker sweeps\nthe `SmgwSession` each gateway registered with `edmd` itself and emits a\ntiered `de.mako.messwert.smgw.cert.expiry-warning` at **90 / 30 / 7 days** before\nexpiry (BSI TR-03109-4 §6.3), once per tier per certificate; it does not read\nthese entries.",
        "operationId": "put_geraet_konfigurationen",
        "parameters": [
          {
            "name": "zaehler_id",
            "in": "path",
            "description": "Zählernummer",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "geraet_id",
            "in": "path",
            "description": "Gerätenummer",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PutKonfigurationenRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "204": {
            "description": "Written"
          },
          "401": {
            "description": "No valid credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "Cedar refused the action",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "422": {
            "description": "The request was refused; `code` names the rule",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/zaehler/{zaehler_id}/register": {
      "get": {
        "tags": [
          "device"
        ],
        "summary": "`GET /api/v1/zaehler/{zaehler_id}/register`",
        "description": "List all `ZaehlzeitRegister` records for a Zähler.\nReturns HT + NT registers for iMSys TOU meters; EINZEL for single-tariff meters.",
        "operationId": "list_zaehler_register",
        "parameters": [
          {
            "name": "zaehler_id",
            "in": "path",
            "description": "Zählernummer",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "401": {
            "description": "No valid credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "Cedar refused the action",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "device"
        ],
        "summary": "`PUT /api/v1/zaehler/{zaehler_id}/register`",
        "description": "Create or update the register of a Zähler that `bezeichnung` and\n`valid_from` identify — one per tariff zone (HT/NT/EINZEL). Answers `200`\nwith the register as stored, whose `id` the season windows are written\nunder.",
        "operationId": "put_zaehler_register",
        "parameters": [
          {
            "name": "zaehler_id",
            "in": "path",
            "description": "Zählernummer",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "description": "`ZaehlzeitRegisterUpsert`",
          "content": {
            "application/json": {
              "schema": {}
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "401": {
            "description": "No valid credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "Cedar refused the action",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "422": {
            "description": "The request was refused; `code` names the rule",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/zaehler/{zaehler_id}/tariff-zone": {
      "get": {
        "tags": [
          "device"
        ],
        "summary": "`GET /api/v1/zaehler/{zaehler_id}/tariff-zone`",
        "description": "Resolve the tariff zone (HT/NT/EINZEL) for a Zähler at a local datetime\n(`?datetime=ISO`, default: now in Europe/Berlin).\n\nThe windows are those of the registers valid on the instant's day, in the\nseason of that day. A single-rate meter answers `EINZEL` from its own\nwindow. An instant no Zählzeit window covers is refused with `422`:\nanswering `EINZEL` there would price a gap in the master data at a rate\nnobody configured. So is an instant two windows of different zones hold.",
        "operationId": "get_tariff_zone",
        "parameters": [
          {
            "name": "zaehler_id",
            "in": "path",
            "description": "Zählernummer",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "401": {
            "description": "No valid credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "Cedar refused the action",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/zaehler/{zaehler_id}/zaehlwerke": {
      "get": {
        "tags": [
          "device"
        ],
        "summary": "`GET /api/v1/zaehler/{zaehler_id}/zaehlwerke`",
        "description": "Returns the `Vec<Zaehlwerk>` registers stored inside `zaehler.data[\"zaehlwerke\"]`\nas typed BO4E objects.\n\nSmart meter gateways (iMSyS) carry multiple registers per Zaehler — active\nimport/export, reactive, max-demand.  This endpoint gives ERP systems and\nMSB applications structured per-register access without parsing raw JSONB.\n\nReturns `404 Not Found` if the Zaehler does not exist or has no `zaehlwerke`\narray in its payload.",
        "operationId": "get_zaehlwerke",
        "parameters": [
          {
            "name": "zaehler_id",
            "in": "path",
            "description": "Zählernummer",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "401": {
            "description": "No valid credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "Cedar refused the action",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/zaehler/{zaehler_id}/zaehlzeitdefinitionen": {
      "get": {
        "tags": [
          "device"
        ],
        "summary": "`GET /api/v1/zaehler/{zaehler_id}/zaehlzeitdefinitionen`",
        "description": "Returns a **typed `rubo4e::current::Zaehlzeitdefinition` BO4E object** for the\ngiven Zähler, assembled from its `zaehler_register` + `zaehler_saisons` rows.\n\n## Why this endpoint?\n\nERP systems (Schleupen, SAP IS-U, powercloud) need to display Time-of-Use register\ndefinitions to customer portal users for §14a Modul 3 tariffs (HT/ST/NT), without\nquerying two endpoints and assembling the nested structure themselves.  This endpoint returns the canonical BO4E `Zaehlzeitdefinition` shape\n(saisons → tagtypen → umschaltzeiten) that portals can display and validate\nschema-first without custom ETL.\n\n## BO4E mapping\n\n```text\nZaehlzeitSaisonRecord rows (zaehler_register × zaehler_saisons)\n  ↓\nZaehlzeitdefinition {\n  _id: zaehler_id,\n  saisons: [\n    Zaehlzeitsaison {\n      bezeichnung: \"WINTER\" | \"SOMMER\" | \"GESAMT\",\n      tagtypen: [\n        Zaehlzeittagtyp {\n          tagtyp: WERKTAGS | WOCHENENDE | ...,\n          umschaltzeiten: [\n            Umschaltzeit { registercode: \"HT\", umschaltzeit: \"07:00\" },\n            Umschaltzeit { registercode: \"NT\", umschaltzeit: \"22:00\" },\n          ]\n        }\n      ]\n    }\n  ]\n}\n```\n\nRegisters with `valid_to IS NOT NULL` (historical) are included in the response.\nUse `?valid_only=true` to restrict to currently valid registers.\n\n## §14a Modul 3 context\n\nUnder §14a Modul 3 (zeitvariable Netzentgelte, BK8-22/010-A), the NB assigns ToU registers (HT/ST/NT) to\ncontrollable loads at specific switching times.\nThis endpoint exposes those definitions in BO4E form for downstream ERP + portal\nconsumption.",
        "operationId": "get_zaehlzeitdefinitionen",
        "parameters": [
          {
            "name": "zaehler_id",
            "in": "path",
            "description": "Zählernummer",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "401": {
            "description": "No valid credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "Cedar refused the action",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/zuordnungsermaechtigungen/{lf_mp_id}": {
      "get": {
        "tags": [
          "zuordnungsermaechtigung"
        ],
        "summary": "`GET /api/v1/zuordnungsermaechtigungen/{lf_mp_id}` — every Ermächtigung,\nactive or ended, naming the Lieferant. An empty list is an answer: no BKV\nhas authorised it.",
        "operationId": "list_zuordnungsermaechtigungen",
        "parameters": [
          {
            "name": "lf_mp_id",
            "in": "path",
            "description": "13-digit MP-ID of the Lieferant",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "401": {
            "description": "No valid credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "403": {
            "description": "Cedar refused the action",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "Angaben": {
        "type": "object",
        "description": "The NB's Angaben of the bündel no BO4E object carries — one dated row.",
        "required": [
          "valid_from",
          "nna_positionen",
          "obis",
          "register"
        ],
        "properties": {
          "nna_positionen": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Nna"
            }
          },
          "obis": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Obis"
            }
          },
          "profilverfahren": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/Verfahren"
              }
            ]
          },
          "register": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Register"
            }
          },
          "standardlastprofil": {
            "type": [
              "string",
              "null"
            ]
          },
          "technische_einrichtungen": {
            "type": [
              "boolean",
              "null"
            ]
          },
          "uenb_mp_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "valid_from": {
            "type": "string",
            "format": "date"
          },
          "valid_to": {
            "type": [
              "string",
              "null"
            ],
            "format": "date"
          }
        }
      },
      "ApiError": {
        "type": "object",
        "description": "The problem body every refusal answers with. Branch on `code`; `detail` is for the developer.",
        "required": [
          "error",
          "detail"
        ],
        "properties": {
          "code": {
            "type": "string",
            "description": "A stable English machine code (`limit_too_large`), where the refusal has one."
          },
          "detail": {
            "type": "string",
            "description": "What went wrong, for the developer."
          },
          "error": {
            "type": "string",
            "description": "The HTTP status's reason phrase."
          },
          "error_id": {
            "type": "string",
            "format": "uuid",
            "description": "On a 5xx: the id the service's log line carries; the cause is never in the body."
          },
          "upstream": {
            "type": "string",
            "description": "On a 502/503/504: the service this one called that failed."
          }
        },
        "additionalProperties": true
      },
      "Delivery": {
        "type": "object",
        "description": "One event to one endpoint.",
        "required": [
          "id",
          "endpoint_id",
          "event_id",
          "event_type",
          "status",
          "attempts",
          "created_at"
        ],
        "properties": {
          "attempts": {
            "type": "integer",
            "format": "int32",
            "description": "Attempts made."
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "description": "When the delivery was created."
          },
          "endpoint_id": {
            "type": "string",
            "format": "uuid",
            "description": "The endpoint delivered to."
          },
          "event_id": {
            "type": "string",
            "description": "The CloudEvent `id`, sent as `webhook-id`."
          },
          "event_type": {
            "type": "string",
            "description": "The CloudEvent `type`."
          },
          "id": {
            "type": "string",
            "format": "uuid",
            "description": "The delivery's id — what a single replay names."
          },
          "last_error": {
            "type": [
              "string",
              "null"
            ],
            "description": "The last attempt's failure."
          },
          "last_status": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int32",
            "description": "The HTTP status of the last attempt; absent when it got no answer."
          },
          "latency_ms": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int32",
            "description": "How long the last answered attempt took, in milliseconds."
          },
          "next_attempt_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "When the next attempt is due, while pending."
          },
          "ordering_key": {
            "type": [
              "string",
              "null"
            ],
            "description": "The aggregate the event is about; deliveries of one key arrive in order."
          },
          "status": {
            "$ref": "#/components/schemas/DeliveryStatus",
            "description": "`pending`, `delivered` or `dead_lettered`."
          }
        }
      },
      "DeliveryFilter": {
        "type": "string",
        "description": "Which deliveries the log lists.",
        "enum": [
          "all",
          "pending",
          "delivered",
          "failed"
        ]
      },
      "DeliveryStatus": {
        "type": "string",
        "description": "A delivery's state.",
        "enum": [
          "pending",
          "delivered",
          "dead_lettered"
        ]
      },
      "DispatchLogEntry": {
        "type": "object",
        "description": "One dispatch audit entry.",
        "required": [
          "id",
          "lf_mp_id",
          "dispatched_at",
          "outcome"
        ],
        "properties": {
          "dispatched_at": {
            "type": "string",
            "format": "date-time"
          },
          "error_detail": {
            "type": [
              "string",
              "null"
            ]
          },
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "lf_mp_id": {
            "type": "string"
          },
          "outcome": {
            "type": "string"
          },
          "process_id": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid"
          }
        }
      },
      "Endpoint": {
        "type": "object",
        "description": "A webhook endpoint, as listed. Its secrets are never part of it.",
        "required": [
          "id",
          "name",
          "url",
          "event_types",
          "patterns_matching_nothing",
          "extensions",
          "owner",
          "active",
          "version",
          "created_at"
        ],
        "properties": {
          "active": {
            "type": "boolean",
            "description": "Whether deliveries are made. A `410 Gone` deactivates an endpoint."
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "description": "When the endpoint was registered."
          },
          "deactivated_reason": {
            "type": [
              "string",
              "null"
            ],
            "description": "Why the endpoint was deactivated (`gone`)."
          },
          "event_types": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "`mako_events::matches` patterns; empty matches every type."
          },
          "extensions": {
            "type": "object",
            "description": "CloudEvent extensions an event must carry with these values\n(`marktsparte`, `marktrole`).",
            "additionalProperties": {
              "type": "string"
            },
            "propertyNames": {
              "type": "string"
            }
          },
          "id": {
            "type": "string",
            "format": "uuid",
            "description": "The endpoint's id."
          },
          "name": {
            "type": "string",
            "description": "Unique per service; `default` is the config URL."
          },
          "owner": {
            "$ref": "#/components/schemas/Owner",
            "description": "`config` or `api`."
          },
          "partner": {
            "type": [
              "string",
              "null"
            ],
            "description": "The Vertriebspartner the endpoint is bound to; it receives only events\nstamped with that partner."
          },
          "patterns_matching_nothing": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "The patterns of `event_types` that match no event type mako emits.\nThey deliver nothing; replace them."
          },
          "previous_secret_expires_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "Until when the previous secret still signs, after a rotation."
          },
          "url": {
            "type": "string",
            "description": "Where deliveries are POSTed."
          },
          "version": {
            "type": "integer",
            "format": "int64",
            "description": "The version `If-Match` names."
          }
        }
      },
      "EndpointCreate": {
        "type": "object",
        "description": "The body of `POST /api/v1/webhooks/endpoints`.",
        "required": [
          "name",
          "url"
        ],
        "properties": {
          "event_types": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "`mako_events::matches` patterns (`de.mako.vertrag.*`); empty matches every type."
          },
          "extensions": {
            "type": "object",
            "description": "CloudEvent extensions an event must carry with these values.",
            "additionalProperties": {
              "type": "string"
            },
            "propertyNames": {
              "type": "string"
            }
          },
          "name": {
            "type": "string",
            "description": "Unique per service; `default` is reserved for the config URL."
          },
          "url": {
            "type": "string",
            "description": "`https` URL deliveries are POSTed to."
          }
        },
        "additionalProperties": false
      },
      "EndpointCreated": {
        "type": "object",
        "description": "A created endpoint and its secret — the only answer that shows it.",
        "required": [
          "endpoint",
          "secret"
        ],
        "properties": {
          "endpoint": {
            "$ref": "#/components/schemas/Endpoint",
            "description": "The endpoint."
          },
          "secret": {
            "type": "string",
            "description": "The `whsec_` signing secret; shown once."
          }
        }
      },
      "EndpointUpdate": {
        "type": "object",
        "description": "The body of `PUT /api/v1/webhooks/endpoints/{id}` — the whole endpoint.",
        "required": [
          "url",
          "active"
        ],
        "properties": {
          "active": {
            "type": "boolean",
            "description": "Whether deliveries are made."
          },
          "event_types": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "`mako_events::matches` patterns; empty matches every type."
          },
          "extensions": {
            "type": "object",
            "description": "CloudEvent extensions an event must carry with these values.",
            "additionalProperties": {
              "type": "string"
            },
            "propertyNames": {
              "type": "string"
            }
          },
          "url": {
            "type": "string",
            "description": "`https` URL deliveries are POSTed to."
          }
        },
        "additionalProperties": false
      },
      "Format": {
        "type": "string",
        "description": "A native format the import reads.",
        "enum": [
          "generisch",
          "smard",
          "energy_charts"
        ]
      },
      "Granularitaet": {
        "type": "string",
        "description": "The Wertegranularität of a register.",
        "enum": [
          "JAEHRLICH",
          "HALBJAEHRLICH",
          "QUARTALSWEISE",
          "MONATLICH"
        ]
      },
      "Kante": {
        "type": "object",
        "description": "One edge of the bündel valid on the Stichtag, half-open\n`[valid_from, valid_to)`.",
        "required": [
          "von_id",
          "von_typ",
          "nach_id",
          "nach_typ"
        ],
        "properties": {
          "nach_id": {
            "type": "string"
          },
          "nach_typ": {
            "$ref": "#/components/schemas/Objekttyp"
          },
          "valid_from": {
            "type": [
              "string",
              "null"
            ],
            "format": "date"
          },
          "valid_to": {
            "type": [
              "string",
              "null"
            ],
            "format": "date"
          },
          "von_id": {
            "type": "string"
          },
          "von_typ": {
            "$ref": "#/components/schemas/Objekttyp"
          }
        }
      },
      "KonfigurationenEntry": {
        "type": "object",
        "description": "A single entry in `PutKonfigurationenRequest`.",
        "required": [
          "parameter",
          "wert"
        ],
        "properties": {
          "notiz": {
            "type": [
              "string",
              "null"
            ],
            "description": "Optional free-text note or sub-key for `Sonstiges` entries."
          },
          "parameter": {
            "type": "string",
            "example": "FIRMWARE_VERSION"
          },
          "wert": {
            "type": "string"
          }
        },
        "additionalProperties": false
      },
      "Lieferstatus": {
        "type": "string",
        "description": "The Lieferstatus of a Marktlokation.",
        "enum": [
          "Beliefert",
          "Unbeliefert",
          "Grundversorgung",
          "Ersatzversorgung",
          "Ruhend",
          "Stillgelegt"
        ]
      },
      "Lokationsbuendel": {
        "type": "object",
        "description": "The Lokationsbündel of a Marktlokation on a Stichtag — the read model\nbehind the Geschäftsdatenanfrage answers 55035 / 55095 / 55060 (UTILMD AHB\nStrom 2.2 Kap. 9.5). Its wire is [`MaloLokationsbuendel`]'s, which makod\nreads with `deny_unknown_fields`, so it carries no field that type lacks;\nthe Lokationsbündelstruktur's wording is [`lokationsbuendelstrukturen`].",
        "required": [
          "malo_id",
          "stichtag",
          "lokationsbuendelcodes",
          "objekte",
          "zuordnungen",
          "zaehler"
        ],
        "properties": {
          "angaben": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/Angaben",
                "description": "The NB's Angaben row covering the Stichtag."
              }
            ]
          },
          "energierichtung": {
            "type": [
              "string",
              "null"
            ],
            "description": "BO4E `Marktlokation.energierichtung` — `AUSSP` verbrauchend, `EINSP`\nerzeugend."
          },
          "lokationsbuendelcodes": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Every distinct `lokationsbuendelcode` the bündel's edges carry; more\nthan one is a graph that disagrees with itself."
          },
          "malo_id": {
            "type": "string"
          },
          "objekte": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Objekt"
            },
            "description": "Every object reached, the Marktlokation itself first."
          },
          "stichtag": {
            "type": "string",
            "format": "date",
            "description": "The date every edge and the Angaben row are resolved for."
          },
          "zaehler": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Zaehler"
            },
            "description": "The Zähler of the bündel's Messlokationen."
          },
          "zuordnungen": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Kante"
            },
            "description": "Every edge valid on the Stichtag that reached them."
          }
        }
      },
      "Lokationsbuendelstruktur": {
        "type": "object",
        "description": "One published Lokationsbündelstruktur.",
        "required": [
          "code",
          "bezeichnung"
        ],
        "properties": {
          "bezeichnung": {
            "type": "string",
            "description": "Its Bezeichnung in the Codeliste der Lokationsbündelstrukturen."
          },
          "code": {
            "type": "string",
            "description": "The `lokationsbuendelcode`."
          }
        }
      },
      "Lokationsbuendelstrukturen": {
        "type": "object",
        "description": "The Codeliste der Lokationsbündelstrukturen (EDI@Energy, BDEW V1.0,\n31.03.2023), as `rubo4e::lokationsbuendel::STRUKTUREN` carries it.",
        "required": [
          "strukturen"
        ],
        "properties": {
          "strukturen": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Lokationsbuendelstruktur"
            }
          }
        }
      },
      "MaloResponse": {
        "type": "object",
        "required": [
          "malo_id",
          "sparte",
          "version",
          "data",
          "rollenzuordnung"
        ],
        "properties": {
          "bilanzierungsgebiet": {
            "type": [
              "string",
              "null"
            ],
            "description": "Bilanzierungsgebiet EIC code extracted from `data.bilanzierungsgebiet`.\nUsed by `processd` NB check 4 as primary source; falls back to `malo_grid` when absent."
          },
          "bilanzierungsmethode": {
            "type": [
              "string",
              "null"
            ],
            "description": "Billing mode extracted from `Marktlokation.bilanzierungsmethode`.\n\nValues: `\"RLM\"` | `\"SLP\"` | `\"TLP_GEMEINSAM\"` | `\"TLP_GETRENNT\"` | `\"PAUSCHAL\"` | `\"IMS\"`.\n`\"RLM\"` → `netzbilanzd` includes Leistungspreis position (`spitzenleistung_kw` required).\n`\"SLP\"` → Arbeitspreis only."
          },
          "data": {
            "type": "object",
            "description": "Validated BO4E `Marktlokation` payload in canonical camelCase form.\nSchema is enforced on every `PUT` — enum fields like `bilanzierungsmethode`\nand `netzebene` are rejected with 422 if they contain unknown values."
          },
          "energierichtung": {
            "type": [
              "string",
              "null"
            ],
            "description": "BO4E `Energierichtung`, named from the grid's point of view:\n`\"EINSP\"` = generation (feeds the grid), `\"AUSSP\"` = consumption."
          },
          "fallgruppe": {
            "type": [
              "string",
              "null"
            ],
            "description": "Gas GaBi RLM Fallgruppe (`data[\"fallgruppenzuordnung\"]`) — determines GaBi billing\ncategory. Values: `GABI_RLM_MIT_TAGESBAND` | `GABI_RLM_OHNE_TAGESBAND` |\n`GABI_RLM_IM_NOMINIERUNGSERSATZVERFAHREN`. Required for Gas MMM settlement routing."
          },
          "fernsteuerbar": {
            "type": [
              "boolean",
              "null"
            ],
            "description": "§14a EnWG „Status der Fernsteuerbarkeit\" (`true` = technisch fernsteuerbar,\n`false` = nicht fernsteuerbar). Populated from UTILMD `CCI+7037` Z97/Z96."
          },
          "gasqualitaet": {
            "type": [
              "string",
              "null"
            ],
            "description": "Gas quality extracted from `data.gasqualitaet` (`\"H_GAS\"` | `\"L_GAS\"`)."
          },
          "lokationsbuendel_objektcode": {
            "type": [
              "string",
              "null"
            ],
            "description": "Lokationsbündel object code (`Marktlokation.lokationsbuendelObjektcode`,\nUTILMD Lokationsbündelstruktur)."
          },
          "malo_id": {
            "type": "string"
          },
          "netzebene": {
            "type": [
              "string",
              "null"
            ],
            "description": "Voltage/pressure level extracted from `data.netzebene` — a BO4E\n`Netzebene` wire value (`\"NSP\"`, `\"MSP\"`, `\"HSP\"`, `\"HSS\"`, `\"MSP_NSP_UMSP\"`, …).\nAvailable immediately on write; no separate grid provisioning needed."
          },
          "regelzone": {
            "type": [
              "string",
              "null"
            ],
            "description": "Regelzone EIC code (`Marktlokation.regelzone`) — maps to the ÜNB for MABIS IFTSTA 21000\nrouting and Redispatch 2.0 Stammdaten forwarding (VNB → ÜNB)."
          },
          "rollenzuordnung": {
            "type": "array",
            "items": {
              "type": "object"
            }
          },
          "sparte": {
            "type": "string",
            "example": "STROM"
          },
          "version": {
            "type": "integer",
            "format": "int64"
          }
        }
      },
      "MaloUpsertRequest": {
        "type": "object",
        "required": [
          "sparte",
          "data"
        ],
        "properties": {
          "data": {
            "description": "Full BO4E MARKTLOKATION payload."
          },
          "rollenzuordnung": {
            "type": "array",
            "items": {
              "type": "object"
            }
          },
          "sparte": {
            "type": "string",
            "description": "\"STROM\" or \"GAS\"",
            "example": "STROM"
          }
        },
        "additionalProperties": false
      },
      "MeloResponse": {
        "type": "object",
        "required": [
          "melo_id",
          "version",
          "data"
        ],
        "properties": {
          "data": {
            "type": "object",
            "description": "Validated BO4E `Messlokation` payload in canonical camelCase form.\n`_typ` is auto-injected on write; enum fields validated on write."
          },
          "lokationsbuendel_objektcode": {
            "type": [
              "string",
              "null"
            ],
            "description": "Lokationsbündel object code (`Messlokation.lokationsbuendelObjektcode`,\nUTILMD Lokationsbündelstruktur)."
          },
          "malo_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "melo_id": {
            "type": "string"
          },
          "netzebene_messung": {
            "type": [
              "string",
              "null"
            ],
            "description": "Voltage/pressure level at the metering point (`Messlokation.netzebeneMessung`)."
          },
          "regelzone": {
            "type": [
              "string",
              "null"
            ],
            "description": "Regelzone EIC code extracted from `standorteigenschaften.eigenschaftenStrom[0].regelzone`.\nMaps this MeLo to the ÜNB for Redispatch 2.0 Stammdaten routing."
          },
          "standorteigenschaften": {
            "description": "Full BO4E `Standorteigenschaften` JSONB — carries `StandorteigenschaftenStrom`\n(regelzone, bilanzierungsgebietEic) and `StandorteigenschaftenGas` (druckstufe).\nRequired for Redispatch 2.0 `NetworkConstraintDocument` and Gas billing zones."
          },
          "version": {
            "type": "integer",
            "format": "int64"
          }
        }
      },
      "MeloUpsertRequest": {
        "type": "object",
        "required": [
          "data"
        ],
        "properties": {
          "data": {
            "description": "Full BO4E MESSLOKATION payload.\n\nThe BO4E schema version is **not** a request field: it is provenance,\nand only the server knows which series it parsed the payload under. It\nis returned on the `GET`."
          },
          "malo_id": {
            "type": [
              "string",
              "null"
            ],
            "description": "Associated MaLo-ID (optional)."
          }
        },
        "additionalProperties": false
      },
      "MsbRahmenvertrag": {
        "type": "object",
        "description": "An MSB framework-contract record **as stored**.\n\nThe natural key is `(tenant, sparte, nb_mp_id, msb_mp_id, valid_from)` —\nupserts are idempotent on it and keep the `id` stable.\n\n`vertrag` reads back as opaque JSON, the way every stored BO4E document in\nmako does: a row may predate the current schema series. What goes *in* is\n[`MsbRvUpsertRequest`], gated.",
        "required": [
          "id",
          "tenant",
          "sparte",
          "nb_mp_id",
          "msb_mp_id",
          "status",
          "valid_from",
          "vertrag",
          "version"
        ],
        "properties": {
          "fassung": {
            "type": [
              "string",
              "null"
            ],
            "description": "Contract text edition. Gas: `KoV XV Anlage 8` unless named otherwise\n(legacy: `BK7-17-026`). Strom: as the parties name it, or absent."
          },
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "msb_mp_id": {
            "type": "string"
          },
          "nb_mp_id": {
            "type": "string"
          },
          "signed_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "sparte": {
            "type": "string",
            "example": "GAS"
          },
          "status": {
            "$ref": "#/components/schemas/MsbRvStatus"
          },
          "tenant": {
            "type": "string"
          },
          "valid_from": {
            "type": "string",
            "format": "date",
            "description": "First day of validity, inclusive."
          },
          "valid_to": {
            "type": [
              "string",
              "null"
            ],
            "format": "date",
            "description": "First day **no longer** valid (half-open `[valid_from, valid_to)`)."
          },
          "version": {
            "type": "integer",
            "format": "int64",
            "description": "Optimistic-locking version, incremented on every successful write."
          },
          "vertrag": {
            "description": "The stored BO4E `Vertrag` (vertragsart `RAHMENVERTRAG`), as stored."
          }
        }
      },
      "MsbRvBefund": {
        "type": "string",
        "description": "What the registry says about one (Sparte, NB, MSB, day).",
        "enum": [
          "abgeschlossen",
          "kein_vertrag",
          "angeboten",
          "anpassung_erforderlich",
          "beendet"
        ]
      },
      "MsbRvPruefung": {
        "type": "object",
        "description": "The answer of `GET /api/v1/msb-rahmenvertraege/check`.",
        "required": [
          "abgeschlossen",
          "befund"
        ],
        "properties": {
          "abgeschlossen": {
            "type": "boolean",
            "description": "`true` only when a contract with status `abgeschlossen` is valid on\n`datum`."
          },
          "befund": {
            "$ref": "#/components/schemas/MsbRvBefund"
          },
          "vertrag": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/MsbRahmenvertrag",
                "description": "The contract covering `datum`, when one does."
              }
            ]
          }
        }
      },
      "MsbRvStatus": {
        "type": "string",
        "description": "Lifecycle state of an MSB framework contract.",
        "enum": [
          "angeboten",
          "abgeschlossen",
          "anpassung_erforderlich",
          "beendet"
        ]
      },
      "MsbRvUpsertRequest": {
        "type": "object",
        "description": "The `PUT /api/v1/msb-rahmenvertraege` body.\n\nSeparate from [`MsbRahmenvertrag`] because the two directions are not\nsymmetric: what is **written** must cross the BO4E gate, and what is\n**read** is whatever was stored.",
        "required": [
          "sparte",
          "nb_mp_id",
          "msb_mp_id",
          "valid_from"
        ],
        "properties": {
          "fassung": {
            "type": [
              "string",
              "null"
            ],
            "description": "Contract text edition. Absent on a Gas row stores [`FASSUNG_GAS`];\nabsent on a Strom row stores nothing."
          },
          "id": {
            "type": "string",
            "format": "uuid",
            "description": "Optional: an id to keep stable. Absent → allocated on insert."
          },
          "msb_mp_id": {
            "type": "string"
          },
          "nb_mp_id": {
            "type": "string"
          },
          "signed_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "sparte": {
            "type": "string",
            "description": "`STROM` or `GAS` — required: the NB holds one MP-ID per Sparte, and a\ncontract of one Sparte never answers the other's lookup.",
            "example": "STROM"
          },
          "status": {
            "$ref": "#/components/schemas/MsbRvStatus"
          },
          "valid_from": {
            "type": "string",
            "format": "date"
          },
          "valid_to": {
            "type": [
              "string",
              "null"
            ],
            "format": "date"
          },
          "version": {
            "type": "integer",
            "format": "int64",
            "description": "Optimistic-locking version; `0`/absent skips the check."
          },
          "vertrag": {
            "type": "object",
            "description": "The BO4E `Vertrag` (vertragsart `RAHMENVERTRAG`), crossing\n[the gate](mako_markt::bo4e::decode) as it deserialises.\n\nAbsent stores the empty object the column defaults to, not `null`."
          }
        },
        "additionalProperties": false
      },
      "NbContractResponse": {
        "type": "object",
        "required": [
          "contract_id",
          "malo_id",
          "nb_mp_id",
          "sparte",
          "netzebene",
          "bilanzierungsmethode",
          "billing_schedule",
          "netznutzer_mp_id",
          "netznutzer_typ",
          "valid_from",
          "data",
          "version",
          "tenant"
        ],
        "properties": {
          "bilanzierungsmethode": {
            "type": "string"
          },
          "billing_schedule": {
            "type": "string"
          },
          "contract_id": {
            "type": "string"
          },
          "data": {
            "type": "object",
            "description": "Full BO4E `Vertrag` payload in canonical camelCase form.\n`_typ: \"VERTRAG\"` is always present after a successful PUT."
          },
          "malo_id": {
            "type": "string"
          },
          "nb_mp_id": {
            "type": "string"
          },
          "netzebene": {
            "type": "string"
          },
          "netznutzer_mp_id": {
            "type": "string"
          },
          "netznutzer_typ": {
            "type": "string"
          },
          "sparte": {
            "type": "string"
          },
          "tenant": {
            "type": "string"
          },
          "valid_from": {
            "type": "string"
          },
          "valid_to": {
            "type": [
              "string",
              "null"
            ]
          },
          "version": {
            "type": "integer",
            "format": "int64"
          },
          "vertragsart": {
            "type": [
              "string",
              "null"
            ],
            "description": "BO4E `Vertragsart` extracted from `data.vertragsart`."
          },
          "vertragsstatus": {
            "type": [
              "string",
              "null"
            ],
            "description": "BO4E `Vertragsstatus` lifecycle — extracted from `data.vertragsstatus`."
          }
        }
      },
      "NbContractUpsertRequest": {
        "type": "object",
        "required": [
          "malo_id",
          "nb_mp_id",
          "sparte",
          "netzebene",
          "bilanzierungsmethode",
          "billing_schedule",
          "netznutzer_mp_id",
          "valid_from"
        ],
        "properties": {
          "bilanzierungsmethode": {
            "type": "string",
            "description": "Billing mode: RLM | SLP | IMS | TLP_GEMEINSAM | TLP_GETRENNT | PAUSCHAL"
          },
          "billing_schedule": {
            "type": "string",
            "description": "MONTHLY | QUARTERLY | ANNUALLY"
          },
          "data": {
            "description": "Full BO4E `Vertrag` payload (L1).\n\n`_typ` is auto-injected to `\"VERTRAG\"` if absent.\nWhen omitted, a minimal `Vertrag` is auto-constructed from the other fields.\nReturns 422 if `_typ` is present but not `\"VERTRAG\"`, or if any typed\nfield (e.g. `vertragsart`, `vertragsstatus`) contains an unknown enum value."
          },
          "malo_id": {
            "type": "string"
          },
          "nb_mp_id": {
            "type": "string"
          },
          "netzebene": {
            "type": "string",
            "description": "Voltage / pressure level: NS | MS | MSP | HSP | HS | HöS | HöS/HS (Strom)\nor GND | GMT | GHD (Gas)"
          },
          "netznutzer_mp_id": {
            "type": "string",
            "description": "MP-ID of the Netznutzer this contract is with — the LF in the ordinary\ncase, the Letztverbraucher itself for a Selbstzahler."
          },
          "netznutzer_typ": {
            "type": "string",
            "description": "`LIEFERANT` (default) | `LETZTVERBRAUCHER`.\n\n`LETZTVERBRAUCHER` marks a **Selbstzahler** — a „Netznutzer ohne\nAll-Inklusiv-Vertrag\" who pays the Netznutzung without an LF and steps\ninto the LF role (GPKE Teil 1, Vorbemerkung).",
            "example": "LIEFERANT"
          },
          "sparte": {
            "type": "string",
            "example": "STROM"
          },
          "valid_from": {
            "type": "string",
            "description": "Contract start date (ISO 8601, e.g. `\"2026-01-01\"`)"
          },
          "valid_to": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "additionalProperties": false
      },
      "NeLoUpsertRequest": {
        "type": "object",
        "description": "PUT body — the BO4E `Netzlokation` in `data`, plus what the BO does not carry.\n\n`nb_mp_id` is the one envelope field: it is an indexed column and\n`Netzlokation` declares no Netzbetreiber. `sparte` is indexed too, but the\nBO declares it, so it is derived from the payload and required by the\nendpoint's profile.",
        "required": [
          "nb_mp_id",
          "data"
        ],
        "properties": {
          "data": {
            "type": "object",
            "description": "Full `rubo4e::current::Netzlokation` payload (BO4E camelCase JSON).\n\nCrosses [the BO4E gate](mako_markt::bo4e::decode), and then this\nendpoint's own profile: `sparte` is **required** despite BO4E making it\noptional, and must be `STROM` or `GAS` — MaKo is a two-commodity market\nby regulation, while BO4E's `Sparte` also covers Fernwärme, Wasser and\nAbwasser.\n\n`sparte` is **not** an envelope field: the BO declares it, and two\nsources for one fact would let a caller file a Netzlokation under `GAS`\nwhile its stored document says `STROM`. The column is what every query\nreads."
          },
          "nb_mp_id": {
            "type": "string",
            "description": "Owning Netzbetreiber MP-ID (indexed column, required for filtering).\n\nmako's own: `Netzlokation` declares no Netzbetreiber field, so this is\nnot a restatement of anything the BO carries."
          }
        },
        "additionalProperties": false
      },
      "Nna": {
        "type": "object",
        "description": "One Netznutzungsabrechnungsposition.",
        "required": [
          "artikel_id",
          "zu_abschlag_prozent"
        ],
        "properties": {
          "artikel_id": {
            "type": "string"
          },
          "zu_abschlag_prozent": {
            "type": "string",
            "format": "decimal",
            "description": "Zuschlag (> 0) or Abschlag (< 0) in Prozent."
          }
        }
      },
      "Obis": {
        "type": "object",
        "description": "One OBIS-Kennzahl of the Marktlokation with its Verwendungszwecke.",
        "required": [
          "obis_kennzahl"
        ],
        "properties": {
          "obis_kennzahl": {
            "type": "string"
          },
          "verwendungszweck_lf": {
            "type": [
              "string",
              "null"
            ]
          },
          "verwendungszweck_nb": {
            "type": [
              "string",
              "null"
            ]
          },
          "verwendungszweck_uenb": {
            "type": [
              "string",
              "null"
            ]
          },
          "wertegranularitaet": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/Granularitaet"
              }
            ]
          }
        }
      },
      "Objekt": {
        "type": "object",
        "description": "One object of the bündel.",
        "required": [
          "typ",
          "id"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "objektcode": {
            "type": [
              "string",
              "null"
            ],
            "description": "BO4E `lokationsbuendelObjektcode` — the object's position in the\nLokationsbündelstruktur."
          },
          "typ": {
            "$ref": "#/components/schemas/Objekttyp"
          }
        }
      },
      "Objekttyp": {
        "type": "string",
        "description": "The kind of object in a Lokationsbündel.",
        "enum": [
          "MALO",
          "MELO",
          "NELO",
          "SR",
          "TR"
        ]
      },
      "Owner": {
        "type": "string",
        "description": "Who owns an endpoint.",
        "enum": [
          "config",
          "api"
        ]
      },
      "Page_Delivery": {
        "type": "object",
        "description": "One page of a list.",
        "required": [
          "items"
        ],
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "type": "object",
              "description": "One event to one endpoint.",
              "required": [
                "id",
                "endpoint_id",
                "event_id",
                "event_type",
                "status",
                "attempts",
                "created_at"
              ],
              "properties": {
                "attempts": {
                  "type": "integer",
                  "format": "int32",
                  "description": "Attempts made."
                },
                "created_at": {
                  "type": "string",
                  "format": "date-time",
                  "description": "When the delivery was created."
                },
                "endpoint_id": {
                  "type": "string",
                  "format": "uuid",
                  "description": "The endpoint delivered to."
                },
                "event_id": {
                  "type": "string",
                  "description": "The CloudEvent `id`, sent as `webhook-id`."
                },
                "event_type": {
                  "type": "string",
                  "description": "The CloudEvent `type`."
                },
                "id": {
                  "type": "string",
                  "format": "uuid",
                  "description": "The delivery's id — what a single replay names."
                },
                "last_error": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "description": "The last attempt's failure."
                },
                "last_status": {
                  "type": [
                    "integer",
                    "null"
                  ],
                  "format": "int32",
                  "description": "The HTTP status of the last attempt; absent when it got no answer."
                },
                "latency_ms": {
                  "type": [
                    "integer",
                    "null"
                  ],
                  "format": "int32",
                  "description": "How long the last answered attempt took, in milliseconds."
                },
                "next_attempt_at": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "format": "date-time",
                  "description": "When the next attempt is due, while pending."
                },
                "ordering_key": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "description": "The aggregate the event is about; deliveries of one key arrive in order."
                },
                "status": {
                  "$ref": "#/components/schemas/DeliveryStatus",
                  "description": "`pending`, `delivered` or `dead_lettered`."
                }
              }
            },
            "description": "The rows of this page, in the list's order."
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ],
            "description": "The cursor of the next page; absent on the last."
          },
          "total_estimate": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/TotalEstimate",
                "description": "How many rows the whole list holds, where the list counts them."
              }
            ]
          }
        }
      },
      "Page_Endpoint": {
        "type": "object",
        "description": "One page of a list.",
        "required": [
          "items"
        ],
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "type": "object",
              "description": "A webhook endpoint, as listed. Its secrets are never part of it.",
              "required": [
                "id",
                "name",
                "url",
                "event_types",
                "patterns_matching_nothing",
                "extensions",
                "owner",
                "active",
                "version",
                "created_at"
              ],
              "properties": {
                "active": {
                  "type": "boolean",
                  "description": "Whether deliveries are made. A `410 Gone` deactivates an endpoint."
                },
                "created_at": {
                  "type": "string",
                  "format": "date-time",
                  "description": "When the endpoint was registered."
                },
                "deactivated_reason": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "description": "Why the endpoint was deactivated (`gone`)."
                },
                "event_types": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  },
                  "description": "`mako_events::matches` patterns; empty matches every type."
                },
                "extensions": {
                  "type": "object",
                  "description": "CloudEvent extensions an event must carry with these values\n(`marktsparte`, `marktrole`).",
                  "additionalProperties": {
                    "type": "string"
                  },
                  "propertyNames": {
                    "type": "string"
                  }
                },
                "id": {
                  "type": "string",
                  "format": "uuid",
                  "description": "The endpoint's id."
                },
                "name": {
                  "type": "string",
                  "description": "Unique per service; `default` is the config URL."
                },
                "owner": {
                  "$ref": "#/components/schemas/Owner",
                  "description": "`config` or `api`."
                },
                "partner": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "description": "The Vertriebspartner the endpoint is bound to; it receives only events\nstamped with that partner."
                },
                "patterns_matching_nothing": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  },
                  "description": "The patterns of `event_types` that match no event type mako emits.\nThey deliver nothing; replace them."
                },
                "previous_secret_expires_at": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "format": "date-time",
                  "description": "Until when the previous secret still signs, after a rotation."
                },
                "url": {
                  "type": "string",
                  "description": "Where deliveries are POSTed."
                },
                "version": {
                  "type": "integer",
                  "format": "int64",
                  "description": "The version `If-Match` names."
                }
              }
            },
            "description": "The rows of this page, in the list's order."
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ],
            "description": "The cursor of the next page; absent on the last."
          },
          "total_estimate": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/TotalEstimate",
                "description": "How many rows the whole list holds, where the list counts them."
              }
            ]
          }
        }
      },
      "Page_Value": {
        "type": "object",
        "description": "One page of a list.",
        "required": [
          "items"
        ],
        "properties": {
          "items": {
            "type": "array",
            "items": {},
            "description": "The rows of this page, in the list's order."
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ],
            "description": "The cursor of the next page; absent on the last."
          },
          "total_estimate": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/TotalEstimate",
                "description": "How many rows the whole list holds, where the list counts them."
              }
            ]
          }
        }
      },
      "PartnerUpsertRequest": {
        "type": "object",
        "description": "The `PUT /api/v1/partners/{mp_id}` body.\n\nSeparate from [`PartnerRecord`] because the two directions are not\nsymmetric: what is written must cross the BO4E gate, and what is read is\nwhatever was stored, possibly under an older schema series. The stored row\nalso carries a `version` the server owns.",
        "properties": {
          "display_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "edi_extrahierbar": {
            "type": [
              "boolean",
              "null"
            ],
            "description": "Whether the EDI format agreed with this partner allows the complete\nextraction of the invoice data into an EN 16931 format — an E-Rechnung\nunder § 14 Abs. 1 Satz 6 Nr. 2 UStG. Omitted or `null` is „not\nrecorded\"; from a supply in 2027 that no grace reaches, makod refuses an\noutbound INVOIC on it."
          },
          "edi_zustimmung": {
            "type": [
              "boolean",
              "null"
            ],
            "description": "The partner's Zustimmung to receiving invoices as EDI@Energy INVOIC\n(§ 27 Abs. 38 Nr. 1 and 3 UStG). Omitted or `null` is „not recorded\",\nand makod refuses an outbound INVOIC to the partner on it."
          },
          "geschaeftspartner": {
            "type": "object",
            "description": "The partner's BO4E `Geschaeftspartner`, crossing\n[the gate](mako_markt::bo4e::decode) as the request deserialises —\n`_typ`, schema, strict enums (`marktrolle`, `rollencodetyp`,\n`marktteilnehmerstatus`, and every other enum in the tree), BO4E rules.\n\nA `serde_json::Value` here would be gated only where the handler\nremembered to; as `Bo4e<Geschaeftspartner>` the gate is the only way in."
          },
          "makoadresse": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "AS4 endpoint URL list (BO4E `Marktteilnehmer.makoadresse`)."
          },
          "marktrolle": {
            "type": "string",
            "description": "BO4E market role — the BDEW code (`LF`, `NB`, `MSB`, …)."
          },
          "mp_id": {
            "type": "string",
            "description": "13-digit Marktpartner-ID.\n\nOptional, and refused when it names a **different** partner than the\n`{mp_id}` path parameter — the same treatment the BO4E gate gives\n`_typ`, and for the same reason: the path already fixes which partner\nthis is, so requiring the caller to repeat it adds a way to be wrong and\nno information — and silently letting the path win means a body naming\nanother partner is neither honoured nor reported."
          },
          "rollencodetyp": {
            "type": "string",
            "description": "Coding authority: `BDEW` | `DVGW` | `GLN`."
          },
          "sparte": {
            "type": "string"
          }
        },
        "additionalProperties": false
      },
      "PreisblattDlUpsertRequest": {
        "type": "object",
        "required": [
          "data"
        ],
        "properties": {
          "data": {
            "type": "object",
            "description": "The BO4E `PreisblattDienstleistung`, crossing\n[the gate](mako_markt::bo4e::decode) as the request deserialises."
          }
        },
        "additionalProperties": false
      },
      "PreisblattHwUpsertRequest": {
        "type": "object",
        "required": [
          "data"
        ],
        "properties": {
          "data": {
            "type": "object",
            "description": "The BO4E `PreisblattHardware`, crossing\n[the gate](mako_markt::bo4e::decode) as the request deserialises."
          }
        },
        "additionalProperties": false
      },
      "PreisblattKaUpsertRequest": {
        "type": "object",
        "description": "Request body for `PUT /api/v1/preisblaetter-ka/{nb_mp_id}`.",
        "required": [
          "data"
        ],
        "properties": {
          "data": {
            "type": "object",
            "description": "The BO4E `PreisblattKonzessionsabgabe`, crossing\n[the gate](mako_markt::bo4e::decode) as the request deserialises."
          },
          "kundengruppe_ka": {
            "type": [
              "string",
              "null"
            ],
            "description": "`\"Tarifkunden\"` | `\"Sondervertragskunden\"` | omit for both."
          },
          "sparte": {
            "type": "string",
            "description": "`\"STROM\"` or `\"GAS\"`. Defaults to `\"STROM\"`."
          }
        },
        "additionalProperties": false
      },
      "PreisblattMessungResponse": {
        "type": "object",
        "description": "Response body for `GET /api/v1/preisblaetter-messung/{msb_mp_id}`.\n\n## Typed `zeitvariablePreispositionen`\n\n`zeitvariable_preispositionen` is exposed as a typed `Vec<ZeitvariablePreisposition>`\n(deserialized from stored JSONB). This enables consumers (`invoicd` check 4,\n`invoic-checker` MSB position validation) to directly access the `zaehlzeitregister`\nband code without JSON path traversal.\n\n`schema_drift` counts elements that could not be deserialized (indicates stale data\nwritten before the band-code validation — re-PUT to normalize).",
        "required": [
          "data",
          "source",
          "bo4e_version",
          "updated_at"
        ],
        "properties": {
          "auf_abschlaege": {
            "type": "array",
            "items": {},
            "description": "Price supplements and discounts (BO4E `AufAbschlag`).\n\nExtracted from `data.aufAbschlaege` for explicit typed access.\nContains conditional supplements and discounts on the MSB base price:\n- remote-read surcharge (`AufAbschlagstyp::AUFSCHLAG`)\n- discounts (`AufAbschlagstyp::ABSCHLAG`)\n- hardware rental add-ons\n\nAn empty list means no supplements/discounts are configured."
          },
          "bo4e_version": {
            "type": "string",
            "description": "BO4E schema version of `data`."
          },
          "data": {
            "description": "The full BO4E `PreisblattMessung` payload."
          },
          "schema_drift_count": {
            "type": "integer",
            "format": "int32",
            "description": "Number of `zeitvariablePreispositionen` elements that failed schema validation.\nNon-zero means a stored element no longer decodes under the current\nschema — re-PUT the sheet to normalize it.",
            "minimum": 0
          },
          "source": {
            "type": "string",
            "description": "How this record entered the system (`\"api\"` or `\"mako\"`)."
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "description": "Wall-clock time (UTC) when this sheet was last written."
          },
          "zeitvariable_preispositionen": {
            "type": "array",
            "items": {
              "type": "object"
            },
            "description": "Time-of-use MSB price positions.\n\nTyped `Vec<ZeitvariablePreisposition>` deserialized from stored JSONB.\nEach element carries `zaehlzeitregister` (e.g. `\"HT\"`, `\"NT\"`), which\nidentifies the band. Used by `invoicd` check 4 for INVOIC 31009 MSB\ntariff validation. A Messstellenbetrieb price is not a Netzentgelt, so\n§ 14a does not number these bands.\n\nEmpty = no TOU bands configured (pure flat MSB tariff)."
          }
        }
      },
      "PreisblattMessungUpsertRequest": {
        "type": "object",
        "description": "Request body for `PUT /api/v1/preisblaetter-messung/{msb_mp_id}`.",
        "required": [
          "data"
        ],
        "properties": {
          "data": {
            "description": "Full BO4E `PreisblattMessung` payload.\n\n`bo4e_version` is **not** an envelope field: it is provenance, and only\nthe server knows which schema series it parsed the payload under. A\ncaller-supplied one let a row be stamped with a version mako never read\nit as."
          }
        },
        "additionalProperties": false
      },
      "PreisblattResponse": {
        "type": "object",
        "description": "Response body for `GET /api/v1/preisblaetter/{nb_mp_id}`.\n\nWraps the BO4E payload with metadata so callers can distinguish\noperator API uploads from engine-ingested sheets.",
        "required": [
          "data",
          "source",
          "bo4e_version",
          "updated_at"
        ],
        "properties": {
          "bo4e_version": {
            "type": "string",
            "description": "BO4E schema version of `data`."
          },
          "data": {
            "description": "The full BO4E `PreisblattNetznutzung` payload."
          },
          "lastvariable_preispositionen": {
            "type": "array",
            "items": {},
            "description": "Quantity-tiered price positions (`LastvariablePreisposition`).\n\nExtracted from `data.lastvariablePreispositionen`. Each element is\npriced by its `tarifkalkulationsmethode` (`STAFFELN`, `ZONEN`, …) over\nits `preisstaffeln`. Not a § 14a module.\n\nEmpty = no quantity-tiered positions on this sheet."
          },
          "source": {
            "type": "string",
            "description": "How this record entered the system.\n`\"api\"` — operator REST upload; `\"mako\"` — PRICAT 27003 engine ingest."
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "description": "Wall-clock time (UTC) when this sheet was last written."
          },
          "zeitvariable_preispositionen": {
            "type": "array",
            "items": {},
            "description": "The § 14a Modul 3 zeitvariables Netzentgelt (BK8-22/010-A Tenor 3.).\n\nExtracted from `data.zeitvariablePreispositionen` for explicit typed\naccess: one `ZeitvariablePreisposition` per Tarifstufe, named by its\n`zaehlzeitregister` — `HT`, `ST` and `NT`, all three present (refused on\nPUT otherwise). `invoicd` check 4 and `netzbilanzd` read the band prices\nfrom here before falling back to static `Leistungstyp` positions.\n\nEmpty = no zeitvariables Netzentgelt on this sheet."
          }
        }
      },
      "PreisblattUpsertRequest": {
        "type": "object",
        "description": "Request body for `PUT /api/v1/preisblaetter/{nb_mp_id}`.",
        "required": [
          "data"
        ],
        "properties": {
          "data": {
            "description": "Full BO4E `PreisblattNetznutzung` payload.\n\n`bo4e_version` is **not** an envelope field: it is provenance, and only\nthe server knows which schema series it parsed the payload under. A\ncaller-supplied one let a row be stamped with a version mako never read\nit as."
          }
        },
        "additionalProperties": false
      },
      "PriCatVersionSummary": {
        "type": "object",
        "description": "One entry in the PRICAT version history list.",
        "required": [
          "id",
          "nb_mp_id",
          "valid_from",
          "bo4e_version",
          "source",
          "dispatch_state",
          "created_at",
          "updated_at"
        ],
        "properties": {
          "bo4e_version": {
            "type": "string"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "dispatch_error": {
            "type": [
              "string",
              "null"
            ]
          },
          "dispatch_state": {
            "type": "string",
            "description": "Dispatch state: `pending` | `queued` | `done` | `error`."
          },
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "nb_mp_id": {
            "type": "string"
          },
          "source": {
            "type": "string"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          },
          "valid_from": {
            "type": "string",
            "description": "Start of validity period (ISO 8601 date)."
          },
          "valid_to": {
            "type": [
              "string",
              "null"
            ],
            "description": "End of validity period, or `null` for open-ended."
          }
        }
      },
      "PutKonfigurationenRequest": {
        "type": "object",
        "description": "Request body for `PUT /api/v1/zaehler/{zaehler_id}/geraete/{geraet_id}/konfigurationen`.\n\nThe list **replaces** the entire configuration for the device atomically.\n`updated_at` on each entry is overwritten server-side — callers must omit it.\n\n### Deduplication\n\nWithin a single PUT body, duplicate `parameter` values are allowed (last entry wins)\nso that callers can include generated lists with overlapping keys.  The server\ndeduplicates on write: only the **last** occurrence of each `parameter` is stored.\n\n### Example — SMGW with §14a CLS after BSI TR-03109-3 gateway rollout\n\n```json\n[\n  { \"parameter\": \"FIRMWARE_VERSION\",       \"wert\": \"3.1.2\"         },\n  { \"parameter\": \"HARDWARE_REVISION\",      \"wert\": \"Rev. C\"        },\n  { \"parameter\": \"KOMMUNIKATION\",          \"wert\": \"GPRS\"          },\n  { \"parameter\": \"CLS_FAEHIG\",             \"wert\": \"true\"          },\n  { \"parameter\": \"CLS_KANAL_ID\",           \"wert\": \"CLS-00042\"     },\n  { \"parameter\": \"SMGW_TLS_CERT_FINGERPRINT\", \"wert\": \"a1b2c3d4...\"  },\n  { \"parameter\": \"SMGW_CERT_ABLAUFDATUM\",  \"wert\": \"2027-06-30\"    },\n  { \"parameter\": \"GWA_CODENUMMER\",         \"wert\": \"9900000000099\" },\n  { \"parameter\": \"HERSTELLER\",             \"wert\": \"Sagemcom\"      },\n  { \"parameter\": \"INBETRIEBNAHMEDATUM\",    \"wert\": \"2024-03-15\"    }\n]\n```",
        "required": [
          "konfigurationen"
        ],
        "properties": {
          "konfigurationen": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/KonfigurationenEntry"
            },
            "description": "Ordered list of configuration entries.  Keys without a value should be\nomitted rather than sent with an empty `wert`."
          }
        },
        "additionalProperties": false
      },
      "PutKonfigurationsprodukteRequest": {
        "type": "object",
        "description": "`PUT /api/v1/steuerbare-ressourcen/{sr_id}/konfigurationsprodukte` body.\n\nAn object rather than a bare array, so the body has keys of its own that\n`mako_service::Json` can refuse: a misspelt `konfigurationsprodukte` is a\n`422` naming it, never a list read as absent. The field is mandatory — `[]`\nclears the products, an absent list is not an empty one.",
        "required": [
          "konfigurationsprodukte"
        ],
        "properties": {
          "konfigurationsprodukte": {
            "type": "array",
            "items": {
              "type": "object"
            },
            "description": "The full contracted list, replacing the stored one."
          }
        }
      },
      "Register": {
        "type": "object",
        "description": "The Wertegranularität of one register of a Zähler.",
        "required": [
          "zaehler_id",
          "obis_kennzahl",
          "wertegranularitaet"
        ],
        "properties": {
          "obis_kennzahl": {
            "type": "string"
          },
          "wertegranularitaet": {
            "$ref": "#/components/schemas/Granularitaet"
          },
          "zaehler_id": {
            "type": "string"
          }
        }
      },
      "ReplayWindow": {
        "type": "object",
        "description": "The body of `POST /api/v1/webhooks/endpoints/{id}/replay`.",
        "required": [
          "from",
          "to"
        ],
        "properties": {
          "from": {
            "type": "string",
            "format": "date-time",
            "description": "Start of the window, inclusive (RFC 3339)."
          },
          "to": {
            "type": "string",
            "format": "date-time",
            "description": "End of the window, exclusive (RFC 3339)."
          }
        },
        "additionalProperties": false
      },
      "Replayed": {
        "type": "object",
        "description": "How many deliveries a replay queued.",
        "required": [
          "queued"
        ],
        "properties": {
          "queued": {
            "type": "integer",
            "format": "int64",
            "description": "Deliveries queued again or for the first time."
          }
        }
      },
      "RotateSecret": {
        "type": "object",
        "description": "The body of `POST /api/v1/webhooks/endpoints/{id}/rotate-secret`.",
        "required": [
          "overlap_hours"
        ],
        "properties": {
          "overlap_hours": {
            "type": "integer",
            "format": "int32",
            "description": "How long the previous secret keeps signing, at most 168 hours.",
            "minimum": 0
          }
        },
        "additionalProperties": false
      },
      "SecretRotated": {
        "type": "object",
        "description": "A rotated secret — the only answer that shows it.",
        "required": [
          "secret",
          "previous_expires_at"
        ],
        "properties": {
          "previous_expires_at": {
            "type": "string",
            "format": "date-time",
            "description": "Until when the previous secret also signs."
          },
          "secret": {
            "type": "string",
            "description": "The new `whsec_` signing secret; shown once."
          }
        }
      },
      "SharingEligibilityEvidence": {
        "type": "object",
        "description": "Master-data inputs behind a [`SharingEligibilityResponse`].",
        "properties": {
          "bilanzierungsmethode": {
            "type": [
              "string",
              "null"
            ],
            "description": "`Marktlokation.bilanzierungsmethode`."
          },
          "ist_fernauslesbar": {
            "type": [
              "boolean",
              "null"
            ],
            "description": "BO4E `Zaehler.istFernauslesbar`."
          },
          "zaehlertyp": {
            "type": [
              "string",
              "null"
            ],
            "description": "BO4E `Zaehlertyp` of the meter installed at this MeLo."
          }
        }
      },
      "SharingEligibilityResponse": {
        "type": "object",
        "description": "Capability verdict for one Messlokation under §42c Abs. 1 EnWG.",
        "required": [
          "melo_id",
          "capability",
          "required_action",
          "reasons",
          "evidence"
        ],
        "properties": {
          "basis": {
            "type": [
              "string",
              "null"
            ],
            "description": "Qualifying statutory limb, when one was established — a stable code,\n`ZAEHLERSTANDSGANGMESSUNG` or `REGISTRIERENDE_LEISTUNGSMESSUNG`."
          },
          "bilanzierungsgebiet": {
            "type": [
              "string",
              "null"
            ],
            "description": "Bilanzierungsgebiet — §42c Abs. 4 requires all participants to share one\nuntil 1 June 2028."
          },
          "capability": {
            "type": "string",
            "description": "`QUALIFIED` · `DISQUALIFIED` · `UNKNOWN`."
          },
          "evidence": {
            "$ref": "#/components/schemas/SharingEligibilityEvidence",
            "description": "Inputs the verdict was derived from, for audit."
          },
          "legal_basis": {
            "type": [
              "string",
              "null"
            ],
            "description": "Citation for `basis`."
          },
          "malo_id": {
            "type": [
              "string",
              "null"
            ],
            "description": "Marktlokation the MeLo belongs to, when linked."
          },
          "melo_id": {
            "type": "string",
            "description": "Messlokations-ID that was assessed."
          },
          "reasons": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Why the point does not qualify, or which master data is missing —\nstable codes from `metering`'s `Finding`, plus marktd's own\n`KEIN_BILANZIERUNGSGEBIET` (§42c Abs. 4 requires a shared Gebiet until\n01.06.2028, which is master data rather than metering)."
          },
          "required_action": {
            "type": "string",
            "description": "What an operator must do to make this point eligible."
          }
        }
      },
      "StatusBody": {
        "type": "object",
        "required": [
          "status"
        ],
        "properties": {
          "expected_version": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64",
            "description": "Optimistic-locking guard: the version the caller last read. When\nsupplied and stale, the update fails with a version-conflict problem\nresponse instead of overwriting."
          },
          "platform_ref": {
            "type": [
              "string",
              "null"
            ],
            "description": "Platform reference, once known."
          },
          "status": {
            "type": "string",
            "description": "Target lifecycle state."
          }
        },
        "additionalProperties": false
      },
      "TestDelivery": {
        "type": "object",
        "description": "What a test delivery came to.",
        "required": [
          "delivered"
        ],
        "properties": {
          "delivered": {
            "type": "boolean",
            "description": "Whether the endpoint answered 2xx."
          },
          "error": {
            "type": [
              "string",
              "null"
            ],
            "description": "Why it was not delivered."
          },
          "latency_ms": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int32",
            "description": "How long it took, when it answered."
          },
          "status": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int32",
            "description": "The HTTP status, when it answered.",
            "minimum": 0
          }
        }
      },
      "TotalEstimate": {
        "type": "object",
        "description": "A count bounded at [`COUNT_CAP`]: a list over a million rows reports\n`{count: 10000, capped: true}` rather than counting them.",
        "required": [
          "count",
          "capped"
        ],
        "properties": {
          "capped": {
            "type": "boolean",
            "description": "`true` when there are more rows than `count`."
          },
          "count": {
            "type": "integer",
            "format": "int64",
            "description": "The rows counted, at most 10 000."
          }
        }
      },
      "TrancheUpsertRequest": {
        "type": "object",
        "description": "PUT body for a Tranche upsert. The typed columns are indexed/patchable; the\nopen-ended Tranche payload goes in `data` (mako's own — see the module docs\nfor why there is no BO4E type here).",
        "properties": {
          "bilanzierungsgebiet": {
            "type": [
              "string",
              "null"
            ],
            "description": "Bilanzierungsgebiet EIC."
          },
          "data": {
            "type": "object",
            "description": "mako's own open-ended Tranche payload (**not** BO4E)."
          },
          "energierichtung": {
            "type": [
              "string",
              "null"
            ],
            "description": "Energierichtung (`EINSPEISUNG` / `ENTNAHME`)."
          },
          "malo_id": {
            "type": [
              "string",
              "null"
            ],
            "description": "Parent Marktlokation this Tranche belongs to."
          },
          "netzebene": {
            "type": [
              "string",
              "null"
            ],
            "description": "Netzebene."
          }
        },
        "additionalProperties": false
      },
      "UpsertGeraetRequest": {
        "type": "object",
        "description": "Request body for `PUT /api/v1/geraete/{geraet_id}`.",
        "required": [
          "zaehler_id",
          "data"
        ],
        "properties": {
          "data": {
            "description": "Full BO4E `Geraet` payload. The `geraet_typ` column is derived from\n`data.geraetetyp`, not supplied beside it."
          },
          "zaehler_id": {
            "type": "string",
            "description": "Owning `zaehler_id`."
          }
        },
        "additionalProperties": false
      },
      "UpsertSrRequest": {
        "type": "object",
        "description": "Request body for `PUT /api/v1/steuerbare-ressourcen/{sr_id}`.",
        "required": [
          "data"
        ],
        "properties": {
          "data": {
            "description": "Full BO4E `SteuerbareRessource` payload (may be `{}`).\n\nThe contracted iMS control products live **inside** it, as\n`konfigurationsprodukte`, **not** beside it: the column `makod` reads\nbefore confirming a Steuerungsauftrag is derived from this payload, so\nthe two cannot name different product lists."
          },
          "malo_id": {
            "type": [
              "string",
              "null"
            ],
            "description": "Associated MaLo-ID, if known.\n\nmako's own: `SteuerbareRessource` declares no MaLo or MeLo field (only\n`lokationszuordnungen`), so this is not a restatement of anything the BO\ncarries and the upsert leaves it alone when omitted."
          },
          "melo_id": {
            "type": [
              "string",
              "null"
            ],
            "description": "Associated MeLo-ID, if known. mako's own, as above."
          }
        },
        "additionalProperties": false
      },
      "UpsertTrRequest": {
        "type": "object",
        "description": "Request body for `PUT /api/v1/technische-ressourcen/{tr_id}`.",
        "required": [
          "data"
        ],
        "properties": {
          "data": {
            "description": "Full BO4E `TechnischeRessource` payload — and the **only** source of\nevery queryable field on the row.\n\n`TechnischeRessource` declares `zugeordneteMarktlokationId`,\n`vorgelagerteMesslokationId`, `technischeRessourceNutzung`,\n`technischeRessourceVerbrauchsart` and `istFernschaltbar`, so none of\nthem is an envelope field. `istFernschaltbar` is what §14a steering\nreads: a resource whose column says controllable while its document says\notherwise is one mako will try to steer and the field will not answer."
          }
        },
        "additionalProperties": false
      },
      "UpsertZaehlerRequest": {
        "type": "object",
        "description": "Request body for `PUT /api/v1/zaehler/{zaehler_id}`.",
        "required": [
          "melo_id",
          "data"
        ],
        "properties": {
          "data": {
            "description": "Full BO4E `Zaehler` payload.\n\nThe `zaehler_typ` and `eichung_bis` columns are derived from\n`data.zaehlertyp` and `data.eichungBis`, never supplied beside them —\nthe column drives the replacement workflow, so it must not be able to\ndisagree with the meter record it shadows."
          },
          "melo_id": {
            "type": "string",
            "description": "Owning MeLo-ID."
          }
        },
        "additionalProperties": false
      },
      "Verfahren": {
        "type": "string",
        "description": "The Verfahren of a normiertes Profil.",
        "enum": [
          "SYNTHETISCH",
          "ANALYTISCH"
        ]
      },
      "VersorgungsStatusHistorie": {
        "type": "object",
        "description": "One page of a Marktlokation's supply-state history, newest first.",
        "required": [
          "items",
          "total",
          "page",
          "size"
        ],
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/VersorgungsStatusHistoryResponse"
            }
          },
          "page": {
            "type": "integer",
            "format": "int32",
            "description": "Zero-based page index.",
            "minimum": 0
          },
          "size": {
            "type": "integer",
            "format": "int32",
            "description": "Page size (at most 500).",
            "minimum": 0
          },
          "total": {
            "type": "integer",
            "format": "int64",
            "description": "Every change recorded for the Marktlokation, not only this page's.",
            "minimum": 0
          }
        }
      },
      "VersorgungsStatusHistoryResponse": {
        "type": "object",
        "description": "One supply-state change of a Marktlokation.",
        "required": [
          "id",
          "malo_id",
          "lieferstatus",
          "zuordnungen",
          "nb_mp_id",
          "version",
          "valid_from"
        ],
        "properties": {
          "id": {
            "type": "integer",
            "format": "int64"
          },
          "last_process_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "lieferende": {
            "type": [
              "string",
              "null"
            ],
            "format": "date"
          },
          "lieferstatus": {
            "$ref": "#/components/schemas/Lieferstatus"
          },
          "malo_id": {
            "type": "string"
          },
          "msb_mp_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "nb_mp_id": {
            "type": "string"
          },
          "valid_from": {
            "type": "string",
            "format": "date-time",
            "description": "The instant this state became active (RFC 3339)."
          },
          "version": {
            "type": "integer",
            "format": "int64"
          },
          "zuordnungen": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Zuordnung"
            },
            "description": "The assignment list as it stood at `valid_from`."
          }
        }
      },
      "VersorgungsStatusResponse": {
        "type": "object",
        "description": "The VersorgungsStatus of a Marktlokation — now, or as it stood on a date.",
        "required": [
          "malo_id",
          "lieferstatus",
          "zuordnungen",
          "nb_mp_id",
          "updated_at",
          "version"
        ],
        "properties": {
          "eog_seit": {
            "type": [
              "string",
              "null"
            ],
            "format": "date",
            "description": "Start of the running Ersatz-/Grundversorgung (§38/§36 EnWG), if any."
          },
          "last_process_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "lf_mp_id": {
            "type": [
              "string",
              "null"
            ],
            "description": "The single active Lieferant, when there is exactly one.\n\nDerived from `zuordnungen` and **absent on a tranchierte\nMarktlokation**, where no single supplier exists — read `zuordnungen`\nthere rather than treating the omission as „unsupplied\"."
          },
          "lf_mp_id_next": {
            "type": [
              "string",
              "null"
            ],
            "description": "The single announced Lieferant, when exactly one Anmeldung is pending.\nDerived, with the same caveat as `lf_mp_id`."
          },
          "lf_next_lieferbeginn": {
            "type": [
              "string",
              "null"
            ],
            "format": "date",
            "description": "Lieferbeginn of the announced Lieferant."
          },
          "lieferbeginn": {
            "type": [
              "string",
              "null"
            ],
            "format": "date"
          },
          "lieferende": {
            "type": [
              "string",
              "null"
            ],
            "format": "date"
          },
          "lieferstatus": {
            "$ref": "#/components/schemas/Lieferstatus"
          },
          "malo_id": {
            "type": "string"
          },
          "msb_mp_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "nb_mp_id": {
            "type": "string"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "description": "When this state was written (RFC 3339) — for a state read `at` a date,\nwhen that historic state became active."
          },
          "version": {
            "type": "integer",
            "format": "int64",
            "description": "Optimistic-locking version, also the `ETag`."
          },
          "zuordnungen": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Zuordnung"
            },
            "description": "Every Lieferant holding a share of this Marktlokation — the authoritative\nanswer to „who supplies it\". A tranchierte Marktlokation carries several."
          }
        }
      },
      "VersorgungsStatusUpsertRequest": {
        "type": "object",
        "required": [
          "lieferstatus",
          "nb_mp_id"
        ],
        "properties": {
          "eog_seit": {
            "type": [
              "string",
              "null"
            ],
            "description": "Start of the Ersatz-/Grundversorgung (ISO date). Required when\n`lieferstatus` is `Ersatzversorgung`/`Grundversorgung`, forbidden\notherwise (DB CHECK)."
          },
          "last_process_id": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid"
          },
          "lf_mp_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "lf_mp_id_next": {
            "type": [
              "string",
              "null"
            ]
          },
          "lf_next_lieferbeginn": {
            "type": [
              "string",
              "null"
            ]
          },
          "lieferbeginn": {
            "type": [
              "string",
              "null"
            ]
          },
          "lieferende": {
            "type": [
              "string",
              "null"
            ]
          },
          "lieferstatus": {
            "type": "string",
            "example": "Beliefert"
          },
          "msb_mp_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "nb_mp_id": {
            "type": "string"
          },
          "zuordnungen": {
            "type": "array",
            "items": {
              "type": "object"
            },
            "description": "The assignment list, written wholesale — what is sent replaces what is\nstored, so an omitted assignment is a removed one.\n\nThis is the only way to state a tranchierte Marktlokation. The scalar\n`lf_mp_id` / `lf_mp_id_next` below are a shorthand for the ordinary\none-supplier case and are ignored when `zuordnungen` is present."
          }
        },
        "additionalProperties": false
      },
      "Zaehler": {
        "type": "object",
        "description": "A Zähler of one of the bündel's Messlokationen.",
        "required": [
          "melo_id",
          "zaehler_id"
        ],
        "properties": {
          "melo_id": {
            "type": "string"
          },
          "zaehler_id": {
            "type": "string"
          },
          "zaehlertyp_spezifikation": {
            "type": [
              "string",
              "null"
            ],
            "description": "BO4E `Zaehler.zaehlertypSpezifikation` (`EDL40`, `EDL21`,\n`SONSTIGER_EHZ`, `MME_STANDARD`, `MME_MEDA`)."
          }
        }
      },
      "Zuordnung": {
        "type": "object",
        "description": "One Lieferant's share of a Marktlokation.",
        "required": [
          "lf_mp_id",
          "prozent",
          "status"
        ],
        "properties": {
          "lf_mp_id": {
            "type": "string",
            "description": "MP-ID of the Lieferant holding this share."
          },
          "process_id": {
            "type": [
              "string",
              "null"
            ],
            "description": "The process that wrote this assignment."
          },
          "prozent": {
            "type": "string",
            "format": "decimal",
            "description": "The share in percent — `100` for an untranchierte Marktlokation."
          },
          "status": {
            "$ref": "#/components/schemas/Zuordnungsstatus"
          },
          "tranche_id": {
            "type": [
              "string",
              "null"
            ],
            "description": "Tranchen-ID of a tranchierte Marktlokation."
          },
          "zuordnungsbeginn": {
            "type": [
              "string",
              "null"
            ],
            "format": "date",
            "description": "Zuordnungsbeginn — the Lieferbeginn of this assignment."
          },
          "zuordnungsende": {
            "type": [
              "string",
              "null"
            ],
            "format": "date",
            "description": "Zuordnungsende, once one is agreed."
          }
        }
      },
      "Zuordnungsstatus": {
        "type": "string",
        "description": "The NB's decision state for one supplier assignment.",
        "enum": [
          "Angekuendigt",
          "Aktiv",
          "Abgeloest"
        ]
      }
    }
  },
  "tags": [
    {
      "name": "malo",
      "description": "Marktlokation (MaLo) management"
    },
    {
      "name": "melo",
      "description": "Messlokation (MeLo) management"
    },
    {
      "name": "webhooks",
      "description": "Webhook endpoints, deliveries, replay and the event feed"
    },
    {
      "name": "correlations",
      "description": "Process correlation index"
    },
    {
      "name": "partners",
      "description": "Trading partner directory"
    },
    {
      "name": "versorgung",
      "description": "VersorgungsStatus per MaLo"
    },
    {
      "name": "pricat",
      "description": "PRICAT 27003 version history and dispatch"
    },
    {
      "name": "netzzugang",
      "description": "§20b EnWG Netzzugangsplattform request registry"
    },
    {
      "name": "msb-rahmenvertraege",
      "description": "MSB-Rahmenvertrag registry, both Sparten (§ 9 Abs. 1 Nr. 3 MsbG; Gas: GeLi Gas 3.0, KoV XV Anlage 8)"
    },
    {
      "name": "health",
      "description": "Health endpoints"
    }
  ]
}
