{
  "info": {
    "title": "NuvaFace Praxis-API",
    "contact": {
      "name": "NuvaFace",
      "email": "info@nuvaface.com"
    },
    "summary": "Patienten, Termine, Messwerte, Dokumente und Rechnungen einer Praxis lesen und anlegen, mit Probelauf und Webhooks.",
    "description": "Jede Praxis hat ihre eigene API: Ein API-Schlüssel gehört genau einer Praxis und sieht nur deren Daten. Die Schnittstelle ist ein Zusatzmodul, das NuvaFace je Praxis freischaltet. Danach legt die Praxisinhaberin Schlüssel in NuvaFace unter Einstellungen, Schnittstellen an; jede Anlage bestätigt sie mit einem Code, den sie per Mail bekommt.\n\nLesen: Patienten, Termine, freie Zeiten, Behandlungskatalog, Praxisdaten, Buchungsanfragen, Messwerte und Messschemata, Dokumente (über die Schnittstelle abgelegte und von der Praxis freigegebene Arten), Einwilligungen je Kanal, Rechnungen (Positionen nur mit eigenem Recht). Schreiben: Patient anlegen, Termin als Anfrage anlegen, verschieben und absagen, Messreihe erfassen, Dokument (PDF, JPEG, PNG) in die Akte legen, Rechnungsentwurf anlegen. Nicht über die API: Patienten ändern oder löschen, Termine bestätigen, Nachrichten an Patienten senden, Rechnungen mit Nummer anlegen, festschreiben oder versenden, Zahlungen buchen, Löschen, Anamnese, Diagnosen, Notizen.\n\nSchreibende JSON-Operationen kennen den Probelauf (dryRun=true: alles prüfen und rechnen, nichts speichern) und den Kopf Idempotency-Key. Zum Üben gibt es Testschlüssel (nfk_test_) mit einer eigenen Übungspraxis ohne echte Patientendaten.\n\nEingeschränkte Akten (Art. 18 DSGVO) und archivierte Akten erscheinen nicht: Einzelabruf 404, in Listen fehlen sie, Schreiben in eine eingeschränkte Akte ergibt 423.\n\nZeiten: Ausgaben in ISO 8601 mit Versatz der Praxis (Europe/Berlin). Fehler: application/problem+json nach RFC 9457 mit stabilem Feld code.\n\nVersionierung nach Semantic Versioning (MAJOR.MINOR.PATCH); der Pfad /v1 gilt für alle Versionen 1.x.y. Minor-Versionen bringen nur Ergänzungen (neue Operationen, neue optionale Felder und Parameter, neue Ereignisse, neue Werte in Aufzählungen von Antworten), Patch-Versionen nur Korrekturen an Texten und Beispielen; Clients ignorieren unbekannte Felder und Werte. Eine inkompatible Änderung gibt es nur als neue Hauptversion mit neuem Pfad (/v2); /v1 bleibt dann mindestens 12 Monate erreichbar. Was entfallen soll, ist mindestens 12 Monate vorher als veraltet markiert (deprecated, Kopfzeilen Deprecation nach RFC 9745 und Sunset nach RFC 8594). Versionsverlauf, Hinweise und Download-Pakete stehen in NuvaFace unter Einstellungen, Schnittstellen, Dokumentation und Versionen.",
    "version": "1.1.0",
    "x-nuvaface-release": {
      "veroeffentlichtAm": "2026-10-16T22:00:00.000Z",
      "art": "minor"
    }
  },
  "tags": [
    {
      "name": "Zugang"
    },
    {
      "name": "Patienten"
    },
    {
      "name": "Termine"
    },
    {
      "name": "Freie Zeiten"
    },
    {
      "name": "Dokumente"
    },
    {
      "name": "Rechnungen"
    },
    {
      "name": "Messwerte"
    },
    {
      "name": "Einwilligungen"
    },
    {
      "name": "Praxis"
    },
    {
      "name": "Buchungsanfragen"
    }
  ],
  "paths": {
    "/me": {
      "get": {
        "tags": [
          "Zugang"
        ],
        "summary": "Zugang prüfen (Praxis, Scopes, Grenzen, heutiger Stand)",
        "security": [
          {
            "apiKey": []
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Zugang"
                },
                "example": {
                  "mode": "live",
                  "usage": {
                    "resetsAt": "2026-11-27T00:00:00+01:00",
                    "patientRecordsToday": 12,
                    "patientRecordsRemaining": 488
                  },
                  "access": {
                    "name": "Make.com Messberichte",
                    "type": "api_key",
                    "prefix": "nfk_a1b2c3d4",
                    "scopes": [
                      "patients.read.basic",
                      "measurements.write",
                      "documents.write"
                    ],
                    "expiresAt": "2027-11-26T00:00:00+01:00"
                  },
                  "limits": {
                    "writesPerMinute": 30,
                    "requestsPerMinute": 120,
                    "patientRecordsPerDay": 500,
                    "patientListsPerMinute": 20
                  },
                  "practice": {
                    "name": "Praxis Lindenhof",
                    "test": false
                  },
                  "apiVersion": "v1"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "code": "VALIDATION",
                  "type": "https://nuvaface-practice.com/api/public/docs#fehler-validation",
                  "title": "Ungültige Anfrage",
                  "detail": "Schlüssel nie in der Adresse übergeben, sondern im Kopf Authorization: Bearer ...",
                  "status": 400,
                  "instance": "urn:nuvaface:request:3f2a6c1e-0000-4000-8000-000000000099",
                  "requestId": "3f2a6c1e-0000-4000-8000-000000000099"
                }
              }
            },
            "description": "Ungültige Anfrage (auch: Schlüssel in der Adresse, ungültige Kennung, NUL-Zeichen)"
          },
          "401": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "code": "TOKEN_INVALID",
                  "type": "https://nuvaface-practice.com/api/public/docs#fehler-token-invalid",
                  "title": "Zugang ungültig",
                  "detail": "Der Schlüssel ist unbekannt, abgelaufen oder widerrufen.",
                  "status": 401,
                  "instance": "urn:nuvaface:request:3f2a6c1e-0000-4000-8000-000000000099",
                  "requestId": "3f2a6c1e-0000-4000-8000-000000000099"
                }
              }
            },
            "description": "Nicht angemeldet oder Schlüssel ungültig"
          },
          "403": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "code": "NICHT_FREIGESCHALTET",
                  "type": "https://nuvaface-practice.com/api/public/docs#fehler-nicht-freigeschaltet",
                  "title": "Für diese Praxis nicht freigeschaltet",
                  "detail": "Die Schnittstelle ist ein Zusatzmodul und für diese Praxis nicht freigeschaltet. Freischaltung bei NuvaFace: info@nuvaface.com",
                  "status": 403,
                  "instance": "urn:nuvaface:request:3f2a6c1e-0000-4000-8000-000000000099",
                  "requestId": "3f2a6c1e-0000-4000-8000-000000000099"
                }
              }
            },
            "description": "Scope fehlt, Schnittstelle nicht freigeschaltet oder Praxis gesperrt (code nennt den Grund)"
          },
          "429": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "code": "RATE_LIMITED",
                  "type": "https://nuvaface-practice.com/api/public/docs#fehler-rate-limited",
                  "title": "Zu viele Anfragen",
                  "detail": "Höchstens 120 Anfragen je Minute und Schlüssel. Bitte die Antwort Retry-After abwarten.",
                  "status": 429,
                  "instance": "urn:nuvaface:request:3f2a6c1e-0000-4000-8000-000000000099",
                  "requestId": "3f2a6c1e-0000-4000-8000-000000000099",
                  "retryAfter": 17
                }
              }
            },
            "description": "Zu viele Anfragen (Kopf Retry-After) oder Tagesgrenze der Patientendatensätze erreicht (DAILY_PATIENT_LIMIT)"
          },
          "503": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "code": "UNAVAILABLE",
                  "type": "https://nuvaface-practice.com/api/public/docs#fehler-unavailable",
                  "title": "Vorübergehend nicht verfügbar",
                  "detail": "Die Schnittstelle ist vorübergehend nicht verfügbar.",
                  "status": 503,
                  "instance": "urn:nuvaface:request:3f2a6c1e-0000-4000-8000-000000000099",
                  "requestId": "3f2a6c1e-0000-4000-8000-000000000099",
                  "retryAfter": 30
                }
              }
            },
            "description": "Prüfung vorübergehend gestört oder (beim Upload) Server ausgelastet; Kopf Retry-After abwarten"
          }
        },
        "description": "Für den Verbindungstest in Make.com und anderen Werkzeugen. Braucht keinen Scope.",
        "operationId": "zugangLesen",
        "x-nuvaface-scopes": []
      }
    },
    "/invoices": {
      "get": {
        "tags": [
          "Rechnungen"
        ],
        "summary": "Rechnungen lesen (ohne Positionen und Diagnosen)",
        "security": [
          {
            "apiKey": []
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data",
                    "nextCursor"
                  ],
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Rechnung"
                      }
                    },
                    "nextCursor": {
                      "type": [
                        "string",
                        "null"
                      ]
                    }
                  }
                },
                "example": {
                  "data": [
                    {
                      "id": "3f2a6c1e-0000-4000-8000-000000000041",
                      "date": "2026-11-20",
                      "total": 190,
                      "number": "RE-2026-0042",
                      "paidAt": null,
                      "status": "sent",
                      "dueDate": "2026-12-04",
                      "currency": "EUR",
                      "patientId": "3f2a6c1e-0000-4000-8000-000000000001",
                      "documentType": "invoice",
                      "appointmentId": "3f2a6c1e-0000-4000-8000-000000000011",
                      "paymentMethod": null
                    }
                  ],
                  "nextCursor": null
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "code": "VALIDATION",
                  "type": "https://nuvaface-practice.com/api/public/docs#fehler-validation",
                  "title": "Ungültige Anfrage",
                  "detail": "documentType: invoice, estimate, cancellation, no_show_fee, quick (mehrere mit Komma).",
                  "status": 400,
                  "instance": "urn:nuvaface:request:3f2a6c1e-0000-4000-8000-000000000099",
                  "requestId": "3f2a6c1e-0000-4000-8000-000000000099"
                }
              }
            },
            "description": "Ungültige Anfrage (auch: Schlüssel in der Adresse, ungültige Kennung, NUL-Zeichen)"
          },
          "401": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "code": "TOKEN_INVALID",
                  "type": "https://nuvaface-practice.com/api/public/docs#fehler-token-invalid",
                  "title": "Zugang ungültig",
                  "detail": "Der Schlüssel ist unbekannt, abgelaufen oder widerrufen.",
                  "status": 401,
                  "instance": "urn:nuvaface:request:3f2a6c1e-0000-4000-8000-000000000099",
                  "requestId": "3f2a6c1e-0000-4000-8000-000000000099"
                }
              }
            },
            "description": "Nicht angemeldet oder Schlüssel ungültig"
          },
          "403": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "code": "INSUFFICIENT_SCOPE",
                  "type": "https://nuvaface-practice.com/api/public/docs#fehler-insufficient-scope",
                  "title": "Berechtigung fehlt",
                  "detail": "Dieser Schlüssel hat den nötigen Scope nicht. Die Praxisinhaberin kann einen Schlüssel mit diesem Recht in NuvaFace unter Einstellungen, Schnittstellen anlegen.",
                  "status": 403,
                  "instance": "urn:nuvaface:request:3f2a6c1e-0000-4000-8000-000000000099",
                  "requestId": "3f2a6c1e-0000-4000-8000-000000000099"
                }
              }
            },
            "description": "Scope fehlt, Schnittstelle nicht freigeschaltet oder Praxis gesperrt (code nennt den Grund)"
          },
          "429": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "code": "RATE_LIMITED",
                  "type": "https://nuvaface-practice.com/api/public/docs#fehler-rate-limited",
                  "title": "Zu viele Anfragen",
                  "detail": "Höchstens 120 Anfragen je Minute und Schlüssel. Bitte die Antwort Retry-After abwarten.",
                  "status": 429,
                  "instance": "urn:nuvaface:request:3f2a6c1e-0000-4000-8000-000000000099",
                  "requestId": "3f2a6c1e-0000-4000-8000-000000000099",
                  "retryAfter": 17
                }
              }
            },
            "description": "Zu viele Anfragen (Kopf Retry-After) oder Tagesgrenze der Patientendatensätze erreicht (DAILY_PATIENT_LIMIT)"
          },
          "503": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "code": "UNAVAILABLE",
                  "type": "https://nuvaface-practice.com/api/public/docs#fehler-unavailable",
                  "title": "Vorübergehend nicht verfügbar",
                  "detail": "Die Schnittstelle ist vorübergehend nicht verfügbar.",
                  "status": 503,
                  "instance": "urn:nuvaface:request:3f2a6c1e-0000-4000-8000-000000000099",
                  "requestId": "3f2a6c1e-0000-4000-8000-000000000099",
                  "retryAfter": 30
                }
              }
            },
            "description": "Prüfung vorübergehend gestört oder (beim Upload) Server ausgelastet; Kopf Retry-After abwarten"
          }
        },
        "parameters": [
          {
            "in": "query",
            "name": "patientId",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "in": "query",
            "name": "status",
            "schema": {
              "type": "string"
            },
            "description": "draft, sent, paid, overdue, cancelled (mehrere mit Komma)"
          },
          {
            "in": "query",
            "name": "documentType",
            "schema": {
              "type": "string",
              "example": "invoice,no_show_fee,quick"
            },
            "description": "Belegart, mehrere mit Komma: invoice (Rechnung), estimate (Kostenvoranschlag), cancellation (Storno, negativer Betrag), no_show_fee (Ausfallhonorar), quick (Schnellrechnung)"
          },
          {
            "in": "query",
            "name": "from",
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "in": "query",
            "name": "to",
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "in": "query",
            "name": "limit",
            "schema": {
              "type": "integer",
              "default": 50,
              "maximum": 100,
              "minimum": 1
            }
          },
          {
            "in": "query",
            "name": "cursor",
            "schema": {
              "type": "string"
            },
            "description": "Wert nextCursor der vorigen Antwort, unverändert"
          }
        ],
        "description": "Scope: invoices.read. Ohne patientId nur Belege ab dem Abrechnungsstichtag der Praxis (wie in der Software). Rechnungen eingeschränkter oder archivierter Akten fehlen. patientName nur mit patients.read; dann zählt jeder unterschiedliche Patient einer Antwort 1 auf die Tagesgrenze. Eine einzelne Rechnung liefert GET /invoices/{id}.",
        "operationId": "rechnungenLesen",
        "x-nuvaface-scopes": [
          "invoices.read"
        ]
      },
      "post": {
        "tags": [
          "Rechnungen"
        ],
        "summary": "Rechnungsentwurf anlegen (keine Rechnung, keine Nummer)",
        "security": [
          {
            "apiKey": []
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Rechnungsentwurf"
                    },
                    {
                      "type": "object",
                      "required": [
                        "dryRun"
                      ],
                      "properties": {
                        "dryRun": {
                          "type": "boolean",
                          "const": true,
                          "description": "Probelauf: nichts gespeichert"
                        }
                      }
                    }
                  ]
                },
                "example": {
                  "id": "3f2a6c1e-0000-4000-8000-000000000081",
                  "items": [
                    {
                      "code": "268",
                      "index": 0,
                      "total": 17.43,
                      "factor": 2.3,
                      "points": 130,
                      "taxRate": 19,
                      "feeFrame": {
                        "maximum": 3.5,
                        "section": "C",
                        "threshold": 2.3
                      },
                      "quantity": 1,
                      "unitPrice": 17.43,
                      "description": "Medikamentöse Infiltrationsbehandlung im Bereich mehrerer Körperregionen",
                      "printedFactor": 2.3
                    }
                  ],
                  "total": 20.74,
                  "dryRun": true,
                  "object": "invoice_draft",
                  "status": "open",
                  "taxRate": 19,
                  "currency": "EUR",
                  "warnings": [
                    {
                      "code": "AMOUNT_MISMATCH",
                      "index": 0,
                      "message": "Position 1: gerechnet 17.43 EUR, erwartet 17.50 EUR. Es gilt der gerechnete Betrag.",
                      "expected": 17.5,
                      "calculated": 17.43
                    }
                  ],
                  "createdAt": "2026-11-26T10:00:00+01:00",
                  "expiresAt": "2026-12-26T10:00:00+01:00",
                  "invoiceId": null,
                  "netAmount": 17.43,
                  "patientId": "3f2a6c1e-0000-4000-8000-000000000001",
                  "taxAmount": 3.31,
                  "serviceDate": "2026-11-25",
                  "appointmentId": "3f2a6c1e-0000-4000-8000-000000000011"
                }
              }
            },
            "description": "Probelauf (dryRun=true): gerechnet, nichts gespeichert"
          },
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Rechnungsentwurf"
                },
                "example": {
                  "id": "3f2a6c1e-0000-4000-8000-000000000081",
                  "items": [
                    {
                      "code": "268",
                      "index": 0,
                      "total": 17.43,
                      "factor": 2.3,
                      "points": 130,
                      "taxRate": 19,
                      "feeFrame": {
                        "maximum": 3.5,
                        "section": "C",
                        "threshold": 2.3
                      },
                      "quantity": 1,
                      "unitPrice": 17.43,
                      "description": "Medikamentöse Infiltrationsbehandlung im Bereich mehrerer Körperregionen",
                      "printedFactor": 2.3
                    }
                  ],
                  "total": 20.74,
                  "object": "invoice_draft",
                  "status": "open",
                  "taxRate": 19,
                  "currency": "EUR",
                  "warnings": [
                    {
                      "code": "AMOUNT_MISMATCH",
                      "index": 0,
                      "message": "Position 1: gerechnet 17.43 EUR, erwartet 17.50 EUR. Es gilt der gerechnete Betrag.",
                      "expected": 17.5,
                      "calculated": 17.43
                    }
                  ],
                  "createdAt": "2026-11-26T10:00:00+01:00",
                  "expiresAt": "2026-12-26T10:00:00+01:00",
                  "invoiceId": null,
                  "netAmount": 17.43,
                  "patientId": "3f2a6c1e-0000-4000-8000-000000000001",
                  "taxAmount": 3.31,
                  "serviceDate": "2026-11-25",
                  "appointmentId": "3f2a6c1e-0000-4000-8000-000000000011"
                }
              }
            },
            "description": "Entwurf angelegt"
          },
          "400": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "code": "VALIDATION",
                  "type": "https://nuvaface-practice.com/api/public/docs#fehler-validation",
                  "title": "Ungültige Anfrage",
                  "detail": "Idempotency-Key fehlt. Für jede anlegende Anfrage einen neuen Wert senden (z. B. eine UUID je Vorgang).",
                  "status": 400,
                  "instance": "urn:nuvaface:request:3f2a6c1e-0000-4000-8000-000000000099",
                  "requestId": "3f2a6c1e-0000-4000-8000-000000000099"
                }
              }
            },
            "description": "Ungültige Anfrage (auch: Schlüssel in der Adresse, ungültige Kennung, NUL-Zeichen)"
          },
          "401": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "code": "TOKEN_INVALID",
                  "type": "https://nuvaface-practice.com/api/public/docs#fehler-token-invalid",
                  "title": "Zugang ungültig",
                  "detail": "Der Schlüssel ist unbekannt, abgelaufen oder widerrufen.",
                  "status": 401,
                  "instance": "urn:nuvaface:request:3f2a6c1e-0000-4000-8000-000000000099",
                  "requestId": "3f2a6c1e-0000-4000-8000-000000000099"
                }
              }
            },
            "description": "Nicht angemeldet oder Schlüssel ungültig"
          },
          "403": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "code": "INSUFFICIENT_SCOPE",
                  "type": "https://nuvaface-practice.com/api/public/docs#fehler-insufficient-scope",
                  "title": "Berechtigung fehlt",
                  "detail": "Dieser Schlüssel hat den nötigen Scope nicht. Die Praxisinhaberin kann einen Schlüssel mit diesem Recht in NuvaFace unter Einstellungen, Schnittstellen anlegen.",
                  "status": 403,
                  "instance": "urn:nuvaface:request:3f2a6c1e-0000-4000-8000-000000000099",
                  "requestId": "3f2a6c1e-0000-4000-8000-000000000099"
                }
              }
            },
            "description": "Scope fehlt, Schnittstelle nicht freigeschaltet oder Praxis gesperrt (code nennt den Grund)"
          },
          "404": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "code": "NOT_FOUND",
                  "type": "https://nuvaface-practice.com/api/public/docs#fehler-not-found",
                  "title": "Nicht gefunden",
                  "detail": "Patient nicht gefunden.",
                  "status": 404,
                  "instance": "urn:nuvaface:request:3f2a6c1e-0000-4000-8000-000000000099",
                  "requestId": "3f2a6c1e-0000-4000-8000-000000000099"
                }
              }
            },
            "description": "Patient oder Termin nicht gefunden"
          },
          "409": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "code": "IDEMPOTENCY_IN_PROGRESS",
                  "type": "https://nuvaface-practice.com/api/public/docs#fehler-idempotency-in-progress",
                  "title": "Anfrage läuft noch",
                  "detail": "Eine Anfrage mit diesem Idempotency-Key läuft noch. Bitte kurz warten und erneut senden.",
                  "status": 409,
                  "instance": "urn:nuvaface:request:3f2a6c1e-0000-4000-8000-000000000099",
                  "requestId": "3f2a6c1e-0000-4000-8000-000000000099",
                  "retryAfter": 2
                }
              }
            },
            "description": "Anfrage mit diesem Idempotency-Key läuft noch"
          },
          "413": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "code": "PAYLOAD_TOO_LARGE",
                  "type": "https://nuvaface-practice.com/api/public/docs#fehler-payload-too-large",
                  "title": "Datei zu groß",
                  "detail": "Der Rumpf ist zu groß (höchstens 100 KB).",
                  "status": 413,
                  "instance": "urn:nuvaface:request:3f2a6c1e-0000-4000-8000-000000000099",
                  "requestId": "3f2a6c1e-0000-4000-8000-000000000099"
                }
              }
            },
            "description": "Rumpf größer als 100 KB (PAYLOAD_TOO_LARGE)"
          },
          "415": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "code": "UNSUPPORTED_MEDIA_TYPE",
                  "type": "https://nuvaface-practice.com/api/public/docs#fehler-unsupported-media-type",
                  "title": "Dateityp nicht erlaubt",
                  "detail": "Bitte den Rumpf als application/json senden.",
                  "status": 415,
                  "instance": "urn:nuvaface:request:3f2a6c1e-0000-4000-8000-000000000099",
                  "requestId": "3f2a6c1e-0000-4000-8000-000000000099"
                }
              }
            },
            "description": "Rumpf nicht als JSON gekennzeichnet oder mit nicht unterstützter Kodierung (UNSUPPORTED_MEDIA_TYPE)"
          },
          "422": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "code": "VALIDATION_FAILED",
                  "type": "https://nuvaface-practice.com/api/public/docs#fehler-validation-failed",
                  "title": "Angaben nicht zulässig",
                  "detail": "Der Entwurf wurde nicht angelegt: 27 Angaben sind nicht zulässig.",
                  "errors": [
                    {
                      "code": "PATIENT_ID_INVALID",
                      "field": "patientId",
                      "detail": "patientId fehlt oder ist keine UUID"
                    },
                    {
                      "code": "APPOINTMENT_ID_INVALID",
                      "field": "appointmentId",
                      "detail": "appointmentId ist keine UUID"
                    },
                    {
                      "code": "APPOINTMENT_OTHER_PATIENT",
                      "field": "appointmentId",
                      "detail": "Termin gehört zu einer anderen Akte der Praxis"
                    },
                    {
                      "code": "SERVICE_DATE_REQUIRED",
                      "field": "serviceDate",
                      "detail": "ohne Termin Pflicht (§ 12 Abs. 2 GOÄ)"
                    },
                    {
                      "code": "SERVICE_DATE_INVALID",
                      "field": "serviceDate",
                      "detail": "kein Kalendertag JJJJ-MM-TT"
                    },
                    {
                      "code": "SERVICE_DATE_IN_FUTURE",
                      "field": "serviceDate",
                      "detail": "nur erbrachte Leistungen (§ 4 Abs. 2 GOÄ), Kalendertag in Berlin"
                    },
                    {
                      "code": "ITEMS_REQUIRED",
                      "field": "items",
                      "detail": "mindestens eine Position"
                    },
                    {
                      "code": "ITEMS_TOO_MANY",
                      "field": "items",
                      "detail": "höchstens 50 Positionen"
                    },
                    {
                      "code": "ITEM_INVALID",
                      "field": "items[0]",
                      "index": 0,
                      "detail": "Position ist kein Objekt"
                    },
                    {
                      "code": "CODE_UNKNOWN",
                      "field": "items[0].code",
                      "index": 0,
                      "detail": "Ziffer fehlt oder steht nicht im GOÄ-Katalog der Software"
                    },
                    {
                      "code": "CODE_POINTS_UNVERIFIED",
                      "field": "items[0].code",
                      "index": 0,
                      "detail": "Punktzahl im Katalog nicht gesichert (nur in der Praxis abrechenbar)"
                    },
                    {
                      "code": "CODE_ONCE_PER_SESSION",
                      "field": "items[0].code",
                      "index": 0,
                      "detail": "Ziffer je Sitzung nur einmal (zweite Zeile oder Menge über 1)"
                    },
                    {
                      "code": "QUANTITY_INVALID",
                      "field": "items[0].quantity",
                      "index": 0,
                      "detail": "ganze Zahl 1 bis 99"
                    },
                    {
                      "code": "FACTOR_INVALID",
                      "field": "items[0].factor",
                      "index": 0,
                      "detail": "Pflicht, Zahl"
                    },
                    {
                      "code": "FACTOR_PRECISION",
                      "field": "items[0].factor",
                      "index": 0,
                      "detail": "höchstens zwei Nachkommastellen"
                    },
                    {
                      "code": "FACTOR_BELOW_MINIMUM",
                      "field": "items[0].factor",
                      "index": 0,
                      "detail": "unter 1,0"
                    },
                    {
                      "code": "FACTOR_ABOVE_MAXIMUM",
                      "hint": "Ein höherer Steigerungssatz ist nur mit einer Honorarvereinbarung nach § 2 GOÄ möglich, die die Praxis vor der Behandlung persönlich schließt und in NuvaFace abrechnet. Über die Schnittstelle geht das nicht.",
                      "field": "items[0].factor",
                      "index": 0,
                      "detail": "über dem Höchstsatz (A, E, O 2,5; M und Nr. 437 1,3; Zuschläge 1,0; sonst 3,5); hint nennt die Honorarvereinbarung in der Praxis",
                      "maximum": 3.5
                    },
                    {
                      "code": "JUSTIFICATION_REQUIRED",
                      "field": "items[0].justification",
                      "index": 0,
                      "detail": "über dem Schwellenwert (1,8; 1,15; 1,0; sonst 2,3)"
                    },
                    {
                      "code": "JUSTIFICATION_TOO_SHORT",
                      "field": "items[0].justification",
                      "index": 0,
                      "detail": "kürzer als 10 Zeichen"
                    },
                    {
                      "code": "JUSTIFICATION_TOO_LONG",
                      "field": "items[0].justification",
                      "index": 0,
                      "detail": "länger als 500 Zeichen"
                    },
                    {
                      "code": "JUSTIFICATION_INVALID",
                      "field": "items[0].justification",
                      "index": 0,
                      "detail": "kein Text"
                    },
                    {
                      "code": "FLAT_FEE_NOT_ALLOWED",
                      "field": "items[0].unitPrice",
                      "index": 0,
                      "detail": "Preis, Punktzahl oder Gesamtbetrag statt Ziffer und Faktor (Pauschale)"
                    },
                    {
                      "code": "TAX_RATE_NOT_SETTABLE",
                      "field": "taxRate",
                      "detail": "Steuersatz kommt aus der Praxis"
                    },
                    {
                      "code": "FIELD_NOT_ALLOWED",
                      "field": "items[0].description",
                      "index": 0,
                      "detail": "Feld außerhalb der Positivliste"
                    },
                    {
                      "code": "EXPECTED_AMOUNT_INVALID",
                      "field": "items[0].expectedAmount",
                      "index": 0,
                      "detail": "erwarteter Betrag keine Zahl"
                    },
                    {
                      "code": "INVOICE_CHECK_*",
                      "field": "items",
                      "detail": "Prüfstelle des Bestands (utils/belegpruefung) weist ab"
                    },
                    {
                      "code": "TOTAL_IMPLAUSIBLE",
                      "field": "items",
                      "detail": "Gesamtbetrag unplausibel hoch"
                    }
                  ],
                  "status": 422,
                  "instance": "urn:nuvaface:request:3f2a6c1e-0000-4000-8000-000000000099",
                  "requestId": "3f2a6c1e-0000-4000-8000-000000000099"
                }
              }
            },
            "description": "Angaben nicht zulässig (VALIDATION_FAILED mit errors) oder Idempotency-Key mit anderem Inhalt"
          },
          "423": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "code": "RECORD_RESTRICTED",
                  "type": "https://nuvaface-practice.com/api/public/docs#fehler-record-restricted",
                  "title": "Akte eingeschränkt",
                  "detail": "Die Akte ist eingeschränkt (Art. 18 DSGVO). Es wird nichts gespeichert.",
                  "status": 423,
                  "instance": "urn:nuvaface:request:3f2a6c1e-0000-4000-8000-000000000099",
                  "requestId": "3f2a6c1e-0000-4000-8000-000000000099"
                }
              }
            },
            "description": "Akte eingeschränkt"
          },
          "429": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "code": "RATE_LIMITED",
                  "type": "https://nuvaface-practice.com/api/public/docs#fehler-rate-limited",
                  "title": "Zu viele Anfragen",
                  "detail": "Höchstens 120 Anfragen je Minute und Schlüssel. Bitte die Antwort Retry-After abwarten.",
                  "status": 429,
                  "instance": "urn:nuvaface:request:3f2a6c1e-0000-4000-8000-000000000099",
                  "requestId": "3f2a6c1e-0000-4000-8000-000000000099",
                  "retryAfter": 17
                }
              }
            },
            "description": "Zu viele Anfragen (Kopf Retry-After) oder Tagesgrenze der Patientendatensätze erreicht (DAILY_PATIENT_LIMIT)"
          },
          "503": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "code": "UNAVAILABLE",
                  "type": "https://nuvaface-practice.com/api/public/docs#fehler-unavailable",
                  "title": "Vorübergehend nicht verfügbar",
                  "detail": "Die Schnittstelle ist vorübergehend nicht verfügbar.",
                  "status": 503,
                  "instance": "urn:nuvaface:request:3f2a6c1e-0000-4000-8000-000000000099",
                  "requestId": "3f2a6c1e-0000-4000-8000-000000000099",
                  "retryAfter": 30
                }
              }
            },
            "description": "Prüfung vorübergehend gestört oder (beim Upload) Server ausgelastet; Kopf Retry-After abwarten"
          }
        },
        "parameters": [
          {
            "in": "header",
            "name": "Idempotency-Key",
            "schema": {
              "type": "string",
              "pattern": "^[!-~]{1,255}$",
              "maxLength": 255,
              "minLength": 1
            },
            "required": false,
            "description": "Pflicht, außer im Probelauf (dryRun=true). ein neuer Wert je Vorgang (z. B. UUID), sonst 400. Eine Wiederholung mit gleichem Wert und gleichem Inhalt legt nichts doppelt an (24 Stunden, Kopf Idempotent-Replayed: true), auch dann nicht, wenn die erste Antwort den Aufrufer nie erreicht hat. Die Wiederholung gibt das angelegte Objekt nur wieder, wenn der Schlüssel es heute lesen darf (zum Beispiel patients.read für eine Akte, measurements.read für eine Messreihe), und zählt dann wie ein Lesen auf die Tagesgrenze; sonst enthält sie nur die Kennung des angelegten Objekts ({ id }). Anderer Inhalt ergibt 422, eine noch laufende Anfrage 409."
          },
          {
            "in": "query",
            "name": "dryRun",
            "schema": {
              "type": "boolean",
              "default": false
            },
            "required": false,
            "description": "true: alles prüfen und rechnen, aber nichts speichern und kein Ereignis auslösen. Antwort 200 mit dryRun: true und dem Ergebnis, das entstanden wäre (Kennungen eines Probelaufs gibt es danach nicht). Ein Idempotency-Key wird im Probelauf nicht verbraucht."
          }
        ],
        "description": "Scope: invoices.write. Gesundheitsbezug. Legt einen ENTWURF an, keinen Beleg: keine Rechnungsnummer, kein Versand, kein Umsatz, kein Export. Die Praxis sieht den Entwurf in NuvaFace (Abrechnung), prüft ihn im Rechnungsassistenten und legt erst dort die Rechnung mit Nummer an oder verwirft ihn. Entwürfe verfallen nach 30 Tagen.\n\nBeträge rechnet NuvaFace aus Ziffer, Punktzahl, Punktwert und Faktor (GOÄ), Umsatzsteuer nach dem Satz der Praxis (heute 19 %, eine steuerfreie Heilbehandlung stellt die Praxis bei der Übernahme ein). Erwartete Beträge (expectedAmount, expectedTotal) werden nur verglichen; Abweichungen über 1 Cent stehen in warnings.\n\nAbgewiesen (422 VALIDATION_FAILED, Feld errors listet ALLE Abweichungen, je Position mit index):\n- PATIENT_ID_INVALID (patientId): patientId fehlt oder ist keine UUID\n- APPOINTMENT_ID_INVALID (appointmentId): appointmentId ist keine UUID\n- APPOINTMENT_OTHER_PATIENT (appointmentId): Termin gehört zu einer anderen Akte der Praxis\n- SERVICE_DATE_REQUIRED (serviceDate): ohne Termin Pflicht (§ 12 Abs. 2 GOÄ)\n- SERVICE_DATE_INVALID (serviceDate): kein Kalendertag JJJJ-MM-TT\n- SERVICE_DATE_IN_FUTURE (serviceDate): nur erbrachte Leistungen (§ 4 Abs. 2 GOÄ), Kalendertag in Berlin\n- ITEMS_REQUIRED (items): mindestens eine Position\n- ITEMS_TOO_MANY (items): höchstens 50 Positionen\n- ITEM_INVALID (items[0]): Position ist kein Objekt\n- CODE_UNKNOWN (items[0].code): Ziffer fehlt oder steht nicht im GOÄ-Katalog der Software\n- CODE_POINTS_UNVERIFIED (items[0].code): Punktzahl im Katalog nicht gesichert (nur in der Praxis abrechenbar)\n- CODE_ONCE_PER_SESSION (items[0].code): Ziffer je Sitzung nur einmal (zweite Zeile oder Menge über 1)\n- QUANTITY_INVALID (items[0].quantity): ganze Zahl 1 bis 99\n- FACTOR_INVALID (items[0].factor): Pflicht, Zahl\n- FACTOR_PRECISION (items[0].factor): höchstens zwei Nachkommastellen\n- FACTOR_BELOW_MINIMUM (items[0].factor): unter 1,0\n- FACTOR_ABOVE_MAXIMUM (items[0].factor): über dem Höchstsatz (A, E, O 2,5; M und Nr. 437 1,3; Zuschläge 1,0; sonst 3,5); hint nennt die Honorarvereinbarung in der Praxis\n- JUSTIFICATION_REQUIRED (items[0].justification): über dem Schwellenwert (1,8; 1,15; 1,0; sonst 2,3)\n- JUSTIFICATION_TOO_SHORT (items[0].justification): kürzer als 10 Zeichen\n- JUSTIFICATION_TOO_LONG (items[0].justification): länger als 500 Zeichen\n- JUSTIFICATION_INVALID (items[0].justification): kein Text\n- FLAT_FEE_NOT_ALLOWED (items[0].unitPrice): Preis, Punktzahl oder Gesamtbetrag statt Ziffer und Faktor (Pauschale)\n- TAX_RATE_NOT_SETTABLE (taxRate): Steuersatz kommt aus der Praxis\n- FIELD_NOT_ALLOWED (items[0].description): Feld außerhalb der Positivliste\n- EXPECTED_AMOUNT_INVALID (items[0].expectedAmount): erwarteter Betrag keine Zahl\n- INVOICE_CHECK_* (items): Prüfstelle des Bestands (utils/belegpruefung) weist ab\n- TOTAL_IMPLAUSIBLE (items): Gesamtbetrag unplausibel hoch\n\nFremde, unbekannte oder archivierte Akte bzw. fremder Termin: 404. Eingeschränkte Akte: 423. Über dem Höchstsatz geht es nur mit einer Honorarvereinbarung, die die Praxis selbst schließt und abrechnet.",
        "operationId": "rechnungsentwurfAnlegen",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "patientId",
                  "items"
                ],
                "properties": {
                  "items": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "required": [
                        "code",
                        "factor"
                      ],
                      "properties": {
                        "code": {
                          "type": "string",
                          "description": "GOÄ-Ziffer bzw. Analogziffer aus dem Katalog (z. B. 1, 268, 2442A, A5)"
                        },
                        "factor": {
                          "type": "number",
                          "maximum": 3.5,
                          "minimum": 1,
                          "description": "Steigerungssatz mit höchstens zwei Nachkommastellen (sonst 422 FACTOR_PRECISION); Höchstsatz je Abschnitt (A, E, O 2,5; M und Nr. 437 1,3; Zuschläge 1,0)"
                        },
                        "quantity": {
                          "type": "integer",
                          "default": 1,
                          "maximum": 99,
                          "minimum": 1
                        },
                        "justification": {
                          "type": "string",
                          "maxLength": 500,
                          "description": "über dem Schwellenwert Pflicht, mindestens 10 Zeichen"
                        },
                        "expectedAmount": {
                          "type": "number",
                          "description": "nur zum Vergleich: erwarteter Zeilenbetrag"
                        }
                      },
                      "additionalProperties": false
                    },
                    "maxItems": 50,
                    "minItems": 1
                  },
                  "patientId": {
                    "type": "string",
                    "format": "uuid",
                    "description": "Akte der Praxis"
                  },
                  "serviceDate": {
                    "type": "string",
                    "format": "date",
                    "description": "Tag der Leistung, nie in der Zukunft (Europe/Berlin)"
                  },
                  "appointmentId": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "format": "uuid",
                    "description": "Termin derselben Akte (empfohlen); ohne serviceDate gilt sein Tag"
                  },
                  "expectedTotal": {
                    "type": "number",
                    "description": "nur zum Vergleich: erwarteter Gesamtbetrag brutto; Abweichung über 1 Cent als Hinweis"
                  }
                },
                "additionalProperties": false
              },
              "example": {
                "items": [
                  {
                    "code": "268",
                    "factor": 2.3,
                    "expectedAmount": 17.5
                  }
                ],
                "patientId": "3f2a6c1e-0000-4000-8000-000000000001",
                "serviceDate": "2026-11-25",
                "appointmentId": "3f2a6c1e-0000-4000-8000-000000000011"
              }
            }
          },
          "required": true
        },
        "x-nuvaface-scopes": [
          "invoices.write"
        ]
      }
    },
    "/patients": {
      "get": {
        "tags": [
          "Patienten"
        ],
        "summary": "Patienten suchen",
        "security": [
          {
            "apiKey": []
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data",
                    "nextCursor"
                  ],
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Patient"
                      }
                    },
                    "nextCursor": {
                      "type": [
                        "string",
                        "null"
                      ]
                    }
                  }
                },
                "example": {
                  "data": [
                    {
                      "id": "3f2a6c1e-0000-4000-8000-000000000001",
                      "age": 41,
                      "code": null,
                      "email": "anna.beispiel@example.com",
                      "phone": "+49 151 00000000",
                      "gender": "female",
                      "status": "active",
                      "address": {
                        "city": "München",
                        "text": null,
                        "street": "Musterweg 1",
                        "postalCode": "80331"
                      },
                      "lastName": "Beispiel",
                      "birthDate": "1985-05-05",
                      "birthYear": 1985,
                      "createdAt": "2026-10-01T09:30:00+02:00",
                      "firstName": "Anna",
                      "updatedAt": "2026-11-20T14:05:00+01:00"
                    }
                  ],
                  "nextCursor": null
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "code": "VALIDATION",
                  "type": "https://nuvaface-practice.com/api/public/docs#fehler-validation",
                  "title": "Ungültige Anfrage",
                  "detail": "search braucht 2 bis 80 Zeichen.",
                  "status": 400,
                  "instance": "urn:nuvaface:request:3f2a6c1e-0000-4000-8000-000000000099",
                  "requestId": "3f2a6c1e-0000-4000-8000-000000000099"
                }
              }
            },
            "description": "Ungültige Anfrage (auch: Schlüssel in der Adresse, ungültige Kennung, NUL-Zeichen)"
          },
          "401": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "code": "TOKEN_INVALID",
                  "type": "https://nuvaface-practice.com/api/public/docs#fehler-token-invalid",
                  "title": "Zugang ungültig",
                  "detail": "Der Schlüssel ist unbekannt, abgelaufen oder widerrufen.",
                  "status": 401,
                  "instance": "urn:nuvaface:request:3f2a6c1e-0000-4000-8000-000000000099",
                  "requestId": "3f2a6c1e-0000-4000-8000-000000000099"
                }
              }
            },
            "description": "Nicht angemeldet oder Schlüssel ungültig"
          },
          "403": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "code": "INSUFFICIENT_SCOPE",
                  "type": "https://nuvaface-practice.com/api/public/docs#fehler-insufficient-scope",
                  "title": "Berechtigung fehlt",
                  "detail": "Dieser Schlüssel hat den nötigen Scope nicht. Die Praxisinhaberin kann einen Schlüssel mit diesem Recht in NuvaFace unter Einstellungen, Schnittstellen anlegen.",
                  "status": 403,
                  "instance": "urn:nuvaface:request:3f2a6c1e-0000-4000-8000-000000000099",
                  "requestId": "3f2a6c1e-0000-4000-8000-000000000099"
                }
              }
            },
            "description": "Scope fehlt, Schnittstelle nicht freigeschaltet oder Praxis gesperrt (code nennt den Grund)"
          },
          "429": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "code": "DAILY_PATIENT_LIMIT",
                  "type": "https://nuvaface-practice.com/api/public/docs#fehler-daily-patient-limit",
                  "limit": 500,
                  "title": "Tagesgrenze für Patientendaten erreicht",
                  "detail": "Die Tagesgrenze von 500 Patientendatensätzen für diesen Schlüssel ist erreicht (heute noch 12 möglich, diese Anfrage hätte 50 geliefert; mit kleinerem limit erneut versuchen). Neue Abrufe ab Mitternacht (Europe/Berlin).",
                  "status": 429,
                  "instance": "urn:nuvaface:request:3f2a6c1e-0000-4000-8000-000000000099",
                  "remaining": 12,
                  "requestId": "3f2a6c1e-0000-4000-8000-000000000099",
                  "retryAfter": 41280
                }
              }
            },
            "description": "Zu viele Anfragen (Kopf Retry-After) oder Tagesgrenze der Patientendatensätze erreicht (DAILY_PATIENT_LIMIT)"
          },
          "503": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "code": "UNAVAILABLE",
                  "type": "https://nuvaface-practice.com/api/public/docs#fehler-unavailable",
                  "title": "Vorübergehend nicht verfügbar",
                  "detail": "Die Schnittstelle ist vorübergehend nicht verfügbar.",
                  "status": 503,
                  "instance": "urn:nuvaface:request:3f2a6c1e-0000-4000-8000-000000000099",
                  "requestId": "3f2a6c1e-0000-4000-8000-000000000099",
                  "retryAfter": 30
                }
              }
            },
            "description": "Prüfung vorübergehend gestört oder (beim Upload) Server ausgelastet; Kopf Retry-After abwarten"
          }
        },
        "parameters": [
          {
            "in": "query",
            "name": "search",
            "schema": {
              "type": "string"
            },
            "description": "Vor- oder Nachname, auch Teile (2 bis 80 Zeichen; % und _ zählen als Zeichen)"
          },
          {
            "in": "query",
            "name": "email",
            "schema": {
              "type": "string",
              "format": "email"
            },
            "description": "genaue E-Mail-Adresse"
          },
          {
            "in": "query",
            "name": "phone",
            "schema": {
              "type": "string"
            },
            "description": "Telefonnummer, verglichen werden die Ziffern (Endung); ohne führende 0 bzw. Landesvorwahl 49 mindestens 5 Ziffern, sonst 400"
          },
          {
            "in": "query",
            "name": "birthDate",
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "in": "query",
            "name": "updatedSince",
            "schema": {
              "type": "string",
              "format": "date-time"
            },
            "description": "nur seit diesem Zeitpunkt angelegt oder geändert; ISO 8601 mit Z bzw. Versatz (ein Kalendertag JJJJ-MM-TT gilt als 00:00 UTC)"
          },
          {
            "in": "query",
            "name": "limit",
            "schema": {
              "type": "integer",
              "default": 50,
              "maximum": 100,
              "minimum": 1
            }
          },
          {
            "in": "query",
            "name": "cursor",
            "schema": {
              "type": "string"
            },
            "description": "Wert nextCursor der vorigen Antwort, unverändert"
          }
        ],
        "description": "Scope: patients.read. Mit patients.read.basic allein 403. Höchstens 20 Listenabrufe je Minute und Schlüssel. Jede gelieferte Zeile zählt auf die Tagesgrenze der Patientendatensätze (Standard 500 je Kalendertag); eine Liste, die die Grenze überschreiten würde, wird ganz abgewiesen (429 DAILY_PATIENT_LIMIT mit remaining). Für Abgleiche updatedSince nutzen.",
        "operationId": "patientenSuchen",
        "x-nuvaface-scopes": [
          "patients.read"
        ]
      },
      "post": {
        "tags": [
          "Patienten"
        ],
        "summary": "Patient anlegen",
        "security": [
          {
            "apiKey": []
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/PatientAngelegt"
                    },
                    {
                      "type": "object",
                      "required": [
                        "dryRun"
                      ],
                      "properties": {
                        "dryRun": {
                          "type": "boolean",
                          "const": true,
                          "description": "Probelauf: nichts gespeichert"
                        }
                      }
                    }
                  ]
                },
                "example": {
                  "id": "3f2a6c1e-0000-4000-8000-000000000001",
                  "age": 34,
                  "code": "7K3M-Q9TB-9",
                  "email": "jana.neumann@example.com",
                  "phone": "0151 98765432",
                  "dryRun": true,
                  "gender": "female",
                  "status": "active",
                  "address": {
                    "city": "München",
                    "text": "Hauptstraße 12a, 80331 München",
                    "street": "Hauptstraße 12a",
                    "postalCode": "80331"
                  },
                  "lastName": "Neumann",
                  "birthDate": "1992-03-04",
                  "birthYear": 1992,
                  "createdAt": "2026-12-01T10:00:00+01:00",
                  "firstName": "Jana",
                  "updatedAt": "2026-12-01T10:00:00+01:00"
                }
              }
            },
            "description": "Probelauf (dryRun=true), nichts gespeichert"
          },
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PatientAngelegt"
                },
                "example": {
                  "id": "3f2a6c1e-0000-4000-8000-000000000001",
                  "age": 34,
                  "code": "7K3M-Q9TB-9",
                  "email": "jana.neumann@example.com",
                  "phone": "0151 98765432",
                  "gender": "female",
                  "status": "active",
                  "address": {
                    "city": "München",
                    "text": "Hauptstraße 12a, 80331 München",
                    "street": "Hauptstraße 12a",
                    "postalCode": "80331"
                  },
                  "lastName": "Neumann",
                  "birthDate": "1992-03-04",
                  "birthYear": 1992,
                  "createdAt": "2026-12-01T10:00:00+01:00",
                  "firstName": "Jana",
                  "updatedAt": "2026-12-01T10:00:00+01:00"
                }
              }
            },
            "description": "Angelegt"
          },
          "400": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "code": "VALIDATION",
                  "type": "https://nuvaface-practice.com/api/public/docs#fehler-validation",
                  "title": "Ungültige Anfrage",
                  "detail": "birthDate liegt in der Zukunft.",
                  "fields": [
                    "birthDate"
                  ],
                  "status": 400,
                  "instance": "urn:nuvaface:request:3f2a6c1e-0000-4000-8000-000000000099",
                  "requestId": "3f2a6c1e-0000-4000-8000-000000000099"
                }
              }
            },
            "description": "Ungültige Anfrage (auch: Schlüssel in der Adresse, ungültige Kennung, NUL-Zeichen)"
          },
          "401": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "code": "TOKEN_INVALID",
                  "type": "https://nuvaface-practice.com/api/public/docs#fehler-token-invalid",
                  "title": "Zugang ungültig",
                  "detail": "Der Schlüssel ist unbekannt, abgelaufen oder widerrufen.",
                  "status": 401,
                  "instance": "urn:nuvaface:request:3f2a6c1e-0000-4000-8000-000000000099",
                  "requestId": "3f2a6c1e-0000-4000-8000-000000000099"
                }
              }
            },
            "description": "Nicht angemeldet oder Schlüssel ungültig"
          },
          "403": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "code": "INSUFFICIENT_SCOPE",
                  "type": "https://nuvaface-practice.com/api/public/docs#fehler-insufficient-scope",
                  "title": "Berechtigung fehlt",
                  "detail": "Dieser Schlüssel hat den nötigen Scope nicht. Die Praxisinhaberin kann einen Schlüssel mit diesem Recht in NuvaFace unter Einstellungen, Schnittstellen anlegen.",
                  "status": 403,
                  "instance": "urn:nuvaface:request:3f2a6c1e-0000-4000-8000-000000000099",
                  "requestId": "3f2a6c1e-0000-4000-8000-000000000099"
                }
              }
            },
            "description": "Scope fehlt, Schnittstelle nicht freigeschaltet oder Praxis gesperrt (code nennt den Grund)"
          },
          "409": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "code": "DUPLICATE",
                  "type": "https://nuvaface-practice.com/api/public/docs#fehler-duplicate",
                  "title": "Akte vermutlich schon vorhanden",
                  "detail": "Zu Name und Geburtsdatum gibt es in dieser Praxis schon eine Akte. Bitte die bestehende Akte verwenden; eine zweite Akte legt die Praxis bei Bedarf in NuvaFace selbst an.",
                  "status": 409,
                  "instance": "urn:nuvaface:request:3f2a6c1e-0000-4000-8000-000000000099",
                  "requestId": "3f2a6c1e-0000-4000-8000-000000000099",
                  "candidates": [
                    {
                      "id": "3f2a6c1e-0000-4000-8000-000000000002",
                      "match": [
                        "name_birthdate",
                        "email"
                      ]
                    }
                  ]
                }
              }
            },
            "description": "DUPLICATE (Akte vermutlich vorhanden, candidates; candidates kann leer sein, dann bitte in der Praxis klären) oder Anfrage mit diesem Idempotency-Key läuft noch"
          },
          "413": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "code": "PAYLOAD_TOO_LARGE",
                  "type": "https://nuvaface-practice.com/api/public/docs#fehler-payload-too-large",
                  "title": "Datei zu groß",
                  "detail": "Der Rumpf ist zu groß (höchstens 100 KB).",
                  "status": 413,
                  "instance": "urn:nuvaface:request:3f2a6c1e-0000-4000-8000-000000000099",
                  "requestId": "3f2a6c1e-0000-4000-8000-000000000099"
                }
              }
            },
            "description": "Rumpf größer als 100 KB (PAYLOAD_TOO_LARGE)"
          },
          "415": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "code": "UNSUPPORTED_MEDIA_TYPE",
                  "type": "https://nuvaface-practice.com/api/public/docs#fehler-unsupported-media-type",
                  "title": "Dateityp nicht erlaubt",
                  "detail": "Bitte den Rumpf als application/json senden.",
                  "status": 415,
                  "instance": "urn:nuvaface:request:3f2a6c1e-0000-4000-8000-000000000099",
                  "requestId": "3f2a6c1e-0000-4000-8000-000000000099"
                }
              }
            },
            "description": "Rumpf nicht als JSON gekennzeichnet oder mit nicht unterstützter Kodierung (UNSUPPORTED_MEDIA_TYPE)"
          },
          "422": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "code": "IDEMPOTENCY_MISMATCH",
                  "type": "https://nuvaface-practice.com/api/public/docs#fehler-idempotency-mismatch",
                  "title": "Idempotency-Key mit anderem Inhalt",
                  "detail": "Dieser Idempotency-Key wurde schon für eine andere Anfrage benutzt.",
                  "status": 422,
                  "instance": "urn:nuvaface:request:3f2a6c1e-0000-4000-8000-000000000099",
                  "requestId": "3f2a6c1e-0000-4000-8000-000000000099"
                }
              }
            },
            "description": "Idempotency-Key mit anderem Inhalt"
          },
          "429": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "code": "RATE_LIMITED",
                  "type": "https://nuvaface-practice.com/api/public/docs#fehler-rate-limited",
                  "title": "Zu viele Anfragen",
                  "detail": "Höchstens 120 Anfragen je Minute und Schlüssel. Bitte die Antwort Retry-After abwarten.",
                  "status": 429,
                  "instance": "urn:nuvaface:request:3f2a6c1e-0000-4000-8000-000000000099",
                  "requestId": "3f2a6c1e-0000-4000-8000-000000000099",
                  "retryAfter": 17
                }
              }
            },
            "description": "Zu viele Anfragen (Kopf Retry-After) oder Tagesgrenze der Patientendatensätze erreicht (DAILY_PATIENT_LIMIT)"
          },
          "503": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "code": "UNAVAILABLE",
                  "type": "https://nuvaface-practice.com/api/public/docs#fehler-unavailable",
                  "title": "Vorübergehend nicht verfügbar",
                  "detail": "Die Schnittstelle ist vorübergehend nicht verfügbar.",
                  "status": 503,
                  "instance": "urn:nuvaface:request:3f2a6c1e-0000-4000-8000-000000000099",
                  "requestId": "3f2a6c1e-0000-4000-8000-000000000099",
                  "retryAfter": 30
                }
              }
            },
            "description": "Prüfung vorübergehend gestört oder (beim Upload) Server ausgelastet; Kopf Retry-After abwarten"
          }
        },
        "parameters": [
          {
            "in": "header",
            "name": "Idempotency-Key",
            "schema": {
              "type": "string",
              "pattern": "^[!-~]{1,255}$",
              "maxLength": 255,
              "minLength": 1
            },
            "required": false,
            "description": "Pflicht, außer im Probelauf (dryRun=true). ein neuer Wert je Vorgang (z. B. UUID), sonst 400. Eine Wiederholung mit gleichem Wert und gleichem Inhalt legt nichts doppelt an (24 Stunden, Kopf Idempotent-Replayed: true), auch dann nicht, wenn die erste Antwort den Aufrufer nie erreicht hat. Die Wiederholung gibt das angelegte Objekt nur wieder, wenn der Schlüssel es heute lesen darf (zum Beispiel patients.read für eine Akte, measurements.read für eine Messreihe), und zählt dann wie ein Lesen auf die Tagesgrenze; sonst enthält sie nur die Kennung des angelegten Objekts ({ id }). Anderer Inhalt ergibt 422, eine noch laufende Anfrage 409."
          },
          {
            "in": "query",
            "name": "dryRun",
            "schema": {
              "type": "boolean",
              "default": false
            },
            "required": false,
            "description": "true: alles prüfen und rechnen, aber nichts speichern und kein Ereignis auslösen. Antwort 200 mit dryRun: true und dem Ergebnis, das entstanden wäre (Kennungen eines Probelaufs gibt es danach nicht). Ein Idempotency-Key wird im Probelauf nicht verbraucht."
          }
        ],
        "description": "Scope: patients.write. Legt eine Akte an, wie in NuvaFace: keine Mail und keine SMS an den Patienten, keine Einwilligung, Quelle und Schlüssel stehen im Verlauf der Akte. Dublettenprüfung nur in der eigenen Praxis (Name und Geburtsdatum, Mail, Telefon); bei Treffern 409 DUPLICATE mit candidates (nur Kennungen und Trefferart, sie zählen auf die Tagesgrenze). Trifft die Prüfung eine Akte, die über die Schnittstelle nicht sichtbar ist (eingeschränkt nach Art. 18 DSGVO oder archiviert), kommt ebenfalls 409 DUPLICATE, aber mit neutralem Text, ohne Kennung und ohne Trefferart dieser Akte (candidates nennt dann nur sichtbare Akten und kann leer sein); allowDuplicate übersteuert das nicht, die Klärung liegt bei der Praxis, die Anfrage zählt mindestens 1 auf die Tagesgrenze. Die Antwort trägt den Patientencode für Papierbögen. Idempotency-Key Pflicht, Probelauf mit dryRun=true.",
        "operationId": "patientAnlegen",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PatientNeu"
              },
              "example": {
                "email": "jana.neumann@example.com",
                "phone": "0151 98765432",
                "gender": "female",
                "address": {
                  "city": "München",
                  "street": "Hauptstraße",
                  "postalCode": "80331",
                  "houseNumber": "12a"
                },
                "lastName": "Neumann",
                "birthDate": "1992-03-04",
                "firstName": "Jana"
              }
            }
          },
          "required": true
        },
        "x-nuvaface-scopes": [
          "patients.write"
        ]
      }
    },
    "/practice": {
      "get": {
        "tags": [
          "Praxis"
        ],
        "summary": "Praxisdaten (wie die öffentliche Buchungsseite)",
        "security": [
          {
            "apiKey": []
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Praxis"
                },
                "example": {
                  "name": "Praxis Lindenhof",
                  "email": "praxis@example.com",
                  "phone": "+49 89 1234567",
                  "address": {
                    "city": "München",
                    "text": "Lindenweg 4, 80331 München",
                    "street": "Lindenweg",
                    "postalCode": "80331",
                    "houseNumber": "4"
                  },
                  "website": "https://praxis.example.com",
                  "timezone": "Europe/Berlin",
                  "bookingPage": {
                    "url": "https://nuvaface-practice.com/booking/praxis-lindenhof",
                    "accessCodeRequired": false
                  },
                  "openingHours": {
                    "friday": {
                      "slots": [
                        {
                          "end": "13:00",
                          "start": "09:00"
                        }
                      ],
                      "isOpen": true
                    },
                    "monday": {
                      "slots": [
                        {
                          "end": "12:00",
                          "start": "08:00"
                        }
                      ],
                      "isOpen": true
                    },
                    "sunday": {
                      "slots": [],
                      "isOpen": false
                    },
                    "tuesday": {
                      "slots": [
                        {
                          "end": "17:00",
                          "start": "09:00"
                        }
                      ],
                      "isOpen": true
                    },
                    "saturday": {
                      "slots": [],
                      "isOpen": false
                    },
                    "thursday": {
                      "slots": [
                        {
                          "end": "17:00",
                          "start": "09:00"
                        }
                      ],
                      "isOpen": true
                    },
                    "wednesday": {
                      "slots": [],
                      "isOpen": false
                    }
                  },
                  "availabilityMode": "fixed"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "code": "VALIDATION",
                  "type": "https://nuvaface-practice.com/api/public/docs#fehler-validation",
                  "title": "Ungültige Anfrage",
                  "detail": "limit muss zwischen 1 und 100 liegen.",
                  "status": 400,
                  "instance": "urn:nuvaface:request:3f2a6c1e-0000-4000-8000-000000000099",
                  "requestId": "3f2a6c1e-0000-4000-8000-000000000099"
                }
              }
            },
            "description": "Ungültige Anfrage (auch: Schlüssel in der Adresse, ungültige Kennung, NUL-Zeichen)"
          },
          "401": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "code": "TOKEN_INVALID",
                  "type": "https://nuvaface-practice.com/api/public/docs#fehler-token-invalid",
                  "title": "Zugang ungültig",
                  "detail": "Der Schlüssel ist unbekannt, abgelaufen oder widerrufen.",
                  "status": 401,
                  "instance": "urn:nuvaface:request:3f2a6c1e-0000-4000-8000-000000000099",
                  "requestId": "3f2a6c1e-0000-4000-8000-000000000099"
                }
              }
            },
            "description": "Nicht angemeldet oder Schlüssel ungültig"
          },
          "403": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "code": "INSUFFICIENT_SCOPE",
                  "type": "https://nuvaface-practice.com/api/public/docs#fehler-insufficient-scope",
                  "title": "Berechtigung fehlt",
                  "detail": "Dieser Schlüssel hat den nötigen Scope nicht. Die Praxisinhaberin kann einen Schlüssel mit diesem Recht in NuvaFace unter Einstellungen, Schnittstellen anlegen.",
                  "status": 403,
                  "instance": "urn:nuvaface:request:3f2a6c1e-0000-4000-8000-000000000099",
                  "requestId": "3f2a6c1e-0000-4000-8000-000000000099"
                }
              }
            },
            "description": "Scope fehlt, Schnittstelle nicht freigeschaltet oder Praxis gesperrt (code nennt den Grund)"
          },
          "429": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "code": "RATE_LIMITED",
                  "type": "https://nuvaface-practice.com/api/public/docs#fehler-rate-limited",
                  "title": "Zu viele Anfragen",
                  "detail": "Höchstens 120 Anfragen je Minute und Schlüssel. Bitte die Antwort Retry-After abwarten.",
                  "status": 429,
                  "instance": "urn:nuvaface:request:3f2a6c1e-0000-4000-8000-000000000099",
                  "requestId": "3f2a6c1e-0000-4000-8000-000000000099",
                  "retryAfter": 17
                }
              }
            },
            "description": "Zu viele Anfragen (Kopf Retry-After) oder Tagesgrenze der Patientendatensätze erreicht (DAILY_PATIENT_LIMIT)"
          },
          "503": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "code": "UNAVAILABLE",
                  "type": "https://nuvaface-practice.com/api/public/docs#fehler-unavailable",
                  "title": "Vorübergehend nicht verfügbar",
                  "detail": "Die Schnittstelle ist vorübergehend nicht verfügbar.",
                  "status": 503,
                  "instance": "urn:nuvaface:request:3f2a6c1e-0000-4000-8000-000000000099",
                  "requestId": "3f2a6c1e-0000-4000-8000-000000000099",
                  "retryAfter": 30
                }
              }
            },
            "description": "Prüfung vorübergehend gestört oder (beim Upload) Server ausgelastet; Kopf Retry-After abwarten"
          }
        },
        "parameters": [],
        "description": "Scope: practice.read. Keine Patientendaten.",
        "operationId": "praxisLesen",
        "x-nuvaface-scopes": [
          "practice.read"
        ]
      }
    },
    "/treatments": {
      "get": {
        "tags": [
          "Freie Zeiten"
        ],
        "summary": "Behandlungskatalog (aktiv)",
        "security": [
          {
            "apiKey": []
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Behandlung"
                      }
                    }
                  }
                },
                "example": {
                  "data": [
                    {
                      "id": "3f2a6c1e-0000-4000-8000-000000000021",
                      "name": "Performance Check",
                      "price": null,
                      "category": "Check",
                      "currency": null,
                      "priceFrom": null,
                      "infoPdfUrl": null,
                      "description": null,
                      "onlineBookable": true,
                      "durationMinutes": 60
                    }
                  ]
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "code": "VALIDATION",
                  "type": "https://nuvaface-practice.com/api/public/docs#fehler-validation",
                  "title": "Ungültige Anfrage",
                  "detail": "Schlüssel nie in der Adresse übergeben, sondern im Kopf Authorization: Bearer ...",
                  "status": 400,
                  "instance": "urn:nuvaface:request:3f2a6c1e-0000-4000-8000-000000000099",
                  "requestId": "3f2a6c1e-0000-4000-8000-000000000099"
                }
              }
            },
            "description": "Ungültige Anfrage (auch: Schlüssel in der Adresse, ungültige Kennung, NUL-Zeichen)"
          },
          "401": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "code": "TOKEN_INVALID",
                  "type": "https://nuvaface-practice.com/api/public/docs#fehler-token-invalid",
                  "title": "Zugang ungültig",
                  "detail": "Der Schlüssel ist unbekannt, abgelaufen oder widerrufen.",
                  "status": 401,
                  "instance": "urn:nuvaface:request:3f2a6c1e-0000-4000-8000-000000000099",
                  "requestId": "3f2a6c1e-0000-4000-8000-000000000099"
                }
              }
            },
            "description": "Nicht angemeldet oder Schlüssel ungültig"
          },
          "403": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "code": "INSUFFICIENT_SCOPE",
                  "type": "https://nuvaface-practice.com/api/public/docs#fehler-insufficient-scope",
                  "title": "Berechtigung fehlt",
                  "detail": "Dieser Schlüssel hat den nötigen Scope nicht. Die Praxisinhaberin kann einen Schlüssel mit diesem Recht in NuvaFace unter Einstellungen, Schnittstellen anlegen.",
                  "status": 403,
                  "instance": "urn:nuvaface:request:3f2a6c1e-0000-4000-8000-000000000099",
                  "requestId": "3f2a6c1e-0000-4000-8000-000000000099"
                }
              }
            },
            "description": "Scope fehlt, Schnittstelle nicht freigeschaltet oder Praxis gesperrt (code nennt den Grund)"
          },
          "429": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "code": "RATE_LIMITED",
                  "type": "https://nuvaface-practice.com/api/public/docs#fehler-rate-limited",
                  "title": "Zu viele Anfragen",
                  "detail": "Höchstens 120 Anfragen je Minute und Schlüssel. Bitte die Antwort Retry-After abwarten.",
                  "status": 429,
                  "instance": "urn:nuvaface:request:3f2a6c1e-0000-4000-8000-000000000099",
                  "requestId": "3f2a6c1e-0000-4000-8000-000000000099",
                  "retryAfter": 17
                }
              }
            },
            "description": "Zu viele Anfragen (Kopf Retry-After) oder Tagesgrenze der Patientendatensätze erreicht (DAILY_PATIENT_LIMIT)"
          },
          "503": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "code": "UNAVAILABLE",
                  "type": "https://nuvaface-practice.com/api/public/docs#fehler-unavailable",
                  "title": "Vorübergehend nicht verfügbar",
                  "detail": "Die Schnittstelle ist vorübergehend nicht verfügbar.",
                  "status": 503,
                  "instance": "urn:nuvaface:request:3f2a6c1e-0000-4000-8000-000000000099",
                  "requestId": "3f2a6c1e-0000-4000-8000-000000000099",
                  "retryAfter": 30
                }
              }
            },
            "description": "Prüfung vorübergehend gestört oder (beim Upload) Server ausgelastet; Kopf Retry-After abwarten"
          }
        },
        "description": "Scope: availability.read.",
        "operationId": "behandlungen",
        "x-nuvaface-scopes": [
          "availability.read"
        ]
      }
    },
    "/appointments": {
      "get": {
        "tags": [
          "Termine"
        ],
        "summary": "Termine lesen (höchstens 92 Tage je Abfrage)",
        "security": [
          {
            "apiKey": []
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data",
                    "nextCursor"
                  ],
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Termin"
                      }
                    },
                    "nextCursor": {
                      "type": [
                        "string",
                        "null"
                      ]
                    }
                  }
                },
                "example": {
                  "data": [
                    {
                      "id": "3f2a6c1e-0000-4000-8000-000000000011",
                      "end": "2026-12-01T10:30:00+01:00",
                      "type": "consultation",
                      "start": "2026-12-01T10:00:00+01:00",
                      "video": false,
                      "source": "manual",
                      "status": "confirmed",
                      "createdAt": "2026-11-20T14:05:00+01:00",
                      "patientId": "3f2a6c1e-0000-4000-8000-000000000001",
                      "updatedAt": "2026-11-20T14:05:00+01:00",
                      "treatmentId": "3f2a6c1e-0000-4000-8000-000000000021",
                      "treatmentName": "Performance Check"
                    }
                  ],
                  "nextCursor": null
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "code": "VALIDATION",
                  "type": "https://nuvaface-practice.com/api/public/docs#fehler-validation",
                  "title": "Ungültige Anfrage",
                  "detail": "Zeitraum höchstens 92 Tage.",
                  "status": 400,
                  "instance": "urn:nuvaface:request:3f2a6c1e-0000-4000-8000-000000000099",
                  "requestId": "3f2a6c1e-0000-4000-8000-000000000099"
                }
              }
            },
            "description": "Ungültige Anfrage (auch: Schlüssel in der Adresse, ungültige Kennung, NUL-Zeichen)"
          },
          "401": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "code": "TOKEN_INVALID",
                  "type": "https://nuvaface-practice.com/api/public/docs#fehler-token-invalid",
                  "title": "Zugang ungültig",
                  "detail": "Der Schlüssel ist unbekannt, abgelaufen oder widerrufen.",
                  "status": 401,
                  "instance": "urn:nuvaface:request:3f2a6c1e-0000-4000-8000-000000000099",
                  "requestId": "3f2a6c1e-0000-4000-8000-000000000099"
                }
              }
            },
            "description": "Nicht angemeldet oder Schlüssel ungültig"
          },
          "403": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "code": "INSUFFICIENT_SCOPE",
                  "type": "https://nuvaface-practice.com/api/public/docs#fehler-insufficient-scope",
                  "title": "Berechtigung fehlt",
                  "detail": "Dieser Schlüssel hat den nötigen Scope nicht. Die Praxisinhaberin kann einen Schlüssel mit diesem Recht in NuvaFace unter Einstellungen, Schnittstellen anlegen.",
                  "status": 403,
                  "instance": "urn:nuvaface:request:3f2a6c1e-0000-4000-8000-000000000099",
                  "requestId": "3f2a6c1e-0000-4000-8000-000000000099"
                }
              }
            },
            "description": "Scope fehlt, Schnittstelle nicht freigeschaltet oder Praxis gesperrt (code nennt den Grund)"
          },
          "429": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "code": "RATE_LIMITED",
                  "type": "https://nuvaface-practice.com/api/public/docs#fehler-rate-limited",
                  "title": "Zu viele Anfragen",
                  "detail": "Höchstens 120 Anfragen je Minute und Schlüssel. Bitte die Antwort Retry-After abwarten.",
                  "status": 429,
                  "instance": "urn:nuvaface:request:3f2a6c1e-0000-4000-8000-000000000099",
                  "requestId": "3f2a6c1e-0000-4000-8000-000000000099",
                  "retryAfter": 17
                }
              }
            },
            "description": "Zu viele Anfragen (Kopf Retry-After) oder Tagesgrenze der Patientendatensätze erreicht (DAILY_PATIENT_LIMIT)"
          },
          "503": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "code": "UNAVAILABLE",
                  "type": "https://nuvaface-practice.com/api/public/docs#fehler-unavailable",
                  "title": "Vorübergehend nicht verfügbar",
                  "detail": "Die Schnittstelle ist vorübergehend nicht verfügbar.",
                  "status": 503,
                  "instance": "urn:nuvaface:request:3f2a6c1e-0000-4000-8000-000000000099",
                  "requestId": "3f2a6c1e-0000-4000-8000-000000000099",
                  "retryAfter": 30
                }
              }
            },
            "description": "Prüfung vorübergehend gestört oder (beim Upload) Server ausgelastet; Kopf Retry-After abwarten"
          }
        },
        "parameters": [
          {
            "in": "query",
            "name": "from",
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "in": "query",
            "name": "to",
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "in": "query",
            "name": "patientId",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "in": "query",
            "name": "status",
            "schema": {
              "type": "string",
              "example": "scheduled,confirmed"
            },
            "description": "mehrere mit Komma"
          },
          {
            "in": "query",
            "name": "limit",
            "schema": {
              "type": "integer",
              "default": 50,
              "maximum": 100,
              "minimum": 1
            }
          },
          {
            "in": "query",
            "name": "cursor",
            "schema": {
              "type": "string"
            },
            "description": "Wert nextCursor der vorigen Antwort, unverändert"
          }
        ],
        "description": "Scope: appointments.read. Ohne from: ab heute, ohne to: 30 Tage. Sperrzeiten (Urlaub, Pausen) erscheinen nicht, Termine eingeschränkter oder archivierter Akten auch nicht. title und guest (Kontakt einer Online-Buchung ohne Akte) nur mit patients.read; dann zählt jeder unterschiedliche Patient einer Antwort 1 auf die Tagesgrenze der Patientendatensätze, ebenso jeder Termin ohne Akte mit Titel oder Gastkontakt (429 DAILY_PATIENT_LIMIT wie bei Patientenabrufen).",
        "operationId": "termineLesen",
        "x-nuvaface-scopes": [
          "appointments.read"
        ]
      },
      "post": {
        "tags": [
          "Termine"
        ],
        "summary": "Termin anlegen (als Anfrage)",
        "security": [
          {
            "apiKey": []
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Termin"
                    },
                    {
                      "type": "object",
                      "required": [
                        "dryRun"
                      ],
                      "properties": {
                        "dryRun": {
                          "type": "boolean",
                          "const": true,
                          "description": "Probelauf: nichts gespeichert"
                        }
                      }
                    }
                  ]
                },
                "example": {
                  "id": "3f2a6c1e-0000-4000-8000-000000000031",
                  "end": "2026-12-02T15:30:00+01:00",
                  "type": "consultation",
                  "start": "2026-12-02T15:00:00+01:00",
                  "video": false,
                  "dryRun": true,
                  "source": "api",
                  "status": "pending",
                  "createdAt": "2026-11-26T09:12:00+01:00",
                  "patientId": "3f2a6c1e-0000-4000-8000-000000000001",
                  "updatedAt": "2026-11-26T09:12:00+01:00",
                  "treatmentId": "3f2a6c1e-0000-4000-8000-000000000021",
                  "treatmentName": "Beratungsgespräch"
                }
              }
            },
            "description": "Probelauf (dryRun=true), nichts gespeichert"
          },
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Termin"
                },
                "example": {
                  "id": "3f2a6c1e-0000-4000-8000-000000000031",
                  "end": "2026-12-02T15:30:00+01:00",
                  "type": "consultation",
                  "start": "2026-12-02T15:00:00+01:00",
                  "video": false,
                  "source": "api",
                  "status": "pending",
                  "createdAt": "2026-11-26T09:12:00+01:00",
                  "patientId": "3f2a6c1e-0000-4000-8000-000000000001",
                  "updatedAt": "2026-11-26T09:12:00+01:00",
                  "treatmentId": "3f2a6c1e-0000-4000-8000-000000000021",
                  "treatmentName": "Beratungsgespräch"
                }
              }
            },
            "description": "Angelegt (Status pending)"
          },
          "400": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "code": "VALIDATION",
                  "type": "https://nuvaface-practice.com/api/public/docs#fehler-validation",
                  "title": "Ungültige Anfrage",
                  "detail": "start: Zeitpunkt nach ISO 8601 mit Zone, volle Minute, z. B. 2026-12-01T10:00:00+01:00 oder 2026-12-01T09:00:00Z.",
                  "fields": [
                    "start"
                  ],
                  "status": 400,
                  "instance": "urn:nuvaface:request:3f2a6c1e-0000-4000-8000-000000000099",
                  "requestId": "3f2a6c1e-0000-4000-8000-000000000099"
                }
              }
            },
            "description": "Ungültig (Feld fehlt, Zeit ohne Zone, Zeitumstellung, Idempotency-Key fehlt)"
          },
          "401": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "code": "TOKEN_INVALID",
                  "type": "https://nuvaface-practice.com/api/public/docs#fehler-token-invalid",
                  "title": "Zugang ungültig",
                  "detail": "Der Schlüssel ist unbekannt, abgelaufen oder widerrufen.",
                  "status": 401,
                  "instance": "urn:nuvaface:request:3f2a6c1e-0000-4000-8000-000000000099",
                  "requestId": "3f2a6c1e-0000-4000-8000-000000000099"
                }
              }
            },
            "description": "Nicht angemeldet oder Schlüssel ungültig"
          },
          "403": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "code": "INSUFFICIENT_SCOPE",
                  "type": "https://nuvaface-practice.com/api/public/docs#fehler-insufficient-scope",
                  "title": "Berechtigung fehlt",
                  "detail": "Dieser Schlüssel hat den nötigen Scope nicht. Die Praxisinhaberin kann einen Schlüssel mit diesem Recht in NuvaFace unter Einstellungen, Schnittstellen anlegen.",
                  "status": 403,
                  "instance": "urn:nuvaface:request:3f2a6c1e-0000-4000-8000-000000000099",
                  "requestId": "3f2a6c1e-0000-4000-8000-000000000099"
                }
              }
            },
            "description": "Scope fehlt, Schnittstelle nicht freigeschaltet oder Praxis gesperrt (code nennt den Grund)"
          },
          "404": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "code": "NOT_FOUND",
                  "type": "https://nuvaface-practice.com/api/public/docs#fehler-not-found",
                  "title": "Nicht gefunden",
                  "detail": "Patient nicht gefunden.",
                  "status": 404,
                  "instance": "urn:nuvaface:request:3f2a6c1e-0000-4000-8000-000000000099",
                  "requestId": "3f2a6c1e-0000-4000-8000-000000000099"
                }
              }
            },
            "description": "Patient oder Behandlung nicht gefunden"
          },
          "409": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "code": "SLOT_UNAVAILABLE",
                  "type": "https://nuvaface-practice.com/api/public/docs#fehler-slot-unavailable",
                  "title": "Zeitpunkt nicht verfügbar",
                  "detail": "Zu dieser Zeit gibt es bereits einen Termin.",
                  "reason": "overlap",
                  "status": 409,
                  "instance": "urn:nuvaface:request:3f2a6c1e-0000-4000-8000-000000000099",
                  "requestId": "3f2a6c1e-0000-4000-8000-000000000099"
                }
              }
            },
            "description": "SLOT_UNAVAILABLE mit reason, oder Anfrage mit diesem Idempotency-Key läuft noch"
          },
          "413": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "code": "PAYLOAD_TOO_LARGE",
                  "type": "https://nuvaface-practice.com/api/public/docs#fehler-payload-too-large",
                  "title": "Datei zu groß",
                  "detail": "Der Rumpf ist zu groß (höchstens 100 KB).",
                  "status": 413,
                  "instance": "urn:nuvaface:request:3f2a6c1e-0000-4000-8000-000000000099",
                  "requestId": "3f2a6c1e-0000-4000-8000-000000000099"
                }
              }
            },
            "description": "Rumpf größer als 100 KB (PAYLOAD_TOO_LARGE)"
          },
          "415": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "code": "UNSUPPORTED_MEDIA_TYPE",
                  "type": "https://nuvaface-practice.com/api/public/docs#fehler-unsupported-media-type",
                  "title": "Dateityp nicht erlaubt",
                  "detail": "Bitte den Rumpf als application/json senden.",
                  "status": 415,
                  "instance": "urn:nuvaface:request:3f2a6c1e-0000-4000-8000-000000000099",
                  "requestId": "3f2a6c1e-0000-4000-8000-000000000099"
                }
              }
            },
            "description": "Rumpf nicht als JSON gekennzeichnet oder mit nicht unterstützter Kodierung (UNSUPPORTED_MEDIA_TYPE)"
          },
          "422": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "code": "IDEMPOTENCY_MISMATCH",
                  "type": "https://nuvaface-practice.com/api/public/docs#fehler-idempotency-mismatch",
                  "title": "Idempotency-Key mit anderem Inhalt",
                  "detail": "Dieser Idempotency-Key wurde schon für eine andere Anfrage benutzt.",
                  "status": 422,
                  "instance": "urn:nuvaface:request:3f2a6c1e-0000-4000-8000-000000000099",
                  "requestId": "3f2a6c1e-0000-4000-8000-000000000099"
                }
              }
            },
            "description": "Idempotency-Key mit anderem Inhalt"
          },
          "423": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "code": "RECORD_RESTRICTED",
                  "type": "https://nuvaface-practice.com/api/public/docs#fehler-record-restricted",
                  "title": "Akte eingeschränkt",
                  "detail": "Die Akte ist eingeschränkt (Art. 18 DSGVO). Es wird kein Termin angelegt.",
                  "status": 423,
                  "instance": "urn:nuvaface:request:3f2a6c1e-0000-4000-8000-000000000099",
                  "requestId": "3f2a6c1e-0000-4000-8000-000000000099"
                }
              }
            },
            "description": "Akte eingeschränkt, kein Termin angelegt"
          },
          "429": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "code": "RATE_LIMITED",
                  "type": "https://nuvaface-practice.com/api/public/docs#fehler-rate-limited",
                  "title": "Zu viele Anfragen",
                  "detail": "Höchstens 120 Anfragen je Minute und Schlüssel. Bitte die Antwort Retry-After abwarten.",
                  "status": 429,
                  "instance": "urn:nuvaface:request:3f2a6c1e-0000-4000-8000-000000000099",
                  "requestId": "3f2a6c1e-0000-4000-8000-000000000099",
                  "retryAfter": 17
                }
              }
            },
            "description": "Zu viele Anfragen (Kopf Retry-After) oder Tagesgrenze der Patientendatensätze erreicht (DAILY_PATIENT_LIMIT)"
          },
          "503": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "code": "UNAVAILABLE",
                  "type": "https://nuvaface-practice.com/api/public/docs#fehler-unavailable",
                  "title": "Vorübergehend nicht verfügbar",
                  "detail": "Die Schnittstelle ist vorübergehend nicht verfügbar.",
                  "status": 503,
                  "instance": "urn:nuvaface:request:3f2a6c1e-0000-4000-8000-000000000099",
                  "requestId": "3f2a6c1e-0000-4000-8000-000000000099",
                  "retryAfter": 30
                }
              }
            },
            "description": "Prüfung vorübergehend gestört oder (beim Upload) Server ausgelastet; Kopf Retry-After abwarten"
          }
        },
        "parameters": [
          {
            "in": "header",
            "name": "Idempotency-Key",
            "schema": {
              "type": "string",
              "pattern": "^[!-~]{1,255}$",
              "maxLength": 255,
              "minLength": 1
            },
            "required": false,
            "description": "Pflicht, außer im Probelauf (dryRun=true). ein neuer Wert je Vorgang (z. B. UUID), sonst 400. Eine Wiederholung mit gleichem Wert und gleichem Inhalt legt nichts doppelt an (24 Stunden, Kopf Idempotent-Replayed: true), auch dann nicht, wenn die erste Antwort den Aufrufer nie erreicht hat. Die Wiederholung gibt das angelegte Objekt nur wieder, wenn der Schlüssel es heute lesen darf (zum Beispiel patients.read für eine Akte, measurements.read für eine Messreihe), und zählt dann wie ein Lesen auf die Tagesgrenze; sonst enthält sie nur die Kennung des angelegten Objekts ({ id }). Anderer Inhalt ergibt 422, eine noch laufende Anfrage 409."
          },
          {
            "in": "query",
            "name": "dryRun",
            "schema": {
              "type": "boolean",
              "default": false
            },
            "required": false,
            "description": "true: alles prüfen und rechnen, aber nichts speichern und kein Ereignis auslösen. Antwort 200 mit dryRun: true und dem Ergebnis, das entstanden wäre (Kennungen eines Probelaufs gibt es danach nicht). Ein Idempotency-Key wird im Probelauf nicht verbraucht."
          }
        ],
        "description": "Scope: appointments.write. Der Termin entsteht bzw. steht danach im Status pending (angefragt) und erscheint im Buchungseingang der Praxis; erst wenn die Praxis dort bestätigt, bekommt der Patient eine Bestätigung von NuvaFace. Die Schnittstelle schreibt nie selbst Mail oder SMS, Erinnerungen laufen erst nach der Bestätigung. Geprüft wird wie bei der Online-Buchung: nicht in der Vergangenheit, Öffnungszeiten bzw. freigegebene Zeitfenster, Sperrzeiten, keine Überschneidung (abgesagte und nicht erschienene Termine belegen nicht). Pflicht: Akte und Behandlung der Praxis (aktiv). Eine eingeschränkte Akte ergibt 423, eine archivierte 404. Konflikt: 409 SLOT_UNAVAILABLE mit reason: in_past (Beginn liegt in der Vergangenheit), closed_day (Praxis an dem Tag geschlossen bzw. kein Zeitfenster freigegeben), outside_opening_hours (nicht ganz in den Öffnungszeiten bzw. einem Zeitfenster), blocked (Sperrzeit der Praxis, z. B. Urlaub), overlap (anderer Termin). Die Antwort enthält keine Namen.",
        "operationId": "terminAnlegen",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "patientId",
                  "treatmentId",
                  "start"
                ],
                "properties": {
                  "start": {
                    "type": "string",
                    "format": "date-time",
                    "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}(:00(\\.0{1,9})?)?(Z|[+-]\\d{2}:\\d{2})$",
                    "description": "Beginn als ISO 8601 MIT Zone (Z oder Versatz), volle Minute, z. B. 2026-12-02T15:00:00+01:00. Ohne Zone 400. Eine Spanne, die an der Zeitumstellung eine doppelte oder fehlende Uhrzeit berührt, ergibt 400 mit reason dst_transition."
                  },
                  "patientId": {
                    "type": "string",
                    "format": "uuid",
                    "description": "Akte der Praxis"
                  },
                  "treatmentId": {
                    "type": "string",
                    "format": "uuid",
                    "description": "Behandlung aus GET /treatments"
                  },
                  "durationMinutes": {
                    "type": "integer",
                    "maximum": 480,
                    "minimum": 5,
                    "description": "Dauer in Minuten. Ohne Angabe: beim Anlegen die Dauer der Behandlung, beim Verschieben die bisherige Dauer."
                  }
                },
                "additionalProperties": false
              },
              "example": {
                "start": "2026-12-02T15:00:00+01:00",
                "patientId": "3f2a6c1e-0000-4000-8000-000000000001",
                "treatmentId": "3f2a6c1e-0000-4000-8000-000000000021"
              }
            }
          },
          "required": true
        },
        "x-nuvaface-scopes": [
          "appointments.write"
        ]
      }
    },
    "/availability": {
      "get": {
        "tags": [
          "Freie Zeiten"
        ],
        "summary": "Freie Zeiten (höchstens 31 Tage)",
        "security": [
          {
            "apiKey": []
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FreieZeiten"
                },
                "example": {
                  "data": [
                    {
                      "date": "2026-12-01",
                      "slots": [
                        {
                          "end": "2026-12-01T10:00:00+01:00",
                          "start": "2026-12-01T09:00:00+01:00"
                        },
                        {
                          "end": "2026-12-01T12:00:00+01:00",
                          "start": "2026-12-01T11:00:00+01:00"
                        }
                      ],
                      "reason": null
                    },
                    {
                      "date": "2026-12-02",
                      "slots": [],
                      "reason": "GESCHLOSSEN"
                    }
                  ],
                  "timezone": "Europe/Berlin",
                  "treatmentId": "3f2a6c1e-0000-4000-8000-000000000021",
                  "durationMinutes": 60
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "code": "VALIDATION",
                  "type": "https://nuvaface-practice.com/api/public/docs#fehler-validation",
                  "title": "Ungültige Anfrage",
                  "detail": "Zeitraum höchstens 31 Tage.",
                  "status": 400,
                  "instance": "urn:nuvaface:request:3f2a6c1e-0000-4000-8000-000000000099",
                  "requestId": "3f2a6c1e-0000-4000-8000-000000000099"
                }
              }
            },
            "description": "Ungültige Anfrage (auch: Schlüssel in der Adresse, ungültige Kennung, NUL-Zeichen)"
          },
          "401": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "code": "TOKEN_INVALID",
                  "type": "https://nuvaface-practice.com/api/public/docs#fehler-token-invalid",
                  "title": "Zugang ungültig",
                  "detail": "Der Schlüssel ist unbekannt, abgelaufen oder widerrufen.",
                  "status": 401,
                  "instance": "urn:nuvaface:request:3f2a6c1e-0000-4000-8000-000000000099",
                  "requestId": "3f2a6c1e-0000-4000-8000-000000000099"
                }
              }
            },
            "description": "Nicht angemeldet oder Schlüssel ungültig"
          },
          "403": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "code": "INSUFFICIENT_SCOPE",
                  "type": "https://nuvaface-practice.com/api/public/docs#fehler-insufficient-scope",
                  "title": "Berechtigung fehlt",
                  "detail": "Dieser Schlüssel hat den nötigen Scope nicht. Die Praxisinhaberin kann einen Schlüssel mit diesem Recht in NuvaFace unter Einstellungen, Schnittstellen anlegen.",
                  "status": 403,
                  "instance": "urn:nuvaface:request:3f2a6c1e-0000-4000-8000-000000000099",
                  "requestId": "3f2a6c1e-0000-4000-8000-000000000099"
                }
              }
            },
            "description": "Scope fehlt, Schnittstelle nicht freigeschaltet oder Praxis gesperrt (code nennt den Grund)"
          },
          "404": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "code": "NOT_FOUND",
                  "type": "https://nuvaface-practice.com/api/public/docs#fehler-not-found",
                  "title": "Nicht gefunden",
                  "detail": "Behandlung nicht gefunden.",
                  "status": 404,
                  "instance": "urn:nuvaface:request:3f2a6c1e-0000-4000-8000-000000000099",
                  "requestId": "3f2a6c1e-0000-4000-8000-000000000099"
                }
              }
            },
            "description": "Behandlung nicht gefunden (treatmentId)"
          },
          "429": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "code": "RATE_LIMITED",
                  "type": "https://nuvaface-practice.com/api/public/docs#fehler-rate-limited",
                  "title": "Zu viele Anfragen",
                  "detail": "Höchstens 120 Anfragen je Minute und Schlüssel. Bitte die Antwort Retry-After abwarten.",
                  "status": 429,
                  "instance": "urn:nuvaface:request:3f2a6c1e-0000-4000-8000-000000000099",
                  "requestId": "3f2a6c1e-0000-4000-8000-000000000099",
                  "retryAfter": 17
                }
              }
            },
            "description": "Zu viele Anfragen (Kopf Retry-After) oder Tagesgrenze der Patientendatensätze erreicht (DAILY_PATIENT_LIMIT)"
          },
          "503": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "code": "UNAVAILABLE",
                  "type": "https://nuvaface-practice.com/api/public/docs#fehler-unavailable",
                  "title": "Vorübergehend nicht verfügbar",
                  "detail": "Die Schnittstelle ist vorübergehend nicht verfügbar.",
                  "status": 503,
                  "instance": "urn:nuvaface:request:3f2a6c1e-0000-4000-8000-000000000099",
                  "requestId": "3f2a6c1e-0000-4000-8000-000000000099",
                  "retryAfter": 30
                }
              }
            },
            "description": "Prüfung vorübergehend gestört oder (beim Upload) Server ausgelastet; Kopf Retry-After abwarten"
          }
        },
        "parameters": [
          {
            "in": "query",
            "name": "from",
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "in": "query",
            "name": "to",
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "in": "query",
            "name": "treatmentId",
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "bestimmt die Dauer"
          },
          {
            "in": "query",
            "name": "durationMinutes",
            "schema": {
              "type": "integer",
              "maximum": 480,
              "minimum": 5
            },
            "description": "ganze Zahl, sonst 400"
          }
        ],
        "description": "Scope: availability.read. Dieselbe Rechnung wie das Buchungswidget: Öffnungszeiten bzw. Zeitfenster, belegte Zeiten, Urlaub und Sperrzeiten, vergangene Zeiten. Die Zeiten sind frei, aber nicht reserviert.",
        "operationId": "freieZeiten",
        "x-nuvaface-scopes": [
          "availability.read"
        ]
      }
    },
    "/invoices/{id}": {
      "get": {
        "tags": [
          "Rechnungen"
        ],
        "summary": "Eine Rechnung lesen, Positionen auf Wunsch",
        "security": [
          {
            "apiKey": []
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RechnungMitPositionen"
                },
                "example": {
                  "id": "3f2a6c1e-0000-4000-8000-000000000041",
                  "date": "2026-11-20",
                  "items": [
                    {
                      "code": "268",
                      "type": "fee",
                      "total": 17.43,
                      "factor": 2.3,
                      "taxRate": 19,
                      "quantity": 1,
                      "unitPrice": 17.43,
                      "description": "Medikamentöse Infiltrationsbehandlung im Bereich mehrerer Körperregionen"
                    }
                  ],
                  "total": 20.74,
                  "number": "RE-2026-0042",
                  "paidAt": null,
                  "status": "sent",
                  "dueDate": "2026-12-04",
                  "taxRate": 19,
                  "currency": "EUR",
                  "netAmount": 17.43,
                  "patientId": "3f2a6c1e-0000-4000-8000-000000000001",
                  "taxAmount": 3.31,
                  "documentType": "invoice",
                  "appointmentId": "3f2a6c1e-0000-4000-8000-000000000011",
                  "paymentMethod": null
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "code": "VALIDATION",
                  "type": "https://nuvaface-practice.com/api/public/docs#fehler-validation",
                  "title": "Ungültige Anfrage",
                  "detail": "limit muss zwischen 1 und 100 liegen.",
                  "status": 400,
                  "instance": "urn:nuvaface:request:3f2a6c1e-0000-4000-8000-000000000099",
                  "requestId": "3f2a6c1e-0000-4000-8000-000000000099"
                }
              }
            },
            "description": "Ungültige Anfrage (auch: Schlüssel in der Adresse, ungültige Kennung, NUL-Zeichen)"
          },
          "401": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "code": "TOKEN_INVALID",
                  "type": "https://nuvaface-practice.com/api/public/docs#fehler-token-invalid",
                  "title": "Zugang ungültig",
                  "detail": "Der Schlüssel ist unbekannt, abgelaufen oder widerrufen.",
                  "status": 401,
                  "instance": "urn:nuvaface:request:3f2a6c1e-0000-4000-8000-000000000099",
                  "requestId": "3f2a6c1e-0000-4000-8000-000000000099"
                }
              }
            },
            "description": "Nicht angemeldet oder Schlüssel ungültig"
          },
          "403": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "code": "INSUFFICIENT_SCOPE",
                  "type": "https://nuvaface-practice.com/api/public/docs#fehler-insufficient-scope",
                  "title": "Berechtigung fehlt",
                  "detail": "Positionen einer Rechnung brauchen den Scope invoices.read.items.",
                  "status": 403,
                  "instance": "urn:nuvaface:request:3f2a6c1e-0000-4000-8000-000000000099",
                  "requestId": "3f2a6c1e-0000-4000-8000-000000000099",
                  "requiredScope": "invoices.read.items"
                }
              }
            },
            "description": "Scope fehlt, Schnittstelle nicht freigeschaltet oder Praxis gesperrt (code nennt den Grund)"
          },
          "404": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "code": "NOT_FOUND",
                  "type": "https://nuvaface-practice.com/api/public/docs#fehler-not-found",
                  "title": "Nicht gefunden",
                  "detail": "Rechnung nicht gefunden.",
                  "status": 404,
                  "instance": "urn:nuvaface:request:3f2a6c1e-0000-4000-8000-000000000099",
                  "requestId": "3f2a6c1e-0000-4000-8000-000000000099"
                }
              }
            },
            "description": "Rechnung nicht gefunden"
          },
          "429": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "code": "RATE_LIMITED",
                  "type": "https://nuvaface-practice.com/api/public/docs#fehler-rate-limited",
                  "title": "Zu viele Anfragen",
                  "detail": "Höchstens 120 Anfragen je Minute und Schlüssel. Bitte die Antwort Retry-After abwarten.",
                  "status": 429,
                  "instance": "urn:nuvaface:request:3f2a6c1e-0000-4000-8000-000000000099",
                  "requestId": "3f2a6c1e-0000-4000-8000-000000000099",
                  "retryAfter": 17
                }
              }
            },
            "description": "Zu viele Anfragen (Kopf Retry-After) oder Tagesgrenze der Patientendatensätze erreicht (DAILY_PATIENT_LIMIT)"
          },
          "503": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "code": "UNAVAILABLE",
                  "type": "https://nuvaface-practice.com/api/public/docs#fehler-unavailable",
                  "title": "Vorübergehend nicht verfügbar",
                  "detail": "Die Schnittstelle ist vorübergehend nicht verfügbar.",
                  "status": 503,
                  "instance": "urn:nuvaface:request:3f2a6c1e-0000-4000-8000-000000000099",
                  "requestId": "3f2a6c1e-0000-4000-8000-000000000099",
                  "retryAfter": 30
                }
              }
            },
            "description": "Prüfung vorübergehend gestört oder (beim Upload) Server ausgelastet; Kopf Retry-After abwarten"
          }
        },
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "required": true
          },
          {
            "in": "query",
            "name": "include",
            "schema": {
              "enum": [
                "items"
              ],
              "type": "string"
            },
            "required": false,
            "description": "items: Positionen mitliefern (Scope invoices.read.items)"
          }
        ],
        "description": "Scope: invoices.read. Kopf wie ein Eintrag der Liste GET /invoices. Mit include=items zusätzlich die Positionen (Ziffer, Bezeichnung, Faktor, Menge, Einzel- und Zeilenbetrag, Steuersatz); dafür ist zusätzlich der Scope invoices.read.items nötig (Gesundheitsbezug), sonst 403. Nie Diagnose, Begründung oder Notiz. Rechnungen eingeschränkter oder archivierter Akten: 404. patientName nur mit patients.read (zählt 1 auf die Tagesgrenze).",
        "operationId": "rechnungLesen",
        "x-nuvaface-scopes": [
          "invoices.read"
        ]
      }
    },
    "/patients/{id}": {
      "get": {
        "tags": [
          "Patienten"
        ],
        "summary": "Patient lesen",
        "security": [
          {
            "apiKey": []
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "oneOf": [
                    {
                      "$ref": "#/components/schemas/Patient"
                    },
                    {
                      "$ref": "#/components/schemas/PatientBasis"
                    }
                  ]
                },
                "example": {
                  "id": "3f2a6c1e-0000-4000-8000-000000000001",
                  "age": 41,
                  "gender": "female",
                  "birthYear": 1985
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "code": "VALIDATION",
                  "type": "https://nuvaface-practice.com/api/public/docs#fehler-validation",
                  "title": "Ungültige Anfrage",
                  "detail": "id ist keine gültige Kennung (UUID).",
                  "status": 400,
                  "instance": "urn:nuvaface:request:3f2a6c1e-0000-4000-8000-000000000099",
                  "requestId": "3f2a6c1e-0000-4000-8000-000000000099"
                }
              }
            },
            "description": "Ungültige Anfrage (auch: Schlüssel in der Adresse, ungültige Kennung, NUL-Zeichen)"
          },
          "401": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "code": "TOKEN_INVALID",
                  "type": "https://nuvaface-practice.com/api/public/docs#fehler-token-invalid",
                  "title": "Zugang ungültig",
                  "detail": "Der Schlüssel ist unbekannt, abgelaufen oder widerrufen.",
                  "status": 401,
                  "instance": "urn:nuvaface:request:3f2a6c1e-0000-4000-8000-000000000099",
                  "requestId": "3f2a6c1e-0000-4000-8000-000000000099"
                }
              }
            },
            "description": "Nicht angemeldet oder Schlüssel ungültig"
          },
          "403": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "code": "INSUFFICIENT_SCOPE",
                  "type": "https://nuvaface-practice.com/api/public/docs#fehler-insufficient-scope",
                  "title": "Berechtigung fehlt",
                  "detail": "Dieser Schlüssel hat den nötigen Scope nicht. Die Praxisinhaberin kann einen Schlüssel mit diesem Recht in NuvaFace unter Einstellungen, Schnittstellen anlegen.",
                  "status": 403,
                  "instance": "urn:nuvaface:request:3f2a6c1e-0000-4000-8000-000000000099",
                  "requestId": "3f2a6c1e-0000-4000-8000-000000000099"
                }
              }
            },
            "description": "Scope fehlt, Schnittstelle nicht freigeschaltet oder Praxis gesperrt (code nennt den Grund)"
          },
          "404": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "code": "NOT_FOUND",
                  "type": "https://nuvaface-practice.com/api/public/docs#fehler-not-found",
                  "title": "Nicht gefunden",
                  "detail": "Patient nicht gefunden.",
                  "status": 404,
                  "instance": "urn:nuvaface:request:3f2a6c1e-0000-4000-8000-000000000099",
                  "requestId": "3f2a6c1e-0000-4000-8000-000000000099"
                }
              }
            },
            "description": "Nicht gefunden (auch eingeschränkt oder archiviert)"
          },
          "429": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "code": "RATE_LIMITED",
                  "type": "https://nuvaface-practice.com/api/public/docs#fehler-rate-limited",
                  "title": "Zu viele Anfragen",
                  "detail": "Höchstens 120 Anfragen je Minute und Schlüssel. Bitte die Antwort Retry-After abwarten.",
                  "status": 429,
                  "instance": "urn:nuvaface:request:3f2a6c1e-0000-4000-8000-000000000099",
                  "requestId": "3f2a6c1e-0000-4000-8000-000000000099",
                  "retryAfter": 17
                }
              }
            },
            "description": "Zu viele Anfragen (Kopf Retry-After) oder Tagesgrenze der Patientendatensätze erreicht (DAILY_PATIENT_LIMIT)"
          },
          "503": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "code": "UNAVAILABLE",
                  "type": "https://nuvaface-practice.com/api/public/docs#fehler-unavailable",
                  "title": "Vorübergehend nicht verfügbar",
                  "detail": "Die Schnittstelle ist vorübergehend nicht verfügbar.",
                  "status": 503,
                  "instance": "urn:nuvaface:request:3f2a6c1e-0000-4000-8000-000000000099",
                  "requestId": "3f2a6c1e-0000-4000-8000-000000000099",
                  "retryAfter": 30
                }
              }
            },
            "description": "Prüfung vorübergehend gestört oder (beim Upload) Server ausgelastet; Kopf Retry-After abwarten"
          }
        },
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "required": true
          }
        ],
        "description": "Scope: patients.read oder patients.read.basic. Mit patients.read.basic allein genau { id, birthYear, age, gender } (PatientBasis); mit patients.read die Stammdaten (Patient). Zählt 1 auf die Tagesgrenze.",
        "operationId": "patientLesen",
        "x-nuvaface-scopes": [
          "patients.read",
          "patients.read.basic"
        ]
      }
    },
    "/documents/{id}": {
      "get": {
        "tags": [
          "Dokumente"
        ],
        "summary": "Ein Dokument (nur Angaben)",
        "security": [
          {
            "apiKey": []
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DokumentInfo"
                },
                "example": {
                  "id": "3f2a6c1e-0000-4000-8000-000000000031",
                  "name": "Messbericht 2026-12-01.pdf",
                  "size": 48213,
                  "type": "messbericht",
                  "source": "api",
                  "mimeType": "application/pdf",
                  "createdAt": "2026-12-01T10:05:00+01:00",
                  "patientId": "3f2a6c1e-0000-4000-8000-000000000001"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "code": "VALIDATION",
                  "type": "https://nuvaface-practice.com/api/public/docs#fehler-validation",
                  "title": "Ungültige Anfrage",
                  "detail": "limit muss zwischen 1 und 100 liegen.",
                  "status": 400,
                  "instance": "urn:nuvaface:request:3f2a6c1e-0000-4000-8000-000000000099",
                  "requestId": "3f2a6c1e-0000-4000-8000-000000000099"
                }
              }
            },
            "description": "Ungültige Anfrage (auch: Schlüssel in der Adresse, ungültige Kennung, NUL-Zeichen)"
          },
          "401": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "code": "TOKEN_INVALID",
                  "type": "https://nuvaface-practice.com/api/public/docs#fehler-token-invalid",
                  "title": "Zugang ungültig",
                  "detail": "Der Schlüssel ist unbekannt, abgelaufen oder widerrufen.",
                  "status": 401,
                  "instance": "urn:nuvaface:request:3f2a6c1e-0000-4000-8000-000000000099",
                  "requestId": "3f2a6c1e-0000-4000-8000-000000000099"
                }
              }
            },
            "description": "Nicht angemeldet oder Schlüssel ungültig"
          },
          "403": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "code": "INSUFFICIENT_SCOPE",
                  "type": "https://nuvaface-practice.com/api/public/docs#fehler-insufficient-scope",
                  "title": "Berechtigung fehlt",
                  "detail": "Dieser Schlüssel hat den nötigen Scope nicht. Die Praxisinhaberin kann einen Schlüssel mit diesem Recht in NuvaFace unter Einstellungen, Schnittstellen anlegen.",
                  "status": 403,
                  "instance": "urn:nuvaface:request:3f2a6c1e-0000-4000-8000-000000000099",
                  "requestId": "3f2a6c1e-0000-4000-8000-000000000099"
                }
              }
            },
            "description": "Scope fehlt, Schnittstelle nicht freigeschaltet oder Praxis gesperrt (code nennt den Grund)"
          },
          "404": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "code": "NOT_FOUND",
                  "type": "https://nuvaface-practice.com/api/public/docs#fehler-not-found",
                  "title": "Nicht gefunden",
                  "detail": "Dokument nicht gefunden.",
                  "status": 404,
                  "instance": "urn:nuvaface:request:3f2a6c1e-0000-4000-8000-000000000099",
                  "requestId": "3f2a6c1e-0000-4000-8000-000000000099"
                }
              }
            },
            "description": "Dokument nicht gefunden"
          },
          "429": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "code": "RATE_LIMITED",
                  "type": "https://nuvaface-practice.com/api/public/docs#fehler-rate-limited",
                  "title": "Zu viele Anfragen",
                  "detail": "Höchstens 120 Anfragen je Minute und Schlüssel. Bitte die Antwort Retry-After abwarten.",
                  "status": 429,
                  "instance": "urn:nuvaface:request:3f2a6c1e-0000-4000-8000-000000000099",
                  "requestId": "3f2a6c1e-0000-4000-8000-000000000099",
                  "retryAfter": 17
                }
              }
            },
            "description": "Zu viele Anfragen (Kopf Retry-After) oder Tagesgrenze der Patientendatensätze erreicht (DAILY_PATIENT_LIMIT)"
          },
          "503": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "code": "UNAVAILABLE",
                  "type": "https://nuvaface-practice.com/api/public/docs#fehler-unavailable",
                  "title": "Vorübergehend nicht verfügbar",
                  "detail": "Die Schnittstelle ist vorübergehend nicht verfügbar.",
                  "status": 503,
                  "instance": "urn:nuvaface:request:3f2a6c1e-0000-4000-8000-000000000099",
                  "requestId": "3f2a6c1e-0000-4000-8000-000000000099",
                  "retryAfter": 30
                }
              }
            },
            "description": "Prüfung vorübergehend gestört oder (beim Upload) Server ausgelastet; Kopf Retry-After abwarten"
          }
        },
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "required": true
          }
        ],
        "description": "Scope: documents.read. Sichtbar sind über die Schnittstelle abgelegte Dokumente und Arten, die die Praxis ausdrücklich freigegeben hat; nie Einwilligungen, Bilder und Fotos, Anamnese oder Check-in-Formulare. Zählt 1 auf die Tagesgrenze.",
        "operationId": "dokumentLesen",
        "x-nuvaface-scopes": [
          "documents.read"
        ]
      }
    },
    "/treatments/{id}": {
      "get": {
        "tags": [
          "Freie Zeiten"
        ],
        "summary": "Eine Behandlung des Katalogs",
        "security": [
          {
            "apiKey": []
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Behandlung"
                },
                "example": {
                  "id": "3f2a6c1e-0000-4000-8000-000000000021",
                  "name": "Performance Check",
                  "price": 120,
                  "category": "Check",
                  "currency": "EUR",
                  "priceFrom": false,
                  "infoPdfUrl": "https://nuvaface-practice.com/api/public/behandlung-info/q2fW9k0Zx7Lr4dP8sN1vB6tYc3mH5gJ0aE7uK2iO4wQ",
                  "description": "Leistungsdiagnostik mit Auswertung",
                  "onlineBookable": true,
                  "durationMinutes": 60
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "code": "VALIDATION",
                  "type": "https://nuvaface-practice.com/api/public/docs#fehler-validation",
                  "title": "Ungültige Anfrage",
                  "detail": "limit muss zwischen 1 und 100 liegen.",
                  "status": 400,
                  "instance": "urn:nuvaface:request:3f2a6c1e-0000-4000-8000-000000000099",
                  "requestId": "3f2a6c1e-0000-4000-8000-000000000099"
                }
              }
            },
            "description": "Ungültige Anfrage (auch: Schlüssel in der Adresse, ungültige Kennung, NUL-Zeichen)"
          },
          "401": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "code": "TOKEN_INVALID",
                  "type": "https://nuvaface-practice.com/api/public/docs#fehler-token-invalid",
                  "title": "Zugang ungültig",
                  "detail": "Der Schlüssel ist unbekannt, abgelaufen oder widerrufen.",
                  "status": 401,
                  "instance": "urn:nuvaface:request:3f2a6c1e-0000-4000-8000-000000000099",
                  "requestId": "3f2a6c1e-0000-4000-8000-000000000099"
                }
              }
            },
            "description": "Nicht angemeldet oder Schlüssel ungültig"
          },
          "403": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "code": "INSUFFICIENT_SCOPE",
                  "type": "https://nuvaface-practice.com/api/public/docs#fehler-insufficient-scope",
                  "title": "Berechtigung fehlt",
                  "detail": "Dieser Schlüssel hat den nötigen Scope nicht. Die Praxisinhaberin kann einen Schlüssel mit diesem Recht in NuvaFace unter Einstellungen, Schnittstellen anlegen.",
                  "status": 403,
                  "instance": "urn:nuvaface:request:3f2a6c1e-0000-4000-8000-000000000099",
                  "requestId": "3f2a6c1e-0000-4000-8000-000000000099"
                }
              }
            },
            "description": "Scope fehlt, Schnittstelle nicht freigeschaltet oder Praxis gesperrt (code nennt den Grund)"
          },
          "404": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "code": "NOT_FOUND",
                  "type": "https://nuvaface-practice.com/api/public/docs#fehler-not-found",
                  "title": "Nicht gefunden",
                  "detail": "Behandlung nicht gefunden.",
                  "status": 404,
                  "instance": "urn:nuvaface:request:3f2a6c1e-0000-4000-8000-000000000099",
                  "requestId": "3f2a6c1e-0000-4000-8000-000000000099"
                }
              }
            },
            "description": "Behandlung nicht gefunden"
          },
          "429": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "code": "RATE_LIMITED",
                  "type": "https://nuvaface-practice.com/api/public/docs#fehler-rate-limited",
                  "title": "Zu viele Anfragen",
                  "detail": "Höchstens 120 Anfragen je Minute und Schlüssel. Bitte die Antwort Retry-After abwarten.",
                  "status": 429,
                  "instance": "urn:nuvaface:request:3f2a6c1e-0000-4000-8000-000000000099",
                  "requestId": "3f2a6c1e-0000-4000-8000-000000000099",
                  "retryAfter": 17
                }
              }
            },
            "description": "Zu viele Anfragen (Kopf Retry-After) oder Tagesgrenze der Patientendatensätze erreicht (DAILY_PATIENT_LIMIT)"
          },
          "503": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "code": "UNAVAILABLE",
                  "type": "https://nuvaface-practice.com/api/public/docs#fehler-unavailable",
                  "title": "Vorübergehend nicht verfügbar",
                  "detail": "Die Schnittstelle ist vorübergehend nicht verfügbar.",
                  "status": 503,
                  "instance": "urn:nuvaface:request:3f2a6c1e-0000-4000-8000-000000000099",
                  "requestId": "3f2a6c1e-0000-4000-8000-000000000099",
                  "retryAfter": 30
                }
              }
            },
            "description": "Prüfung vorübergehend gestört oder (beim Upload) Server ausgelastet; Kopf Retry-After abwarten"
          }
        },
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "required": true
          }
        ],
        "description": "Scope: availability.read. Felder wie in GET /treatments. Preis, Beschreibung und Info-PDF nur, wenn die öffentliche Buchungsseite sie zeigt.",
        "operationId": "behandlungLesen",
        "x-nuvaface-scopes": [
          "availability.read"
        ]
      }
    },
    "/booking-requests": {
      "get": {
        "tags": [
          "Buchungsanfragen"
        ],
        "summary": "Buchungsanfragen (Standard: offene)",
        "security": [
          {
            "apiKey": []
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data",
                    "nextCursor"
                  ],
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Buchungsanfrage"
                      }
                    },
                    "nextCursor": {
                      "type": [
                        "string",
                        "null"
                      ]
                    }
                  }
                },
                "example": {
                  "data": [
                    {
                      "id": "3f2a6c1e-0000-4000-8000-000000000051",
                      "date": "2026-12-01",
                      "type": "onsite",
                      "start": "2026-12-01T09:30:00+01:00",
                      "video": false,
                      "source": "widget",
                      "status": "pending",
                      "contact": {
                        "name": "Mia Neu",
                        "email": "mia.neu@example.com",
                        "phone": "+49 151 33333333"
                      },
                      "createdAt": "2026-11-28T18:02:11+01:00",
                      "updatedAt": "2026-11-28T18:02:11+01:00",
                      "treatmentId": "3f2a6c1e-0000-4000-8000-000000000021",
                      "appointmentId": "3f2a6c1e-0000-4000-8000-000000000011",
                      "treatmentName": "Performance Check"
                    }
                  ],
                  "nextCursor": null
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "code": "VALIDATION",
                  "type": "https://nuvaface-practice.com/api/public/docs#fehler-validation",
                  "title": "Ungültige Anfrage",
                  "detail": "status: pending, confirmed, rejected, cancelled (mehrere mit Komma).",
                  "status": 400,
                  "instance": "urn:nuvaface:request:3f2a6c1e-0000-4000-8000-000000000099",
                  "requestId": "3f2a6c1e-0000-4000-8000-000000000099"
                }
              }
            },
            "description": "Ungültige Anfrage (auch: Schlüssel in der Adresse, ungültige Kennung, NUL-Zeichen)"
          },
          "401": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "code": "TOKEN_INVALID",
                  "type": "https://nuvaface-practice.com/api/public/docs#fehler-token-invalid",
                  "title": "Zugang ungültig",
                  "detail": "Der Schlüssel ist unbekannt, abgelaufen oder widerrufen.",
                  "status": 401,
                  "instance": "urn:nuvaface:request:3f2a6c1e-0000-4000-8000-000000000099",
                  "requestId": "3f2a6c1e-0000-4000-8000-000000000099"
                }
              }
            },
            "description": "Nicht angemeldet oder Schlüssel ungültig"
          },
          "403": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "code": "INSUFFICIENT_SCOPE",
                  "type": "https://nuvaface-practice.com/api/public/docs#fehler-insufficient-scope",
                  "title": "Berechtigung fehlt",
                  "detail": "Dieser Schlüssel hat den nötigen Scope nicht. Die Praxisinhaberin kann einen Schlüssel mit diesem Recht in NuvaFace unter Einstellungen, Schnittstellen anlegen.",
                  "status": 403,
                  "instance": "urn:nuvaface:request:3f2a6c1e-0000-4000-8000-000000000099",
                  "requestId": "3f2a6c1e-0000-4000-8000-000000000099"
                }
              }
            },
            "description": "Scope fehlt, Schnittstelle nicht freigeschaltet oder Praxis gesperrt (code nennt den Grund)"
          },
          "429": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "code": "RATE_LIMITED",
                  "type": "https://nuvaface-practice.com/api/public/docs#fehler-rate-limited",
                  "title": "Zu viele Anfragen",
                  "detail": "Höchstens 120 Anfragen je Minute und Schlüssel. Bitte die Antwort Retry-After abwarten.",
                  "status": 429,
                  "instance": "urn:nuvaface:request:3f2a6c1e-0000-4000-8000-000000000099",
                  "requestId": "3f2a6c1e-0000-4000-8000-000000000099",
                  "retryAfter": 17
                }
              }
            },
            "description": "Zu viele Anfragen (Kopf Retry-After) oder Tagesgrenze der Patientendatensätze erreicht (DAILY_PATIENT_LIMIT)"
          },
          "503": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "code": "UNAVAILABLE",
                  "type": "https://nuvaface-practice.com/api/public/docs#fehler-unavailable",
                  "title": "Vorübergehend nicht verfügbar",
                  "detail": "Die Schnittstelle ist vorübergehend nicht verfügbar.",
                  "status": 503,
                  "instance": "urn:nuvaface:request:3f2a6c1e-0000-4000-8000-000000000099",
                  "requestId": "3f2a6c1e-0000-4000-8000-000000000099",
                  "retryAfter": 30
                }
              }
            },
            "description": "Prüfung vorübergehend gestört oder (beim Upload) Server ausgelastet; Kopf Retry-After abwarten"
          }
        },
        "parameters": [
          {
            "in": "query",
            "name": "status",
            "schema": {
              "type": "string",
              "default": "pending"
            },
            "required": false,
            "description": "pending, confirmed, rejected, cancelled (mehrere mit Komma)"
          },
          {
            "in": "query",
            "name": "from",
            "schema": {
              "type": "string",
              "format": "date"
            },
            "required": false,
            "description": "gewünschter Tag ab (JJJJ-MM-TT)"
          },
          {
            "in": "query",
            "name": "to",
            "schema": {
              "type": "string",
              "format": "date"
            },
            "required": false,
            "description": "gewünschter Tag bis (höchstens 366 Tage nach from)"
          },
          {
            "in": "query",
            "name": "limit",
            "schema": {
              "type": "integer",
              "default": 50,
              "maximum": 100,
              "minimum": 1
            }
          },
          {
            "in": "query",
            "name": "cursor",
            "schema": {
              "type": "string"
            },
            "description": "Wert nextCursor der vorigen Antwort, unverändert"
          }
        ],
        "description": "Scope: bookings.read. Name und Kontakt nur mit patients.read; dann zählt jede Person einmal auf die Tagesgrenze.",
        "operationId": "buchungsanfragenLesen",
        "x-nuvaface-scopes": [
          "bookings.read"
        ]
      }
    },
    "/appointments/{id}": {
      "get": {
        "tags": [
          "Termine"
        ],
        "summary": "Termin lesen",
        "security": [
          {
            "apiKey": []
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Termin"
                },
                "example": {
                  "id": "3f2a6c1e-0000-4000-8000-000000000011",
                  "end": "2026-12-01T10:30:00+01:00",
                  "type": "consultation",
                  "start": "2026-12-01T10:00:00+01:00",
                  "video": false,
                  "source": "manual",
                  "status": "confirmed",
                  "createdAt": "2026-11-20T14:05:00+01:00",
                  "patientId": "3f2a6c1e-0000-4000-8000-000000000001",
                  "updatedAt": "2026-11-20T14:05:00+01:00",
                  "treatmentId": "3f2a6c1e-0000-4000-8000-000000000021",
                  "treatmentName": "Performance Check"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "code": "VALIDATION",
                  "type": "https://nuvaface-practice.com/api/public/docs#fehler-validation",
                  "title": "Ungültige Anfrage",
                  "detail": "id ist keine gültige Kennung (UUID).",
                  "status": 400,
                  "instance": "urn:nuvaface:request:3f2a6c1e-0000-4000-8000-000000000099",
                  "requestId": "3f2a6c1e-0000-4000-8000-000000000099"
                }
              }
            },
            "description": "Ungültige Anfrage (auch: Schlüssel in der Adresse, ungültige Kennung, NUL-Zeichen)"
          },
          "401": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "code": "TOKEN_INVALID",
                  "type": "https://nuvaface-practice.com/api/public/docs#fehler-token-invalid",
                  "title": "Zugang ungültig",
                  "detail": "Der Schlüssel ist unbekannt, abgelaufen oder widerrufen.",
                  "status": 401,
                  "instance": "urn:nuvaface:request:3f2a6c1e-0000-4000-8000-000000000099",
                  "requestId": "3f2a6c1e-0000-4000-8000-000000000099"
                }
              }
            },
            "description": "Nicht angemeldet oder Schlüssel ungültig"
          },
          "403": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "code": "INSUFFICIENT_SCOPE",
                  "type": "https://nuvaface-practice.com/api/public/docs#fehler-insufficient-scope",
                  "title": "Berechtigung fehlt",
                  "detail": "Dieser Schlüssel hat den nötigen Scope nicht. Die Praxisinhaberin kann einen Schlüssel mit diesem Recht in NuvaFace unter Einstellungen, Schnittstellen anlegen.",
                  "status": 403,
                  "instance": "urn:nuvaface:request:3f2a6c1e-0000-4000-8000-000000000099",
                  "requestId": "3f2a6c1e-0000-4000-8000-000000000099"
                }
              }
            },
            "description": "Scope fehlt, Schnittstelle nicht freigeschaltet oder Praxis gesperrt (code nennt den Grund)"
          },
          "404": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "code": "NOT_FOUND",
                  "type": "https://nuvaface-practice.com/api/public/docs#fehler-not-found",
                  "title": "Nicht gefunden",
                  "detail": "Termin nicht gefunden.",
                  "status": 404,
                  "instance": "urn:nuvaface:request:3f2a6c1e-0000-4000-8000-000000000099",
                  "requestId": "3f2a6c1e-0000-4000-8000-000000000099"
                }
              }
            },
            "description": "Nicht gefunden"
          },
          "429": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "code": "RATE_LIMITED",
                  "type": "https://nuvaface-practice.com/api/public/docs#fehler-rate-limited",
                  "title": "Zu viele Anfragen",
                  "detail": "Höchstens 120 Anfragen je Minute und Schlüssel. Bitte die Antwort Retry-After abwarten.",
                  "status": 429,
                  "instance": "urn:nuvaface:request:3f2a6c1e-0000-4000-8000-000000000099",
                  "requestId": "3f2a6c1e-0000-4000-8000-000000000099",
                  "retryAfter": 17
                }
              }
            },
            "description": "Zu viele Anfragen (Kopf Retry-After) oder Tagesgrenze der Patientendatensätze erreicht (DAILY_PATIENT_LIMIT)"
          },
          "503": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "code": "UNAVAILABLE",
                  "type": "https://nuvaface-practice.com/api/public/docs#fehler-unavailable",
                  "title": "Vorübergehend nicht verfügbar",
                  "detail": "Die Schnittstelle ist vorübergehend nicht verfügbar.",
                  "status": 503,
                  "instance": "urn:nuvaface:request:3f2a6c1e-0000-4000-8000-000000000099",
                  "requestId": "3f2a6c1e-0000-4000-8000-000000000099",
                  "retryAfter": 30
                }
              }
            },
            "description": "Prüfung vorübergehend gestört oder (beim Upload) Server ausgelastet; Kopf Retry-After abwarten"
          }
        },
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "required": true
          }
        ],
        "description": "Scope: appointments.read. Mit patients.read zählt ein Termin mit Patient oder Gast 1 auf die Tagesgrenze.",
        "operationId": "terminLesen",
        "x-nuvaface-scopes": [
          "appointments.read"
        ]
      },
      "patch": {
        "tags": [
          "Termine"
        ],
        "summary": "Termin verschieben",
        "security": [
          {
            "apiKey": []
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Termin"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "dryRun": {
                          "type": "boolean",
                          "const": true,
                          "description": "nur im Probelauf (dryRun=true): nichts gespeichert"
                        }
                      }
                    }
                  ]
                },
                "example": {
                  "id": "3f2a6c1e-0000-4000-8000-000000000031",
                  "end": "2026-12-03T10:00:00+01:00",
                  "type": "consultation",
                  "start": "2026-12-03T09:30:00+01:00",
                  "video": false,
                  "source": "api",
                  "status": "pending",
                  "createdAt": "2026-11-26T09:12:00+01:00",
                  "patientId": "3f2a6c1e-0000-4000-8000-000000000001",
                  "updatedAt": "2026-11-26T10:02:00+01:00",
                  "treatmentId": "3f2a6c1e-0000-4000-8000-000000000021",
                  "treatmentName": "Beratungsgespräch"
                }
              }
            },
            "description": "Verschoben (Status pending)"
          },
          "400": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "code": "VALIDATION",
                  "type": "https://nuvaface-practice.com/api/public/docs#fehler-validation",
                  "title": "Ungültige Anfrage",
                  "detail": "limit muss zwischen 1 und 100 liegen.",
                  "status": 400,
                  "instance": "urn:nuvaface:request:3f2a6c1e-0000-4000-8000-000000000099",
                  "requestId": "3f2a6c1e-0000-4000-8000-000000000099"
                }
              }
            },
            "description": "Ungültige Anfrage (auch: Schlüssel in der Adresse, ungültige Kennung, NUL-Zeichen)"
          },
          "401": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "code": "TOKEN_INVALID",
                  "type": "https://nuvaface-practice.com/api/public/docs#fehler-token-invalid",
                  "title": "Zugang ungültig",
                  "detail": "Der Schlüssel ist unbekannt, abgelaufen oder widerrufen.",
                  "status": 401,
                  "instance": "urn:nuvaface:request:3f2a6c1e-0000-4000-8000-000000000099",
                  "requestId": "3f2a6c1e-0000-4000-8000-000000000099"
                }
              }
            },
            "description": "Nicht angemeldet oder Schlüssel ungültig"
          },
          "403": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "code": "INSUFFICIENT_SCOPE",
                  "type": "https://nuvaface-practice.com/api/public/docs#fehler-insufficient-scope",
                  "title": "Berechtigung fehlt",
                  "detail": "Dieser Schlüssel hat den nötigen Scope nicht. Die Praxisinhaberin kann einen Schlüssel mit diesem Recht in NuvaFace unter Einstellungen, Schnittstellen anlegen.",
                  "status": 403,
                  "instance": "urn:nuvaface:request:3f2a6c1e-0000-4000-8000-000000000099",
                  "requestId": "3f2a6c1e-0000-4000-8000-000000000099"
                }
              }
            },
            "description": "Scope fehlt, Schnittstelle nicht freigeschaltet oder Praxis gesperrt (code nennt den Grund)"
          },
          "404": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "code": "NOT_FOUND",
                  "type": "https://nuvaface-practice.com/api/public/docs#fehler-not-found",
                  "title": "Nicht gefunden",
                  "detail": "Termin nicht gefunden.",
                  "status": 404,
                  "instance": "urn:nuvaface:request:3f2a6c1e-0000-4000-8000-000000000099",
                  "requestId": "3f2a6c1e-0000-4000-8000-000000000099"
                }
              }
            },
            "description": "Termin nicht gefunden"
          },
          "409": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "code": "STATE_CONFLICT",
                  "type": "https://nuvaface-practice.com/api/public/docs#fehler-state-conflict",
                  "title": "Im aktuellen Zustand nicht möglich",
                  "detail": "Ein Termin im Status cancelled wird nicht verschoben.",
                  "reason": "cancelled",
                  "status": 409,
                  "instance": "urn:nuvaface:request:3f2a6c1e-0000-4000-8000-000000000099",
                  "requestId": "3f2a6c1e-0000-4000-8000-000000000099"
                }
              }
            },
            "description": "SLOT_UNAVAILABLE oder STATE_CONFLICT mit reason, oder Anfrage mit diesem Idempotency-Key läuft noch"
          },
          "413": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "code": "PAYLOAD_TOO_LARGE",
                  "type": "https://nuvaface-practice.com/api/public/docs#fehler-payload-too-large",
                  "title": "Datei zu groß",
                  "detail": "Der Rumpf ist zu groß (höchstens 100 KB).",
                  "status": 413,
                  "instance": "urn:nuvaface:request:3f2a6c1e-0000-4000-8000-000000000099",
                  "requestId": "3f2a6c1e-0000-4000-8000-000000000099"
                }
              }
            },
            "description": "Rumpf größer als 100 KB (PAYLOAD_TOO_LARGE)"
          },
          "415": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "code": "UNSUPPORTED_MEDIA_TYPE",
                  "type": "https://nuvaface-practice.com/api/public/docs#fehler-unsupported-media-type",
                  "title": "Dateityp nicht erlaubt",
                  "detail": "Bitte den Rumpf als application/json senden.",
                  "status": 415,
                  "instance": "urn:nuvaface:request:3f2a6c1e-0000-4000-8000-000000000099",
                  "requestId": "3f2a6c1e-0000-4000-8000-000000000099"
                }
              }
            },
            "description": "Rumpf nicht als JSON gekennzeichnet oder mit nicht unterstützter Kodierung (UNSUPPORTED_MEDIA_TYPE)"
          },
          "422": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "code": "IDEMPOTENCY_MISMATCH",
                  "type": "https://nuvaface-practice.com/api/public/docs#fehler-idempotency-mismatch",
                  "title": "Idempotency-Key mit anderem Inhalt",
                  "detail": "Dieser Idempotency-Key wurde schon für eine andere Anfrage benutzt.",
                  "status": 422,
                  "instance": "urn:nuvaface:request:3f2a6c1e-0000-4000-8000-000000000099",
                  "requestId": "3f2a6c1e-0000-4000-8000-000000000099"
                }
              }
            },
            "description": "Idempotency-Key mit anderem Inhalt"
          },
          "423": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "code": "RECORD_RESTRICTED",
                  "type": "https://nuvaface-practice.com/api/public/docs#fehler-record-restricted",
                  "title": "Akte eingeschränkt",
                  "detail": "Die Akte ist eingeschränkt (Art. 18 DSGVO). Der Termin wird über die Schnittstelle nicht geändert.",
                  "status": 423,
                  "instance": "urn:nuvaface:request:3f2a6c1e-0000-4000-8000-000000000099",
                  "requestId": "3f2a6c1e-0000-4000-8000-000000000099"
                }
              }
            },
            "description": "Akte eingeschränkt, nichts geändert"
          },
          "429": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "code": "RATE_LIMITED",
                  "type": "https://nuvaface-practice.com/api/public/docs#fehler-rate-limited",
                  "title": "Zu viele Anfragen",
                  "detail": "Höchstens 120 Anfragen je Minute und Schlüssel. Bitte die Antwort Retry-After abwarten.",
                  "status": 429,
                  "instance": "urn:nuvaface:request:3f2a6c1e-0000-4000-8000-000000000099",
                  "requestId": "3f2a6c1e-0000-4000-8000-000000000099",
                  "retryAfter": 17
                }
              }
            },
            "description": "Zu viele Anfragen (Kopf Retry-After) oder Tagesgrenze der Patientendatensätze erreicht (DAILY_PATIENT_LIMIT)"
          },
          "503": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "code": "UNAVAILABLE",
                  "type": "https://nuvaface-practice.com/api/public/docs#fehler-unavailable",
                  "title": "Vorübergehend nicht verfügbar",
                  "detail": "Die Schnittstelle ist vorübergehend nicht verfügbar.",
                  "status": 503,
                  "instance": "urn:nuvaface:request:3f2a6c1e-0000-4000-8000-000000000099",
                  "requestId": "3f2a6c1e-0000-4000-8000-000000000099",
                  "retryAfter": 30
                }
              }
            },
            "description": "Prüfung vorübergehend gestört oder (beim Upload) Server ausgelastet; Kopf Retry-After abwarten"
          }
        },
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "required": true
          },
          {
            "in": "header",
            "name": "Idempotency-Key",
            "schema": {
              "type": "string",
              "pattern": "^[!-~]{1,255}$",
              "maxLength": 255,
              "minLength": 1
            },
            "required": false,
            "description": "Empfohlen: ein neuer Wert je Vorgang (z. B. UUID). Eine Wiederholung mit gleichem Wert und gleichem Inhalt legt nichts doppelt an (24 Stunden, Kopf Idempotent-Replayed: true). Anderer Inhalt ergibt 422, eine noch laufende Anfrage 409."
          },
          {
            "in": "query",
            "name": "dryRun",
            "schema": {
              "type": "boolean",
              "default": false
            },
            "required": false,
            "description": "true: alles prüfen und rechnen, aber nichts speichern und kein Ereignis auslösen. Antwort 200 mit dryRun: true und dem Ergebnis, das entstanden wäre (Kennungen eines Probelaufs gibt es danach nicht). Ein Idempotency-Key wird im Probelauf nicht verbraucht."
          }
        ],
        "description": "Scope: appointments.write. Der Termin entsteht bzw. steht danach im Status pending (angefragt) und erscheint im Buchungseingang der Praxis; erst wenn die Praxis dort bestätigt, bekommt der Patient eine Bestätigung von NuvaFace. Die Schnittstelle schreibt nie selbst Mail oder SMS, Erinnerungen laufen erst nach der Bestätigung. Geprüft wird wie bei der Online-Buchung: nicht in der Vergangenheit, Öffnungszeiten bzw. freigegebene Zeitfenster, Sperrzeiten, keine Überschneidung (abgesagte und nicht erschienene Termine belegen nicht). Nur künftige Termine im Status pending, confirmed oder scheduled; ein bestätigter Termin wird durch das Verschieben wieder pending und muss von der Praxis neu bestätigt werden. Andere Status bzw. ein begonnener Termin: 409 STATE_CONFLICT mit reason (cancelled, completed, no_show, past). Derselbe Platz noch einmal ändert nichts. Sperrzeiten der Praxis lassen sich nicht verschieben (404).",
        "operationId": "terminVerschieben",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "start"
                ],
                "properties": {
                  "start": {
                    "type": "string",
                    "format": "date-time",
                    "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}(:00(\\.0{1,9})?)?(Z|[+-]\\d{2}:\\d{2})$",
                    "description": "Beginn als ISO 8601 MIT Zone (Z oder Versatz), volle Minute, z. B. 2026-12-02T15:00:00+01:00. Ohne Zone 400. Eine Spanne, die an der Zeitumstellung eine doppelte oder fehlende Uhrzeit berührt, ergibt 400 mit reason dst_transition."
                  },
                  "durationMinutes": {
                    "type": "integer",
                    "maximum": 480,
                    "minimum": 5,
                    "description": "Dauer in Minuten. Ohne Angabe: beim Anlegen die Dauer der Behandlung, beim Verschieben die bisherige Dauer."
                  }
                },
                "additionalProperties": false
              },
              "example": {
                "start": "2026-12-03T09:30:00+01:00"
              }
            }
          },
          "required": true
        },
        "x-nuvaface-scopes": [
          "appointments.write"
        ]
      }
    },
    "/measurements/{id}": {
      "get": {
        "tags": [
          "Messwerte"
        ],
        "summary": "Eine Messreihe",
        "security": [
          {
            "apiKey": []
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Messreihe"
                },
                "example": {
                  "id": "3f2a6c1e-0000-4000-8000-000000000091",
                  "schema": {
                    "id": "3f2a6c1e-0000-4000-8000-000000000081",
                    "key": "performance_analysis",
                    "name": "Performance Analysis",
                    "version": 2
                  },
                  "source": "api",
                  "values": {
                    "gewicht": 78.4,
                    "groesse": 182.5,
                    "anliegen": "Mehr Energie am Nachmittag",
                    "blutdruck": [
                      124,
                      78
                    ],
                    "raucherstatus": "nie",
                    "schlafqualitaet": 7,
                    "anliegen_bereiche": [
                      "schlaf",
                      "stress"
                    ]
                  },
                  "createdAt": "2026-12-01T08:16:02+01:00",
                  "patientId": "3f2a6c1e-0000-4000-8000-000000000001",
                  "documentId": "3f2a6c1e-0000-4000-8000-000000000031",
                  "measuredAt": "2026-12-01T08:15:00+01:00",
                  "replacesId": null,
                  "replacedById": null,
                  "appointmentId": "3f2a6c1e-0000-4000-8000-000000000011",
                  "correctionReason": null
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "code": "VALIDATION",
                  "type": "https://nuvaface-practice.com/api/public/docs#fehler-validation",
                  "title": "Ungültige Anfrage",
                  "detail": "id ist keine gültige Kennung (UUID).",
                  "status": 400,
                  "instance": "urn:nuvaface:request:3f2a6c1e-0000-4000-8000-000000000099",
                  "requestId": "3f2a6c1e-0000-4000-8000-000000000099"
                }
              }
            },
            "description": "Ungültige Anfrage (auch: Schlüssel in der Adresse, ungültige Kennung, NUL-Zeichen)"
          },
          "401": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "code": "TOKEN_INVALID",
                  "type": "https://nuvaface-practice.com/api/public/docs#fehler-token-invalid",
                  "title": "Zugang ungültig",
                  "detail": "Der Schlüssel ist unbekannt, abgelaufen oder widerrufen.",
                  "status": 401,
                  "instance": "urn:nuvaface:request:3f2a6c1e-0000-4000-8000-000000000099",
                  "requestId": "3f2a6c1e-0000-4000-8000-000000000099"
                }
              }
            },
            "description": "Nicht angemeldet oder Schlüssel ungültig"
          },
          "403": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "code": "INSUFFICIENT_SCOPE",
                  "type": "https://nuvaface-practice.com/api/public/docs#fehler-insufficient-scope",
                  "title": "Berechtigung fehlt",
                  "detail": "Dieser Schlüssel hat den nötigen Scope nicht. Die Praxisinhaberin kann einen Schlüssel mit diesem Recht in NuvaFace unter Einstellungen, Schnittstellen anlegen.",
                  "status": 403,
                  "instance": "urn:nuvaface:request:3f2a6c1e-0000-4000-8000-000000000099",
                  "requestId": "3f2a6c1e-0000-4000-8000-000000000099"
                }
              }
            },
            "description": "Scope fehlt, Schnittstelle nicht freigeschaltet oder Praxis gesperrt (code nennt den Grund)"
          },
          "404": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "code": "NOT_FOUND",
                  "type": "https://nuvaface-practice.com/api/public/docs#fehler-not-found",
                  "title": "Nicht gefunden",
                  "detail": "Messreihe nicht gefunden.",
                  "status": 404,
                  "instance": "urn:nuvaface:request:3f2a6c1e-0000-4000-8000-000000000099",
                  "requestId": "3f2a6c1e-0000-4000-8000-000000000099"
                }
              }
            },
            "description": "Messreihe nicht gefunden"
          },
          "429": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "code": "RATE_LIMITED",
                  "type": "https://nuvaface-practice.com/api/public/docs#fehler-rate-limited",
                  "title": "Zu viele Anfragen",
                  "detail": "Höchstens 120 Anfragen je Minute und Schlüssel. Bitte die Antwort Retry-After abwarten.",
                  "status": 429,
                  "instance": "urn:nuvaface:request:3f2a6c1e-0000-4000-8000-000000000099",
                  "requestId": "3f2a6c1e-0000-4000-8000-000000000099",
                  "retryAfter": 17
                }
              }
            },
            "description": "Zu viele Anfragen (Kopf Retry-After) oder Tagesgrenze der Patientendatensätze erreicht (DAILY_PATIENT_LIMIT)"
          },
          "503": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "code": "UNAVAILABLE",
                  "type": "https://nuvaface-practice.com/api/public/docs#fehler-unavailable",
                  "title": "Vorübergehend nicht verfügbar",
                  "detail": "Die Schnittstelle ist vorübergehend nicht verfügbar.",
                  "status": 503,
                  "instance": "urn:nuvaface:request:3f2a6c1e-0000-4000-8000-000000000099",
                  "requestId": "3f2a6c1e-0000-4000-8000-000000000099",
                  "retryAfter": 30
                }
              }
            },
            "description": "Prüfung vorübergehend gestört oder (beim Upload) Server ausgelastet; Kopf Retry-After abwarten"
          }
        },
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "required": true
          }
        ],
        "description": "Scope: measurements.read. Zählt 1 auf die Tagesgrenze.",
        "operationId": "messreiheLesen",
        "x-nuvaface-scopes": [
          "measurements.read"
        ]
      }
    },
    "/documents/{id}/file": {
      "get": {
        "tags": [
          "Dokumente"
        ],
        "summary": "Datei eines Dokuments herunterladen",
        "security": [
          {
            "apiKey": []
          }
        ],
        "responses": {
          "200": {
            "content": {
              "image/png": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                },
                "example": "(Inhalt der Datei)"
              },
              "image/jpeg": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                },
                "example": "(Inhalt der Datei)"
              },
              "application/pdf": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                },
                "example": "(Inhalt der Datei)"
              },
              "application/octet-stream": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                },
                "example": "(Inhalt der Datei)"
              }
            },
            "description": "Die Datei"
          },
          "400": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "code": "VALIDATION",
                  "type": "https://nuvaface-practice.com/api/public/docs#fehler-validation",
                  "title": "Ungültige Anfrage",
                  "detail": "limit muss zwischen 1 und 100 liegen.",
                  "status": 400,
                  "instance": "urn:nuvaface:request:3f2a6c1e-0000-4000-8000-000000000099",
                  "requestId": "3f2a6c1e-0000-4000-8000-000000000099"
                }
              }
            },
            "description": "Ungültige Anfrage (auch: Schlüssel in der Adresse, ungültige Kennung, NUL-Zeichen)"
          },
          "401": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "code": "TOKEN_INVALID",
                  "type": "https://nuvaface-practice.com/api/public/docs#fehler-token-invalid",
                  "title": "Zugang ungültig",
                  "detail": "Der Schlüssel ist unbekannt, abgelaufen oder widerrufen.",
                  "status": 401,
                  "instance": "urn:nuvaface:request:3f2a6c1e-0000-4000-8000-000000000099",
                  "requestId": "3f2a6c1e-0000-4000-8000-000000000099"
                }
              }
            },
            "description": "Nicht angemeldet oder Schlüssel ungültig"
          },
          "403": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "code": "INSUFFICIENT_SCOPE",
                  "type": "https://nuvaface-practice.com/api/public/docs#fehler-insufficient-scope",
                  "title": "Berechtigung fehlt",
                  "detail": "Dieser Schlüssel hat den nötigen Scope nicht. Die Praxisinhaberin kann einen Schlüssel mit diesem Recht in NuvaFace unter Einstellungen, Schnittstellen anlegen.",
                  "status": 403,
                  "instance": "urn:nuvaface:request:3f2a6c1e-0000-4000-8000-000000000099",
                  "requestId": "3f2a6c1e-0000-4000-8000-000000000099"
                }
              }
            },
            "description": "Scope fehlt, Schnittstelle nicht freigeschaltet oder Praxis gesperrt (code nennt den Grund)"
          },
          "404": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "code": "NOT_FOUND",
                  "type": "https://nuvaface-practice.com/api/public/docs#fehler-not-found",
                  "title": "Nicht gefunden",
                  "detail": "Dokument nicht gefunden.",
                  "status": 404,
                  "instance": "urn:nuvaface:request:3f2a6c1e-0000-4000-8000-000000000099",
                  "requestId": "3f2a6c1e-0000-4000-8000-000000000099"
                }
              }
            },
            "description": "Dokument oder Datei nicht gefunden"
          },
          "429": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "code": "RATE_LIMITED",
                  "type": "https://nuvaface-practice.com/api/public/docs#fehler-rate-limited",
                  "title": "Zu viele Anfragen",
                  "detail": "Höchstens 120 Anfragen je Minute und Schlüssel. Bitte die Antwort Retry-After abwarten.",
                  "status": 429,
                  "instance": "urn:nuvaface:request:3f2a6c1e-0000-4000-8000-000000000099",
                  "requestId": "3f2a6c1e-0000-4000-8000-000000000099",
                  "retryAfter": 17
                }
              }
            },
            "description": "Zu viele Anfragen (Kopf Retry-After) oder Tagesgrenze der Patientendatensätze erreicht (DAILY_PATIENT_LIMIT)"
          },
          "503": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "code": "UNAVAILABLE",
                  "type": "https://nuvaface-practice.com/api/public/docs#fehler-unavailable",
                  "title": "Vorübergehend nicht verfügbar",
                  "detail": "Die Schnittstelle ist vorübergehend nicht verfügbar.",
                  "status": 503,
                  "instance": "urn:nuvaface:request:3f2a6c1e-0000-4000-8000-000000000099",
                  "requestId": "3f2a6c1e-0000-4000-8000-000000000099",
                  "retryAfter": 30
                }
              }
            },
            "description": "Prüfung vorübergehend gestört oder (beim Upload) Server ausgelastet; Kopf Retry-After abwarten"
          }
        },
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "required": true
          }
        ],
        "description": "Scope: documents.read. Sichtbar sind über die Schnittstelle abgelegte Dokumente und Arten, die die Praxis ausdrücklich freigegeben hat; nie Einwilligungen, Bilder und Fotos, Anamnese oder Check-in-Formulare. Immer als Anhang (Content-Disposition: attachment, X-Content-Type-Options: nosniff, Cache-Control: no-store). Content-Type aus der Prüfung beim Ablegen (PDF, JPEG, PNG), sonst application/octet-stream. Fehlt die Datei: 404. Zählt 1 auf die Tagesgrenze.",
        "operationId": "dokumentDatei",
        "x-nuvaface-scopes": [
          "documents.read"
        ]
      }
    },
    "/invoice-drafts/{id}": {
      "get": {
        "tags": [
          "Rechnungen"
        ],
        "summary": "Rechnungsentwurf nachlesen (Status, Positionen, Beträge)",
        "security": [
          {
            "apiKey": []
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Rechnungsentwurf"
                },
                "example": {
                  "id": "3f2a6c1e-0000-4000-8000-000000000081",
                  "items": [
                    {
                      "code": "268",
                      "index": 0,
                      "total": 17.43,
                      "factor": 2.3,
                      "points": 130,
                      "taxRate": 19,
                      "feeFrame": {
                        "maximum": 3.5,
                        "section": "C",
                        "threshold": 2.3
                      },
                      "quantity": 1,
                      "unitPrice": 17.43,
                      "description": "Medikamentöse Infiltrationsbehandlung im Bereich mehrerer Körperregionen",
                      "printedFactor": 2.3
                    }
                  ],
                  "total": 20.74,
                  "object": "invoice_draft",
                  "status": "taken_over",
                  "taxRate": 19,
                  "currency": "EUR",
                  "warnings": [
                    {
                      "code": "AMOUNT_MISMATCH",
                      "index": 0,
                      "message": "Position 1: gerechnet 17.43 EUR, erwartet 17.50 EUR. Es gilt der gerechnete Betrag.",
                      "expected": 17.5,
                      "calculated": 17.43
                    }
                  ],
                  "createdAt": "2026-11-26T10:00:00+01:00",
                  "expiresAt": "2026-12-26T10:00:00+01:00",
                  "invoiceId": "3f2a6c1e-0000-4000-8000-000000000042",
                  "netAmount": 17.43,
                  "patientId": "3f2a6c1e-0000-4000-8000-000000000001",
                  "taxAmount": 3.31,
                  "serviceDate": "2026-11-25",
                  "appointmentId": "3f2a6c1e-0000-4000-8000-000000000011"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "code": "VALIDATION",
                  "type": "https://nuvaface-practice.com/api/public/docs#fehler-validation",
                  "title": "Ungültige Anfrage",
                  "detail": "limit muss zwischen 1 und 100 liegen.",
                  "status": 400,
                  "instance": "urn:nuvaface:request:3f2a6c1e-0000-4000-8000-000000000099",
                  "requestId": "3f2a6c1e-0000-4000-8000-000000000099"
                }
              }
            },
            "description": "Ungültige Anfrage (auch: Schlüssel in der Adresse, ungültige Kennung, NUL-Zeichen)"
          },
          "401": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "code": "TOKEN_INVALID",
                  "type": "https://nuvaface-practice.com/api/public/docs#fehler-token-invalid",
                  "title": "Zugang ungültig",
                  "detail": "Der Schlüssel ist unbekannt, abgelaufen oder widerrufen.",
                  "status": 401,
                  "instance": "urn:nuvaface:request:3f2a6c1e-0000-4000-8000-000000000099",
                  "requestId": "3f2a6c1e-0000-4000-8000-000000000099"
                }
              }
            },
            "description": "Nicht angemeldet oder Schlüssel ungültig"
          },
          "403": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "code": "INSUFFICIENT_SCOPE",
                  "type": "https://nuvaface-practice.com/api/public/docs#fehler-insufficient-scope",
                  "title": "Berechtigung fehlt",
                  "detail": "Dieser Schlüssel hat den nötigen Scope nicht. Die Praxisinhaberin kann einen Schlüssel mit diesem Recht in NuvaFace unter Einstellungen, Schnittstellen anlegen.",
                  "status": 403,
                  "instance": "urn:nuvaface:request:3f2a6c1e-0000-4000-8000-000000000099",
                  "requestId": "3f2a6c1e-0000-4000-8000-000000000099"
                }
              }
            },
            "description": "Scope fehlt, Schnittstelle nicht freigeschaltet oder Praxis gesperrt (code nennt den Grund)"
          },
          "404": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "code": "NOT_FOUND",
                  "type": "https://nuvaface-practice.com/api/public/docs#fehler-not-found",
                  "title": "Nicht gefunden",
                  "detail": "Rechnungsentwurf nicht gefunden.",
                  "status": 404,
                  "instance": "urn:nuvaface:request:3f2a6c1e-0000-4000-8000-000000000099",
                  "requestId": "3f2a6c1e-0000-4000-8000-000000000099"
                }
              }
            },
            "description": "Rechnungsentwurf nicht gefunden"
          },
          "429": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "code": "RATE_LIMITED",
                  "type": "https://nuvaface-practice.com/api/public/docs#fehler-rate-limited",
                  "title": "Zu viele Anfragen",
                  "detail": "Höchstens 120 Anfragen je Minute und Schlüssel. Bitte die Antwort Retry-After abwarten.",
                  "status": 429,
                  "instance": "urn:nuvaface:request:3f2a6c1e-0000-4000-8000-000000000099",
                  "requestId": "3f2a6c1e-0000-4000-8000-000000000099",
                  "retryAfter": 17
                }
              }
            },
            "description": "Zu viele Anfragen (Kopf Retry-After) oder Tagesgrenze der Patientendatensätze erreicht (DAILY_PATIENT_LIMIT)"
          },
          "503": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "code": "UNAVAILABLE",
                  "type": "https://nuvaface-practice.com/api/public/docs#fehler-unavailable",
                  "title": "Vorübergehend nicht verfügbar",
                  "detail": "Die Schnittstelle ist vorübergehend nicht verfügbar.",
                  "status": 503,
                  "instance": "urn:nuvaface:request:3f2a6c1e-0000-4000-8000-000000000099",
                  "requestId": "3f2a6c1e-0000-4000-8000-000000000099",
                  "retryAfter": 30
                }
              }
            },
            "description": "Prüfung vorübergehend gestört oder (beim Upload) Server ausgelastet; Kopf Retry-After abwarten"
          }
        },
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "required": true
          }
        ],
        "description": "Scope: invoices.write oder invoices.read.items. Gesundheitsbezug. Status open, taken_over (mit invoiceId der Rechnung, die die Praxis angelegt hat), discarded oder expired. Entwürfe eingeschränkter oder archivierter Akten: 404.",
        "operationId": "rechnungsentwurfLesen",
        "x-nuvaface-scopes": [
          "invoices.write",
          "invoices.read.items"
        ]
      }
    },
    "/measurement-schemas": {
      "get": {
        "tags": [
          "Messwerte"
        ],
        "summary": "Messschemata der Praxis",
        "security": [
          {
            "apiKey": []
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Messschema"
                      }
                    }
                  }
                },
                "example": {
                  "data": [
                    {
                      "id": "3f2a6c1e-0000-4000-8000-000000000081",
                      "key": "performance_analysis",
                      "name": "Performance Analysis",
                      "active": true,
                      "fields": [
                        {
                          "key": "groesse",
                          "max": 250,
                          "min": 50,
                          "typ": "zahl",
                          "ucum": "cm",
                          "label": "Größe",
                          "gruppe": "Körperdaten",
                          "einheit": "cm",
                          "pflicht": true
                        },
                        {
                          "key": "gewicht",
                          "max": 400,
                          "min": 20,
                          "typ": "zahl",
                          "ucum": "kg",
                          "label": "Gewicht",
                          "gruppe": "Körperdaten",
                          "einheit": "kg",
                          "pflicht": true
                        },
                        {
                          "key": "blutdruck",
                          "typ": "wertepaar",
                          "paar": [
                            {
                              "max": 300,
                              "min": 50,
                              "label": "systolisch"
                            },
                            {
                              "max": 200,
                              "min": 20,
                              "label": "diastolisch"
                            }
                          ],
                          "ucum": "mm[Hg]",
                          "label": "Blutdruck",
                          "gruppe": "Vitalwerte",
                          "einheit": "mmHg",
                          "ersterGroesser": true
                        },
                        {
                          "key": "raucherstatus",
                          "typ": "auswahl",
                          "label": "Raucherstatus",
                          "gruppe": "Lebensstil",
                          "optionen": [
                            {
                              "wert": "nie",
                              "label": "Nie"
                            },
                            {
                              "wert": "raucher",
                              "label": "Raucher"
                            }
                          ]
                        },
                        {
                          "key": "schlafqualitaet",
                          "max": 10,
                          "min": 1,
                          "typ": "skala",
                          "label": "Schlafqualität",
                          "gruppe": "Wohlbefinden",
                          "skalaText": {
                            "max": "Sehr gut",
                            "min": "Schlecht"
                          }
                        },
                        {
                          "key": "anliegen_bereiche",
                          "typ": "mehrfachauswahl",
                          "label": "Welcher Bereich stört derzeit am meisten?",
                          "gruppe": "Aktuelle Anliegen",
                          "optionen": [
                            {
                              "wert": "schlaf",
                              "label": "Schlaf"
                            },
                            {
                              "wert": "stress",
                              "label": "Stress"
                            },
                            {
                              "wert": "erholung",
                              "label": "Erholung"
                            }
                          ],
                          "maxAuswahl": 3
                        },
                        {
                          "key": "anliegen",
                          "typ": "text",
                          "label": "Anliegen (Freitext, auch \"Andere\")",
                          "gruppe": "Aktuelle Anliegen",
                          "maxLaenge": 500
                        }
                      ],
                      "version": 2,
                      "isLatest": true,
                      "template": "performance_analysis",
                      "createdAt": "2026-11-26T10:00:00+01:00",
                      "description": "Erfassungsbogen der Leistungsdiagnostik (Auszug: 7 von 26 Feldern).",
                      "deactivatedAt": null,
                      "latestVersion": 2
                    }
                  ]
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "code": "VALIDATION",
                  "type": "https://nuvaface-practice.com/api/public/docs#fehler-validation",
                  "title": "Ungültige Anfrage",
                  "detail": "allVersions: true oder false.",
                  "status": 400,
                  "instance": "urn:nuvaface:request:3f2a6c1e-0000-4000-8000-000000000099",
                  "requestId": "3f2a6c1e-0000-4000-8000-000000000099"
                }
              }
            },
            "description": "Ungültige Anfrage (auch: Schlüssel in der Adresse, ungültige Kennung, NUL-Zeichen)"
          },
          "401": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "code": "TOKEN_INVALID",
                  "type": "https://nuvaface-practice.com/api/public/docs#fehler-token-invalid",
                  "title": "Zugang ungültig",
                  "detail": "Der Schlüssel ist unbekannt, abgelaufen oder widerrufen.",
                  "status": 401,
                  "instance": "urn:nuvaface:request:3f2a6c1e-0000-4000-8000-000000000099",
                  "requestId": "3f2a6c1e-0000-4000-8000-000000000099"
                }
              }
            },
            "description": "Nicht angemeldet oder Schlüssel ungültig"
          },
          "403": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "code": "INSUFFICIENT_SCOPE",
                  "type": "https://nuvaface-practice.com/api/public/docs#fehler-insufficient-scope",
                  "title": "Berechtigung fehlt",
                  "detail": "Dieser Schlüssel hat den nötigen Scope nicht. Die Praxisinhaberin kann einen Schlüssel mit diesem Recht in NuvaFace unter Einstellungen, Schnittstellen anlegen.",
                  "status": 403,
                  "instance": "urn:nuvaface:request:3f2a6c1e-0000-4000-8000-000000000099",
                  "requestId": "3f2a6c1e-0000-4000-8000-000000000099"
                }
              }
            },
            "description": "Scope fehlt, Schnittstelle nicht freigeschaltet oder Praxis gesperrt (code nennt den Grund)"
          },
          "429": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "code": "RATE_LIMITED",
                  "type": "https://nuvaface-practice.com/api/public/docs#fehler-rate-limited",
                  "title": "Zu viele Anfragen",
                  "detail": "Höchstens 120 Anfragen je Minute und Schlüssel. Bitte die Antwort Retry-After abwarten.",
                  "status": 429,
                  "instance": "urn:nuvaface:request:3f2a6c1e-0000-4000-8000-000000000099",
                  "requestId": "3f2a6c1e-0000-4000-8000-000000000099",
                  "retryAfter": 17
                }
              }
            },
            "description": "Zu viele Anfragen (Kopf Retry-After) oder Tagesgrenze der Patientendatensätze erreicht (DAILY_PATIENT_LIMIT)"
          },
          "503": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "code": "UNAVAILABLE",
                  "type": "https://nuvaface-practice.com/api/public/docs#fehler-unavailable",
                  "title": "Vorübergehend nicht verfügbar",
                  "detail": "Die Schnittstelle ist vorübergehend nicht verfügbar.",
                  "status": 503,
                  "instance": "urn:nuvaface:request:3f2a6c1e-0000-4000-8000-000000000099",
                  "requestId": "3f2a6c1e-0000-4000-8000-000000000099",
                  "retryAfter": 30
                }
              }
            },
            "description": "Prüfung vorübergehend gestört oder (beim Upload) Server ausgelastet; Kopf Retry-After abwarten"
          }
        },
        "parameters": [
          {
            "in": "query",
            "name": "schemaKey",
            "schema": {
              "type": "string",
              "pattern": "^[a-z][a-z0-9_]{1,59}$"
            },
            "description": "nur dieses Schema (Kennung; der Name key ist für Schlüssel gesperrt)"
          },
          {
            "in": "query",
            "name": "allVersions",
            "schema": {
              "type": "boolean",
              "default": false
            },
            "description": "true: alle Fassungen"
          },
          {
            "in": "query",
            "name": "includeInactive",
            "schema": {
              "type": "boolean",
              "default": false
            },
            "description": "true: auch deaktivierte Schemata"
          }
        ],
        "description": "Scope: measurements.read oder measurements.write. Je Kennung die neueste aktive Fassung. Die Praxis pflegt ihre Schemata in NuvaFace unter Einstellungen; über die Schnittstelle nur lesen. Keine Patientendaten.",
        "operationId": "messschemataLesen",
        "x-nuvaface-scopes": [
          "measurements.read",
          "measurements.write"
        ]
      }
    },
    "/booking-requests/{id}": {
      "get": {
        "tags": [
          "Buchungsanfragen"
        ],
        "summary": "Eine Buchungsanfrage",
        "security": [
          {
            "apiKey": []
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Buchungsanfrage"
                },
                "example": {
                  "id": "3f2a6c1e-0000-4000-8000-000000000051",
                  "date": "2026-12-01",
                  "type": "onsite",
                  "start": "2026-12-01T09:30:00+01:00",
                  "video": false,
                  "source": "widget",
                  "status": "pending",
                  "contact": {
                    "name": "Mia Neu",
                    "email": "mia.neu@example.com",
                    "phone": "+49 151 33333333"
                  },
                  "createdAt": "2026-11-28T18:02:11+01:00",
                  "updatedAt": "2026-11-28T18:02:11+01:00",
                  "treatmentId": "3f2a6c1e-0000-4000-8000-000000000021",
                  "appointmentId": "3f2a6c1e-0000-4000-8000-000000000011",
                  "treatmentName": "Performance Check"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "code": "VALIDATION",
                  "type": "https://nuvaface-practice.com/api/public/docs#fehler-validation",
                  "title": "Ungültige Anfrage",
                  "detail": "limit muss zwischen 1 und 100 liegen.",
                  "status": 400,
                  "instance": "urn:nuvaface:request:3f2a6c1e-0000-4000-8000-000000000099",
                  "requestId": "3f2a6c1e-0000-4000-8000-000000000099"
                }
              }
            },
            "description": "Ungültige Anfrage (auch: Schlüssel in der Adresse, ungültige Kennung, NUL-Zeichen)"
          },
          "401": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "code": "TOKEN_INVALID",
                  "type": "https://nuvaface-practice.com/api/public/docs#fehler-token-invalid",
                  "title": "Zugang ungültig",
                  "detail": "Der Schlüssel ist unbekannt, abgelaufen oder widerrufen.",
                  "status": 401,
                  "instance": "urn:nuvaface:request:3f2a6c1e-0000-4000-8000-000000000099",
                  "requestId": "3f2a6c1e-0000-4000-8000-000000000099"
                }
              }
            },
            "description": "Nicht angemeldet oder Schlüssel ungültig"
          },
          "403": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "code": "INSUFFICIENT_SCOPE",
                  "type": "https://nuvaface-practice.com/api/public/docs#fehler-insufficient-scope",
                  "title": "Berechtigung fehlt",
                  "detail": "Dieser Schlüssel hat den nötigen Scope nicht. Die Praxisinhaberin kann einen Schlüssel mit diesem Recht in NuvaFace unter Einstellungen, Schnittstellen anlegen.",
                  "status": 403,
                  "instance": "urn:nuvaface:request:3f2a6c1e-0000-4000-8000-000000000099",
                  "requestId": "3f2a6c1e-0000-4000-8000-000000000099"
                }
              }
            },
            "description": "Scope fehlt, Schnittstelle nicht freigeschaltet oder Praxis gesperrt (code nennt den Grund)"
          },
          "404": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "code": "NOT_FOUND",
                  "type": "https://nuvaface-practice.com/api/public/docs#fehler-not-found",
                  "title": "Nicht gefunden",
                  "detail": "Buchungsanfrage nicht gefunden.",
                  "status": 404,
                  "instance": "urn:nuvaface:request:3f2a6c1e-0000-4000-8000-000000000099",
                  "requestId": "3f2a6c1e-0000-4000-8000-000000000099"
                }
              }
            },
            "description": "Buchungsanfrage nicht gefunden"
          },
          "429": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "code": "RATE_LIMITED",
                  "type": "https://nuvaface-practice.com/api/public/docs#fehler-rate-limited",
                  "title": "Zu viele Anfragen",
                  "detail": "Höchstens 120 Anfragen je Minute und Schlüssel. Bitte die Antwort Retry-After abwarten.",
                  "status": 429,
                  "instance": "urn:nuvaface:request:3f2a6c1e-0000-4000-8000-000000000099",
                  "requestId": "3f2a6c1e-0000-4000-8000-000000000099",
                  "retryAfter": 17
                }
              }
            },
            "description": "Zu viele Anfragen (Kopf Retry-After) oder Tagesgrenze der Patientendatensätze erreicht (DAILY_PATIENT_LIMIT)"
          },
          "503": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "code": "UNAVAILABLE",
                  "type": "https://nuvaface-practice.com/api/public/docs#fehler-unavailable",
                  "title": "Vorübergehend nicht verfügbar",
                  "detail": "Die Schnittstelle ist vorübergehend nicht verfügbar.",
                  "status": 503,
                  "instance": "urn:nuvaface:request:3f2a6c1e-0000-4000-8000-000000000099",
                  "requestId": "3f2a6c1e-0000-4000-8000-000000000099",
                  "retryAfter": 30
                }
              }
            },
            "description": "Prüfung vorübergehend gestört oder (beim Upload) Server ausgelastet; Kopf Retry-After abwarten"
          }
        },
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "required": true
          }
        ],
        "description": "Scope: bookings.read. Name und Kontakt nur mit patients.read.",
        "operationId": "buchungsanfrageLesen",
        "x-nuvaface-scopes": [
          "bookings.read"
        ]
      }
    },
    "/patients/{id}/consents": {
      "get": {
        "tags": [
          "Einwilligungen"
        ],
        "summary": "Einwilligungen eines Patienten je Kanal",
        "security": [
          {
            "apiKey": []
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Einwilligungen"
                },
                "example": {
                  "channels": {
                    "reminderSms": {
                      "method": null,
                      "status": "unknown",
                      "recordedAt": null
                    },
                    "reminderEmail": {
                      "method": "online_buchung",
                      "status": "granted",
                      "recordedAt": "2026-11-20T10:15:00+01:00"
                    },
                    "marketingEmail": {
                      "method": "praxisbogen",
                      "status": "denied",
                      "recordedAt": "2026-07-01T08:00:00+02:00"
                    }
                  },
                  "patientId": "3f2a6c1e-0000-4000-8000-000000000001"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "code": "VALIDATION",
                  "type": "https://nuvaface-practice.com/api/public/docs#fehler-validation",
                  "title": "Ungültige Anfrage",
                  "detail": "limit muss zwischen 1 und 100 liegen.",
                  "status": 400,
                  "instance": "urn:nuvaface:request:3f2a6c1e-0000-4000-8000-000000000099",
                  "requestId": "3f2a6c1e-0000-4000-8000-000000000099"
                }
              }
            },
            "description": "Ungültige Anfrage (auch: Schlüssel in der Adresse, ungültige Kennung, NUL-Zeichen)"
          },
          "401": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "code": "TOKEN_INVALID",
                  "type": "https://nuvaface-practice.com/api/public/docs#fehler-token-invalid",
                  "title": "Zugang ungültig",
                  "detail": "Der Schlüssel ist unbekannt, abgelaufen oder widerrufen.",
                  "status": 401,
                  "instance": "urn:nuvaface:request:3f2a6c1e-0000-4000-8000-000000000099",
                  "requestId": "3f2a6c1e-0000-4000-8000-000000000099"
                }
              }
            },
            "description": "Nicht angemeldet oder Schlüssel ungültig"
          },
          "403": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "code": "INSUFFICIENT_SCOPE",
                  "type": "https://nuvaface-practice.com/api/public/docs#fehler-insufficient-scope",
                  "title": "Berechtigung fehlt",
                  "detail": "Dieser Schlüssel hat den nötigen Scope nicht. Die Praxisinhaberin kann einen Schlüssel mit diesem Recht in NuvaFace unter Einstellungen, Schnittstellen anlegen.",
                  "status": 403,
                  "instance": "urn:nuvaface:request:3f2a6c1e-0000-4000-8000-000000000099",
                  "requestId": "3f2a6c1e-0000-4000-8000-000000000099"
                }
              }
            },
            "description": "Scope fehlt, Schnittstelle nicht freigeschaltet oder Praxis gesperrt (code nennt den Grund)"
          },
          "404": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "code": "NOT_FOUND",
                  "type": "https://nuvaface-practice.com/api/public/docs#fehler-not-found",
                  "title": "Nicht gefunden",
                  "detail": "Patient nicht gefunden.",
                  "status": 404,
                  "instance": "urn:nuvaface:request:3f2a6c1e-0000-4000-8000-000000000099",
                  "requestId": "3f2a6c1e-0000-4000-8000-000000000099"
                }
              }
            },
            "description": "Patient nicht gefunden"
          },
          "429": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "code": "RATE_LIMITED",
                  "type": "https://nuvaface-practice.com/api/public/docs#fehler-rate-limited",
                  "title": "Zu viele Anfragen",
                  "detail": "Höchstens 120 Anfragen je Minute und Schlüssel. Bitte die Antwort Retry-After abwarten.",
                  "status": 429,
                  "instance": "urn:nuvaface:request:3f2a6c1e-0000-4000-8000-000000000099",
                  "requestId": "3f2a6c1e-0000-4000-8000-000000000099",
                  "retryAfter": 17
                }
              }
            },
            "description": "Zu viele Anfragen (Kopf Retry-After) oder Tagesgrenze der Patientendatensätze erreicht (DAILY_PATIENT_LIMIT)"
          },
          "503": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "code": "UNAVAILABLE",
                  "type": "https://nuvaface-practice.com/api/public/docs#fehler-unavailable",
                  "title": "Vorübergehend nicht verfügbar",
                  "detail": "Die Schnittstelle ist vorübergehend nicht verfügbar.",
                  "status": 503,
                  "instance": "urn:nuvaface:request:3f2a6c1e-0000-4000-8000-000000000099",
                  "requestId": "3f2a6c1e-0000-4000-8000-000000000099",
                  "retryAfter": 30
                }
              }
            },
            "description": "Prüfung vorübergehend gestört oder (beim Upload) Server ausgelastet; Kopf Retry-After abwarten"
          }
        },
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "required": true
          }
        ],
        "description": "Scope: consents.read. Der Stand an der Akte, wie NuvaFace ihn in der Akte zeigt. Für eine einzelne Terminerinnerung kann zusätzlich eine jüngere Angabe am Termin gelten (das Häkchen bei der Online-Buchung dieses Termins geht der Akte vor, bis es in die Akte übernommen ist); sie erscheint hier nicht. Der Abruf ändert nichts an der Akte. Ob die Praxis tatsächlich erinnert, hängt zusätzlich von ihren Einstellungen ab. Zählt 1 auf die Tagesgrenze.",
        "operationId": "einwilligungenLesen",
        "x-nuvaface-scopes": [
          "consents.read"
        ]
      }
    },
    "/patients/by-code/{code}": {
      "get": {
        "tags": [
          "Patienten"
        ],
        "summary": "Patient zum Patientencode des Bogens",
        "security": [
          {
            "apiKey": []
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PatientCode"
                },
                "example": {
                  "id": "3f2a6c1e-0000-4000-8000-000000000001",
                  "age": 34,
                  "code": "7K3M-Q9TB-9",
                  "gender": "female",
                  "birthYear": 1992
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "code": "PATIENT_CODE_INVALID",
                  "type": "https://nuvaface-practice.com/api/public/docs#fehler-patient-code-invalid",
                  "title": "Patientencode ungültig",
                  "detail": "Der Patientencode ist ungültig: 8 Zeichen und ein Prüfzeichen, zum Beispiel ABCD-EFGH-K. Bitte vom Bogen erneut abschreiben.",
                  "status": 400,
                  "instance": "urn:nuvaface:request:3f2a6c1e-0000-4000-8000-000000000099",
                  "requestId": "3f2a6c1e-0000-4000-8000-000000000099"
                }
              }
            },
            "description": "PATIENT_CODE_INVALID: Format oder Prüfzeichen falsch"
          },
          "401": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "code": "TOKEN_INVALID",
                  "type": "https://nuvaface-practice.com/api/public/docs#fehler-token-invalid",
                  "title": "Zugang ungültig",
                  "detail": "Der Schlüssel ist unbekannt, abgelaufen oder widerrufen.",
                  "status": 401,
                  "instance": "urn:nuvaface:request:3f2a6c1e-0000-4000-8000-000000000099",
                  "requestId": "3f2a6c1e-0000-4000-8000-000000000099"
                }
              }
            },
            "description": "Nicht angemeldet oder Schlüssel ungültig"
          },
          "403": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "code": "INSUFFICIENT_SCOPE",
                  "type": "https://nuvaface-practice.com/api/public/docs#fehler-insufficient-scope",
                  "title": "Berechtigung fehlt",
                  "detail": "Dieser Schlüssel hat den nötigen Scope nicht. Die Praxisinhaberin kann einen Schlüssel mit diesem Recht in NuvaFace unter Einstellungen, Schnittstellen anlegen.",
                  "status": 403,
                  "instance": "urn:nuvaface:request:3f2a6c1e-0000-4000-8000-000000000099",
                  "requestId": "3f2a6c1e-0000-4000-8000-000000000099"
                }
              }
            },
            "description": "Scope fehlt, Schnittstelle nicht freigeschaltet oder Praxis gesperrt (code nennt den Grund)"
          },
          "404": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "code": "NOT_FOUND",
                  "type": "https://nuvaface-practice.com/api/public/docs#fehler-not-found",
                  "title": "Nicht gefunden",
                  "detail": "Patient nicht gefunden.",
                  "status": 404,
                  "instance": "urn:nuvaface:request:3f2a6c1e-0000-4000-8000-000000000099",
                  "requestId": "3f2a6c1e-0000-4000-8000-000000000099"
                }
              }
            },
            "description": "Patient nicht gefunden"
          },
          "429": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "code": "RATE_LIMITED",
                  "type": "https://nuvaface-practice.com/api/public/docs#fehler-rate-limited",
                  "title": "Zu viele Anfragen",
                  "detail": "Höchstens 120 Anfragen je Minute und Schlüssel. Bitte die Antwort Retry-After abwarten.",
                  "status": 429,
                  "instance": "urn:nuvaface:request:3f2a6c1e-0000-4000-8000-000000000099",
                  "requestId": "3f2a6c1e-0000-4000-8000-000000000099",
                  "retryAfter": 17
                }
              }
            },
            "description": "Zu viele Anfragen (Kopf Retry-After) oder Tagesgrenze der Patientendatensätze erreicht (DAILY_PATIENT_LIMIT)"
          },
          "503": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "code": "UNAVAILABLE",
                  "type": "https://nuvaface-practice.com/api/public/docs#fehler-unavailable",
                  "title": "Vorübergehend nicht verfügbar",
                  "detail": "Die Schnittstelle ist vorübergehend nicht verfügbar.",
                  "status": 503,
                  "instance": "urn:nuvaface:request:3f2a6c1e-0000-4000-8000-000000000099",
                  "requestId": "3f2a6c1e-0000-4000-8000-000000000099",
                  "retryAfter": 30
                }
              }
            },
            "description": "Prüfung vorübergehend gestört oder (beim Upload) Server ausgelastet; Kopf Retry-After abwarten"
          }
        },
        "parameters": [
          {
            "in": "path",
            "name": "code",
            "schema": {
              "type": "string",
              "pattern": "^[0-9A-Za-z -]{9,40}$",
              "maxLength": 40,
              "minLength": 9
            },
            "required": true,
            "description": "Patientencode vom Bogen: 8 Zeichen und ein Prüfzeichen, z. B. 7K3M-Q9TB-9. Groß- und Kleinschreibung, Bindestriche und Leerzeichen sind gleich; O gilt als 0, I und L als 1."
          }
        ],
        "description": "Scope: patients.read oder patients.read.basic. Liefert wie der Basisabruf nur id, birthYear, age, gender, dazu code. Ein falsch abgeschriebener Code (jeder einzelne Tippfehler, jeder Dreher zweier Nachbarzeichen) ergibt 400 PATIENT_CODE_INVALID, ohne dass die Datenbank gefragt wird; ein gültiger Code, den es in dieser Praxis nicht gibt (auch: Akte eingeschränkt oder archiviert), 404. Ein Treffer zählt 1 auf die Tagesgrenze.",
        "operationId": "patientZuCode",
        "x-nuvaface-scopes": [
          "patients.read",
          "patients.read.basic"
        ]
      }
    },
    "/patients/{id}/documents": {
      "get": {
        "tags": [
          "Dokumente"
        ],
        "summary": "Dokumente einer Akte (nur Angaben, ohne Datei)",
        "security": [
          {
            "apiKey": []
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data",
                    "nextCursor"
                  ],
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/DokumentInfo"
                      }
                    },
                    "nextCursor": {
                      "type": [
                        "string",
                        "null"
                      ]
                    }
                  }
                },
                "example": {
                  "data": [
                    {
                      "id": "3f2a6c1e-0000-4000-8000-000000000031",
                      "name": "Messbericht 2026-12-01.pdf",
                      "size": 48213,
                      "type": "messbericht",
                      "source": "api",
                      "mimeType": "application/pdf",
                      "createdAt": "2026-12-01T10:05:00+01:00",
                      "patientId": "3f2a6c1e-0000-4000-8000-000000000001"
                    }
                  ],
                  "nextCursor": null
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "code": "VALIDATION",
                  "type": "https://nuvaface-practice.com/api/public/docs#fehler-validation",
                  "title": "Ungültige Anfrage",
                  "detail": "limit muss zwischen 1 und 100 liegen.",
                  "status": 400,
                  "instance": "urn:nuvaface:request:3f2a6c1e-0000-4000-8000-000000000099",
                  "requestId": "3f2a6c1e-0000-4000-8000-000000000099"
                }
              }
            },
            "description": "Ungültige Anfrage (auch: Schlüssel in der Adresse, ungültige Kennung, NUL-Zeichen)"
          },
          "401": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "code": "TOKEN_INVALID",
                  "type": "https://nuvaface-practice.com/api/public/docs#fehler-token-invalid",
                  "title": "Zugang ungültig",
                  "detail": "Der Schlüssel ist unbekannt, abgelaufen oder widerrufen.",
                  "status": 401,
                  "instance": "urn:nuvaface:request:3f2a6c1e-0000-4000-8000-000000000099",
                  "requestId": "3f2a6c1e-0000-4000-8000-000000000099"
                }
              }
            },
            "description": "Nicht angemeldet oder Schlüssel ungültig"
          },
          "403": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "code": "INSUFFICIENT_SCOPE",
                  "type": "https://nuvaface-practice.com/api/public/docs#fehler-insufficient-scope",
                  "title": "Berechtigung fehlt",
                  "detail": "Dieser Schlüssel hat den nötigen Scope nicht. Die Praxisinhaberin kann einen Schlüssel mit diesem Recht in NuvaFace unter Einstellungen, Schnittstellen anlegen.",
                  "status": 403,
                  "instance": "urn:nuvaface:request:3f2a6c1e-0000-4000-8000-000000000099",
                  "requestId": "3f2a6c1e-0000-4000-8000-000000000099"
                }
              }
            },
            "description": "Scope fehlt, Schnittstelle nicht freigeschaltet oder Praxis gesperrt (code nennt den Grund)"
          },
          "404": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "code": "NOT_FOUND",
                  "type": "https://nuvaface-practice.com/api/public/docs#fehler-not-found",
                  "title": "Nicht gefunden",
                  "detail": "Patient nicht gefunden.",
                  "status": 404,
                  "instance": "urn:nuvaface:request:3f2a6c1e-0000-4000-8000-000000000099",
                  "requestId": "3f2a6c1e-0000-4000-8000-000000000099"
                }
              }
            },
            "description": "Patient nicht gefunden"
          },
          "429": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "code": "RATE_LIMITED",
                  "type": "https://nuvaface-practice.com/api/public/docs#fehler-rate-limited",
                  "title": "Zu viele Anfragen",
                  "detail": "Höchstens 120 Anfragen je Minute und Schlüssel. Bitte die Antwort Retry-After abwarten.",
                  "status": 429,
                  "instance": "urn:nuvaface:request:3f2a6c1e-0000-4000-8000-000000000099",
                  "requestId": "3f2a6c1e-0000-4000-8000-000000000099",
                  "retryAfter": 17
                }
              }
            },
            "description": "Zu viele Anfragen (Kopf Retry-After) oder Tagesgrenze der Patientendatensätze erreicht (DAILY_PATIENT_LIMIT)"
          },
          "503": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "code": "UNAVAILABLE",
                  "type": "https://nuvaface-practice.com/api/public/docs#fehler-unavailable",
                  "title": "Vorübergehend nicht verfügbar",
                  "detail": "Die Schnittstelle ist vorübergehend nicht verfügbar.",
                  "status": 503,
                  "instance": "urn:nuvaface:request:3f2a6c1e-0000-4000-8000-000000000099",
                  "requestId": "3f2a6c1e-0000-4000-8000-000000000099",
                  "retryAfter": 30
                }
              }
            },
            "description": "Prüfung vorübergehend gestört oder (beim Upload) Server ausgelastet; Kopf Retry-After abwarten"
          }
        },
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "required": true
          },
          {
            "in": "query",
            "name": "limit",
            "schema": {
              "type": "integer",
              "default": 50,
              "maximum": 100,
              "minimum": 1
            }
          },
          {
            "in": "query",
            "name": "cursor",
            "schema": {
              "type": "string"
            },
            "description": "Wert nextCursor der vorigen Antwort, unverändert"
          }
        ],
        "description": "Scope: documents.read. Sichtbar sind über die Schnittstelle abgelegte Dokumente und Arten, die die Praxis ausdrücklich freigegeben hat; nie Einwilligungen, Bilder und Fotos, Anamnese oder Check-in-Formulare. Eine nicht leere Liste zählt 1 auf die Tagesgrenze.",
        "operationId": "dokumenteLesen",
        "x-nuvaface-scopes": [
          "documents.read"
        ]
      },
      "post": {
        "tags": [
          "Dokumente"
        ],
        "summary": "Dokument in die Akte legen (PDF, JPEG, PNG bis 10 MB)",
        "security": [
          {
            "apiKey": []
          }
        ],
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Dokument"
                },
                "example": {
                  "id": "3f2a6c1e-0000-4000-8000-000000000031",
                  "name": "Messbericht 2026-12-01.pdf",
                  "size": 184320,
                  "type": "messbericht",
                  "mimeType": "application/pdf",
                  "createdAt": "2026-12-01T10:42:00+01:00",
                  "patientId": "3f2a6c1e-0000-4000-8000-000000000001"
                }
              }
            },
            "description": "Abgelegt"
          },
          "400": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "code": "VALIDATION",
                  "type": "https://nuvaface-practice.com/api/public/docs#fehler-validation",
                  "title": "Ungültige Anfrage",
                  "detail": "Datei fehlt: multipart/form-data mit dem Feld file.",
                  "status": 400,
                  "instance": "urn:nuvaface:request:3f2a6c1e-0000-4000-8000-000000000099",
                  "requestId": "3f2a6c1e-0000-4000-8000-000000000099"
                }
              }
            },
            "description": "Ungültige Anfrage (auch: Schlüssel in der Adresse, ungültige Kennung, NUL-Zeichen)"
          },
          "401": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "code": "TOKEN_INVALID",
                  "type": "https://nuvaface-practice.com/api/public/docs#fehler-token-invalid",
                  "title": "Zugang ungültig",
                  "detail": "Der Schlüssel ist unbekannt, abgelaufen oder widerrufen.",
                  "status": 401,
                  "instance": "urn:nuvaface:request:3f2a6c1e-0000-4000-8000-000000000099",
                  "requestId": "3f2a6c1e-0000-4000-8000-000000000099"
                }
              }
            },
            "description": "Nicht angemeldet oder Schlüssel ungültig"
          },
          "403": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "code": "INSUFFICIENT_SCOPE",
                  "type": "https://nuvaface-practice.com/api/public/docs#fehler-insufficient-scope",
                  "title": "Berechtigung fehlt",
                  "detail": "Dieser Schlüssel hat den nötigen Scope nicht. Die Praxisinhaberin kann einen Schlüssel mit diesem Recht in NuvaFace unter Einstellungen, Schnittstellen anlegen.",
                  "status": 403,
                  "instance": "urn:nuvaface:request:3f2a6c1e-0000-4000-8000-000000000099",
                  "requestId": "3f2a6c1e-0000-4000-8000-000000000099"
                }
              }
            },
            "description": "Scope fehlt, Schnittstelle nicht freigeschaltet oder Praxis gesperrt (code nennt den Grund)"
          },
          "404": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "code": "NOT_FOUND",
                  "type": "https://nuvaface-practice.com/api/public/docs#fehler-not-found",
                  "title": "Nicht gefunden",
                  "detail": "Patient nicht gefunden.",
                  "status": 404,
                  "instance": "urn:nuvaface:request:3f2a6c1e-0000-4000-8000-000000000099",
                  "requestId": "3f2a6c1e-0000-4000-8000-000000000099"
                }
              }
            },
            "description": "Patient nicht gefunden"
          },
          "409": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "code": "IDEMPOTENCY_IN_PROGRESS",
                  "type": "https://nuvaface-practice.com/api/public/docs#fehler-idempotency-in-progress",
                  "title": "Anfrage läuft noch",
                  "detail": "Eine Anfrage mit diesem Idempotency-Key läuft noch. Bitte kurz warten und erneut senden.",
                  "status": 409,
                  "instance": "urn:nuvaface:request:3f2a6c1e-0000-4000-8000-000000000099",
                  "requestId": "3f2a6c1e-0000-4000-8000-000000000099",
                  "retryAfter": 2
                }
              }
            },
            "description": "Anfrage mit diesem Idempotency-Key läuft noch"
          },
          "413": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "code": "PAYLOAD_TOO_LARGE",
                  "type": "https://nuvaface-practice.com/api/public/docs#fehler-payload-too-large",
                  "title": "Datei zu groß",
                  "detail": "Höchstens 10 MB.",
                  "status": 413,
                  "instance": "urn:nuvaface:request:3f2a6c1e-0000-4000-8000-000000000099",
                  "requestId": "3f2a6c1e-0000-4000-8000-000000000099"
                }
              }
            },
            "description": "Zu groß"
          },
          "415": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "code": "UNSUPPORTED_MEDIA_TYPE",
                  "type": "https://nuvaface-practice.com/api/public/docs#fehler-unsupported-media-type",
                  "title": "Dateityp nicht erlaubt",
                  "detail": "Erlaubt sind PDF, JPEG und PNG (geprüft am Inhalt, nicht an der Endung).",
                  "status": 415,
                  "instance": "urn:nuvaface:request:3f2a6c1e-0000-4000-8000-000000000099",
                  "requestId": "3f2a6c1e-0000-4000-8000-000000000099"
                }
              }
            },
            "description": "Dateityp nicht erlaubt"
          },
          "422": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "code": "IDEMPOTENCY_MISMATCH",
                  "type": "https://nuvaface-practice.com/api/public/docs#fehler-idempotency-mismatch",
                  "title": "Idempotency-Key mit anderem Inhalt",
                  "detail": "Dieser Idempotency-Key wurde schon für eine andere Anfrage benutzt. Für jeden neuen Vorgang einen neuen Schlüssel nehmen.",
                  "status": 422,
                  "instance": "urn:nuvaface:request:3f2a6c1e-0000-4000-8000-000000000099",
                  "requestId": "3f2a6c1e-0000-4000-8000-000000000099"
                }
              }
            },
            "description": "Idempotency-Key mit anderem Inhalt"
          },
          "423": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "code": "RECORD_RESTRICTED",
                  "type": "https://nuvaface-practice.com/api/public/docs#fehler-record-restricted",
                  "title": "Akte eingeschränkt",
                  "detail": "Die Akte ist eingeschränkt (Art. 18 DSGVO). Es wird nichts abgelegt.",
                  "status": 423,
                  "instance": "urn:nuvaface:request:3f2a6c1e-0000-4000-8000-000000000099",
                  "requestId": "3f2a6c1e-0000-4000-8000-000000000099"
                }
              }
            },
            "description": "Akte eingeschränkt (RECORD_RESTRICTED), nichts abgelegt"
          },
          "429": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "code": "RATE_LIMITED",
                  "type": "https://nuvaface-practice.com/api/public/docs#fehler-rate-limited",
                  "title": "Zu viele Anfragen",
                  "detail": "Höchstens 120 Anfragen je Minute und Schlüssel. Bitte die Antwort Retry-After abwarten.",
                  "status": 429,
                  "instance": "urn:nuvaface:request:3f2a6c1e-0000-4000-8000-000000000099",
                  "requestId": "3f2a6c1e-0000-4000-8000-000000000099",
                  "retryAfter": 17
                }
              }
            },
            "description": "Zu viele Anfragen (Kopf Retry-After) oder Tagesgrenze der Patientendatensätze erreicht (DAILY_PATIENT_LIMIT)"
          },
          "503": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "code": "UNAVAILABLE",
                  "type": "https://nuvaface-practice.com/api/public/docs#fehler-unavailable",
                  "title": "Vorübergehend nicht verfügbar",
                  "detail": "Die Schnittstelle ist vorübergehend nicht verfügbar.",
                  "status": 503,
                  "instance": "urn:nuvaface:request:3f2a6c1e-0000-4000-8000-000000000099",
                  "requestId": "3f2a6c1e-0000-4000-8000-000000000099",
                  "retryAfter": 30
                }
              }
            },
            "description": "Prüfung vorübergehend gestört oder (beim Upload) Server ausgelastet; Kopf Retry-After abwarten"
          }
        },
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "required": true
          },
          {
            "in": "header",
            "name": "Idempotency-Key",
            "schema": {
              "type": "string",
              "pattern": "^[!-~]{1,255}$",
              "maxLength": 255,
              "minLength": 1
            },
            "required": false,
            "description": "Empfohlen: ein neuer Wert je Vorgang (z. B. UUID). Eine Wiederholung mit gleichem Wert und gleichem Inhalt legt nichts doppelt an (24 Stunden, Kopf Idempotent-Replayed: true). Anderer Inhalt ergibt 422, eine noch laufende Anfrage 409."
          }
        ],
        "description": "Scope: documents.write. Die Datei landet in der Akte, Reiter Dokumente, auf demselben Weg wie ein Upload in NuvaFace, mit Herkunft api, Schlüssel und SHA-256 im Protokoll. Der Dateityp wird an den ersten Bytes geprüft, nicht an Endung oder Kopf. Höchstens 30 schreibende Anfragen je Minute und höchstens 2 gleichzeitige Uploads je Praxis (über alle Schlüssel und Uploads in NuvaFace zusammen); darüber 429 RATE_LIMITED mit Retry-After. Nimmt der Server insgesamt schon die höchste Zahl gleichzeitiger Uploads entgegen, 503 UNAVAILABLE mit Retry-After. Ein Upload, dessen Rumpf nach 60 Sekunden nicht vollständig angekommen ist, wird abgebrochen.",
        "operationId": "dokumentAblegen",
        "requestBody": {
          "content": {
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "required": [
                  "file"
                ],
                "properties": {
                  "file": {
                    "type": "string",
                    "description": "PDF, JPEG oder PNG, eine Datei",
                    "contentMediaType": "application/octet-stream"
                  },
                  "type": {
                    "enum": [
                      "report",
                      "consent",
                      "prescription",
                      "image",
                      "document",
                      "other",
                      "messbericht"
                    ],
                    "type": "string",
                    "default": "document",
                    "description": "Art in der Akte: report (Befund), consent (Einwilligung), prescription (Rezept), image (Bild), document (Dokument), other (Sonstiges), messbericht (Messbericht)"
                  },
                  "title": {
                    "type": "string",
                    "maxLength": 80,
                    "description": "Name in der Akte, z. B. Messbericht Hautanalyse"
                  },
                  "documentDate": {
                    "type": "string",
                    "format": "date",
                    "description": "Datum des Dokuments (steht in den Metadaten)"
                  }
                }
              }
            }
          },
          "required": true
        },
        "x-nuvaface-scopes": [
          "documents.write"
        ]
      }
    },
    "/appointments/{id}/cancel": {
      "post": {
        "tags": [
          "Termine"
        ],
        "summary": "Termin absagen",
        "security": [
          {
            "apiKey": []
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Termin"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "dryRun": {
                          "type": "boolean",
                          "const": true,
                          "description": "nur im Probelauf (dryRun=true): nichts gespeichert"
                        }
                      }
                    }
                  ]
                },
                "example": {
                  "id": "3f2a6c1e-0000-4000-8000-000000000031",
                  "end": "2026-12-02T15:30:00+01:00",
                  "type": "consultation",
                  "start": "2026-12-02T15:00:00+01:00",
                  "video": false,
                  "source": "api",
                  "status": "cancelled",
                  "createdAt": "2026-11-26T09:12:00+01:00",
                  "patientId": "3f2a6c1e-0000-4000-8000-000000000001",
                  "updatedAt": "2026-11-26T11:40:00+01:00",
                  "treatmentId": "3f2a6c1e-0000-4000-8000-000000000021",
                  "treatmentName": "Beratungsgespräch"
                }
              }
            },
            "description": "Abgesagt (Status cancelled)"
          },
          "400": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "code": "VALIDATION",
                  "type": "https://nuvaface-practice.com/api/public/docs#fehler-validation",
                  "title": "Ungültige Anfrage",
                  "detail": "limit muss zwischen 1 und 100 liegen.",
                  "status": 400,
                  "instance": "urn:nuvaface:request:3f2a6c1e-0000-4000-8000-000000000099",
                  "requestId": "3f2a6c1e-0000-4000-8000-000000000099"
                }
              }
            },
            "description": "Ungültige Anfrage (auch: Schlüssel in der Adresse, ungültige Kennung, NUL-Zeichen)"
          },
          "401": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "code": "TOKEN_INVALID",
                  "type": "https://nuvaface-practice.com/api/public/docs#fehler-token-invalid",
                  "title": "Zugang ungültig",
                  "detail": "Der Schlüssel ist unbekannt, abgelaufen oder widerrufen.",
                  "status": 401,
                  "instance": "urn:nuvaface:request:3f2a6c1e-0000-4000-8000-000000000099",
                  "requestId": "3f2a6c1e-0000-4000-8000-000000000099"
                }
              }
            },
            "description": "Nicht angemeldet oder Schlüssel ungültig"
          },
          "403": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "code": "INSUFFICIENT_SCOPE",
                  "type": "https://nuvaface-practice.com/api/public/docs#fehler-insufficient-scope",
                  "title": "Berechtigung fehlt",
                  "detail": "Dieser Schlüssel hat den nötigen Scope nicht. Die Praxisinhaberin kann einen Schlüssel mit diesem Recht in NuvaFace unter Einstellungen, Schnittstellen anlegen.",
                  "status": 403,
                  "instance": "urn:nuvaface:request:3f2a6c1e-0000-4000-8000-000000000099",
                  "requestId": "3f2a6c1e-0000-4000-8000-000000000099"
                }
              }
            },
            "description": "Scope fehlt, Schnittstelle nicht freigeschaltet oder Praxis gesperrt (code nennt den Grund)"
          },
          "404": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "code": "NOT_FOUND",
                  "type": "https://nuvaface-practice.com/api/public/docs#fehler-not-found",
                  "title": "Nicht gefunden",
                  "detail": "Termin nicht gefunden.",
                  "status": 404,
                  "instance": "urn:nuvaface:request:3f2a6c1e-0000-4000-8000-000000000099",
                  "requestId": "3f2a6c1e-0000-4000-8000-000000000099"
                }
              }
            },
            "description": "Termin nicht gefunden"
          },
          "409": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "code": "STATE_CONFLICT",
                  "type": "https://nuvaface-practice.com/api/public/docs#fehler-state-conflict",
                  "title": "Im aktuellen Zustand nicht möglich",
                  "detail": "Ein Termin im Status cancelled wird nicht abgesagt.",
                  "reason": "cancelled",
                  "status": 409,
                  "instance": "urn:nuvaface:request:3f2a6c1e-0000-4000-8000-000000000099",
                  "requestId": "3f2a6c1e-0000-4000-8000-000000000099"
                }
              }
            },
            "description": "STATE_CONFLICT mit reason, oder Anfrage mit diesem Idempotency-Key läuft noch"
          },
          "413": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "code": "PAYLOAD_TOO_LARGE",
                  "type": "https://nuvaface-practice.com/api/public/docs#fehler-payload-too-large",
                  "title": "Datei zu groß",
                  "detail": "Der Rumpf ist zu groß (höchstens 100 KB).",
                  "status": 413,
                  "instance": "urn:nuvaface:request:3f2a6c1e-0000-4000-8000-000000000099",
                  "requestId": "3f2a6c1e-0000-4000-8000-000000000099"
                }
              }
            },
            "description": "Rumpf größer als 100 KB (PAYLOAD_TOO_LARGE)"
          },
          "415": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "code": "UNSUPPORTED_MEDIA_TYPE",
                  "type": "https://nuvaface-practice.com/api/public/docs#fehler-unsupported-media-type",
                  "title": "Dateityp nicht erlaubt",
                  "detail": "Bitte den Rumpf als application/json senden.",
                  "status": 415,
                  "instance": "urn:nuvaface:request:3f2a6c1e-0000-4000-8000-000000000099",
                  "requestId": "3f2a6c1e-0000-4000-8000-000000000099"
                }
              }
            },
            "description": "Rumpf nicht als JSON gekennzeichnet oder mit nicht unterstützter Kodierung (UNSUPPORTED_MEDIA_TYPE)"
          },
          "422": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "code": "IDEMPOTENCY_MISMATCH",
                  "type": "https://nuvaface-practice.com/api/public/docs#fehler-idempotency-mismatch",
                  "title": "Idempotency-Key mit anderem Inhalt",
                  "detail": "Dieser Idempotency-Key wurde schon für eine andere Anfrage benutzt.",
                  "status": 422,
                  "instance": "urn:nuvaface:request:3f2a6c1e-0000-4000-8000-000000000099",
                  "requestId": "3f2a6c1e-0000-4000-8000-000000000099"
                }
              }
            },
            "description": "Idempotency-Key mit anderem Inhalt"
          },
          "423": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "code": "RECORD_RESTRICTED",
                  "type": "https://nuvaface-practice.com/api/public/docs#fehler-record-restricted",
                  "title": "Akte eingeschränkt",
                  "detail": "Die Akte ist eingeschränkt (Art. 18 DSGVO). Der Termin wird über die Schnittstelle nicht geändert.",
                  "status": 423,
                  "instance": "urn:nuvaface:request:3f2a6c1e-0000-4000-8000-000000000099",
                  "requestId": "3f2a6c1e-0000-4000-8000-000000000099"
                }
              }
            },
            "description": "Akte eingeschränkt, nichts geändert"
          },
          "429": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "code": "RATE_LIMITED",
                  "type": "https://nuvaface-practice.com/api/public/docs#fehler-rate-limited",
                  "title": "Zu viele Anfragen",
                  "detail": "Höchstens 120 Anfragen je Minute und Schlüssel. Bitte die Antwort Retry-After abwarten.",
                  "status": 429,
                  "instance": "urn:nuvaface:request:3f2a6c1e-0000-4000-8000-000000000099",
                  "requestId": "3f2a6c1e-0000-4000-8000-000000000099",
                  "retryAfter": 17
                }
              }
            },
            "description": "Zu viele Anfragen (Kopf Retry-After) oder Tagesgrenze der Patientendatensätze erreicht (DAILY_PATIENT_LIMIT)"
          },
          "503": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "code": "UNAVAILABLE",
                  "type": "https://nuvaface-practice.com/api/public/docs#fehler-unavailable",
                  "title": "Vorübergehend nicht verfügbar",
                  "detail": "Die Schnittstelle ist vorübergehend nicht verfügbar.",
                  "status": 503,
                  "instance": "urn:nuvaface:request:3f2a6c1e-0000-4000-8000-000000000099",
                  "requestId": "3f2a6c1e-0000-4000-8000-000000000099",
                  "retryAfter": 30
                }
              }
            },
            "description": "Prüfung vorübergehend gestört oder (beim Upload) Server ausgelastet; Kopf Retry-After abwarten"
          }
        },
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "required": true
          },
          {
            "in": "header",
            "name": "Idempotency-Key",
            "schema": {
              "type": "string",
              "pattern": "^[!-~]{1,255}$",
              "maxLength": 255,
              "minLength": 1
            },
            "required": false,
            "description": "Empfohlen: ein neuer Wert je Vorgang (z. B. UUID). Eine Wiederholung mit gleichem Wert und gleichem Inhalt legt nichts doppelt an (24 Stunden, Kopf Idempotent-Replayed: true). Anderer Inhalt ergibt 422, eine noch laufende Anfrage 409."
          },
          {
            "in": "query",
            "name": "dryRun",
            "schema": {
              "type": "boolean",
              "default": false
            },
            "required": false,
            "description": "true: alles prüfen und rechnen, aber nichts speichern und kein Ereignis auslösen. Antwort 200 mit dryRun: true und dem Ergebnis, das entstanden wäre (Kennungen eines Probelaufs gibt es danach nicht). Ein Idempotency-Key wird im Probelauf nicht verbraucht."
          }
        ],
        "description": "Scope: appointments.write. Nur künftige Termine im Status pending, confirmed oder scheduled (sonst 409 STATE_CONFLICT mit reason). reason ist Pflicht (1 bis 300 Zeichen) und steht für die Praxis in der Terminnotiz; bitte keine Gesundheitsangaben hineinschreiben. Die Schnittstelle benachrichtigt den Patienten nicht (das macht die Praxis auf ihrem Weg), legt keine Rechnung an und löst kein Ausfallhonorar aus. Eine offene Anfrage im Buchungseingang wird mit abgesagt.",
        "operationId": "terminAbsagen",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "reason"
                ],
                "properties": {
                  "reason": {
                    "type": "string",
                    "pattern": "^[^\\u0000-\\u0008\\u000b\\u000c\\u000e-\\u001f\\u007f]*[^\\s\\u0000-\\u001f\\u007f][^\\u0000-\\u0008\\u000b\\u000c\\u000e-\\u001f\\u007f]*$",
                    "maxLength": 300,
                    "minLength": 1,
                    "description": "Grund der Absage, ohne Gesundheitsangaben"
                  }
                },
                "additionalProperties": false
              },
              "example": {
                "reason": "Patient hat telefonisch abgesagt"
              }
            }
          },
          "required": true
        },
        "x-nuvaface-scopes": [
          "appointments.write"
        ]
      }
    },
    "/measurement-schemas/{id}": {
      "get": {
        "tags": [
          "Messwerte"
        ],
        "summary": "Eine Fassung eines Messschemas",
        "security": [
          {
            "apiKey": []
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Messschema"
                },
                "example": {
                  "id": "3f2a6c1e-0000-4000-8000-000000000081",
                  "key": "performance_analysis",
                  "name": "Performance Analysis",
                  "active": true,
                  "fields": [
                    {
                      "key": "groesse",
                      "max": 250,
                      "min": 50,
                      "typ": "zahl",
                      "ucum": "cm",
                      "label": "Größe",
                      "gruppe": "Körperdaten",
                      "einheit": "cm",
                      "pflicht": true
                    },
                    {
                      "key": "gewicht",
                      "max": 400,
                      "min": 20,
                      "typ": "zahl",
                      "ucum": "kg",
                      "label": "Gewicht",
                      "gruppe": "Körperdaten",
                      "einheit": "kg",
                      "pflicht": true
                    },
                    {
                      "key": "blutdruck",
                      "typ": "wertepaar",
                      "paar": [
                        {
                          "max": 300,
                          "min": 50,
                          "label": "systolisch"
                        },
                        {
                          "max": 200,
                          "min": 20,
                          "label": "diastolisch"
                        }
                      ],
                      "ucum": "mm[Hg]",
                      "label": "Blutdruck",
                      "gruppe": "Vitalwerte",
                      "einheit": "mmHg",
                      "ersterGroesser": true
                    },
                    {
                      "key": "raucherstatus",
                      "typ": "auswahl",
                      "label": "Raucherstatus",
                      "gruppe": "Lebensstil",
                      "optionen": [
                        {
                          "wert": "nie",
                          "label": "Nie"
                        },
                        {
                          "wert": "raucher",
                          "label": "Raucher"
                        }
                      ]
                    },
                    {
                      "key": "schlafqualitaet",
                      "max": 10,
                      "min": 1,
                      "typ": "skala",
                      "label": "Schlafqualität",
                      "gruppe": "Wohlbefinden",
                      "skalaText": {
                        "max": "Sehr gut",
                        "min": "Schlecht"
                      }
                    },
                    {
                      "key": "anliegen_bereiche",
                      "typ": "mehrfachauswahl",
                      "label": "Welcher Bereich stört derzeit am meisten?",
                      "gruppe": "Aktuelle Anliegen",
                      "optionen": [
                        {
                          "wert": "schlaf",
                          "label": "Schlaf"
                        },
                        {
                          "wert": "stress",
                          "label": "Stress"
                        },
                        {
                          "wert": "erholung",
                          "label": "Erholung"
                        }
                      ],
                      "maxAuswahl": 3
                    },
                    {
                      "key": "anliegen",
                      "typ": "text",
                      "label": "Anliegen (Freitext, auch \"Andere\")",
                      "gruppe": "Aktuelle Anliegen",
                      "maxLaenge": 500
                    }
                  ],
                  "version": 2,
                  "isLatest": true,
                  "template": "performance_analysis",
                  "createdAt": "2026-11-26T10:00:00+01:00",
                  "description": "Erfassungsbogen der Leistungsdiagnostik (Auszug: 7 von 26 Feldern).",
                  "deactivatedAt": null,
                  "latestVersion": 2
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "code": "VALIDATION",
                  "type": "https://nuvaface-practice.com/api/public/docs#fehler-validation",
                  "title": "Ungültige Anfrage",
                  "detail": "id ist keine gültige Kennung (UUID).",
                  "status": 400,
                  "instance": "urn:nuvaface:request:3f2a6c1e-0000-4000-8000-000000000099",
                  "requestId": "3f2a6c1e-0000-4000-8000-000000000099"
                }
              }
            },
            "description": "Ungültige Anfrage (auch: Schlüssel in der Adresse, ungültige Kennung, NUL-Zeichen)"
          },
          "401": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "code": "TOKEN_INVALID",
                  "type": "https://nuvaface-practice.com/api/public/docs#fehler-token-invalid",
                  "title": "Zugang ungültig",
                  "detail": "Der Schlüssel ist unbekannt, abgelaufen oder widerrufen.",
                  "status": 401,
                  "instance": "urn:nuvaface:request:3f2a6c1e-0000-4000-8000-000000000099",
                  "requestId": "3f2a6c1e-0000-4000-8000-000000000099"
                }
              }
            },
            "description": "Nicht angemeldet oder Schlüssel ungültig"
          },
          "403": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "code": "INSUFFICIENT_SCOPE",
                  "type": "https://nuvaface-practice.com/api/public/docs#fehler-insufficient-scope",
                  "title": "Berechtigung fehlt",
                  "detail": "Dieser Schlüssel hat den nötigen Scope nicht. Die Praxisinhaberin kann einen Schlüssel mit diesem Recht in NuvaFace unter Einstellungen, Schnittstellen anlegen.",
                  "status": 403,
                  "instance": "urn:nuvaface:request:3f2a6c1e-0000-4000-8000-000000000099",
                  "requestId": "3f2a6c1e-0000-4000-8000-000000000099"
                }
              }
            },
            "description": "Scope fehlt, Schnittstelle nicht freigeschaltet oder Praxis gesperrt (code nennt den Grund)"
          },
          "404": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "code": "NOT_FOUND",
                  "type": "https://nuvaface-practice.com/api/public/docs#fehler-not-found",
                  "title": "Nicht gefunden",
                  "detail": "Messschema nicht gefunden.",
                  "status": 404,
                  "instance": "urn:nuvaface:request:3f2a6c1e-0000-4000-8000-000000000099",
                  "requestId": "3f2a6c1e-0000-4000-8000-000000000099"
                }
              }
            },
            "description": "Messschema nicht gefunden"
          },
          "429": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "code": "RATE_LIMITED",
                  "type": "https://nuvaface-practice.com/api/public/docs#fehler-rate-limited",
                  "title": "Zu viele Anfragen",
                  "detail": "Höchstens 120 Anfragen je Minute und Schlüssel. Bitte die Antwort Retry-After abwarten.",
                  "status": 429,
                  "instance": "urn:nuvaface:request:3f2a6c1e-0000-4000-8000-000000000099",
                  "requestId": "3f2a6c1e-0000-4000-8000-000000000099",
                  "retryAfter": 17
                }
              }
            },
            "description": "Zu viele Anfragen (Kopf Retry-After) oder Tagesgrenze der Patientendatensätze erreicht (DAILY_PATIENT_LIMIT)"
          },
          "503": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "code": "UNAVAILABLE",
                  "type": "https://nuvaface-practice.com/api/public/docs#fehler-unavailable",
                  "title": "Vorübergehend nicht verfügbar",
                  "detail": "Die Schnittstelle ist vorübergehend nicht verfügbar.",
                  "status": 503,
                  "instance": "urn:nuvaface:request:3f2a6c1e-0000-4000-8000-000000000099",
                  "requestId": "3f2a6c1e-0000-4000-8000-000000000099",
                  "retryAfter": 30
                }
              }
            },
            "description": "Prüfung vorübergehend gestört oder (beim Upload) Server ausgelastet; Kopf Retry-After abwarten"
          }
        },
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "required": true
          }
        ],
        "description": "Scope: measurements.read oder measurements.write. Jede Fassung bleibt lesbar, auch ältere und deaktivierte; eine Messreihe nennt die Fassung, mit der gemessen wurde.",
        "operationId": "messschemaLesen",
        "x-nuvaface-scopes": [
          "measurements.read",
          "measurements.write"
        ]
      }
    },
    "/patients/{id}/measurements": {
      "get": {
        "tags": [
          "Messwerte"
        ],
        "summary": "Messreihen einer Akte",
        "security": [
          {
            "apiKey": []
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data",
                    "nextCursor"
                  ],
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Messreihe"
                      }
                    },
                    "nextCursor": {
                      "type": [
                        "string",
                        "null"
                      ]
                    }
                  }
                },
                "example": {
                  "data": [
                    {
                      "id": "3f2a6c1e-0000-4000-8000-000000000091",
                      "schema": {
                        "id": "3f2a6c1e-0000-4000-8000-000000000081",
                        "key": "performance_analysis",
                        "name": "Performance Analysis",
                        "version": 2
                      },
                      "source": "api",
                      "values": {
                        "gewicht": 78.4,
                        "groesse": 182.5,
                        "anliegen": "Mehr Energie am Nachmittag",
                        "blutdruck": [
                          124,
                          78
                        ],
                        "raucherstatus": "nie",
                        "schlafqualitaet": 7,
                        "anliegen_bereiche": [
                          "schlaf",
                          "stress"
                        ]
                      },
                      "createdAt": "2026-12-01T08:16:02+01:00",
                      "patientId": "3f2a6c1e-0000-4000-8000-000000000001",
                      "documentId": "3f2a6c1e-0000-4000-8000-000000000031",
                      "measuredAt": "2026-12-01T08:15:00+01:00",
                      "replacesId": null,
                      "replacedById": null,
                      "appointmentId": "3f2a6c1e-0000-4000-8000-000000000011",
                      "correctionReason": null
                    }
                  ],
                  "nextCursor": null
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "code": "VALIDATION",
                  "type": "https://nuvaface-practice.com/api/public/docs#fehler-validation",
                  "title": "Ungültige Anfrage",
                  "detail": "limit muss zwischen 1 und 100 liegen.",
                  "status": 400,
                  "instance": "urn:nuvaface:request:3f2a6c1e-0000-4000-8000-000000000099",
                  "requestId": "3f2a6c1e-0000-4000-8000-000000000099"
                }
              }
            },
            "description": "Ungültige Anfrage (auch: Schlüssel in der Adresse, ungültige Kennung, NUL-Zeichen)"
          },
          "401": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "code": "TOKEN_INVALID",
                  "type": "https://nuvaface-practice.com/api/public/docs#fehler-token-invalid",
                  "title": "Zugang ungültig",
                  "detail": "Der Schlüssel ist unbekannt, abgelaufen oder widerrufen.",
                  "status": 401,
                  "instance": "urn:nuvaface:request:3f2a6c1e-0000-4000-8000-000000000099",
                  "requestId": "3f2a6c1e-0000-4000-8000-000000000099"
                }
              }
            },
            "description": "Nicht angemeldet oder Schlüssel ungültig"
          },
          "403": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "code": "INSUFFICIENT_SCOPE",
                  "type": "https://nuvaface-practice.com/api/public/docs#fehler-insufficient-scope",
                  "title": "Berechtigung fehlt",
                  "detail": "Dieser Schlüssel hat den nötigen Scope nicht. Die Praxisinhaberin kann einen Schlüssel mit diesem Recht in NuvaFace unter Einstellungen, Schnittstellen anlegen.",
                  "status": 403,
                  "instance": "urn:nuvaface:request:3f2a6c1e-0000-4000-8000-000000000099",
                  "requestId": "3f2a6c1e-0000-4000-8000-000000000099"
                }
              }
            },
            "description": "Scope fehlt, Schnittstelle nicht freigeschaltet oder Praxis gesperrt (code nennt den Grund)"
          },
          "404": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "code": "NOT_FOUND",
                  "type": "https://nuvaface-practice.com/api/public/docs#fehler-not-found",
                  "title": "Nicht gefunden",
                  "detail": "Patient nicht gefunden.",
                  "status": 404,
                  "instance": "urn:nuvaface:request:3f2a6c1e-0000-4000-8000-000000000099",
                  "requestId": "3f2a6c1e-0000-4000-8000-000000000099"
                }
              }
            },
            "description": "Akte oder Messschema nicht gefunden"
          },
          "429": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "code": "RATE_LIMITED",
                  "type": "https://nuvaface-practice.com/api/public/docs#fehler-rate-limited",
                  "title": "Zu viele Anfragen",
                  "detail": "Höchstens 120 Anfragen je Minute und Schlüssel. Bitte die Antwort Retry-After abwarten.",
                  "status": 429,
                  "instance": "urn:nuvaface:request:3f2a6c1e-0000-4000-8000-000000000099",
                  "requestId": "3f2a6c1e-0000-4000-8000-000000000099",
                  "retryAfter": 17
                }
              }
            },
            "description": "Zu viele Anfragen (Kopf Retry-After) oder Tagesgrenze der Patientendatensätze erreicht (DAILY_PATIENT_LIMIT)"
          },
          "503": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "code": "UNAVAILABLE",
                  "type": "https://nuvaface-practice.com/api/public/docs#fehler-unavailable",
                  "title": "Vorübergehend nicht verfügbar",
                  "detail": "Die Schnittstelle ist vorübergehend nicht verfügbar.",
                  "status": 503,
                  "instance": "urn:nuvaface:request:3f2a6c1e-0000-4000-8000-000000000099",
                  "requestId": "3f2a6c1e-0000-4000-8000-000000000099",
                  "retryAfter": 30
                }
              }
            },
            "description": "Prüfung vorübergehend gestört oder (beim Upload) Server ausgelastet; Kopf Retry-After abwarten"
          }
        },
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "required": true
          },
          {
            "in": "query",
            "name": "schemaId",
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "nur diese Fassung"
          },
          {
            "in": "query",
            "name": "schemaKey",
            "schema": {
              "type": "string",
              "pattern": "^[a-z][a-z0-9_]{1,59}$"
            },
            "description": "nur dieses Schema (alle Fassungen)"
          },
          {
            "in": "query",
            "name": "from",
            "schema": {
              "type": "string"
            },
            "description": "ab diesem Tag (JJJJ-MM-TT, Praxiszeit) oder Zeitpunkt"
          },
          {
            "in": "query",
            "name": "to",
            "schema": {
              "type": "string"
            },
            "description": "bis einschließlich diesem Tag (JJJJ-MM-TT, Praxiszeit) oder Zeitpunkt"
          },
          {
            "in": "query",
            "name": "onlyCurrent",
            "schema": {
              "type": "boolean",
              "default": false
            },
            "description": "true: korrigierte Messreihen auslassen"
          },
          {
            "in": "query",
            "name": "limit",
            "schema": {
              "type": "integer",
              "default": 50,
              "maximum": 100,
              "minimum": 1
            }
          },
          {
            "in": "query",
            "name": "cursor",
            "schema": {
              "type": "string"
            },
            "description": "Wert nextCursor der vorigen Antwort, unverändert"
          }
        ],
        "description": "Scope: measurements.read. Neueste zuerst. Korrigierte Messreihen tragen replacedById (mit onlyCurrent=true ausgelassen). Zählt 1 auf die Tagesgrenze.",
        "operationId": "messreihenLesen",
        "x-nuvaface-scopes": [
          "measurements.read"
        ]
      },
      "post": {
        "tags": [
          "Messwerte"
        ],
        "summary": "Messreihe in eine Akte schreiben",
        "security": [
          {
            "apiKey": []
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Messreihe"
                    },
                    {
                      "type": "object",
                      "required": [
                        "dryRun"
                      ],
                      "properties": {
                        "dryRun": {
                          "type": "boolean",
                          "const": true,
                          "description": "Probelauf: nichts gespeichert"
                        }
                      }
                    }
                  ]
                },
                "example": {
                  "id": "3f2a6c1e-0000-4000-8000-000000000091",
                  "dryRun": true,
                  "schema": {
                    "id": "3f2a6c1e-0000-4000-8000-000000000081",
                    "key": "performance_analysis",
                    "name": "Performance Analysis",
                    "version": 2
                  },
                  "source": "api",
                  "values": {
                    "gewicht": 78.4,
                    "groesse": 182.5,
                    "anliegen": "Mehr Energie am Nachmittag",
                    "blutdruck": [
                      124,
                      78
                    ],
                    "raucherstatus": "nie",
                    "schlafqualitaet": 7,
                    "anliegen_bereiche": [
                      "schlaf",
                      "stress"
                    ]
                  },
                  "createdAt": "2026-12-01T08:16:02+01:00",
                  "patientId": "3f2a6c1e-0000-4000-8000-000000000001",
                  "documentId": "3f2a6c1e-0000-4000-8000-000000000031",
                  "measuredAt": "2026-12-01T08:15:00+01:00",
                  "replacesId": null,
                  "replacedById": null,
                  "appointmentId": "3f2a6c1e-0000-4000-8000-000000000011",
                  "correctionReason": null
                }
              }
            },
            "description": "Probelauf (dryRun=true): geprüft, nichts gespeichert, Antwort mit dryRun: true"
          },
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Messreihe"
                },
                "example": {
                  "id": "3f2a6c1e-0000-4000-8000-000000000091",
                  "schema": {
                    "id": "3f2a6c1e-0000-4000-8000-000000000081",
                    "key": "performance_analysis",
                    "name": "Performance Analysis",
                    "version": 2
                  },
                  "source": "api",
                  "values": {
                    "gewicht": 78.4,
                    "groesse": 182.5,
                    "anliegen": "Mehr Energie am Nachmittag",
                    "blutdruck": [
                      124,
                      78
                    ],
                    "raucherstatus": "nie",
                    "schlafqualitaet": 7,
                    "anliegen_bereiche": [
                      "schlaf",
                      "stress"
                    ]
                  },
                  "createdAt": "2026-12-01T08:16:02+01:00",
                  "patientId": "3f2a6c1e-0000-4000-8000-000000000001",
                  "documentId": "3f2a6c1e-0000-4000-8000-000000000031",
                  "measuredAt": "2026-12-01T08:15:00+01:00",
                  "replacesId": null,
                  "replacedById": null,
                  "appointmentId": "3f2a6c1e-0000-4000-8000-000000000011",
                  "correctionReason": null
                }
              }
            },
            "description": "Angelegt"
          },
          "400": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "code": "VALIDATION",
                  "type": "https://nuvaface-practice.com/api/public/docs#fehler-validation",
                  "title": "Ungültige Anfrage",
                  "detail": "Idempotency-Key fehlt. Für jede anlegende Anfrage einen neuen Wert senden (z. B. eine UUID je Vorgang).",
                  "status": 400,
                  "instance": "urn:nuvaface:request:3f2a6c1e-0000-4000-8000-000000000099",
                  "requestId": "3f2a6c1e-0000-4000-8000-000000000099"
                }
              }
            },
            "description": "Ungültige Anfrage (auch: Schlüssel in der Adresse, ungültige Kennung, NUL-Zeichen)"
          },
          "401": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "code": "TOKEN_INVALID",
                  "type": "https://nuvaface-practice.com/api/public/docs#fehler-token-invalid",
                  "title": "Zugang ungültig",
                  "detail": "Der Schlüssel ist unbekannt, abgelaufen oder widerrufen.",
                  "status": 401,
                  "instance": "urn:nuvaface:request:3f2a6c1e-0000-4000-8000-000000000099",
                  "requestId": "3f2a6c1e-0000-4000-8000-000000000099"
                }
              }
            },
            "description": "Nicht angemeldet oder Schlüssel ungültig"
          },
          "403": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "code": "INSUFFICIENT_SCOPE",
                  "type": "https://nuvaface-practice.com/api/public/docs#fehler-insufficient-scope",
                  "title": "Berechtigung fehlt",
                  "detail": "Dieser Schlüssel hat den nötigen Scope nicht. Die Praxisinhaberin kann einen Schlüssel mit diesem Recht in NuvaFace unter Einstellungen, Schnittstellen anlegen.",
                  "status": 403,
                  "instance": "urn:nuvaface:request:3f2a6c1e-0000-4000-8000-000000000099",
                  "requestId": "3f2a6c1e-0000-4000-8000-000000000099"
                }
              }
            },
            "description": "Scope fehlt, Schnittstelle nicht freigeschaltet oder Praxis gesperrt (code nennt den Grund)"
          },
          "404": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "code": "NOT_FOUND",
                  "type": "https://nuvaface-practice.com/api/public/docs#fehler-not-found",
                  "title": "Nicht gefunden",
                  "detail": "Termin nicht gefunden.",
                  "status": 404,
                  "instance": "urn:nuvaface:request:3f2a6c1e-0000-4000-8000-000000000099",
                  "requestId": "3f2a6c1e-0000-4000-8000-000000000099"
                }
              }
            },
            "description": "Akte, Messschema, Termin, Dokument oder zu korrigierende Messreihe nicht gefunden (auch: fremd, eingeschränkt beim Lesen, archiviert)"
          },
          "409": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "code": "SCHEMA_INACTIVE",
                  "type": "https://nuvaface-practice.com/api/public/docs#fehler-schema-inactive",
                  "title": "Messschema deaktiviert",
                  "detail": "Dieses Messschema ist deaktiviert. Neue Messreihen sind erst nach dem Aktivieren möglich.",
                  "status": 409,
                  "instance": "urn:nuvaface:request:3f2a6c1e-0000-4000-8000-000000000099",
                  "schemaId": "3f2a6c1e-0000-4000-8000-000000000081",
                  "requestId": "3f2a6c1e-0000-4000-8000-000000000099"
                }
              }
            },
            "description": "Messschema deaktiviert (SCHEMA_INACTIVE), Messreihe schon korrigiert (MEASUREMENT_REPLACED) oder Anfrage mit diesem Idempotency-Key läuft noch (IDEMPOTENCY_IN_PROGRESS)"
          },
          "413": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "code": "PAYLOAD_TOO_LARGE",
                  "type": "https://nuvaface-practice.com/api/public/docs#fehler-payload-too-large",
                  "title": "Datei zu groß",
                  "detail": "Der Rumpf ist zu groß (höchstens 100 KB).",
                  "status": 413,
                  "instance": "urn:nuvaface:request:3f2a6c1e-0000-4000-8000-000000000099",
                  "requestId": "3f2a6c1e-0000-4000-8000-000000000099"
                }
              }
            },
            "description": "Rumpf größer als 100 KB (PAYLOAD_TOO_LARGE)"
          },
          "415": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "code": "UNSUPPORTED_MEDIA_TYPE",
                  "type": "https://nuvaface-practice.com/api/public/docs#fehler-unsupported-media-type",
                  "title": "Dateityp nicht erlaubt",
                  "detail": "Bitte den Rumpf als application/json senden.",
                  "status": 415,
                  "instance": "urn:nuvaface:request:3f2a6c1e-0000-4000-8000-000000000099",
                  "requestId": "3f2a6c1e-0000-4000-8000-000000000099"
                }
              }
            },
            "description": "Rumpf nicht als JSON gekennzeichnet oder mit nicht unterstützter Kodierung (UNSUPPORTED_MEDIA_TYPE)"
          },
          "422": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "code": "MEASUREMENT_INVALID",
                  "type": "https://nuvaface-practice.com/api/public/docs#fehler-measurement-invalid",
                  "title": "Messwerte ungültig",
                  "detail": "Die Messwerte sind ungültig. Einzelheiten in errors.",
                  "errors": [
                    {
                      "max": 400,
                      "code": "max",
                      "field": "values.gewicht",
                      "detail": "Gewicht: höchstens 400 kg."
                    },
                    {
                      "code": "reihenfolge",
                      "field": "values.blutdruck",
                      "detail": "Blutdruck: systolisch muss größer sein als diastolisch."
                    },
                    {
                      "code": "unbekannt",
                      "field": "values.alter",
                      "detail": "Das Feld alter gibt es in diesem Messschema nicht."
                    }
                  ],
                  "status": 422,
                  "instance": "urn:nuvaface:request:3f2a6c1e-0000-4000-8000-000000000099",
                  "requestId": "3f2a6c1e-0000-4000-8000-000000000099"
                }
              }
            },
            "description": "Messwerte ungültig (MEASUREMENT_INVALID, Feldliste in errors) oder Idempotency-Key mit anderem Inhalt (IDEMPOTENCY_MISMATCH)"
          },
          "423": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "code": "RECORD_RESTRICTED",
                  "type": "https://nuvaface-practice.com/api/public/docs#fehler-record-restricted",
                  "title": "Akte eingeschränkt",
                  "detail": "Die Akte ist eingeschränkt (Art. 18 DSGVO). Es können keine Messwerte erfasst werden.",
                  "status": 423,
                  "instance": "urn:nuvaface:request:3f2a6c1e-0000-4000-8000-000000000099",
                  "requestId": "3f2a6c1e-0000-4000-8000-000000000099"
                }
              }
            },
            "description": "Akte eingeschränkt (Art. 18 DSGVO), nichts gespeichert"
          },
          "429": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "code": "RATE_LIMITED",
                  "type": "https://nuvaface-practice.com/api/public/docs#fehler-rate-limited",
                  "title": "Zu viele Anfragen",
                  "detail": "Höchstens 120 Anfragen je Minute und Schlüssel. Bitte die Antwort Retry-After abwarten.",
                  "status": 429,
                  "instance": "urn:nuvaface:request:3f2a6c1e-0000-4000-8000-000000000099",
                  "requestId": "3f2a6c1e-0000-4000-8000-000000000099",
                  "retryAfter": 17
                }
              }
            },
            "description": "Zu viele Anfragen (Kopf Retry-After) oder Tagesgrenze der Patientendatensätze erreicht (DAILY_PATIENT_LIMIT)"
          },
          "503": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                },
                "example": {
                  "code": "UNAVAILABLE",
                  "type": "https://nuvaface-practice.com/api/public/docs#fehler-unavailable",
                  "title": "Vorübergehend nicht verfügbar",
                  "detail": "Die Schnittstelle ist vorübergehend nicht verfügbar.",
                  "status": 503,
                  "instance": "urn:nuvaface:request:3f2a6c1e-0000-4000-8000-000000000099",
                  "requestId": "3f2a6c1e-0000-4000-8000-000000000099",
                  "retryAfter": 30
                }
              }
            },
            "description": "Prüfung vorübergehend gestört oder (beim Upload) Server ausgelastet; Kopf Retry-After abwarten"
          }
        },
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "required": true
          },
          {
            "in": "header",
            "name": "Idempotency-Key",
            "schema": {
              "type": "string",
              "pattern": "^[!-~]{1,255}$",
              "maxLength": 255,
              "minLength": 1
            },
            "required": false,
            "description": "Pflicht, außer im Probelauf (dryRun=true). ein neuer Wert je Vorgang (z. B. UUID), sonst 400. Eine Wiederholung mit gleichem Wert und gleichem Inhalt legt nichts doppelt an (24 Stunden, Kopf Idempotent-Replayed: true), auch dann nicht, wenn die erste Antwort den Aufrufer nie erreicht hat. Die Wiederholung gibt das angelegte Objekt nur wieder, wenn der Schlüssel es heute lesen darf (zum Beispiel patients.read für eine Akte, measurements.read für eine Messreihe), und zählt dann wie ein Lesen auf die Tagesgrenze; sonst enthält sie nur die Kennung des angelegten Objekts ({ id }). Anderer Inhalt ergibt 422, eine noch laufende Anfrage 409."
          },
          {
            "in": "query",
            "name": "dryRun",
            "schema": {
              "type": "boolean",
              "default": false
            },
            "required": false,
            "description": "true: alles prüfen und rechnen, aber nichts speichern und kein Ereignis auslösen. Antwort 200 mit dryRun: true und dem Ergebnis, das entstanden wäre (Kennungen eines Probelaufs gibt es danach nicht). Ein Idempotency-Key wird im Probelauf nicht verbraucht."
          }
        ],
        "description": "Scope: measurements.write. Eine Messreihe ist eine Untersuchung mit allen Werten eines Bogens nach einem Messschema der Praxis. Messreihen werden nie geändert oder gelöscht; eine Korrektur ist eine neue Messreihe mit replacesId und correctionReason. Quelle api und der Schlüssel stehen an der Messreihe. Löst measurement.created aus. Die Software bewertet nichts medizinisch.",
        "operationId": "messreiheAnlegen",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MessreiheNeu"
              },
              "example": {
                "values": {
                  "gewicht": 78.4,
                  "groesse": 182.5,
                  "anliegen": "Mehr Energie am Nachmittag",
                  "blutdruck": [
                    124,
                    78
                  ],
                  "raucherstatus": "nie",
                  "schlafqualitaet": 7,
                  "anliegen_bereiche": [
                    "schlaf",
                    "stress"
                  ]
                },
                "schemaKey": "performance_analysis",
                "documentId": "3f2a6c1e-0000-4000-8000-000000000031",
                "measuredAt": "2026-12-01T08:15:00+01:00",
                "appointmentId": "3f2a6c1e-0000-4000-8000-000000000011"
              }
            }
          },
          "required": true
        },
        "x-nuvaface-scopes": [
          "measurements.write"
        ]
      }
    }
  },
  "openapi": "3.1.0",
  "servers": [
    {
      "url": "https://nuvaface-practice.com/api/public/v1",
      "description": "Produktion"
    }
  ],
  "security": [
    {
      "apiKey": []
    }
  ],
  "webhooks": {
    "invoice.paid": {
      "post": {
        "summary": "Rechnung bezahlt (auch Ausfallhonorar und Schnellrechnung)",
        "responses": {
          "200": {
            "description": "Angenommen (jeder 2xx-Status)"
          }
        },
        "parameters": [
          {
            "in": "header",
            "name": "webhook-id",
            "schema": {
              "type": "string"
            },
            "required": true
          },
          {
            "in": "header",
            "name": "webhook-timestamp",
            "schema": {
              "type": "string"
            },
            "required": true
          },
          {
            "in": "header",
            "name": "webhook-signature",
            "schema": {
              "type": "string"
            },
            "required": true
          }
        ],
        "description": "Signiert nach Standard Webhooks: Kopfzeilen webhook-id, webhook-timestamp, webhook-signature (v1,Base64 HMAC-SHA256 über id.timestamp.rohkörper, Schlüssel = Base64-dekodierter Teil nach whsec_). Nutzdaten minimal (Kennungen, Zeiten, Status); Details mit der API abholen. Bei Termin-Ereignissen und Online-Buchungen geht die Kennung der Behandlung mit (treatmentId); zusammen mit dem Behandlungskatalog zeigt sie, welche Behandlung eine Person bekommt, und ist damit ein Gesundheitsdatum. Ereignisse eingeschränkter Akten werden nicht zugestellt. Antwort 2xx innerhalb von 10 Sekunden, sonst Wiederholung. Der Testknopf in NuvaFace sendet stattdessen type webhook.test mit data { webhookId, hinweis }; die Datenstruktur deshalb am Beispiel bzw. an einem echten Ereignis festlegen.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Ereignis_invoice_paid"
              },
              "example": {
                "data": {
                  "total": 190,
                  "number": "RE-2026-0042",
                  "paidAt": "2026-12-01T09:45:00Z",
                  "invoiceId": "3f2a6c1e-0000-4000-8000-000000000041",
                  "patientId": "3f2a6c1e-0000-4000-8000-000000000001",
                  "documentType": "invoice"
                },
                "type": "invoice.paid",
                "timestamp": "2026-11-26T09:12:00+01:00"
              }
            }
          }
        }
      }
    },
    "patient.created": {
      "post": {
        "summary": "Patient angelegt",
        "responses": {
          "200": {
            "description": "Angenommen (jeder 2xx-Status)"
          }
        },
        "parameters": [
          {
            "in": "header",
            "name": "webhook-id",
            "schema": {
              "type": "string"
            },
            "required": true
          },
          {
            "in": "header",
            "name": "webhook-timestamp",
            "schema": {
              "type": "string"
            },
            "required": true
          },
          {
            "in": "header",
            "name": "webhook-signature",
            "schema": {
              "type": "string"
            },
            "required": true
          }
        ],
        "description": "Signiert nach Standard Webhooks: Kopfzeilen webhook-id, webhook-timestamp, webhook-signature (v1,Base64 HMAC-SHA256 über id.timestamp.rohkörper, Schlüssel = Base64-dekodierter Teil nach whsec_). Nutzdaten minimal (Kennungen, Zeiten, Status); Details mit der API abholen. Bei Termin-Ereignissen und Online-Buchungen geht die Kennung der Behandlung mit (treatmentId); zusammen mit dem Behandlungskatalog zeigt sie, welche Behandlung eine Person bekommt, und ist damit ein Gesundheitsdatum. Ereignisse eingeschränkter Akten werden nicht zugestellt. Antwort 2xx innerhalb von 10 Sekunden, sonst Wiederholung. Der Testknopf in NuvaFace sendet stattdessen type webhook.test mit data { webhookId, hinweis }; die Datenstruktur deshalb am Beispiel bzw. an einem echten Ereignis festlegen.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Ereignis_patient_created"
              },
              "example": {
                "data": {
                  "patientId": "3f2a6c1e-0000-4000-8000-000000000001"
                },
                "type": "patient.created",
                "timestamp": "2026-11-26T09:12:00+01:00"
              }
            }
          }
        }
      }
    },
    "patient.updated": {
      "post": {
        "summary": "Stammdaten eines Patienten geändert (nur Kennung; nie für eingeschränkte oder archivierte Akten)",
        "responses": {
          "200": {
            "description": "Angenommen (jeder 2xx-Status)"
          }
        },
        "parameters": [
          {
            "in": "header",
            "name": "webhook-id",
            "schema": {
              "type": "string"
            },
            "required": true
          },
          {
            "in": "header",
            "name": "webhook-timestamp",
            "schema": {
              "type": "string"
            },
            "required": true
          },
          {
            "in": "header",
            "name": "webhook-signature",
            "schema": {
              "type": "string"
            },
            "required": true
          }
        ],
        "description": "Signiert nach Standard Webhooks: Kopfzeilen webhook-id, webhook-timestamp, webhook-signature (v1,Base64 HMAC-SHA256 über id.timestamp.rohkörper, Schlüssel = Base64-dekodierter Teil nach whsec_). Nutzdaten minimal (Kennungen, Zeiten, Status); Details mit der API abholen. Bei Termin-Ereignissen und Online-Buchungen geht die Kennung der Behandlung mit (treatmentId); zusammen mit dem Behandlungskatalog zeigt sie, welche Behandlung eine Person bekommt, und ist damit ein Gesundheitsdatum. Ereignisse eingeschränkter Akten werden nicht zugestellt. Antwort 2xx innerhalb von 10 Sekunden, sonst Wiederholung. Der Testknopf in NuvaFace sendet stattdessen type webhook.test mit data { webhookId, hinweis }; die Datenstruktur deshalb am Beispiel bzw. an einem echten Ereignis festlegen.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Ereignis_patient_updated"
              },
              "example": {
                "data": {
                  "patientId": "3f2a6c1e-0000-4000-8000-000000000001"
                },
                "type": "patient.updated",
                "timestamp": "2026-11-26T09:12:00+01:00"
              }
            }
          }
        }
      }
    },
    "document.created": {
      "post": {
        "summary": "Dokument in der Akte abgelegt",
        "responses": {
          "200": {
            "description": "Angenommen (jeder 2xx-Status)"
          }
        },
        "parameters": [
          {
            "in": "header",
            "name": "webhook-id",
            "schema": {
              "type": "string"
            },
            "required": true
          },
          {
            "in": "header",
            "name": "webhook-timestamp",
            "schema": {
              "type": "string"
            },
            "required": true
          },
          {
            "in": "header",
            "name": "webhook-signature",
            "schema": {
              "type": "string"
            },
            "required": true
          }
        ],
        "description": "Signiert nach Standard Webhooks: Kopfzeilen webhook-id, webhook-timestamp, webhook-signature (v1,Base64 HMAC-SHA256 über id.timestamp.rohkörper, Schlüssel = Base64-dekodierter Teil nach whsec_). Nutzdaten minimal (Kennungen, Zeiten, Status); Details mit der API abholen. Bei Termin-Ereignissen und Online-Buchungen geht die Kennung der Behandlung mit (treatmentId); zusammen mit dem Behandlungskatalog zeigt sie, welche Behandlung eine Person bekommt, und ist damit ein Gesundheitsdatum. Ereignisse eingeschränkter Akten werden nicht zugestellt. Antwort 2xx innerhalb von 10 Sekunden, sonst Wiederholung. Der Testknopf in NuvaFace sendet stattdessen type webhook.test mit data { webhookId, hinweis }; die Datenstruktur deshalb am Beispiel bzw. an einem echten Ereignis festlegen.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Ereignis_document_created"
              },
              "example": {
                "data": {
                  "type": "messbericht",
                  "source": "api",
                  "mimeType": "application/pdf",
                  "patientId": "3f2a6c1e-0000-4000-8000-000000000001",
                  "documentId": "3f2a6c1e-0000-4000-8000-000000000031"
                },
                "type": "document.created",
                "timestamp": "2026-11-26T09:12:00+01:00"
              }
            }
          }
        }
      }
    },
    "booking.requested": {
      "post": {
        "summary": "Online-Buchung eingegangen",
        "responses": {
          "200": {
            "description": "Angenommen (jeder 2xx-Status)"
          }
        },
        "parameters": [
          {
            "in": "header",
            "name": "webhook-id",
            "schema": {
              "type": "string"
            },
            "required": true
          },
          {
            "in": "header",
            "name": "webhook-timestamp",
            "schema": {
              "type": "string"
            },
            "required": true
          },
          {
            "in": "header",
            "name": "webhook-signature",
            "schema": {
              "type": "string"
            },
            "required": true
          }
        ],
        "description": "Signiert nach Standard Webhooks: Kopfzeilen webhook-id, webhook-timestamp, webhook-signature (v1,Base64 HMAC-SHA256 über id.timestamp.rohkörper, Schlüssel = Base64-dekodierter Teil nach whsec_). Nutzdaten minimal (Kennungen, Zeiten, Status); Details mit der API abholen. Bei Termin-Ereignissen und Online-Buchungen geht die Kennung der Behandlung mit (treatmentId); zusammen mit dem Behandlungskatalog zeigt sie, welche Behandlung eine Person bekommt, und ist damit ein Gesundheitsdatum. Ereignisse eingeschränkter Akten werden nicht zugestellt. Antwort 2xx innerhalb von 10 Sekunden, sonst Wiederholung. Der Testknopf in NuvaFace sendet stattdessen type webhook.test mit data { webhookId, hinweis }; die Datenstruktur deshalb am Beispiel bzw. an einem echten Ereignis festlegen.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Ereignis_booking_requested"
              },
              "example": {
                "data": {
                  "status": "pending",
                  "treatmentId": "3f2a6c1e-0000-4000-8000-000000000021",
                  "appointmentId": "3f2a6c1e-0000-4000-8000-000000000011",
                  "requestedDate": "2026-12-01",
                  "requestedTime": "10:00",
                  "bookingRequestId": "3f2a6c1e-0000-4000-8000-000000000051"
                },
                "type": "booking.requested",
                "timestamp": "2026-11-26T09:12:00+01:00"
              }
            }
          }
        }
      }
    },
    "appointment.created": {
      "post": {
        "summary": "Termin angelegt",
        "responses": {
          "200": {
            "description": "Angenommen (jeder 2xx-Status)"
          }
        },
        "parameters": [
          {
            "in": "header",
            "name": "webhook-id",
            "schema": {
              "type": "string"
            },
            "required": true
          },
          {
            "in": "header",
            "name": "webhook-timestamp",
            "schema": {
              "type": "string"
            },
            "required": true
          },
          {
            "in": "header",
            "name": "webhook-signature",
            "schema": {
              "type": "string"
            },
            "required": true
          }
        ],
        "description": "Signiert nach Standard Webhooks: Kopfzeilen webhook-id, webhook-timestamp, webhook-signature (v1,Base64 HMAC-SHA256 über id.timestamp.rohkörper, Schlüssel = Base64-dekodierter Teil nach whsec_). Nutzdaten minimal (Kennungen, Zeiten, Status); Details mit der API abholen. Bei Termin-Ereignissen und Online-Buchungen geht die Kennung der Behandlung mit (treatmentId); zusammen mit dem Behandlungskatalog zeigt sie, welche Behandlung eine Person bekommt, und ist damit ein Gesundheitsdatum. Ereignisse eingeschränkter Akten werden nicht zugestellt. Antwort 2xx innerhalb von 10 Sekunden, sonst Wiederholung. Der Testknopf in NuvaFace sendet stattdessen type webhook.test mit data { webhookId, hinweis }; die Datenstruktur deshalb am Beispiel bzw. an einem echten Ereignis festlegen.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Ereignis_appointment_created"
              },
              "example": {
                "data": {
                  "end": "2026-12-01T10:30:00+01:00",
                  "type": "treatment",
                  "start": "2026-12-01T10:00:00+01:00",
                  "source": "online_booking",
                  "status": "pending",
                  "patientId": null,
                  "treatmentId": "3f2a6c1e-0000-4000-8000-000000000021",
                  "appointmentId": "3f2a6c1e-0000-4000-8000-000000000011"
                },
                "type": "appointment.created",
                "timestamp": "2026-11-26T09:12:00+01:00"
              }
            }
          }
        }
      }
    },
    "appointment.updated": {
      "post": {
        "summary": "Termin geändert (Zeit, Status, Patient, Behandlung)",
        "responses": {
          "200": {
            "description": "Angenommen (jeder 2xx-Status)"
          }
        },
        "parameters": [
          {
            "in": "header",
            "name": "webhook-id",
            "schema": {
              "type": "string"
            },
            "required": true
          },
          {
            "in": "header",
            "name": "webhook-timestamp",
            "schema": {
              "type": "string"
            },
            "required": true
          },
          {
            "in": "header",
            "name": "webhook-signature",
            "schema": {
              "type": "string"
            },
            "required": true
          }
        ],
        "description": "Signiert nach Standard Webhooks: Kopfzeilen webhook-id, webhook-timestamp, webhook-signature (v1,Base64 HMAC-SHA256 über id.timestamp.rohkörper, Schlüssel = Base64-dekodierter Teil nach whsec_). Nutzdaten minimal (Kennungen, Zeiten, Status); Details mit der API abholen. Bei Termin-Ereignissen und Online-Buchungen geht die Kennung der Behandlung mit (treatmentId); zusammen mit dem Behandlungskatalog zeigt sie, welche Behandlung eine Person bekommt, und ist damit ein Gesundheitsdatum. Ereignisse eingeschränkter Akten werden nicht zugestellt. Antwort 2xx innerhalb von 10 Sekunden, sonst Wiederholung. Der Testknopf in NuvaFace sendet stattdessen type webhook.test mit data { webhookId, hinweis }; die Datenstruktur deshalb am Beispiel bzw. an einem echten Ereignis festlegen.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Ereignis_appointment_updated"
              },
              "example": {
                "data": {
                  "end": "2026-12-01T10:30:00+01:00",
                  "type": "consultation",
                  "start": "2026-12-01T10:00:00+01:00",
                  "source": "manual",
                  "status": "confirmed",
                  "changed": [
                    "status",
                    "patientId"
                  ],
                  "patientId": "3f2a6c1e-0000-4000-8000-000000000001",
                  "treatmentId": "3f2a6c1e-0000-4000-8000-000000000021",
                  "appointmentId": "3f2a6c1e-0000-4000-8000-000000000011"
                },
                "type": "appointment.updated",
                "timestamp": "2026-11-26T09:12:00+01:00"
              }
            }
          }
        }
      }
    },
    "measurement.created": {
      "post": {
        "summary": "Messreihe angelegt (Schnittstelle oder Praxis)",
        "responses": {
          "200": {
            "description": "Angenommen (jeder 2xx-Status)"
          }
        },
        "parameters": [
          {
            "in": "header",
            "name": "webhook-id",
            "schema": {
              "type": "string"
            },
            "required": true
          },
          {
            "in": "header",
            "name": "webhook-timestamp",
            "schema": {
              "type": "string"
            },
            "required": true
          },
          {
            "in": "header",
            "name": "webhook-signature",
            "schema": {
              "type": "string"
            },
            "required": true
          }
        ],
        "description": "Signiert nach Standard Webhooks: Kopfzeilen webhook-id, webhook-timestamp, webhook-signature (v1,Base64 HMAC-SHA256 über id.timestamp.rohkörper, Schlüssel = Base64-dekodierter Teil nach whsec_). Nutzdaten minimal (Kennungen, Zeiten, Status); Details mit der API abholen. Bei Termin-Ereignissen und Online-Buchungen geht die Kennung der Behandlung mit (treatmentId); zusammen mit dem Behandlungskatalog zeigt sie, welche Behandlung eine Person bekommt, und ist damit ein Gesundheitsdatum. Ereignisse eingeschränkter Akten werden nicht zugestellt. Antwort 2xx innerhalb von 10 Sekunden, sonst Wiederholung. Der Testknopf in NuvaFace sendet stattdessen type webhook.test mit data { webhookId, hinweis }; die Datenstruktur deshalb am Beispiel bzw. an einem echten Ereignis festlegen.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Ereignis_measurement_created"
              },
              "example": {
                "data": {
                  "schemaId": "3f2a6c1e-0000-4000-8000-000000000081",
                  "patientId": "3f2a6c1e-0000-4000-8000-000000000001",
                  "replacesId": null,
                  "measurementId": "3f2a6c1e-0000-4000-8000-000000000091"
                },
                "type": "measurement.created",
                "timestamp": "2026-11-26T09:12:00+01:00"
              }
            }
          }
        }
      }
    },
    "appointment.cancelled": {
      "post": {
        "summary": "Termin abgesagt",
        "responses": {
          "200": {
            "description": "Angenommen (jeder 2xx-Status)"
          }
        },
        "parameters": [
          {
            "in": "header",
            "name": "webhook-id",
            "schema": {
              "type": "string"
            },
            "required": true
          },
          {
            "in": "header",
            "name": "webhook-timestamp",
            "schema": {
              "type": "string"
            },
            "required": true
          },
          {
            "in": "header",
            "name": "webhook-signature",
            "schema": {
              "type": "string"
            },
            "required": true
          }
        ],
        "description": "Signiert nach Standard Webhooks: Kopfzeilen webhook-id, webhook-timestamp, webhook-signature (v1,Base64 HMAC-SHA256 über id.timestamp.rohkörper, Schlüssel = Base64-dekodierter Teil nach whsec_). Nutzdaten minimal (Kennungen, Zeiten, Status); Details mit der API abholen. Bei Termin-Ereignissen und Online-Buchungen geht die Kennung der Behandlung mit (treatmentId); zusammen mit dem Behandlungskatalog zeigt sie, welche Behandlung eine Person bekommt, und ist damit ein Gesundheitsdatum. Ereignisse eingeschränkter Akten werden nicht zugestellt. Antwort 2xx innerhalb von 10 Sekunden, sonst Wiederholung. Der Testknopf in NuvaFace sendet stattdessen type webhook.test mit data { webhookId, hinweis }; die Datenstruktur deshalb am Beispiel bzw. an einem echten Ereignis festlegen.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Ereignis_appointment_cancelled"
              },
              "example": {
                "data": {
                  "end": "2026-12-01T10:30:00+01:00",
                  "type": "consultation",
                  "start": "2026-12-01T10:00:00+01:00",
                  "source": "manual",
                  "status": "cancelled",
                  "patientId": "3f2a6c1e-0000-4000-8000-000000000001",
                  "treatmentId": "3f2a6c1e-0000-4000-8000-000000000021",
                  "appointmentId": "3f2a6c1e-0000-4000-8000-000000000011"
                },
                "type": "appointment.cancelled",
                "timestamp": "2026-11-26T09:12:00+01:00"
              }
            }
          }
        }
      }
    },
    "invoice.draft_created": {
      "post": {
        "summary": "Rechnungsentwurf über die Schnittstelle angelegt",
        "responses": {
          "200": {
            "description": "Angenommen (jeder 2xx-Status)"
          }
        },
        "parameters": [
          {
            "in": "header",
            "name": "webhook-id",
            "schema": {
              "type": "string"
            },
            "required": true
          },
          {
            "in": "header",
            "name": "webhook-timestamp",
            "schema": {
              "type": "string"
            },
            "required": true
          },
          {
            "in": "header",
            "name": "webhook-signature",
            "schema": {
              "type": "string"
            },
            "required": true
          }
        ],
        "description": "Signiert nach Standard Webhooks: Kopfzeilen webhook-id, webhook-timestamp, webhook-signature (v1,Base64 HMAC-SHA256 über id.timestamp.rohkörper, Schlüssel = Base64-dekodierter Teil nach whsec_). Nutzdaten minimal (Kennungen, Zeiten, Status); Details mit der API abholen. Bei Termin-Ereignissen und Online-Buchungen geht die Kennung der Behandlung mit (treatmentId); zusammen mit dem Behandlungskatalog zeigt sie, welche Behandlung eine Person bekommt, und ist damit ein Gesundheitsdatum. Ereignisse eingeschränkter Akten werden nicht zugestellt. Antwort 2xx innerhalb von 10 Sekunden, sonst Wiederholung. Der Testknopf in NuvaFace sendet stattdessen type webhook.test mit data { webhookId, hinweis }; die Datenstruktur deshalb am Beispiel bzw. an einem echten Ereignis festlegen.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Ereignis_invoice_draft_created"
              },
              "example": {
                "data": {
                  "draftId": "3f2a6c1e-0000-4000-8000-000000000081",
                  "patientId": "3f2a6c1e-0000-4000-8000-000000000001",
                  "appointmentId": "3f2a6c1e-0000-4000-8000-000000000011"
                },
                "type": "invoice.draft_created",
                "timestamp": "2026-11-26T09:12:00+01:00"
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "Praxis": {
        "type": "object",
        "required": [
          "name",
          "address",
          "phone",
          "email",
          "website",
          "timezone",
          "availabilityMode",
          "openingHours",
          "bookingPage"
        ],
        "properties": {
          "name": {
            "type": [
              "string",
              "null"
            ]
          },
          "email": {
            "type": [
              "string",
              "null"
            ],
            "description": "Mailadresse der Praxis (steht auf der Buchungsseite)"
          },
          "phone": {
            "type": [
              "string",
              "null"
            ]
          },
          "address": {
            "type": "object",
            "properties": {
              "city": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "text": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "eine Zeile wie auf der Buchungsseite"
              },
              "street": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "postalCode": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "houseNumber": {
                "type": [
                  "string",
                  "null"
                ]
              }
            },
            "additionalProperties": false
          },
          "website": {
            "type": [
              "string",
              "null"
            ]
          },
          "timezone": {
            "type": "string"
          },
          "bookingPage": {
            "type": [
              "object",
              "null"
            ],
            "properties": {
              "url": {
                "type": "string",
                "format": "uri"
              },
              "accessCodeRequired": {
                "type": "boolean"
              }
            },
            "description": "nur wenn es eine öffentliche Buchungsseite mit buchbaren Behandlungen gibt"
          },
          "openingHours": {
            "type": [
              "object",
              "null"
            ],
            "properties": {
              "friday": {
                "type": "object",
                "properties": {
                  "slots": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "end": {
                          "type": "string",
                          "pattern": "^\\d{2}:\\d{2}$"
                        },
                        "start": {
                          "type": "string",
                          "pattern": "^\\d{2}:\\d{2}$"
                        }
                      }
                    }
                  },
                  "isOpen": {
                    "type": "boolean"
                  }
                }
              },
              "monday": {
                "type": "object",
                "properties": {
                  "slots": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "end": {
                          "type": "string",
                          "pattern": "^\\d{2}:\\d{2}$"
                        },
                        "start": {
                          "type": "string",
                          "pattern": "^\\d{2}:\\d{2}$"
                        }
                      }
                    }
                  },
                  "isOpen": {
                    "type": "boolean"
                  }
                }
              },
              "sunday": {
                "type": "object",
                "properties": {
                  "slots": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "end": {
                          "type": "string",
                          "pattern": "^\\d{2}:\\d{2}$"
                        },
                        "start": {
                          "type": "string",
                          "pattern": "^\\d{2}:\\d{2}$"
                        }
                      }
                    }
                  },
                  "isOpen": {
                    "type": "boolean"
                  }
                }
              },
              "tuesday": {
                "type": "object",
                "properties": {
                  "slots": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "end": {
                          "type": "string",
                          "pattern": "^\\d{2}:\\d{2}$"
                        },
                        "start": {
                          "type": "string",
                          "pattern": "^\\d{2}:\\d{2}$"
                        }
                      }
                    }
                  },
                  "isOpen": {
                    "type": "boolean"
                  }
                }
              },
              "saturday": {
                "type": "object",
                "properties": {
                  "slots": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "end": {
                          "type": "string",
                          "pattern": "^\\d{2}:\\d{2}$"
                        },
                        "start": {
                          "type": "string",
                          "pattern": "^\\d{2}:\\d{2}$"
                        }
                      }
                    }
                  },
                  "isOpen": {
                    "type": "boolean"
                  }
                }
              },
              "thursday": {
                "type": "object",
                "properties": {
                  "slots": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "end": {
                          "type": "string",
                          "pattern": "^\\d{2}:\\d{2}$"
                        },
                        "start": {
                          "type": "string",
                          "pattern": "^\\d{2}:\\d{2}$"
                        }
                      }
                    }
                  },
                  "isOpen": {
                    "type": "boolean"
                  }
                }
              },
              "wednesday": {
                "type": "object",
                "properties": {
                  "slots": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "end": {
                          "type": "string",
                          "pattern": "^\\d{2}:\\d{2}$"
                        },
                        "start": {
                          "type": "string",
                          "pattern": "^\\d{2}:\\d{2}$"
                        }
                      }
                    }
                  },
                  "isOpen": {
                    "type": "boolean"
                  }
                }
              }
            },
            "description": "je Wochentag geöffnet und Zeitfenster; null, wenn die Praxis keine eingerichtet hat"
          },
          "availabilityMode": {
            "enum": [
              "fixed",
              "availability"
            ],
            "type": "string",
            "description": "fixed: feste Öffnungszeiten je Wochentag; availability: einzeln freigegebene Tage (dann GET /availability nutzen)"
          }
        },
        "additionalProperties": false
      },
      "Termin": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "end": {
            "type": "string",
            "format": "date-time"
          },
          "type": {
            "type": [
              "string",
              "null"
            ]
          },
          "guest": {
            "type": [
              "object",
              "null"
            ],
            "properties": {
              "name": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "email": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "phone": {
                "type": [
                  "string",
                  "null"
                ]
              }
            },
            "description": "nur mit patients.read: Kontakt aus der Online-Buchung, solange keine Akte zugeordnet ist"
          },
          "start": {
            "type": "string",
            "format": "date-time"
          },
          "title": {
            "type": [
              "string",
              "null"
            ],
            "description": "nur mit patients.read"
          },
          "video": {
            "type": "boolean"
          },
          "source": {
            "type": [
              "string",
              "null"
            ],
            "description": "z. B. manual, online_booking, booking_request"
          },
          "status": {
            "enum": [
              "scheduled",
              "pending",
              "confirmed",
              "completed",
              "cancelled",
              "no_show"
            ],
            "type": "string"
          },
          "createdAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "patientId": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid",
            "description": "null bei Online-Buchung, die noch keiner Akte zugeordnet ist"
          },
          "updatedAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "treatmentId": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid"
          },
          "treatmentName": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      },
      "Zugang": {
        "type": "object",
        "properties": {
          "mode": {
            "enum": [
              "live",
              "test"
            ],
            "type": "string",
            "description": "test bei einem Testschlüssel (nfk_test_); jede Antwort trägt dazu die Kopfzeile X-NuvaFace-Mode"
          },
          "usage": {
            "type": "object",
            "properties": {
              "resetsAt": {
                "type": "string",
                "format": "date-time"
              },
              "patientRecordsToday": {
                "type": "integer"
              },
              "patientRecordsRemaining": {
                "type": "integer"
              }
            }
          },
          "access": {
            "type": "object",
            "properties": {
              "name": {
                "type": "string"
              },
              "type": {
                "type": "string",
                "const": "api_key"
              },
              "prefix": {
                "type": "string"
              },
              "scopes": {
                "type": "array",
                "items": {
                  "enum": [
                    "patients.read.basic",
                    "patients.read",
                    "appointments.read",
                    "availability.read",
                    "documents.write",
                    "invoices.read",
                    "measurements.read",
                    "measurements.write",
                    "patients.write",
                    "appointments.write",
                    "documents.read",
                    "invoices.read.items",
                    "invoices.write",
                    "consents.read",
                    "practice.read",
                    "bookings.read"
                  ],
                  "type": "string"
                }
              },
              "expiresAt": {
                "type": [
                  "string",
                  "null"
                ],
                "format": "date-time"
              }
            }
          },
          "limits": {
            "type": "object",
            "properties": {
              "writesPerMinute": {
                "type": "integer"
              },
              "requestsPerMinute": {
                "type": "integer"
              },
              "patientRecordsPerDay": {
                "type": "integer"
              },
              "patientListsPerMinute": {
                "type": "integer"
              }
            }
          },
          "practice": {
            "type": "object",
            "properties": {
              "name": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "test": {
                "type": "boolean",
                "description": "true: Testschlüssel, die Praxis ist die Übungspraxis mit erfundenen Daten"
              }
            }
          },
          "apiVersion": {
            "type": "string"
          }
        }
      },
      "Patient": {
        "type": "object",
        "required": [
          "id",
          "firstName",
          "lastName"
        ],
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "age": {
            "type": [
              "integer",
              "null"
            ]
          },
          "code": {
            "type": [
              "string",
              "null"
            ],
            "description": "Patientencode für Papierbögen (ABCD-EFGH-K), null solange keiner vergeben ist (v1.1)"
          },
          "email": {
            "type": [
              "string",
              "null"
            ]
          },
          "phone": {
            "type": [
              "string",
              "null"
            ]
          },
          "gender": {
            "enum": [
              "female",
              "male",
              "diverse",
              "unknown",
              null
            ],
            "type": [
              "string",
              "null"
            ]
          },
          "status": {
            "type": [
              "string",
              "null"
            ]
          },
          "address": {
            "type": "object",
            "properties": {
              "city": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "text": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "street": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "postalCode": {
                "type": [
                  "string",
                  "null"
                ]
              }
            }
          },
          "lastName": {
            "type": "string"
          },
          "birthDate": {
            "type": [
              "string",
              "null"
            ],
            "format": "date"
          },
          "birthYear": {
            "type": [
              "integer",
              "null"
            ]
          },
          "createdAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "firstName": {
            "type": "string"
          },
          "updatedAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          }
        }
      },
      "Problem": {
        "type": "object",
        "properties": {
          "code": {
            "enum": [
              "UNAUTHORIZED",
              "TOKEN_INVALID",
              "INSUFFICIENT_SCOPE",
              "NICHT_FREIGESCHALTET",
              "IN_PRAXIS_ABGESCHALTET",
              "KONTO_GESPERRT",
              "VERTRAG_BEENDET",
              "TESTPHASE_BEENDET",
              "NOT_FOUND",
              "METHOD_NOT_ALLOWED",
              "SLOT_UNAVAILABLE",
              "STATE_CONFLICT",
              "VALIDATION",
              "IDEMPOTENCY_IN_PROGRESS",
              "DUPLICATE",
              "PATIENT_CODE_INVALID",
              "IDEMPOTENCY_MISMATCH",
              "VALIDATION_FAILED",
              "RECORD_RESTRICTED",
              "MEASUREMENT_INVALID",
              "MEASUREMENT_REPLACED",
              "SCHEMA_INACTIVE",
              "UNSUPPORTED_MEDIA_TYPE",
              "PAYLOAD_TOO_LARGE",
              "RATE_LIMITED",
              "DAILY_PATIENT_LIMIT",
              "UNAVAILABLE",
              "INTERNAL"
            ],
            "type": "string"
          },
          "type": {
            "type": "string",
            "format": "uri"
          },
          "limit": {
            "type": "integer"
          },
          "title": {
            "type": "string"
          },
          "detail": {
            "type": "string"
          },
          "status": {
            "type": "integer"
          },
          "instance": {
            "type": "string"
          },
          "remaining": {
            "type": "integer",
            "description": "bei DAILY_PATIENT_LIMIT: heute noch abrufbare Datensätze"
          },
          "requestId": {
            "type": "string"
          },
          "retryAfter": {
            "type": "integer"
          },
          "requiredScope": {
            "type": "string"
          }
        },
        "description": "RFC 9457"
      },
      "Dokument": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "name": {
            "type": "string"
          },
          "size": {
            "type": "integer"
          },
          "type": {
            "enum": [
              "report",
              "consent",
              "prescription",
              "image",
              "document",
              "other",
              "messbericht"
            ],
            "type": "string"
          },
          "mimeType": {
            "type": "string"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "patientId": {
            "type": "string",
            "format": "uuid"
          }
        }
      },
      "Dublette": {
        "type": "object",
        "properties": {
          "candidates": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string",
                  "format": "uuid"
                },
                "match": {
                  "type": "array",
                  "items": {
                    "enum": [
                      "name_birthdate",
                      "email",
                      "phone"
                    ],
                    "type": "string"
                  }
                }
              }
            }
          }
        }
      },
      "Messfeld": {
        "type": "object",
        "required": [
          "key",
          "label",
          "typ"
        ],
        "properties": {
          "key": {
            "type": "string",
            "pattern": "^[a-z][a-z0-9_]{0,39}$",
            "description": "Name des Werts in values"
          },
          "max": {
            "type": "number"
          },
          "min": {
            "type": "number"
          },
          "typ": {
            "enum": [
              "zahl",
              "ganzzahl",
              "wertepaar",
              "auswahl",
              "mehrfachauswahl",
              "skala",
              "text"
            ],
            "type": "string",
            "description": "zahl, ganzzahl, wertepaar ([erster, zweiter], z. B. Blutdruck), auswahl (ein wert aus optionen), mehrfachauswahl (Liste, höchstens maxAuswahl), skala (ganze Zahl min bis max), text (höchstens maxLaenge, höchstens 500)"
          },
          "paar": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "max": {
                  "type": "number"
                },
                "min": {
                  "type": "number"
                },
                "label": {
                  "type": "string"
                }
              }
            },
            "maxItems": 2,
            "minItems": 2
          },
          "ucum": {
            "type": "string",
            "description": "Einheit als UCUM-Code"
          },
          "hilfe": {
            "type": "string"
          },
          "label": {
            "type": "string"
          },
          "gruppe": {
            "type": "string"
          },
          "einheit": {
            "type": "string",
            "description": "Einheit, fest aus dem Schema (nie Teil der Eingabe)"
          },
          "pflicht": {
            "type": "boolean"
          },
          "optionen": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "wert": {
                  "type": "string"
                },
                "label": {
                  "type": "string"
                }
              }
            }
          },
          "referenz": {
            "type": "object",
            "properties": {
              "max": {
                "type": "number"
              },
              "min": {
                "type": "number"
              },
              "text": {
                "type": "string"
              }
            }
          },
          "maxLaenge": {
            "type": "integer"
          },
          "skalaText": {
            "type": "object",
            "properties": {
              "max": {
                "type": "string"
              },
              "min": {
                "type": "string"
              }
            }
          },
          "maxAuswahl": {
            "type": "integer"
          },
          "ersterGroesser": {
            "type": "boolean"
          }
        },
        "description": "Feld eines Messschemas. min und max sind harte Grenzen (Plausibilität, keine medizinische Bewertung); referenz dient nur der Anzeige."
      },
      "Rechnung": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "date": {
            "type": [
              "string",
              "null"
            ],
            "format": "date"
          },
          "total": {
            "type": [
              "number",
              "null"
            ]
          },
          "number": {
            "type": [
              "string",
              "null"
            ]
          },
          "paidAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "status": {
            "type": "string"
          },
          "dueDate": {
            "type": [
              "string",
              "null"
            ],
            "format": "date"
          },
          "currency": {
            "type": "string",
            "const": "EUR"
          },
          "patientId": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid"
          },
          "patientName": {
            "type": [
              "string",
              "null"
            ],
            "description": "nur mit patients.read"
          },
          "documentType": {
            "enum": [
              "invoice",
              "estimate",
              "cancellation",
              "no_show_fee",
              "quick"
            ],
            "type": "string",
            "description": "Belegart wie in NuvaFace; cancellation ist ein Storno mit negativem Betrag"
          },
          "appointmentId": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid"
          },
          "paymentMethod": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      },
      "Messreihe": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "schema": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string",
                "format": "uuid"
              },
              "key": {
                "type": "string"
              },
              "name": {
                "type": "string"
              },
              "version": {
                "type": "integer"
              }
            }
          },
          "source": {
            "enum": [
              "praxis",
              "api",
              "import"
            ],
            "type": "string"
          },
          "values": {
            "type": "object",
            "description": "Werte je Feld (key), Einheit aus dem Schema",
            "additionalProperties": true
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "patientId": {
            "type": "string",
            "format": "uuid"
          },
          "documentId": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid"
          },
          "measuredAt": {
            "type": "string",
            "format": "date-time",
            "description": "Zeitpunkt der Messung, ISO 8601 mit Versatz der Praxis"
          },
          "replacesId": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid",
            "description": "Diese Messreihe korrigiert jene"
          },
          "replacedById": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid",
            "description": "Diese Messreihe wurde durch jene korrigiert"
          },
          "appointmentId": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid"
          },
          "correctionReason": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      },
      "Behandlung": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "name": {
            "type": "string"
          },
          "price": {
            "type": [
              "number",
              "null"
            ],
            "description": "v1.1: Preis wie auf der Buchungsseite (nur wenn die Praxis Preise zeigt)"
          },
          "category": {
            "type": [
              "string",
              "null"
            ]
          },
          "currency": {
            "enum": [
              "EUR",
              null
            ],
            "type": [
              "string",
              "null"
            ]
          },
          "priceFrom": {
            "type": [
              "boolean",
              "null"
            ],
            "description": "v1.1: true heißt \"ab\""
          },
          "infoPdfUrl": {
            "type": [
              "string",
              "null"
            ],
            "format": "uri",
            "description": "v1.1: öffentliches Info-PDF wie im Buchungswidget"
          },
          "description": {
            "type": [
              "string",
              "null"
            ],
            "description": "v1.1: Beschreibung wie auf der Buchungsseite"
          },
          "onlineBookable": {
            "type": "boolean"
          },
          "durationMinutes": {
            "type": [
              "integer",
              "null"
            ]
          }
        }
      },
      "Messschema": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "key": {
            "type": "string",
            "description": "Kennung des Schemas über alle Fassungen"
          },
          "name": {
            "type": "string"
          },
          "active": {
            "type": "boolean",
            "description": "false: deaktiviert, keine neuen Messreihen"
          },
          "fields": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Messfeld"
            }
          },
          "version": {
            "type": "integer",
            "description": "Fassung; jede Änderung ist eine neue Fassung"
          },
          "isLatest": {
            "type": "boolean"
          },
          "template": {
            "type": [
              "string",
              "null"
            ],
            "description": "Vorlage, aus der das Schema übernommen wurde"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "description": {
            "type": [
              "string",
              "null"
            ]
          },
          "deactivatedAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "latestVersion": {
            "type": "integer"
          }
        }
      },
      "PatientNeu": {
        "type": "object",
        "required": [
          "firstName",
          "lastName",
          "birthDate"
        ],
        "properties": {
          "email": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 255,
            "description": "wie in NuvaFace geprüft; gespeichert in Kleinschreibung, Punkte und Zusätze bleiben"
          },
          "phone": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 50,
            "description": "gültige Rufnummer; national im Land der Praxis, sonst mit Ländervorwahl"
          },
          "gender": {
            "enum": [
              "female",
              "male",
              "diverse",
              "unknown",
              null
            ],
            "type": [
              "string",
              "null"
            ]
          },
          "address": {
            "type": [
              "object",
              "null"
            ],
            "properties": {
              "city": {
                "type": "string",
                "maxLength": 100
              },
              "street": {
                "type": "string",
                "maxLength": 200
              },
              "postalCode": {
                "type": "string",
                "maxLength": 10,
                "description": "5 Ziffern, Österreich und Schweiz 4"
              },
              "houseNumber": {
                "type": "string",
                "maxLength": 20
              }
            },
            "additionalProperties": false
          },
          "lastName": {
            "type": "string",
            "maxLength": 100,
            "minLength": 1
          },
          "birthDate": {
            "type": "string",
            "format": "date",
            "description": "echter Kalendertag, nicht in der Zukunft, nicht vor 1900-01-01"
          },
          "firstName": {
            "type": "string",
            "maxLength": 100,
            "minLength": 1
          },
          "allowDuplicate": {
            "type": "boolean",
            "default": false,
            "description": "übersteuert nur einen reinen Mail- oder Telefontreffer, nie Name plus Geburtsdatum"
          }
        },
        "additionalProperties": false
      },
      "FreieZeiten": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "date": {
                  "type": "string",
                  "format": "date"
                },
                "slots": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "end": {
                        "type": "string",
                        "format": "date-time"
                      },
                      "start": {
                        "type": "string",
                        "format": "date-time"
                      }
                    }
                  }
                },
                "reason": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "description": "ohne freie Zeit: Grund, z. B. GESCHLOSSEN"
                }
              }
            }
          },
          "timezone": {
            "type": "string"
          },
          "treatmentId": {
            "type": [
              "string",
              "null"
            ]
          },
          "durationMinutes": {
            "type": "integer"
          }
        }
      },
      "PatientCode": {
        "type": "object",
        "required": [
          "id",
          "birthYear",
          "age",
          "gender",
          "code"
        ],
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "age": {
            "type": [
              "integer",
              "null"
            ]
          },
          "code": {
            "type": "string",
            "description": "ABCD-EFGH-K"
          },
          "gender": {
            "enum": [
              "female",
              "male",
              "diverse",
              "unknown",
              null
            ],
            "type": [
              "string",
              "null"
            ]
          },
          "birthYear": {
            "type": [
              "integer",
              "null"
            ]
          }
        },
        "additionalProperties": false
      },
      "DokumentInfo": {
        "type": "object",
        "required": [
          "id",
          "patientId",
          "name",
          "type",
          "mimeType",
          "size",
          "createdAt",
          "source"
        ],
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "name": {
            "type": [
              "string",
              "null"
            ]
          },
          "size": {
            "type": [
              "integer",
              "null"
            ]
          },
          "type": {
            "enum": [
              "report",
              "prescription",
              "document",
              "other",
              "messbericht",
              "estimate"
            ],
            "type": "string"
          },
          "source": {
            "enum": [
              "api",
              "practice"
            ],
            "type": "string",
            "description": "api: über die Schnittstelle abgelegt; practice: in NuvaFace abgelegt und von der Praxis freigegeben"
          },
          "mimeType": {
            "type": [
              "string",
              "null"
            ]
          },
          "createdAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "patientId": {
            "type": "string",
            "format": "uuid"
          }
        },
        "additionalProperties": false
      },
      "MessreiheNeu": {
        "type": "object",
        "required": [
          "measuredAt",
          "values"
        ],
        "properties": {
          "values": {
            "type": "object",
            "description": "Werte je Feld des Schemas. Unbekannte Felder, fehlende Pflichtfelder, falscher Typ oder Werte außerhalb min/max ergeben 422 mit Feldliste.",
            "additionalProperties": true
          },
          "schemaId": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid",
            "description": "Fassung eines Messschemas der Praxis"
          },
          "schemaKey": {
            "type": [
              "string",
              "null"
            ],
            "description": "Kennung eines Messschemas; es gilt die neueste Fassung"
          },
          "documentId": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid",
            "description": "Dokument derselben Akte (z. B. Messbericht aus POST /patients/{id}/documents)"
          },
          "measuredAt": {
            "type": "string",
            "description": "ISO 8601; mit Z oder Versatz eindeutig, ohne Versatz Praxiszeit (Europe/Berlin). Höchstens 10 Minuten in der Zukunft."
          },
          "replacesId": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid",
            "description": "Korrektur: Messreihe derselben Akte und desselben Schemas, die diese Messreihe ersetzt (höchstens einmal je Messreihe)"
          },
          "appointmentId": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid",
            "description": "Termin derselben Akte"
          },
          "correctionReason": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 300,
            "description": "Pflicht mit replacesId (3 bis 300 Zeichen)"
          }
        },
        "description": "schemaId (jede Fassung) oder schemaKey (neueste Fassung) angeben.",
        "additionalProperties": false
      },
      "PatientBasis": {
        "type": "object",
        "required": [
          "id",
          "birthYear",
          "age",
          "gender"
        ],
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "age": {
            "type": [
              "integer",
              "null"
            ],
            "description": "volle Jahre am heutigen Tag (Europe/Berlin)"
          },
          "gender": {
            "enum": [
              "female",
              "male",
              "diverse",
              "unknown",
              null
            ],
            "type": [
              "string",
              "null"
            ]
          },
          "birthYear": {
            "type": [
              "integer",
              "null"
            ]
          }
        },
        "additionalProperties": false
      },
      "Einwilligungen": {
        "type": "object",
        "required": [
          "patientId",
          "channels"
        ],
        "properties": {
          "channels": {
            "type": "object",
            "required": [
              "reminderEmail",
              "reminderSms",
              "marketingEmail"
            ],
            "properties": {
              "reminderSms": {
                "type": "object",
                "required": [
                  "status",
                  "recordedAt",
                  "method"
                ],
                "properties": {
                  "method": {
                    "enum": [
                      "online_buchung",
                      "checkin",
                      "akte",
                      "termin",
                      "abmeldelink",
                      "erinnerungsmail",
                      "einwilligungserklaerung",
                      "praxisbogen",
                      "sms_kurzlink",
                      null
                    ],
                    "type": [
                      "string",
                      "null"
                    ],
                    "description": "Weg der Erfassung, wie in der Akte: online_buchung, checkin, akte, termin, abmeldelink, erinnerungsmail, einwilligungserklaerung, praxisbogen, sms_kurzlink"
                  },
                  "status": {
                    "enum": [
                      "granted",
                      "denied",
                      "unknown"
                    ],
                    "type": "string",
                    "description": "denied: abgelehnt oder widerrufen"
                  },
                  "recordedAt": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "format": "date-time",
                    "description": "wann der jetzige Stand erfasst wurde"
                  }
                },
                "additionalProperties": false
              },
              "reminderEmail": {
                "type": "object",
                "required": [
                  "status",
                  "recordedAt",
                  "method"
                ],
                "properties": {
                  "method": {
                    "enum": [
                      "online_buchung",
                      "checkin",
                      "akte",
                      "termin",
                      "abmeldelink",
                      "erinnerungsmail",
                      "einwilligungserklaerung",
                      "praxisbogen",
                      "sms_kurzlink",
                      null
                    ],
                    "type": [
                      "string",
                      "null"
                    ],
                    "description": "Weg der Erfassung, wie in der Akte: online_buchung, checkin, akte, termin, abmeldelink, erinnerungsmail, einwilligungserklaerung, praxisbogen, sms_kurzlink"
                  },
                  "status": {
                    "enum": [
                      "granted",
                      "denied",
                      "unknown"
                    ],
                    "type": "string",
                    "description": "denied: abgelehnt oder widerrufen"
                  },
                  "recordedAt": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "format": "date-time",
                    "description": "wann der jetzige Stand erfasst wurde"
                  }
                },
                "additionalProperties": false
              },
              "marketingEmail": {
                "type": "object",
                "required": [
                  "status",
                  "recordedAt",
                  "method"
                ],
                "properties": {
                  "method": {
                    "enum": [
                      "online_buchung",
                      "checkin",
                      "akte",
                      "termin",
                      "abmeldelink",
                      "erinnerungsmail",
                      "einwilligungserklaerung",
                      "praxisbogen",
                      "sms_kurzlink",
                      null
                    ],
                    "type": [
                      "string",
                      "null"
                    ],
                    "description": "Weg der Erfassung, wie in der Akte: online_buchung, checkin, akte, termin, abmeldelink, erinnerungsmail, einwilligungserklaerung, praxisbogen, sms_kurzlink"
                  },
                  "status": {
                    "enum": [
                      "granted",
                      "denied",
                      "unknown"
                    ],
                    "type": "string",
                    "description": "denied: abgelehnt oder widerrufen"
                  },
                  "recordedAt": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "format": "date-time",
                    "description": "wann der jetzige Stand erfasst wurde"
                  }
                },
                "additionalProperties": false
              }
            },
            "additionalProperties": false
          },
          "patientId": {
            "type": "string",
            "format": "uuid"
          }
        },
        "additionalProperties": false
      },
      "Buchungsanfrage": {
        "type": "object",
        "required": [
          "id",
          "status",
          "start",
          "date",
          "treatmentId",
          "treatmentName",
          "appointmentId",
          "type",
          "video",
          "source",
          "createdAt",
          "updatedAt"
        ],
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "date": {
            "type": [
              "string",
              "null"
            ],
            "format": "date"
          },
          "type": {
            "type": [
              "string",
              "null"
            ]
          },
          "start": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "gewünschter Beginn in der Zeitzone der Praxis"
          },
          "video": {
            "type": "boolean"
          },
          "source": {
            "type": [
              "string",
              "null"
            ]
          },
          "status": {
            "enum": [
              "pending",
              "confirmed",
              "rejected",
              "cancelled"
            ],
            "type": "string"
          },
          "contact": {
            "type": [
              "object",
              "null"
            ],
            "properties": {
              "name": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "email": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "phone": {
                "type": [
                  "string",
                  "null"
                ]
              }
            },
            "description": "nur mit patients.read; null, wenn die Angaben gelöscht sind"
          },
          "createdAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "updatedAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "treatmentId": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid"
          },
          "appointmentId": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid"
          },
          "treatmentName": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "additionalProperties": false
      },
      "PatientAngelegt": {
        "allOf": [
          {
            "$ref": "#/components/schemas/Patient"
          },
          {
            "type": "object",
            "properties": {
              "code": {
                "type": "string",
                "description": "Patientencode für Papierbögen (ABCD-EFGH-K)"
              }
            }
          }
        ]
      },
      "Rechnungsentwurf": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "items": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "code": {
                  "type": "string"
                },
                "index": {
                  "type": "integer"
                },
                "total": {
                  "type": "number"
                },
                "factor": {
                  "type": "number",
                  "description": "angeforderter Steigerungssatz"
                },
                "points": {
                  "type": "integer"
                },
                "taxRate": {
                  "type": "number"
                },
                "feeFrame": {
                  "type": "object",
                  "properties": {
                    "maximum": {
                      "type": "number"
                    },
                    "section": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "threshold": {
                      "type": "number"
                    }
                  }
                },
                "quantity": {
                  "type": "integer"
                },
                "unitPrice": {
                  "type": [
                    "number",
                    "null"
                  ]
                },
                "description": {
                  "type": "string"
                },
                "printedFactor": {
                  "type": "number",
                  "description": "Steigerungssatz, der nach der Rechnung von NuvaFace auf der Rechnung stünde. Er weicht um Tausendstel von factor ab, wenn der Rundungsausgleich des Belegs diese Zeile trifft; dann steht in warnings PRINTED_FACTOR_DIFFERS. Läge er über dem Höchstsatz oder ohne Begründung über dem Schwellenwert, wird der Entwurf mit 422 abgewiesen (PRINTED_FACTOR_ABOVE_MAXIMUM, PRINTED_FACTOR_NEEDS_JUSTIFICATION)"
                }
              }
            }
          },
          "total": {
            "type": "number",
            "description": "Gesamtbetrag brutto, gerechnet von NuvaFace"
          },
          "object": {
            "type": "string",
            "const": "invoice_draft"
          },
          "status": {
            "enum": [
              "open",
              "taken_over",
              "discarded",
              "expired"
            ],
            "type": "string",
            "description": "open: wartet auf die Praxis; taken_over: in der Praxis zur Rechnung geworden (invoiceId); discarded: verworfen; expired: nach 30 Tagen verfallen"
          },
          "taxRate": {
            "type": "number",
            "description": "aus der Praxis, nie vom Aufrufer"
          },
          "currency": {
            "type": "string",
            "const": "EUR"
          },
          "warnings": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "code": {
                  "type": "string"
                },
                "index": {
                  "type": "integer"
                },
                "message": {
                  "type": "string"
                }
              }
            },
            "description": "Hinweise ohne Wirkung auf die Anlage: AMOUNT_MISMATCH, POSSIBLE_DUPLICATE, SERVICE_DATE_DIFFERS, FEE_FRAME_UNCERTAIN, INVOICE_CHECK"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "expiresAt": {
            "type": "string",
            "format": "date-time"
          },
          "invoiceId": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid",
            "description": "Rechnung, die die Praxis aus dem Entwurf angelegt hat"
          },
          "netAmount": {
            "type": "number"
          },
          "patientId": {
            "type": "string",
            "format": "uuid"
          },
          "taxAmount": {
            "type": "number"
          },
          "serviceDate": {
            "type": "string",
            "format": "date"
          },
          "appointmentId": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid"
          }
        }
      },
      "Rechnungsposition": {
        "type": "object",
        "properties": {
          "code": {
            "type": [
              "string",
              "null"
            ]
          },
          "type": {
            "enum": [
              "fee",
              "material",
              "other"
            ],
            "type": "string"
          },
          "total": {
            "type": [
              "number",
              "null"
            ],
            "description": "Zeilenbetrag in Euro wie auf der Rechnung"
          },
          "factor": {
            "type": [
              "number",
              "null"
            ],
            "description": "gedruckter Steigerungssatz"
          },
          "taxRate": {
            "type": "number"
          },
          "quantity": {
            "type": "number"
          },
          "unitPrice": {
            "type": [
              "number",
              "null"
            ],
            "description": "Einzelbetrag in Euro (netto bei Belegen mit Umsatzsteuer)"
          },
          "description": {
            "type": "string"
          }
        }
      },
      "Ereignis_invoice_paid": {
        "type": "object",
        "required": [
          "type",
          "timestamp",
          "data"
        ],
        "properties": {
          "data": {
            "type": "object",
            "properties": {
              "total": {
                "type": [
                  "number",
                  "string",
                  "null"
                ]
              },
              "number": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "paidAt": {
                "type": "string",
                "format": "date-time"
              },
              "invoiceId": {
                "type": "string",
                "format": "uuid"
              },
              "patientId": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "documentType": {
                "enum": [
                  "invoice",
                  "no_show_fee",
                  "quick"
                ],
                "type": "string"
              }
            }
          },
          "type": {
            "type": "string",
            "const": "invoice.paid"
          },
          "timestamp": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "RechnungMitPositionen": {
        "allOf": [
          {
            "$ref": "#/components/schemas/Rechnung"
          },
          {
            "type": "object",
            "properties": {
              "items": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/Rechnungsposition"
                },
                "description": "nur mit include=items und Scope invoices.read.items"
              },
              "taxRate": {
                "type": [
                  "number",
                  "null"
                ]
              },
              "netAmount": {
                "type": [
                  "number",
                  "null"
                ]
              },
              "taxAmount": {
                "type": [
                  "number",
                  "null"
                ]
              },
              "itemAmountsKnown": {
                "type": "boolean",
                "description": "false bei Altbelegen, deren Positionen keine Preise tragen: unitPrice und total der Positionen sind dann null, der Betrag steht nur im Belegkopf"
              }
            }
          }
        ]
      },
      "Ereignis_patient_created": {
        "type": "object",
        "required": [
          "type",
          "timestamp",
          "data"
        ],
        "properties": {
          "data": {
            "type": "object",
            "properties": {
              "patientId": {
                "type": "string",
                "format": "uuid"
              }
            }
          },
          "type": {
            "type": "string",
            "const": "patient.created"
          },
          "timestamp": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "Ereignis_patient_updated": {
        "type": "object",
        "required": [
          "type",
          "timestamp",
          "data"
        ],
        "properties": {
          "data": {
            "type": "object",
            "properties": {
              "patientId": {
                "type": "string",
                "format": "uuid"
              }
            }
          },
          "type": {
            "type": "string",
            "const": "patient.updated"
          },
          "timestamp": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "Ereignis_document_created": {
        "type": "object",
        "required": [
          "type",
          "timestamp",
          "data"
        ],
        "properties": {
          "data": {
            "type": "object",
            "properties": {
              "type": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "source": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "mimeType": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "patientId": {
                "type": "string",
                "format": "uuid"
              },
              "documentId": {
                "type": "string",
                "format": "uuid"
              }
            }
          },
          "type": {
            "type": "string",
            "const": "document.created"
          },
          "timestamp": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "Ereignis_booking_requested": {
        "type": "object",
        "required": [
          "type",
          "timestamp",
          "data"
        ],
        "properties": {
          "data": {
            "type": "object",
            "properties": {
              "status": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "treatmentId": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "appointmentId": {
                "type": [
                  "string",
                  "null"
                ],
                "format": "uuid"
              },
              "requestedDate": {
                "type": "string",
                "format": "date"
              },
              "requestedTime": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "bookingRequestId": {
                "type": "string",
                "format": "uuid"
              }
            }
          },
          "type": {
            "type": "string",
            "const": "booking.requested"
          },
          "timestamp": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "Ereignis_appointment_created": {
        "type": "object",
        "required": [
          "type",
          "timestamp",
          "data"
        ],
        "properties": {
          "data": {
            "type": "object",
            "properties": {
              "end": {
                "type": "string",
                "format": "date-time"
              },
              "type": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "start": {
                "type": "string",
                "format": "date-time"
              },
              "source": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "status": {
                "type": "string"
              },
              "patientId": {
                "type": [
                  "string",
                  "null"
                ],
                "format": "uuid"
              },
              "treatmentId": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "appointmentId": {
                "type": "string",
                "format": "uuid"
              }
            }
          },
          "type": {
            "type": "string",
            "const": "appointment.created"
          },
          "timestamp": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "Ereignis_appointment_updated": {
        "type": "object",
        "required": [
          "type",
          "timestamp",
          "data"
        ],
        "properties": {
          "data": {
            "type": "object",
            "properties": {
              "end": {
                "type": "string",
                "format": "date-time"
              },
              "type": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "start": {
                "type": "string",
                "format": "date-time"
              },
              "source": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "status": {
                "type": "string"
              },
              "changed": {
                "type": "array",
                "items": {
                  "enum": [
                    "start",
                    "end",
                    "status",
                    "patientId",
                    "treatmentId",
                    "type"
                  ],
                  "type": "string"
                }
              },
              "patientId": {
                "type": [
                  "string",
                  "null"
                ],
                "format": "uuid"
              },
              "treatmentId": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "appointmentId": {
                "type": "string",
                "format": "uuid"
              }
            }
          },
          "type": {
            "type": "string",
            "const": "appointment.updated"
          },
          "timestamp": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "Ereignis_measurement_created": {
        "type": "object",
        "required": [
          "type",
          "timestamp",
          "data"
        ],
        "properties": {
          "data": {
            "type": "object",
            "properties": {
              "schemaId": {
                "type": "string",
                "format": "uuid"
              },
              "patientId": {
                "type": "string",
                "format": "uuid"
              },
              "replacesId": {
                "type": [
                  "string",
                  "null"
                ],
                "format": "uuid"
              },
              "measurementId": {
                "type": "string",
                "format": "uuid"
              }
            }
          },
          "type": {
            "type": "string",
            "const": "measurement.created"
          },
          "timestamp": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "Ereignis_appointment_cancelled": {
        "type": "object",
        "required": [
          "type",
          "timestamp",
          "data"
        ],
        "properties": {
          "data": {
            "type": "object",
            "properties": {
              "end": {
                "type": "string",
                "format": "date-time"
              },
              "type": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "start": {
                "type": "string",
                "format": "date-time"
              },
              "source": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "status": {
                "type": "string"
              },
              "patientId": {
                "type": [
                  "string",
                  "null"
                ],
                "format": "uuid"
              },
              "treatmentId": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "appointmentId": {
                "type": "string",
                "format": "uuid"
              }
            }
          },
          "type": {
            "type": "string",
            "const": "appointment.cancelled"
          },
          "timestamp": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "Ereignis_invoice_draft_created": {
        "type": "object",
        "required": [
          "type",
          "timestamp",
          "data"
        ],
        "properties": {
          "data": {
            "type": "object",
            "properties": {
              "draftId": {
                "type": "string",
                "format": "uuid"
              },
              "patientId": {
                "type": "string",
                "format": "uuid"
              },
              "appointmentId": {
                "type": [
                  "string",
                  "null"
                ],
                "format": "uuid"
              }
            }
          },
          "type": {
            "type": "string",
            "const": "invoice.draft_created"
          },
          "timestamp": {
            "type": "string",
            "format": "date-time"
          }
        }
      }
    },
    "securitySchemes": {
      "apiKey": {
        "type": "http",
        "scheme": "bearer",
        "description": "API-Schlüssel nfk_... im Kopf Authorization: Bearer (alternativ X-API-Key). Anlegen in NuvaFace unter Einstellungen, Schnittstellen, mit Bestätigungscode per Mail."
      }
    }
  }
}
