{
  "info": {
    "title": "NuvaFace Praxis-API",
    "contact": {
      "name": "NuvaFace",
      "email": "info@nuvaface.com"
    },
    "summary": "Patienten, Termine, freie Zeiten, Rechnungen lesen und Dokumente in die Akte legen, mit Webhooks.",
    "description": "Stand 26.11.2026. 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, Rechnungen ohne Positionen. Schreiben: nur Dokumente (PDF, JPEG, PNG) in die Akte. Nicht über die API: Patienten oder Termine anlegen, Rechnungen anlegen oder versenden, Löschen, Anamnese, Diagnosen, Notizen.\n\nEingeschränkte Akten (Art. 18 DSGVO) und archivierte Akten erscheinen nicht: Einzelabruf 404, in Listen fehlen sie, ein Dokument 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: Pfad /v1. Abwärtskompatible Ergänzungen (neue Felder, neue Endpunkte) ohne neue Version; Clients ignorieren unbekannte Felder. Eine inkompatible Änderung bekommt /v2, v1 bleibt dann mindestens 12 Monate nach Ankündigung erhalten.",
    "version": "1.0.0",
    "x-nuvaface-release": {
      "veroeffentlichtAm": "2026-09-14T22:00:00.000Z",
      "art": "major"
    }
  },
  "tags": [
    {
      "name": "Zugang"
    },
    {
      "name": "Patienten"
    },
    {
      "name": "Termine"
    },
    {
      "name": "Freie Zeiten"
    },
    {
      "name": "Dokumente"
    },
    {
      "name": "Rechnungen"
    }
  ],
  "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"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "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"
                }
              }
            },
            "description": "Nicht angemeldet oder Schlüssel ungültig"
          },
          "403": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "Scope fehlt, Schnittstelle nicht freigeschaltet oder Praxis gesperrt (code nennt den Grund)"
          },
          "429": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "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"
                }
              }
            },
            "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"
      }
    },
    "/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"
                      ]
                    }
                  }
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "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"
                }
              }
            },
            "description": "Nicht angemeldet oder Schlüssel ungültig"
          },
          "403": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "Scope fehlt, Schnittstelle nicht freigeschaltet oder Praxis gesperrt (code nennt den Grund)"
          },
          "429": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "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"
                }
              }
            },
            "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. Einzelne Rechnungen lassen sich in dieser Fassung nicht abrufen.",
        "operationId": "rechnungenLesen"
      }
    },
    "/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"
                      ]
                    }
                  }
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "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"
                }
              }
            },
            "description": "Nicht angemeldet oder Schlüssel ungültig"
          },
          "403": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "Scope fehlt, Schnittstelle nicht freigeschaltet oder Praxis gesperrt (code nennt den Grund)"
          },
          "429": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "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"
                }
              }
            },
            "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"
          },
          {
            "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"
      }
    },
    "/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"
                      }
                    }
                  }
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "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"
                }
              }
            },
            "description": "Nicht angemeldet oder Schlüssel ungültig"
          },
          "403": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "Scope fehlt, Schnittstelle nicht freigeschaltet oder Praxis gesperrt (code nennt den Grund)"
          },
          "429": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "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"
                }
              }
            },
            "description": "Prüfung vorübergehend gestört oder (beim Upload) Server ausgelastet; Kopf Retry-After abwarten"
          }
        },
        "description": "Scope: availability.read.",
        "operationId": "behandlungen"
      }
    },
    "/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"
                      ]
                    }
                  }
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "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"
                }
              }
            },
            "description": "Nicht angemeldet oder Schlüssel ungültig"
          },
          "403": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "Scope fehlt, Schnittstelle nicht freigeschaltet oder Praxis gesperrt (code nennt den Grund)"
          },
          "429": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "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"
                }
              }
            },
            "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"
      }
    },
    "/availability": {
      "get": {
        "tags": [
          "Freie Zeiten"
        ],
        "summary": "Freie Zeiten (höchstens 31 Tage)",
        "security": [
          {
            "apiKey": []
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FreieZeiten"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "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"
                }
              }
            },
            "description": "Nicht angemeldet oder Schlüssel ungültig"
          },
          "403": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "Scope fehlt, Schnittstelle nicht freigeschaltet oder Praxis gesperrt (code nennt den Grund)"
          },
          "404": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "Behandlung nicht gefunden (treatmentId)"
          },
          "429": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "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"
                }
              }
            },
            "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"
      }
    },
    "/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"
                    }
                  ]
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "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"
                }
              }
            },
            "description": "Nicht angemeldet oder Schlüssel ungültig"
          },
          "403": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "Scope fehlt, Schnittstelle nicht freigeschaltet oder Praxis gesperrt (code nennt den Grund)"
          },
          "404": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "Nicht gefunden (auch eingeschränkt oder archiviert)"
          },
          "429": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "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"
                }
              }
            },
            "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"
      }
    },
    "/appointments/{id}": {
      "get": {
        "tags": [
          "Termine"
        ],
        "summary": "Termin lesen",
        "security": [
          {
            "apiKey": []
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Termin"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "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"
                }
              }
            },
            "description": "Nicht angemeldet oder Schlüssel ungültig"
          },
          "403": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "Scope fehlt, Schnittstelle nicht freigeschaltet oder Praxis gesperrt (code nennt den Grund)"
          },
          "404": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "Nicht gefunden"
          },
          "429": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "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"
                }
              }
            },
            "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"
      }
    },
    "/patients/{id}/documents": {
      "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"
                }
              }
            },
            "description": "Abgelegt"
          },
          "400": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "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"
                }
              }
            },
            "description": "Nicht angemeldet oder Schlüssel ungültig"
          },
          "403": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "Scope fehlt, Schnittstelle nicht freigeschaltet oder Praxis gesperrt (code nennt den Grund)"
          },
          "404": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "Patient nicht gefunden"
          },
          "409": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "Anfrage mit diesem Idempotency-Key läuft noch"
          },
          "413": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "Zu groß"
          },
          "415": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "Dateityp nicht erlaubt"
          },
          "422": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "Idempotency-Key mit anderem Inhalt"
          },
          "423": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "Akte eingeschränkt (RECORD_RESTRICTED), nichts abgelegt"
          },
          "429": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "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"
                }
              }
            },
            "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",
              "maxLength": 255
            },
            "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
        }
      }
    }
  },
  "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"
              }
            }
          }
        }
      }
    },
    "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"
              }
            }
          }
        }
      }
    },
    "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"
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "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": {
          "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"
                  ],
                  "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"
                ]
              }
            }
          },
          "apiVersion": {
            "type": "string"
          }
        }
      },
      "Patient": {
        "type": "object",
        "required": [
          "id",
          "firstName",
          "lastName"
        ],
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "age": {
            "type": [
              "integer",
              "null"
            ]
          },
          "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",
              "VALIDATION",
              "IDEMPOTENCY_IN_PROGRESS",
              "IDEMPOTENCY_MISMATCH",
              "RECORD_RESTRICTED",
              "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"
          }
        }
      },
      "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"
            ]
          }
        }
      },
      "Behandlung": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "name": {
            "type": "string"
          },
          "category": {
            "type": [
              "string",
              "null"
            ]
          },
          "onlineBookable": {
            "type": "boolean"
          },
          "durationMinutes": {
            "type": [
              "integer",
              "null"
            ]
          }
        }
      },
      "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"
          }
        }
      },
      "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
      },
      "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"
          }
        }
      },
      "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_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_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"
          }
        }
      }
    },
    "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."
      }
    }
  }
}
