{
  "openapi": "3.1.0",
  "info": {
    "title": "Agile Storage API",
    "version": "1.0.0",
    "description": "Die REST-API von **Agile Storage** bietet alle Funktionen der Web-App: Ordner, Dateien, Uploads in Teilen mit Fortsetzen, Versionen, Papierkorb, Favoriten, Suche, Teilen mit Personen, Teams und Links, Synchronisation und Webhooks. Web-App und Desktop-App nutzen genau diese Schnittstelle.\n\n## Schnellstart\n1. In der App unter **Einstellungen › Entwickler** einen API-Schlüssel anlegen (Rechte wählen). Er wird nur einmal angezeigt.\n2. Erster Aufruf:\n```bash\ncurl -H \"Authorization: Bearer agile_sto_…\" https://storage.agiledeveloper.de/api/v1/eintraege\n```\n3. Datei hochladen:\n```bash\ncurl -X POST -H \"Authorization: Bearer agile_sto_…\" --data-binary @bericht.pdf \"https://storage.agiledeveloper.de/api/v1/dateien?name=bericht.pdf\"\n```\n\n## Authentifizierung\n`Authorization: Bearer <schlüssel>` mit einem API-Schlüssel (`agile_sto_…`) oder einem OAuth-Access-Token (Authorization Code mit PKCE). Rechte: `dateien:lesen`, `dateien:schreiben`, `freigaben:verwalten`, `teams:verwalten`, `konto:lesen`, `webhooks:verwalten`.\n\n## Fehler\nEinheitlich `{ \"fehler\": { \"code\", \"nachricht\", \"details\" } }` mit passendem HTTP-Status. Wichtige Codes: `konflikt` (409, Datei wurde inzwischen geändert), `name_vergeben` (409), `speicher_voll` (507), `recht` (403).\n\n## Pagination\nListen nehmen `limit` und `offset` und antworten mit `{ \"daten\": [...], \"seite\": { \"limit\", \"offset\", \"gesamt\" } }`.\n\n## Rate-Limits\n300 Anfragen pro Minute je Schlüssel bzw. App. Jede Antwort trägt `RateLimit-Limit`, `RateLimit-Remaining` und `RateLimit-Reset`; bei 429 zusätzlich `Retry-After`.\n\n## Idempotenz\nPOST-Anfragen akzeptieren `Idempotency-Key`. Eine Wiederholung mit demselben Schlüssel liefert die gespeicherte Antwort (Header `Idempotent-Replayed: true`).\n\n## Große Dateien\n`POST /api/v1/uploads` mit Name und Größe, dann jedes Teil mit `PUT /api/v1/uploads/{id}/teile/{nr}` (Standard 8 MB), zum Schluss `POST …/abschliessen`. Bricht die Verbindung ab, zeigt `GET /api/v1/uploads/{id}` die fehlenden Teile. Mit `sha256` prüft der Server die Datei vor dem Übernehmen.\n\n## Konfliktschutz\nWer eine Datei ändert, gibt die bekannte `version_id` mit (`If-Match` bzw. `if_match`). Hat jemand die Datei inzwischen geändert, antwortet die API mit 409 und überschreibt nichts.\n\n## Synchronisation\n`GET /api/v1/sync/aenderungen?cursor=0` liefert den Bestand, danach mit dem gelieferten Cursor nur Änderungen. `/api/v1/sync/warten` wartet bis zu 55 Sekunden auf neue Änderungen.\n\n## Webhooks\nEreignisse: `datei.hochgeladen` (Datei hochgeladen), `datei.geaendert` (Datei geändert (neue Version, umbenannt, verschoben)), `datei.geloescht` (In den Papierkorb gelegt), `ordner.angelegt` (Ordner angelegt), `freigabe.erhalten` (Etwas wurde mit Ihnen geteilt), `link.upload` (Upload über Ihren Upload-Link), `speicher.fast_voll` (Speicher fast voll). Zustellung per POST mit JSON (Schema WebhookEreignis) und Header `Agile-Signature: t=<unix>,v1=<hex>`; `v1` ist HMAC-SHA256 mit dem Webhook-Geheimnis über `<t>.<body>`. Antworten Sie mit 2xx; sonst wiederholen wir nach 1, 5, 30, 120, 360 und 1440 Minuten.\n\n## WebDAV\n`https://storage.agiledeveloper.de/dav/` mit E-Mail-Adresse und einem App-Passwort (Einstellungen › WebDAV). Für Explorer, Finder, rclone, Cyberduck und andere.\n\n## MCP für Claude und ChatGPT\nMCP-Server: `https://storage.agiledeveloper.de/mcp` (Streamable HTTP, OAuth 2.1 mit Discovery und dynamischer Registrierung). Anleitung: [/docs/mcp](https://storage.agiledeveloper.de/docs/mcp).",
    "contact": {
      "name": "Agile Developer",
      "email": "info@agiledeveloper.de",
      "url": "https://agiledeveloper.de"
    },
    "license": {
      "name": "Proprietär",
      "url": "https://agiledeveloper.de/impressum"
    }
  },
  "servers": [
    {
      "url": "https://storage.agiledeveloper.de",
      "description": "Produktion"
    }
  ],
  "tags": [
    {
      "name": "Dateien und Ordner",
      "description": "Auflisten, anlegen, umbenennen, verschieben, kopieren, löschen."
    },
    {
      "name": "Inhalte",
      "description": "Herunterladen, hochladen, Vorschau, ZIP."
    },
    {
      "name": "Uploads in Teilen",
      "description": "Große Dateien fortsetzbar hochladen."
    },
    {
      "name": "Versionen",
      "description": "Frühere Fassungen einer Datei."
    },
    {
      "name": "Papierkorb",
      "description": "30 Tage wiederherstellbar."
    },
    {
      "name": "Favoriten und Zuletzt",
      "description": "Schnellzugriff."
    },
    {
      "name": "Suche",
      "description": "Namen und Inhalte."
    },
    {
      "name": "Teilen",
      "description": "Mit Personen und Teams."
    },
    {
      "name": "Links",
      "description": "Öffentliche Links mit Passwort, Ablauf, Nur-Ansehen und Upload-Links."
    },
    {
      "name": "Teams",
      "description": "Gruppen für gemeinsames Teilen."
    },
    {
      "name": "Synchronisation",
      "description": "Änderungsjournal für Desktop-Clients und Integrationen."
    },
    {
      "name": "Konto",
      "description": "Profil, Speicher, Benachrichtigungen."
    },
    {
      "name": "Webhook-Endpunkte",
      "description": "Signierte Ereignisse an Ihre Systeme."
    }
  ],
  "security": [
    {
      "apiSchluessel": []
    },
    {
      "oauth2": [
        "lesen"
      ]
    }
  ],
  "paths": {
    "/api/v1/ich": {
      "get": {
        "tags": [
          "Konto"
        ],
        "summary": "Eigenes Konto",
        "operationId": "getIch",
        "description": "Profil, Speicherplatz und Rechte des aktuellen Zugangs.\n\nJeder gültige Zugang.",
        "responses": {
          "200": {
            "description": "Erfolg",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Ich"
                }
              }
            }
          },
          "401": {
            "description": "Nicht angemeldet",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Fehler"
                }
              }
            }
          },
          "429": {
            "description": "Rate-Limit überschritten",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Fehler"
                }
              }
            }
          }
        },
        "security": [
          {
            "apiSchluessel": []
          },
          {
            "oauth2": [
              "lesen"
            ]
          }
        ]
      }
    },
    "/api/v1/speicher": {
      "get": {
        "tags": [
          "Konto"
        ],
        "summary": "Speicherplatz",
        "operationId": "getSpeicher",
        "description": "Recht: `konto:lesen` (OAuth: lesen).",
        "responses": {
          "200": {
            "description": "Erfolg",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Speicher"
                }
              }
            }
          },
          "401": {
            "description": "Nicht angemeldet",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Fehler"
                }
              }
            }
          },
          "403": {
            "description": "Recht fehlt",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Fehler"
                }
              }
            }
          },
          "429": {
            "description": "Rate-Limit überschritten",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Fehler"
                }
              }
            }
          }
        },
        "security": [
          {
            "apiSchluessel": []
          },
          {
            "oauth2": [
              "lesen"
            ]
          }
        ]
      }
    },
    "/api/v1/benachrichtigungen": {
      "get": {
        "tags": [
          "Konto"
        ],
        "summary": "Benachrichtigungen",
        "operationId": "getBenachrichtigungen",
        "description": "Die letzten 50 Benachrichtigungen (Glocke).\n\nRecht: `konto:lesen` (OAuth: lesen).",
        "responses": {
          "200": {
            "description": "Erfolg",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "daten": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Benachrichtigung"
                      }
                    },
                    "ungelesen": {
                      "type": "integer"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Nicht angemeldet",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Fehler"
                }
              }
            }
          },
          "403": {
            "description": "Recht fehlt",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Fehler"
                }
              }
            }
          },
          "429": {
            "description": "Rate-Limit überschritten",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Fehler"
                }
              }
            }
          }
        },
        "security": [
          {
            "apiSchluessel": []
          },
          {
            "oauth2": [
              "lesen"
            ]
          }
        ]
      }
    },
    "/api/v1/benachrichtigungen/gelesen": {
      "post": {
        "tags": [
          "Konto"
        ],
        "summary": "Als gelesen markieren",
        "operationId": "postBenachrichtigungenGelesen",
        "description": "Ohne id: alle.\n\nRecht: `konto:lesen` (OAuth: lesen).",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "integer"
                  }
                }
              },
              "example": {}
            }
          }
        },
        "responses": {
          "200": {
            "description": "Erfolg",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Nicht angemeldet",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Fehler"
                }
              }
            }
          },
          "403": {
            "description": "Recht fehlt",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Fehler"
                }
              }
            }
          },
          "429": {
            "description": "Rate-Limit überschritten",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Fehler"
                }
              }
            }
          }
        },
        "security": [
          {
            "apiSchluessel": []
          },
          {
            "oauth2": [
              "lesen"
            ]
          }
        ]
      }
    },
    "/api/v1/eintraege": {
      "get": {
        "tags": [
          "Dateien und Ordner"
        ],
        "summary": "Ordnerinhalt auflisten",
        "operationId": "getEintraege",
        "description": "Ohne ordner: „Meine Ablage“. Ordner zuerst, dann Dateien.\n\nRecht: `dateien:lesen` (OAuth: lesen).",
        "parameters": [
          {
            "name": "ordner",
            "in": "query",
            "description": "id des Ordners",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "sortierung",
            "in": "query",
            "description": "Sortierung",
            "schema": {
              "type": "string",
              "enum": [
                "name",
                "geaendert",
                "groesse",
                "typ"
              ]
            }
          },
          {
            "name": "richtung",
            "in": "query",
            "description": "auf oder ab",
            "schema": {
              "type": "string",
              "enum": [
                "auf",
                "ab"
              ]
            }
          },
          {
            "name": "limit",
            "in": "query",
            "description": "Anzahl je Seite",
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          },
          {
            "name": "offset",
            "in": "query",
            "description": "Versatz",
            "schema": {
              "type": "integer",
              "minimum": 0,
              "default": 0
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Erfolg",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Ordnerinhalt"
                }
              }
            }
          },
          "401": {
            "description": "Nicht angemeldet",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Fehler"
                }
              }
            }
          },
          "403": {
            "description": "Recht fehlt",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Fehler"
                }
              }
            }
          },
          "404": {
            "description": "Nicht gefunden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Fehler"
                }
              }
            }
          },
          "429": {
            "description": "Rate-Limit überschritten",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Fehler"
                }
              }
            }
          }
        },
        "security": [
          {
            "apiSchluessel": []
          },
          {
            "oauth2": [
              "lesen"
            ]
          }
        ]
      }
    },
    "/api/v1/eintraege/{id}": {
      "get": {
        "tags": [
          "Dateien und Ordner"
        ],
        "summary": "Eintrag lesen",
        "operationId": "getEintraegeId",
        "description": "Mit Pfad (Brotkrumen) und Ihrer Rolle.\n\nRecht: `dateien:lesen` (OAuth: lesen).",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "id der Datei bzw. des Ordners",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Erfolg",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Eintrag"
                },
                "example": {
                  "id": "3f1c0b7e-8a52-4c5a-9a3e-2f0a3b9d1c11",
                  "typ": "datei",
                  "name": "Angebot.pdf",
                  "art": "pdf",
                  "groesse": 482113,
                  "mime": "application/pdf",
                  "sha256": "9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08",
                  "version_id": "6b2d0c1a-1111-4c5a-9a3e-2f0a3b9d1c22",
                  "eltern_id": "0d4e5f6a-2222-4c5a-9a3e-2f0a3b9d1c33",
                  "geaendert_am": "2026-10-11T08:30:00.000Z",
                  "erstellt_am": "2026-10-11T08:30:00.000Z",
                  "aktualisiert_am": "2026-10-11T08:30:00.000Z",
                  "favorit": false,
                  "geteilt": true,
                  "wurzel": false,
                  "besitzer": {
                    "id": "7a8b9c0d-3333-4c5a-9a3e-2f0a3b9d1c44",
                    "name": "Max Muster",
                    "email": "max@example.com"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Nicht angemeldet",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Fehler"
                }
              }
            }
          },
          "403": {
            "description": "Recht fehlt",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Fehler"
                }
              }
            }
          },
          "404": {
            "description": "Nicht gefunden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Fehler"
                }
              }
            }
          },
          "429": {
            "description": "Rate-Limit überschritten",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Fehler"
                }
              }
            }
          }
        },
        "security": [
          {
            "apiSchluessel": []
          },
          {
            "oauth2": [
              "lesen"
            ]
          }
        ]
      },
      "patch": {
        "tags": [
          "Dateien und Ordner"
        ],
        "summary": "Umbenennen oder verschieben",
        "operationId": "patchEintraegeId",
        "description": "Verschieben geht innerhalb derselben Ablage. Namen dürfen \\ / : * ? \" < > | nicht enthalten.\n\nRecht: `dateien:schreiben` (OAuth: schreiben).",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "id der Datei bzw. des Ordners",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string"
                  },
                  "eltern_id": {
                    "type": "string",
                    "format": "uuid"
                  },
                  "geaendert_am": {
                    "type": "string",
                    "format": "date-time"
                  },
                  "konflikt": {
                    "type": "string",
                    "enum": [
                      "fehler",
                      "umbenennen"
                    ]
                  }
                }
              },
              "example": {
                "name": "Angebot final.pdf"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Erfolg",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Eintrag"
                }
              }
            }
          },
          "400": {
            "description": "Eingabe ungültig",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Fehler"
                }
              }
            }
          },
          "401": {
            "description": "Nicht angemeldet",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Fehler"
                }
              }
            }
          },
          "403": {
            "description": "Recht fehlt",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Fehler"
                }
              }
            }
          },
          "404": {
            "description": "Nicht gefunden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Fehler"
                }
              }
            }
          },
          "409": {
            "description": "Konflikt (Name vergeben, Datei geändert)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Fehler"
                }
              }
            }
          },
          "429": {
            "description": "Rate-Limit überschritten",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Fehler"
                }
              }
            }
          }
        },
        "security": [
          {
            "apiSchluessel": []
          },
          {
            "oauth2": [
              "schreiben"
            ]
          }
        ]
      },
      "delete": {
        "tags": [
          "Dateien und Ordner"
        ],
        "summary": "In den Papierkorb",
        "operationId": "deleteEintraegeId",
        "description": "Legt den Eintrag samt Inhalt in den Papierkorb (30 Tage wiederherstellbar).\n\nRecht: `dateien:schreiben` (OAuth: schreiben).",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "id der Datei bzw. des Ordners",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Erfolg",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "eintraege": {
                      "type": "integer"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Nicht angemeldet",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Fehler"
                }
              }
            }
          },
          "403": {
            "description": "Recht fehlt",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Fehler"
                }
              }
            }
          },
          "404": {
            "description": "Nicht gefunden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Fehler"
                }
              }
            }
          },
          "429": {
            "description": "Rate-Limit überschritten",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Fehler"
                }
              }
            }
          }
        },
        "security": [
          {
            "apiSchluessel": []
          },
          {
            "oauth2": [
              "schreiben"
            ]
          }
        ]
      }
    },
    "/api/v1/eintraege/{id}/kopieren": {
      "post": {
        "tags": [
          "Dateien und Ordner"
        ],
        "summary": "Kopieren",
        "operationId": "postEintraegeIdKopieren",
        "description": "Kopiert Datei oder Ordner in ziel_id (Standard: Meine Ablage). Auch aus Freigaben in die eigene Ablage.\n\nRecht: `dateien:schreiben` (OAuth: schreiben).",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "id der Datei bzw. des Ordners",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "description": "Optional: gleiche Anfrage mit gleichem Schlüssel wird nur einmal ausgeführt (24 h).",
            "schema": {
              "type": "string",
              "maxLength": 200
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "ziel_id": {
                    "type": "string",
                    "format": "uuid"
                  },
                  "name": {
                    "type": "string"
                  }
                }
              },
              "example": {
                "ziel_id": "0d4e5f6a-2222-4c5a-9a3e-2f0a3b9d1c33"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Erfolg",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Eintrag"
                }
              }
            }
          },
          "400": {
            "description": "Eingabe ungültig",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Fehler"
                }
              }
            }
          },
          "401": {
            "description": "Nicht angemeldet",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Fehler"
                }
              }
            }
          },
          "403": {
            "description": "Recht fehlt",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Fehler"
                }
              }
            }
          },
          "404": {
            "description": "Nicht gefunden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Fehler"
                }
              }
            }
          },
          "429": {
            "description": "Rate-Limit überschritten",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Fehler"
                }
              }
            }
          },
          "507": {
            "description": "Speicherplatz reicht nicht",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Fehler"
                }
              }
            }
          }
        },
        "security": [
          {
            "apiSchluessel": []
          },
          {
            "oauth2": [
              "schreiben"
            ]
          }
        ]
      }
    },
    "/api/v1/eintraege/{id}/inhalt": {
      "get": {
        "tags": [
          "Inhalte"
        ],
        "summary": "Datei herunterladen",
        "operationId": "getEintraegeIdInhalt",
        "description": "Unterstützt Range-Anfragen (Videos, Fortsetzen). Header X-Agile-Version und X-Agile-Sha256. Mit download=1 immer als Anhang.\n\nRecht: `dateien:lesen` (OAuth: lesen).",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "id der Datei bzw. des Ordners",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "version",
            "in": "query",
            "description": "Bestimmte Version",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "download",
            "in": "query",
            "description": "1 = als Anhang",
            "schema": {
              "type": "string",
              "enum": [
                "1"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Inhalt",
            "content": {
              "application/octet-stream": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "401": {
            "description": "Nicht angemeldet",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Fehler"
                }
              }
            }
          },
          "403": {
            "description": "Recht fehlt",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Fehler"
                }
              }
            }
          },
          "404": {
            "description": "Nicht gefunden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Fehler"
                }
              }
            }
          },
          "429": {
            "description": "Rate-Limit überschritten",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Fehler"
                }
              }
            }
          }
        },
        "security": [
          {
            "apiSchluessel": []
          },
          {
            "oauth2": [
              "lesen"
            ]
          }
        ]
      },
      "head": {
        "tags": [
          "Inhalte"
        ],
        "summary": "Kopfdaten der Datei",
        "operationId": "headEintraegeIdInhalt",
        "description": "Recht: `dateien:lesen` (OAuth: lesen).",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "id der Datei bzw. des Ordners",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Inhalt",
            "content": {
              "application/octet-stream": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "401": {
            "description": "Nicht angemeldet",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Fehler"
                }
              }
            }
          },
          "403": {
            "description": "Recht fehlt",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Fehler"
                }
              }
            }
          },
          "404": {
            "description": "Nicht gefunden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Fehler"
                }
              }
            }
          },
          "429": {
            "description": "Rate-Limit überschritten",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Fehler"
                }
              }
            }
          }
        },
        "security": [
          {
            "apiSchluessel": []
          },
          {
            "oauth2": [
              "lesen"
            ]
          }
        ]
      },
      "put": {
        "tags": [
          "Inhalte"
        ],
        "summary": "Neue Version hochladen",
        "operationId": "putEintraegeIdInhalt",
        "description": "Body = Dateiinhalt (bis 100 MB empfohlen, größer über /uploads). If-Match: erwartete aktuelle version_id; passt sie nicht, 409 „konflikt“ und nichts wird überschrieben.\n\nRecht: `dateien:schreiben` (OAuth: schreiben).",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "id der Datei bzw. des Ordners",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "If-Match",
            "in": "header",
            "schema": {
              "type": "string"
            },
            "description": "version_id"
          },
          {
            "name": "geaendert_am",
            "in": "query",
            "description": "Änderungszeit",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/octet-stream": {
              "schema": {
                "type": "string",
                "format": "binary"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Erfolg",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Eintrag"
                }
              }
            }
          },
          "400": {
            "description": "Eingabe ungültig",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Fehler"
                }
              }
            }
          },
          "401": {
            "description": "Nicht angemeldet",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Fehler"
                }
              }
            }
          },
          "403": {
            "description": "Recht fehlt",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Fehler"
                }
              }
            }
          },
          "404": {
            "description": "Nicht gefunden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Fehler"
                }
              }
            }
          },
          "409": {
            "description": "Konflikt (Name vergeben, Datei geändert)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Fehler"
                }
              }
            }
          },
          "413": {
            "description": "Zu groß",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Fehler"
                }
              }
            }
          },
          "429": {
            "description": "Rate-Limit überschritten",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Fehler"
                }
              }
            }
          },
          "507": {
            "description": "Speicherplatz reicht nicht",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Fehler"
                }
              }
            }
          }
        },
        "security": [
          {
            "apiSchluessel": []
          },
          {
            "oauth2": [
              "schreiben"
            ]
          }
        ]
      }
    },
    "/api/v1/eintraege/{id}/vorschaubild": {
      "get": {
        "tags": [
          "Inhalte"
        ],
        "summary": "Vorschaubild (WebP)",
        "operationId": "getEintraegeIdVorschaubild",
        "description": "Für Bilder, höchstens 480 px.\n\nRecht: `dateien:lesen` (OAuth: lesen).",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "id der Datei bzw. des Ordners",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Inhalt",
            "content": {
              "image/webp": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "401": {
            "description": "Nicht angemeldet",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Fehler"
                }
              }
            }
          },
          "403": {
            "description": "Recht fehlt",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Fehler"
                }
              }
            }
          },
          "404": {
            "description": "Nicht gefunden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Fehler"
                }
              }
            }
          },
          "429": {
            "description": "Rate-Limit überschritten",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Fehler"
                }
              }
            }
          }
        },
        "security": [
          {
            "apiSchluessel": []
          },
          {
            "oauth2": [
              "lesen"
            ]
          }
        ]
      }
    },
    "/api/v1/eintraege/{id}/vorschau": {
      "get": {
        "tags": [
          "Inhalte"
        ],
        "summary": "Vorschau als Daten",
        "operationId": "getEintraegeIdVorschau",
        "description": "Text, Word (HTML), Excel (Tabellen), PowerPoint (Folientext), OpenDocument.\n\nRecht: `dateien:lesen` (OAuth: lesen).",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "id der Datei bzw. des Ordners",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Erfolg",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Vorschau"
                }
              }
            }
          },
          "400": {
            "description": "Eingabe ungültig",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Fehler"
                }
              }
            }
          },
          "401": {
            "description": "Nicht angemeldet",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Fehler"
                }
              }
            }
          },
          "403": {
            "description": "Recht fehlt",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Fehler"
                }
              }
            }
          },
          "404": {
            "description": "Nicht gefunden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Fehler"
                }
              }
            }
          },
          "429": {
            "description": "Rate-Limit überschritten",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Fehler"
                }
              }
            }
          }
        },
        "security": [
          {
            "apiSchluessel": []
          },
          {
            "oauth2": [
              "lesen"
            ]
          }
        ]
      }
    },
    "/api/v1/eintraege/{id}/zip": {
      "get": {
        "tags": [
          "Inhalte"
        ],
        "summary": "Ordner als ZIP",
        "operationId": "getEintraegeIdZip",
        "description": "Streamt den Ordner samt Unterordnern als ZIP (ZIP64 ab 4 GB).\n\nRecht: `dateien:lesen` (OAuth: lesen).",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "id der Datei bzw. des Ordners",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Inhalt",
            "content": {
              "application/zip": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "401": {
            "description": "Nicht angemeldet",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Fehler"
                }
              }
            }
          },
          "403": {
            "description": "Recht fehlt",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Fehler"
                }
              }
            }
          },
          "404": {
            "description": "Nicht gefunden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Fehler"
                }
              }
            }
          },
          "429": {
            "description": "Rate-Limit überschritten",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Fehler"
                }
              }
            }
          }
        },
        "security": [
          {
            "apiSchluessel": []
          },
          {
            "oauth2": [
              "lesen"
            ]
          }
        ]
      }
    },
    "/api/v1/zip": {
      "get": {
        "tags": [
          "Inhalte"
        ],
        "summary": "Mehrere Einträge als ZIP",
        "operationId": "getZip",
        "description": "Recht: `dateien:lesen` (OAuth: lesen).",
        "parameters": [
          {
            "name": "ids",
            "in": "query",
            "description": "Kommagetrennte ids",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Inhalt",
            "content": {
              "application/zip": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "400": {
            "description": "Eingabe ungültig",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Fehler"
                }
              }
            }
          },
          "401": {
            "description": "Nicht angemeldet",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Fehler"
                }
              }
            }
          },
          "403": {
            "description": "Recht fehlt",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Fehler"
                }
              }
            }
          },
          "404": {
            "description": "Nicht gefunden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Fehler"
                }
              }
            }
          },
          "429": {
            "description": "Rate-Limit überschritten",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Fehler"
                }
              }
            }
          }
        },
        "security": [
          {
            "apiSchluessel": []
          },
          {
            "oauth2": [
              "lesen"
            ]
          }
        ]
      }
    },
    "/api/v1/eintraege/{id}/versionen": {
      "get": {
        "tags": [
          "Versionen"
        ],
        "summary": "Versionen auflisten",
        "operationId": "getEintraegeIdVersionen",
        "description": "Recht: `dateien:lesen` (OAuth: lesen).",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "id der Datei bzw. des Ordners",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "description": "Anzahl je Seite",
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          },
          {
            "name": "offset",
            "in": "query",
            "description": "Versatz",
            "schema": {
              "type": "integer",
              "minimum": 0,
              "default": 0
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Erfolg",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "daten": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Version"
                      }
                    },
                    "seite": {
                      "$ref": "#/components/schemas/Seite"
                    }
                  },
                  "required": [
                    "daten",
                    "seite"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Nicht angemeldet",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Fehler"
                }
              }
            }
          },
          "403": {
            "description": "Recht fehlt",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Fehler"
                }
              }
            }
          },
          "404": {
            "description": "Nicht gefunden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Fehler"
                }
              }
            }
          },
          "429": {
            "description": "Rate-Limit überschritten",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Fehler"
                }
              }
            }
          }
        },
        "security": [
          {
            "apiSchluessel": []
          },
          {
            "oauth2": [
              "lesen"
            ]
          }
        ]
      }
    },
    "/api/v1/eintraege/{id}/versionen/{version}": {
      "patch": {
        "tags": [
          "Versionen"
        ],
        "summary": "Version dauerhaft behalten",
        "operationId": "patchEintraegeIdVersionenVersion",
        "description": "Behaltene Versionen räumt die automatische Bereinigung nicht ab.\n\nRecht: `dateien:schreiben` (OAuth: schreiben).",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "id der Datei bzw. des Ordners",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "version",
            "in": "path",
            "required": true,
            "description": "Versions-id",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "behalten": {
                    "type": "boolean"
                  }
                }
              },
              "example": {
                "behalten": true
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Erfolg",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "behalten": {
                      "type": "boolean"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Nicht angemeldet",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Fehler"
                }
              }
            }
          },
          "403": {
            "description": "Recht fehlt",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Fehler"
                }
              }
            }
          },
          "404": {
            "description": "Nicht gefunden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Fehler"
                }
              }
            }
          },
          "429": {
            "description": "Rate-Limit überschritten",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Fehler"
                }
              }
            }
          }
        },
        "security": [
          {
            "apiSchluessel": []
          },
          {
            "oauth2": [
              "schreiben"
            ]
          }
        ]
      },
      "delete": {
        "tags": [
          "Versionen"
        ],
        "summary": "Version löschen",
        "operationId": "deleteEintraegeIdVersionenVersion",
        "description": "Nur Eigentümer, nicht die aktuelle Version.\n\nRecht: `dateien:schreiben` (OAuth: schreiben).",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "id der Datei bzw. des Ordners",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "version",
            "in": "path",
            "required": true,
            "description": "Versions-id",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Erledigt, ohne Inhalt"
          },
          "400": {
            "description": "Eingabe ungültig",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Fehler"
                }
              }
            }
          },
          "401": {
            "description": "Nicht angemeldet",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Fehler"
                }
              }
            }
          },
          "403": {
            "description": "Recht fehlt",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Fehler"
                }
              }
            }
          },
          "404": {
            "description": "Nicht gefunden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Fehler"
                }
              }
            }
          },
          "429": {
            "description": "Rate-Limit überschritten",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Fehler"
                }
              }
            }
          }
        },
        "security": [
          {
            "apiSchluessel": []
          },
          {
            "oauth2": [
              "schreiben"
            ]
          }
        ]
      }
    },
    "/api/v1/eintraege/{id}/versionen/{version}/wiederherstellen": {
      "post": {
        "tags": [
          "Versionen"
        ],
        "summary": "Version wiederherstellen",
        "operationId": "postEintraegeIdVersionenVersionWiederherstellen",
        "description": "Macht die Version zur aktuellen; die bisherige bleibt als Version erhalten.\n\nRecht: `dateien:schreiben` (OAuth: schreiben).",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "id der Datei bzw. des Ordners",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "version",
            "in": "path",
            "required": true,
            "description": "Versions-id",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Erfolg",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Eintrag"
                }
              }
            }
          },
          "401": {
            "description": "Nicht angemeldet",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Fehler"
                }
              }
            }
          },
          "403": {
            "description": "Recht fehlt",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Fehler"
                }
              }
            }
          },
          "404": {
            "description": "Nicht gefunden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Fehler"
                }
              }
            }
          },
          "429": {
            "description": "Rate-Limit überschritten",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Fehler"
                }
              }
            }
          }
        },
        "security": [
          {
            "apiSchluessel": []
          },
          {
            "oauth2": [
              "schreiben"
            ]
          }
        ]
      }
    },
    "/api/v1/eintraege/{id}/favorit": {
      "put": {
        "tags": [
          "Favoriten und Zuletzt"
        ],
        "summary": "Als Favorit markieren",
        "operationId": "putEintraegeIdFavorit",
        "description": "Recht: `dateien:lesen` (OAuth: lesen).",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "id der Datei bzw. des Ordners",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Erfolg",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "favorit": {
                      "type": "boolean"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Nicht angemeldet",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Fehler"
                }
              }
            }
          },
          "403": {
            "description": "Recht fehlt",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Fehler"
                }
              }
            }
          },
          "404": {
            "description": "Nicht gefunden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Fehler"
                }
              }
            }
          },
          "429": {
            "description": "Rate-Limit überschritten",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Fehler"
                }
              }
            }
          }
        },
        "security": [
          {
            "apiSchluessel": []
          },
          {
            "oauth2": [
              "lesen"
            ]
          }
        ]
      },
      "delete": {
        "tags": [
          "Favoriten und Zuletzt"
        ],
        "summary": "Favorit entfernen",
        "operationId": "deleteEintraegeIdFavorit",
        "description": "Recht: `dateien:lesen` (OAuth: lesen).",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "id der Datei bzw. des Ordners",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Erfolg",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "favorit": {
                      "type": "boolean"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Nicht angemeldet",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Fehler"
                }
              }
            }
          },
          "403": {
            "description": "Recht fehlt",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Fehler"
                }
              }
            }
          },
          "404": {
            "description": "Nicht gefunden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Fehler"
                }
              }
            }
          },
          "429": {
            "description": "Rate-Limit überschritten",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Fehler"
                }
              }
            }
          }
        },
        "security": [
          {
            "apiSchluessel": []
          },
          {
            "oauth2": [
              "lesen"
            ]
          }
        ]
      }
    },
    "/api/v1/eintraege/{id}/freigaben": {
      "get": {
        "tags": [
          "Teilen"
        ],
        "summary": "Freigaben anzeigen",
        "operationId": "getEintraegeIdFreigaben",
        "description": "Recht: `dateien:lesen` (OAuth: lesen).",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "id der Datei bzw. des Ordners",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Erfolg",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Freigaben"
                }
              }
            }
          },
          "401": {
            "description": "Nicht angemeldet",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Fehler"
                }
              }
            }
          },
          "403": {
            "description": "Recht fehlt",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Fehler"
                }
              }
            }
          },
          "404": {
            "description": "Nicht gefunden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Fehler"
                }
              }
            }
          },
          "429": {
            "description": "Rate-Limit überschritten",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Fehler"
                }
              }
            }
          }
        },
        "security": [
          {
            "apiSchluessel": []
          },
          {
            "oauth2": [
              "lesen"
            ]
          }
        ]
      },
      "post": {
        "tags": [
          "Teilen"
        ],
        "summary": "Mit Person oder Team teilen",
        "operationId": "postEintraegeIdFreigaben",
        "description": "E-Mail ohne Konto: Einladung, die Freigabe greift nach der Registrierung.\n\nRecht: `freigaben:verwalten` (OAuth: teilen).",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "id der Datei bzw. des Ordners",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "description": "Optional: gleiche Anfrage mit gleichem Schlüssel wird nur einmal ausgeführt (24 h).",
            "schema": {
              "type": "string",
              "maxLength": 200
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/FreigabeEingabe"
              },
              "example": {
                "email": "kollegin@example.com",
                "rolle": "bearbeiter",
                "nachricht": "Hier die Unterlagen."
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Erfolg",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Freigaben"
                }
              }
            }
          },
          "400": {
            "description": "Eingabe ungültig",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Fehler"
                }
              }
            }
          },
          "401": {
            "description": "Nicht angemeldet",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Fehler"
                }
              }
            }
          },
          "403": {
            "description": "Recht fehlt",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Fehler"
                }
              }
            }
          },
          "404": {
            "description": "Nicht gefunden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Fehler"
                }
              }
            }
          },
          "429": {
            "description": "Rate-Limit überschritten",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Fehler"
                }
              }
            }
          }
        },
        "security": [
          {
            "apiSchluessel": []
          },
          {
            "oauth2": [
              "teilen"
            ]
          }
        ]
      }
    },
    "/api/v1/eintraege/{id}/freigaben/{freigabe}": {
      "patch": {
        "tags": [
          "Teilen"
        ],
        "summary": "Rolle ändern",
        "operationId": "patchEintraegeIdFreigabenFreigabe",
        "description": "Recht: `freigaben:verwalten` (OAuth: teilen).",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "id der Datei bzw. des Ordners",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "freigabe",
            "in": "path",
            "required": true,
            "description": "Freigabe-id",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "rolle"
                ],
                "properties": {
                  "rolle": {
                    "type": "string",
                    "enum": [
                      "betrachter",
                      "bearbeiter"
                    ]
                  }
                }
              },
              "example": {
                "rolle": "betrachter"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Erfolg",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Freigaben"
                }
              }
            }
          },
          "401": {
            "description": "Nicht angemeldet",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Fehler"
                }
              }
            }
          },
          "403": {
            "description": "Recht fehlt",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Fehler"
                }
              }
            }
          },
          "404": {
            "description": "Nicht gefunden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Fehler"
                }
              }
            }
          },
          "429": {
            "description": "Rate-Limit überschritten",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Fehler"
                }
              }
            }
          }
        },
        "security": [
          {
            "apiSchluessel": []
          },
          {
            "oauth2": [
              "teilen"
            ]
          }
        ]
      },
      "delete": {
        "tags": [
          "Teilen"
        ],
        "summary": "Freigabe entfernen",
        "operationId": "deleteEintraegeIdFreigabenFreigabe",
        "description": "Empfänger können eine Freigabe an sich selbst auch verlassen.\n\nRecht: `freigaben:verwalten` (OAuth: teilen).",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "id der Datei bzw. des Ordners",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "freigabe",
            "in": "path",
            "required": true,
            "description": "Freigabe-id",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Erledigt, ohne Inhalt"
          },
          "401": {
            "description": "Nicht angemeldet",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Fehler"
                }
              }
            }
          },
          "403": {
            "description": "Recht fehlt",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Fehler"
                }
              }
            }
          },
          "404": {
            "description": "Nicht gefunden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Fehler"
                }
              }
            }
          },
          "429": {
            "description": "Rate-Limit überschritten",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Fehler"
                }
              }
            }
          }
        },
        "security": [
          {
            "apiSchluessel": []
          },
          {
            "oauth2": [
              "teilen"
            ]
          }
        ]
      }
    },
    "/api/v1/eintraege/{id}/links": {
      "get": {
        "tags": [
          "Links"
        ],
        "summary": "Links eines Eintrags",
        "operationId": "getEintraegeIdLinks",
        "description": "Recht: `dateien:lesen` (OAuth: lesen).",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "id der Datei bzw. des Ordners",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Erfolg",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "daten": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Link"
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Nicht angemeldet",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Fehler"
                }
              }
            }
          },
          "403": {
            "description": "Recht fehlt",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Fehler"
                }
              }
            }
          },
          "404": {
            "description": "Nicht gefunden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Fehler"
                }
              }
            }
          },
          "429": {
            "description": "Rate-Limit überschritten",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Fehler"
                }
              }
            }
          }
        },
        "security": [
          {
            "apiSchluessel": []
          },
          {
            "oauth2": [
              "lesen"
            ]
          }
        ]
      },
      "post": {
        "tags": [
          "Links"
        ],
        "summary": "Link erstellen",
        "operationId": "postEintraegeIdLinks",
        "description": "modus herunterladen, ansehen (ohne Download) oder hochladen (nur Ordner). Optional Passwort, Ablaufdatum, Download-Limit.\n\nRecht: `freigaben:verwalten` (OAuth: teilen).",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "id der Datei bzw. des Ordners",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "description": "Optional: gleiche Anfrage mit gleichem Schlüssel wird nur einmal ausgeführt (24 h).",
            "schema": {
              "type": "string",
              "maxLength": 200
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/LinkEingabe"
              },
              "example": {
                "modus": "herunterladen",
                "passwort": "sommer-2026",
                "laeuft_ab_am": "2026-11-01T00:00:00+01:00"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Erfolg",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Link"
                }
              }
            }
          },
          "400": {
            "description": "Eingabe ungültig",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Fehler"
                }
              }
            }
          },
          "401": {
            "description": "Nicht angemeldet",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Fehler"
                }
              }
            }
          },
          "403": {
            "description": "Recht fehlt",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Fehler"
                }
              }
            }
          },
          "404": {
            "description": "Nicht gefunden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Fehler"
                }
              }
            }
          },
          "429": {
            "description": "Rate-Limit überschritten",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Fehler"
                }
              }
            }
          }
        },
        "security": [
          {
            "apiSchluessel": []
          },
          {
            "oauth2": [
              "teilen"
            ]
          }
        ]
      }
    },
    "/api/v1/ordner": {
      "post": {
        "tags": [
          "Dateien und Ordner"
        ],
        "summary": "Ordner anlegen",
        "operationId": "postOrdner",
        "description": "Mit pfad („a/b/c“) werden fehlende Ordner angelegt und der letzte zurückgegeben.\n\nRecht: `dateien:schreiben` (OAuth: schreiben).",
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "description": "Optional: gleiche Anfrage mit gleichem Schlüssel wird nur einmal ausgeführt (24 h).",
            "schema": {
              "type": "string",
              "maxLength": 200
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string"
                  },
                  "eltern_id": {
                    "type": "string",
                    "format": "uuid"
                  },
                  "pfad": {
                    "type": "string"
                  },
                  "konflikt": {
                    "type": "string",
                    "enum": [
                      "fehler",
                      "umbenennen",
                      "ersetzen"
                    ]
                  }
                }
              },
              "example": {
                "name": "Projekte 2026"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Erfolg",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Eintrag"
                }
              }
            }
          },
          "400": {
            "description": "Eingabe ungültig",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Fehler"
                }
              }
            }
          },
          "401": {
            "description": "Nicht angemeldet",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Fehler"
                }
              }
            }
          },
          "403": {
            "description": "Recht fehlt",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Fehler"
                }
              }
            }
          },
          "404": {
            "description": "Nicht gefunden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Fehler"
                }
              }
            }
          },
          "409": {
            "description": "Konflikt (Name vergeben, Datei geändert)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Fehler"
                }
              }
            }
          },
          "429": {
            "description": "Rate-Limit überschritten",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Fehler"
                }
              }
            }
          }
        },
        "security": [
          {
            "apiSchluessel": []
          },
          {
            "oauth2": [
              "schreiben"
            ]
          }
        ]
      }
    },
    "/api/v1/dateien": {
      "post": {
        "tags": [
          "Inhalte"
        ],
        "summary": "Datei hochladen (in einem Stück)",
        "operationId": "postDateien",
        "description": "Body = Dateiinhalt. Für große Dateien und Fortsetzen /api/v1/uploads nutzen.\n\nRecht: `dateien:schreiben` (OAuth: schreiben).",
        "parameters": [
          {
            "name": "name",
            "in": "query",
            "description": "Dateiname",
            "schema": {
              "type": "string"
            },
            "example": "Notizen.txt"
          },
          {
            "name": "ordner",
            "in": "query",
            "description": "Zielordner",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "pfad",
            "in": "query",
            "description": "Unterordnerpfad, wird angelegt",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "konflikt",
            "in": "query",
            "description": "Name existiert schon: umbenennen (Standard), ersetzen (neue Version) oder fehler (409)",
            "schema": {
              "type": "string",
              "enum": [
                "umbenennen",
                "ersetzen",
                "fehler"
              ]
            }
          },
          {
            "name": "geaendert_am",
            "in": "query",
            "description": "Änderungszeit",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "if_match",
            "in": "query",
            "description": "Bei konflikt=ersetzen: erwartete version_id",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "description": "Optional: gleiche Anfrage mit gleichem Schlüssel wird nur einmal ausgeführt (24 h).",
            "schema": {
              "type": "string",
              "maxLength": 200
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/octet-stream": {
              "schema": {
                "type": "string",
                "format": "binary"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Erfolg",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Eintrag"
                }
              }
            }
          },
          "400": {
            "description": "Eingabe ungültig",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Fehler"
                }
              }
            }
          },
          "401": {
            "description": "Nicht angemeldet",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Fehler"
                }
              }
            }
          },
          "403": {
            "description": "Recht fehlt",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Fehler"
                }
              }
            }
          },
          "404": {
            "description": "Nicht gefunden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Fehler"
                }
              }
            }
          },
          "409": {
            "description": "Konflikt (Name vergeben, Datei geändert)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Fehler"
                }
              }
            }
          },
          "413": {
            "description": "Zu groß",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Fehler"
                }
              }
            }
          },
          "429": {
            "description": "Rate-Limit überschritten",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Fehler"
                }
              }
            }
          },
          "507": {
            "description": "Speicherplatz reicht nicht",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Fehler"
                }
              }
            }
          }
        },
        "security": [
          {
            "apiSchluessel": []
          },
          {
            "oauth2": [
              "schreiben"
            ]
          }
        ]
      }
    },
    "/api/v1/favoriten": {
      "get": {
        "tags": [
          "Favoriten und Zuletzt"
        ],
        "summary": "Favoriten",
        "operationId": "getFavoriten",
        "description": "Recht: `dateien:lesen` (OAuth: lesen).",
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "description": "Anzahl je Seite",
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          },
          {
            "name": "offset",
            "in": "query",
            "description": "Versatz",
            "schema": {
              "type": "integer",
              "minimum": 0,
              "default": 0
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Erfolg",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "daten": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Eintrag"
                      }
                    },
                    "seite": {
                      "$ref": "#/components/schemas/Seite"
                    }
                  },
                  "required": [
                    "daten",
                    "seite"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Nicht angemeldet",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Fehler"
                }
              }
            }
          },
          "403": {
            "description": "Recht fehlt",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Fehler"
                }
              }
            }
          },
          "429": {
            "description": "Rate-Limit überschritten",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Fehler"
                }
              }
            }
          }
        },
        "security": [
          {
            "apiSchluessel": []
          },
          {
            "oauth2": [
              "lesen"
            ]
          }
        ]
      }
    },
    "/api/v1/zuletzt": {
      "get": {
        "tags": [
          "Favoriten und Zuletzt"
        ],
        "summary": "Zuletzt verwendet",
        "operationId": "getZuletzt",
        "description": "Recht: `dateien:lesen` (OAuth: lesen).",
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "description": "Anzahl je Seite",
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          },
          {
            "name": "offset",
            "in": "query",
            "description": "Versatz",
            "schema": {
              "type": "integer",
              "minimum": 0,
              "default": 0
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Erfolg",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "daten": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Eintrag"
                      }
                    },
                    "seite": {
                      "$ref": "#/components/schemas/Seite"
                    }
                  },
                  "required": [
                    "daten",
                    "seite"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Nicht angemeldet",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Fehler"
                }
              }
            }
          },
          "403": {
            "description": "Recht fehlt",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Fehler"
                }
              }
            }
          },
          "429": {
            "description": "Rate-Limit überschritten",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Fehler"
                }
              }
            }
          }
        },
        "security": [
          {
            "apiSchluessel": []
          },
          {
            "oauth2": [
              "lesen"
            ]
          }
        ]
      }
    },
    "/api/v1/geteilt": {
      "get": {
        "tags": [
          "Teilen"
        ],
        "summary": "Für mich freigegeben",
        "operationId": "getGeteilt",
        "description": "Recht: `dateien:lesen` (OAuth: lesen).",
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "description": "Anzahl je Seite",
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          },
          {
            "name": "offset",
            "in": "query",
            "description": "Versatz",
            "schema": {
              "type": "integer",
              "minimum": 0,
              "default": 0
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Erfolg",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "daten": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Eintrag"
                      }
                    },
                    "seite": {
                      "$ref": "#/components/schemas/Seite"
                    }
                  },
                  "required": [
                    "daten",
                    "seite"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Nicht angemeldet",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Fehler"
                }
              }
            }
          },
          "403": {
            "description": "Recht fehlt",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Fehler"
                }
              }
            }
          },
          "429": {
            "description": "Rate-Limit überschritten",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Fehler"
                }
              }
            }
          }
        },
        "security": [
          {
            "apiSchluessel": []
          },
          {
            "oauth2": [
              "lesen"
            ]
          }
        ]
      }
    },
    "/api/v1/suche": {
      "get": {
        "tags": [
          "Suche"
        ],
        "summary": "Suchen",
        "operationId": "getSuche",
        "description": "Namen und Inhalte (Text, Word, Excel, PowerPoint, OpenDocument) in eigenen und freigegebenen Dateien.\n\nRecht: `dateien:lesen` (OAuth: lesen).",
        "parameters": [
          {
            "name": "q",
            "in": "query",
            "description": "Suchbegriff",
            "schema": {
              "type": "string"
            },
            "example": "Angebot"
          },
          {
            "name": "art",
            "in": "query",
            "description": "Filter",
            "schema": {
              "type": "string",
              "enum": [
                "ordner",
                "bild",
                "video",
                "audio",
                "pdf",
                "dokument",
                "tabelle",
                "praesentation"
              ]
            }
          },
          {
            "name": "geaendert_seit",
            "in": "query",
            "description": "Nur ab Datum",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "description": "Anzahl",
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Erfolg",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "daten": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Eintrag"
                      }
                    },
                    "seite": {
                      "$ref": "#/components/schemas/Seite"
                    }
                  },
                  "required": [
                    "daten",
                    "seite"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Eingabe ungültig",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Fehler"
                }
              }
            }
          },
          "401": {
            "description": "Nicht angemeldet",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Fehler"
                }
              }
            }
          },
          "403": {
            "description": "Recht fehlt",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Fehler"
                }
              }
            }
          },
          "429": {
            "description": "Rate-Limit überschritten",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Fehler"
                }
              }
            }
          }
        },
        "security": [
          {
            "apiSchluessel": []
          },
          {
            "oauth2": [
              "lesen"
            ]
          }
        ]
      }
    },
    "/api/v1/papierkorb": {
      "get": {
        "tags": [
          "Papierkorb"
        ],
        "summary": "Papierkorb",
        "operationId": "getPapierkorb",
        "description": "Einträge werden nach 30 Tagen endgültig gelöscht.\n\nRecht: `dateien:lesen` (OAuth: lesen).",
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "description": "Anzahl je Seite",
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          },
          {
            "name": "offset",
            "in": "query",
            "description": "Versatz",
            "schema": {
              "type": "integer",
              "minimum": 0,
              "default": 0
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Erfolg",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "daten": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Eintrag"
                      }
                    },
                    "seite": {
                      "$ref": "#/components/schemas/Seite"
                    }
                  },
                  "required": [
                    "daten",
                    "seite"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Nicht angemeldet",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Fehler"
                }
              }
            }
          },
          "403": {
            "description": "Recht fehlt",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Fehler"
                }
              }
            }
          },
          "429": {
            "description": "Rate-Limit überschritten",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Fehler"
                }
              }
            }
          }
        },
        "security": [
          {
            "apiSchluessel": []
          },
          {
            "oauth2": [
              "lesen"
            ]
          }
        ]
      },
      "delete": {
        "tags": [
          "Papierkorb"
        ],
        "summary": "Papierkorb leeren",
        "operationId": "deletePapierkorb",
        "description": "Endgültig, nicht rückgängig zu machen.\n\nRecht: `dateien:schreiben` (OAuth: schreiben).",
        "responses": {
          "200": {
            "description": "Erfolg",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "geloescht": {
                      "type": "integer"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Nicht angemeldet",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Fehler"
                }
              }
            }
          },
          "403": {
            "description": "Recht fehlt",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Fehler"
                }
              }
            }
          },
          "429": {
            "description": "Rate-Limit überschritten",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Fehler"
                }
              }
            }
          }
        },
        "security": [
          {
            "apiSchluessel": []
          },
          {
            "oauth2": [
              "schreiben"
            ]
          }
        ]
      }
    },
    "/api/v1/papierkorb/{id}": {
      "delete": {
        "tags": [
          "Papierkorb"
        ],
        "summary": "Endgültig löschen",
        "operationId": "deletePapierkorbId",
        "description": "Recht: `dateien:schreiben` (OAuth: schreiben).",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "id der Datei bzw. des Ordners",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Erfolg",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "geloescht": {
                      "type": "integer"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Eingabe ungültig",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Fehler"
                }
              }
            }
          },
          "401": {
            "description": "Nicht angemeldet",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Fehler"
                }
              }
            }
          },
          "403": {
            "description": "Recht fehlt",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Fehler"
                }
              }
            }
          },
          "404": {
            "description": "Nicht gefunden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Fehler"
                }
              }
            }
          },
          "429": {
            "description": "Rate-Limit überschritten",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Fehler"
                }
              }
            }
          }
        },
        "security": [
          {
            "apiSchluessel": []
          },
          {
            "oauth2": [
              "schreiben"
            ]
          }
        ]
      }
    },
    "/api/v1/papierkorb/{id}/wiederherstellen": {
      "post": {
        "tags": [
          "Papierkorb"
        ],
        "summary": "Wiederherstellen",
        "operationId": "postPapierkorbIdWiederherstellen",
        "description": "Am alten Ort; gibt es den nicht mehr, in „Meine Ablage“.\n\nRecht: `dateien:schreiben` (OAuth: schreiben).",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "id der Datei bzw. des Ordners",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Erfolg",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Eintrag"
                }
              }
            }
          },
          "400": {
            "description": "Eingabe ungültig",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Fehler"
                }
              }
            }
          },
          "401": {
            "description": "Nicht angemeldet",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Fehler"
                }
              }
            }
          },
          "403": {
            "description": "Recht fehlt",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Fehler"
                }
              }
            }
          },
          "404": {
            "description": "Nicht gefunden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Fehler"
                }
              }
            }
          },
          "429": {
            "description": "Rate-Limit überschritten",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Fehler"
                }
              }
            }
          }
        },
        "security": [
          {
            "apiSchluessel": []
          },
          {
            "oauth2": [
              "schreiben"
            ]
          }
        ]
      }
    },
    "/api/v1/uploads": {
      "get": {
        "tags": [
          "Uploads in Teilen"
        ],
        "summary": "Offene Uploads",
        "operationId": "getUploads",
        "description": "Recht: `dateien:schreiben` (OAuth: schreiben).",
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "description": "Anzahl je Seite",
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          },
          {
            "name": "offset",
            "in": "query",
            "description": "Versatz",
            "schema": {
              "type": "integer",
              "minimum": 0,
              "default": 0
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Erfolg",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "daten": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Upload"
                      }
                    },
                    "seite": {
                      "$ref": "#/components/schemas/Seite"
                    }
                  },
                  "required": [
                    "daten",
                    "seite"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Nicht angemeldet",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Fehler"
                }
              }
            }
          },
          "403": {
            "description": "Recht fehlt",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Fehler"
                }
              }
            }
          },
          "429": {
            "description": "Rate-Limit überschritten",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Fehler"
                }
              }
            }
          }
        },
        "security": [
          {
            "apiSchluessel": []
          },
          {
            "oauth2": [
              "schreiben"
            ]
          }
        ]
      },
      "post": {
        "tags": [
          "Uploads in Teilen"
        ],
        "summary": "Upload beginnen",
        "operationId": "postUploads",
        "description": "Merkt den Platz vor. Danach Teile per PUT senden (Reihenfolge egal, wiederholbar), dann abschließen. Mit datei_id entsteht eine neue Version (if_match für Konfliktschutz).\n\nRecht: `dateien:schreiben` (OAuth: schreiben).",
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "description": "Optional: gleiche Anfrage mit gleichem Schlüssel wird nur einmal ausgeführt (24 h).",
            "schema": {
              "type": "string",
              "maxLength": 200
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UploadEingabe"
              },
              "example": {
                "name": "Video.mp4",
                "groesse": 734003200,
                "ordner_id": "0d4e5f6a-2222-4c5a-9a3e-2f0a3b9d1c33",
                "teil_groesse": 8388608
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Erfolg",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Upload"
                }
              }
            }
          },
          "400": {
            "description": "Eingabe ungültig",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Fehler"
                }
              }
            }
          },
          "401": {
            "description": "Nicht angemeldet",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Fehler"
                }
              }
            }
          },
          "403": {
            "description": "Recht fehlt",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Fehler"
                }
              }
            }
          },
          "404": {
            "description": "Nicht gefunden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Fehler"
                }
              }
            }
          },
          "413": {
            "description": "Zu groß",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Fehler"
                }
              }
            }
          },
          "429": {
            "description": "Rate-Limit überschritten",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Fehler"
                }
              }
            }
          },
          "507": {
            "description": "Speicherplatz reicht nicht",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Fehler"
                }
              }
            }
          }
        },
        "security": [
          {
            "apiSchluessel": []
          },
          {
            "oauth2": [
              "schreiben"
            ]
          }
        ]
      }
    },
    "/api/v1/uploads/{id}": {
      "get": {
        "tags": [
          "Uploads in Teilen"
        ],
        "summary": "Stand eines Uploads",
        "operationId": "getUploadsId",
        "description": "fehlende_teile zeigt, was zum Fortsetzen noch fehlt.\n\nRecht: `dateien:schreiben` (OAuth: schreiben).",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Upload-id",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Erfolg",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Upload"
                }
              }
            }
          },
          "401": {
            "description": "Nicht angemeldet",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Fehler"
                }
              }
            }
          },
          "403": {
            "description": "Recht fehlt",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Fehler"
                }
              }
            }
          },
          "404": {
            "description": "Nicht gefunden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Fehler"
                }
              }
            }
          },
          "429": {
            "description": "Rate-Limit überschritten",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Fehler"
                }
              }
            }
          }
        },
        "security": [
          {
            "apiSchluessel": []
          },
          {
            "oauth2": [
              "schreiben"
            ]
          }
        ]
      },
      "delete": {
        "tags": [
          "Uploads in Teilen"
        ],
        "summary": "Upload abbrechen",
        "operationId": "deleteUploadsId",
        "description": "Recht: `dateien:schreiben` (OAuth: schreiben).",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Upload-id",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Erfolg",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "abgebrochen": {
                      "type": "boolean"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Nicht angemeldet",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Fehler"
                }
              }
            }
          },
          "403": {
            "description": "Recht fehlt",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Fehler"
                }
              }
            }
          },
          "404": {
            "description": "Nicht gefunden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Fehler"
                }
              }
            }
          },
          "429": {
            "description": "Rate-Limit überschritten",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Fehler"
                }
              }
            }
          }
        },
        "security": [
          {
            "apiSchluessel": []
          },
          {
            "oauth2": [
              "schreiben"
            ]
          }
        ]
      }
    },
    "/api/v1/uploads/{id}/teile/{nr}": {
      "put": {
        "tags": [
          "Uploads in Teilen"
        ],
        "summary": "Teil senden",
        "operationId": "putUploadsIdTeileNr",
        "description": "Body = Bytes des Teils (alle Teile teil_groesse, der letzte kleiner). Nummern ab 0.\n\nRecht: `dateien:schreiben` (OAuth: schreiben).",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Upload-id",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "nr",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "minimum": 0
            },
            "description": "Teilnummer ab 0"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/octet-stream": {
              "schema": {
                "type": "string",
                "format": "binary"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Erfolg",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Upload"
                }
              }
            }
          },
          "400": {
            "description": "Eingabe ungültig",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Fehler"
                }
              }
            }
          },
          "401": {
            "description": "Nicht angemeldet",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Fehler"
                }
              }
            }
          },
          "403": {
            "description": "Recht fehlt",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Fehler"
                }
              }
            }
          },
          "404": {
            "description": "Nicht gefunden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Fehler"
                }
              }
            }
          },
          "409": {
            "description": "Konflikt (Name vergeben, Datei geändert)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Fehler"
                }
              }
            }
          },
          "429": {
            "description": "Rate-Limit überschritten",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Fehler"
                }
              }
            }
          }
        },
        "security": [
          {
            "apiSchluessel": []
          },
          {
            "oauth2": [
              "schreiben"
            ]
          }
        ]
      }
    },
    "/api/v1/uploads/{id}/abschliessen": {
      "post": {
        "tags": [
          "Uploads in Teilen"
        ],
        "summary": "Upload abschließen",
        "operationId": "postUploadsIdAbschliessen",
        "description": "Setzt die Teile zusammen, prüft optional die SHA-256-Prüfsumme und legt Datei bzw. Version an. Wiederholbar.\n\nRecht: `dateien:schreiben` (OAuth: schreiben).",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Upload-id",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "201": {
            "description": "Erfolg",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "upload": {
                      "$ref": "#/components/schemas/Upload"
                    },
                    "datei": {
                      "$ref": "#/components/schemas/Eintrag"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Nicht angemeldet",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Fehler"
                }
              }
            }
          },
          "403": {
            "description": "Recht fehlt",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Fehler"
                }
              }
            }
          },
          "404": {
            "description": "Nicht gefunden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Fehler"
                }
              }
            }
          },
          "409": {
            "description": "Konflikt (Name vergeben, Datei geändert)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Fehler"
                }
              }
            }
          },
          "422": {
            "description": "Prüfsumme falsch",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Fehler"
                }
              }
            }
          },
          "429": {
            "description": "Rate-Limit überschritten",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Fehler"
                }
              }
            }
          }
        },
        "security": [
          {
            "apiSchluessel": []
          },
          {
            "oauth2": [
              "schreiben"
            ]
          }
        ]
      }
    },
    "/api/v1/links": {
      "get": {
        "tags": [
          "Links"
        ],
        "summary": "Alle Links",
        "operationId": "getLinks",
        "description": "Recht: `dateien:lesen` (OAuth: lesen).",
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "description": "Anzahl je Seite",
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          },
          {
            "name": "offset",
            "in": "query",
            "description": "Versatz",
            "schema": {
              "type": "integer",
              "minimum": 0,
              "default": 0
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Erfolg",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "daten": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Link"
                      }
                    },
                    "seite": {
                      "$ref": "#/components/schemas/Seite"
                    }
                  },
                  "required": [
                    "daten",
                    "seite"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Nicht angemeldet",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Fehler"
                }
              }
            }
          },
          "403": {
            "description": "Recht fehlt",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Fehler"
                }
              }
            }
          },
          "429": {
            "description": "Rate-Limit überschritten",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Fehler"
                }
              }
            }
          }
        },
        "security": [
          {
            "apiSchluessel": []
          },
          {
            "oauth2": [
              "lesen"
            ]
          }
        ]
      }
    },
    "/api/v1/links/{id}": {
      "patch": {
        "tags": [
          "Links"
        ],
        "summary": "Link ändern",
        "operationId": "patchLinksId",
        "description": "Recht: `freigaben:verwalten` (OAuth: teilen).",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Link-id",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/LinkEingabe"
              },
              "example": {
                "laeuft_ab_am": null,
                "passwort": null
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Erfolg",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Link"
                }
              }
            }
          },
          "400": {
            "description": "Eingabe ungültig",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Fehler"
                }
              }
            }
          },
          "401": {
            "description": "Nicht angemeldet",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Fehler"
                }
              }
            }
          },
          "403": {
            "description": "Recht fehlt",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Fehler"
                }
              }
            }
          },
          "404": {
            "description": "Nicht gefunden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Fehler"
                }
              }
            }
          },
          "429": {
            "description": "Rate-Limit überschritten",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Fehler"
                }
              }
            }
          }
        },
        "security": [
          {
            "apiSchluessel": []
          },
          {
            "oauth2": [
              "teilen"
            ]
          }
        ]
      },
      "delete": {
        "tags": [
          "Links"
        ],
        "summary": "Link widerrufen",
        "operationId": "deleteLinksId",
        "description": "Recht: `freigaben:verwalten` (OAuth: teilen).",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Link-id",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Erledigt, ohne Inhalt"
          },
          "401": {
            "description": "Nicht angemeldet",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Fehler"
                }
              }
            }
          },
          "403": {
            "description": "Recht fehlt",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Fehler"
                }
              }
            }
          },
          "404": {
            "description": "Nicht gefunden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Fehler"
                }
              }
            }
          },
          "429": {
            "description": "Rate-Limit überschritten",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Fehler"
                }
              }
            }
          }
        },
        "security": [
          {
            "apiSchluessel": []
          },
          {
            "oauth2": [
              "teilen"
            ]
          }
        ]
      }
    },
    "/api/v1/teams": {
      "get": {
        "tags": [
          "Teams"
        ],
        "summary": "Meine Teams",
        "operationId": "getTeams",
        "description": "Recht: `konto:lesen` (OAuth: lesen).",
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "description": "Anzahl je Seite",
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          },
          {
            "name": "offset",
            "in": "query",
            "description": "Versatz",
            "schema": {
              "type": "integer",
              "minimum": 0,
              "default": 0
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Erfolg",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "daten": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Team"
                      }
                    },
                    "seite": {
                      "$ref": "#/components/schemas/Seite"
                    }
                  },
                  "required": [
                    "daten",
                    "seite"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Nicht angemeldet",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Fehler"
                }
              }
            }
          },
          "403": {
            "description": "Recht fehlt",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Fehler"
                }
              }
            }
          },
          "429": {
            "description": "Rate-Limit überschritten",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Fehler"
                }
              }
            }
          }
        },
        "security": [
          {
            "apiSchluessel": []
          },
          {
            "oauth2": [
              "lesen"
            ]
          }
        ]
      },
      "post": {
        "tags": [
          "Teams"
        ],
        "summary": "Team anlegen",
        "operationId": "postTeams",
        "description": "Recht: `teams:verwalten` (OAuth: teilen).",
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "description": "Optional: gleiche Anfrage mit gleichem Schlüssel wird nur einmal ausgeführt (24 h).",
            "schema": {
              "type": "string",
              "maxLength": 200
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "name"
                ],
                "properties": {
                  "name": {
                    "type": "string"
                  }
                }
              },
              "example": {
                "name": "Vertrieb"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Erfolg",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TeamDetail"
                }
              }
            }
          },
          "400": {
            "description": "Eingabe ungültig",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Fehler"
                }
              }
            }
          },
          "401": {
            "description": "Nicht angemeldet",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Fehler"
                }
              }
            }
          },
          "403": {
            "description": "Recht fehlt",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Fehler"
                }
              }
            }
          },
          "409": {
            "description": "Konflikt (Name vergeben, Datei geändert)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Fehler"
                }
              }
            }
          },
          "429": {
            "description": "Rate-Limit überschritten",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Fehler"
                }
              }
            }
          }
        },
        "security": [
          {
            "apiSchluessel": []
          },
          {
            "oauth2": [
              "teilen"
            ]
          }
        ]
      }
    },
    "/api/v1/teams/{id}": {
      "get": {
        "tags": [
          "Teams"
        ],
        "summary": "Team lesen",
        "operationId": "getTeamsId",
        "description": "Recht: `konto:lesen` (OAuth: lesen).",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Team-id",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Erfolg",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TeamDetail"
                }
              }
            }
          },
          "401": {
            "description": "Nicht angemeldet",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Fehler"
                }
              }
            }
          },
          "403": {
            "description": "Recht fehlt",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Fehler"
                }
              }
            }
          },
          "404": {
            "description": "Nicht gefunden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Fehler"
                }
              }
            }
          },
          "429": {
            "description": "Rate-Limit überschritten",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Fehler"
                }
              }
            }
          }
        },
        "security": [
          {
            "apiSchluessel": []
          },
          {
            "oauth2": [
              "lesen"
            ]
          }
        ]
      },
      "patch": {
        "tags": [
          "Teams"
        ],
        "summary": "Team umbenennen",
        "operationId": "patchTeamsId",
        "description": "Recht: `teams:verwalten` (OAuth: teilen).",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Team-id",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "name"
                ],
                "properties": {
                  "name": {
                    "type": "string"
                  }
                }
              },
              "example": {
                "name": "Vertrieb Süd"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Erfolg",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TeamDetail"
                }
              }
            }
          },
          "401": {
            "description": "Nicht angemeldet",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Fehler"
                }
              }
            }
          },
          "403": {
            "description": "Recht fehlt",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Fehler"
                }
              }
            }
          },
          "404": {
            "description": "Nicht gefunden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Fehler"
                }
              }
            }
          },
          "429": {
            "description": "Rate-Limit überschritten",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Fehler"
                }
              }
            }
          }
        },
        "security": [
          {
            "apiSchluessel": []
          },
          {
            "oauth2": [
              "teilen"
            ]
          }
        ]
      },
      "delete": {
        "tags": [
          "Teams"
        ],
        "summary": "Team löschen",
        "operationId": "deleteTeamsId",
        "description": "Recht: `teams:verwalten` (OAuth: teilen).",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Team-id",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Erledigt, ohne Inhalt"
          },
          "401": {
            "description": "Nicht angemeldet",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Fehler"
                }
              }
            }
          },
          "403": {
            "description": "Recht fehlt",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Fehler"
                }
              }
            }
          },
          "404": {
            "description": "Nicht gefunden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Fehler"
                }
              }
            }
          },
          "429": {
            "description": "Rate-Limit überschritten",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Fehler"
                }
              }
            }
          }
        },
        "security": [
          {
            "apiSchluessel": []
          },
          {
            "oauth2": [
              "teilen"
            ]
          }
        ]
      }
    },
    "/api/v1/teams/{id}/mitglieder": {
      "post": {
        "tags": [
          "Teams"
        ],
        "summary": "Mitglied hinzufügen",
        "operationId": "postTeamsIdMitglieder",
        "description": "Ohne Konto: Einladung per Mail.\n\nRecht: `teams:verwalten` (OAuth: teilen).",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Team-id",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "description": "Optional: gleiche Anfrage mit gleichem Schlüssel wird nur einmal ausgeführt (24 h).",
            "schema": {
              "type": "string",
              "maxLength": 200
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "email"
                ],
                "properties": {
                  "email": {
                    "type": "string",
                    "format": "email"
                  },
                  "rolle": {
                    "type": "string",
                    "enum": [
                      "admin",
                      "mitglied"
                    ]
                  }
                }
              },
              "example": {
                "email": "kollege@example.com"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Erfolg",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TeamDetail"
                }
              }
            }
          },
          "400": {
            "description": "Eingabe ungültig",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Fehler"
                }
              }
            }
          },
          "401": {
            "description": "Nicht angemeldet",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Fehler"
                }
              }
            }
          },
          "403": {
            "description": "Recht fehlt",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Fehler"
                }
              }
            }
          },
          "404": {
            "description": "Nicht gefunden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Fehler"
                }
              }
            }
          },
          "429": {
            "description": "Rate-Limit überschritten",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Fehler"
                }
              }
            }
          }
        },
        "security": [
          {
            "apiSchluessel": []
          },
          {
            "oauth2": [
              "teilen"
            ]
          }
        ]
      }
    },
    "/api/v1/teams/{id}/mitglieder/{mitglied}": {
      "delete": {
        "tags": [
          "Teams"
        ],
        "summary": "Mitglied entfernen oder Team verlassen",
        "operationId": "deleteTeamsIdMitgliederMitglied",
        "description": "Recht: `teams:verwalten` (OAuth: teilen).",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Team-id",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "mitglied",
            "in": "path",
            "required": true,
            "description": "Nutzer-id",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Erfolg",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TeamDetail"
                }
              }
            }
          },
          "401": {
            "description": "Nicht angemeldet",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Fehler"
                }
              }
            }
          },
          "403": {
            "description": "Recht fehlt",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Fehler"
                }
              }
            }
          },
          "404": {
            "description": "Nicht gefunden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Fehler"
                }
              }
            }
          },
          "409": {
            "description": "Konflikt (Name vergeben, Datei geändert)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Fehler"
                }
              }
            }
          },
          "429": {
            "description": "Rate-Limit überschritten",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Fehler"
                }
              }
            }
          }
        },
        "security": [
          {
            "apiSchluessel": []
          },
          {
            "oauth2": [
              "teilen"
            ]
          }
        ]
      }
    },
    "/api/v1/teams/{id}/einladungen/{einladung}": {
      "delete": {
        "tags": [
          "Teams"
        ],
        "summary": "Einladung zurückziehen",
        "operationId": "deleteTeamsIdEinladungenEinladung",
        "description": "Recht: `teams:verwalten` (OAuth: teilen).",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Team-id",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "einladung",
            "in": "path",
            "required": true,
            "description": "Einladungs-id",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Erfolg",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TeamDetail"
                }
              }
            }
          },
          "401": {
            "description": "Nicht angemeldet",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Fehler"
                }
              }
            }
          },
          "403": {
            "description": "Recht fehlt",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Fehler"
                }
              }
            }
          },
          "404": {
            "description": "Nicht gefunden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Fehler"
                }
              }
            }
          },
          "429": {
            "description": "Rate-Limit überschritten",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Fehler"
                }
              }
            }
          }
        },
        "security": [
          {
            "apiSchluessel": []
          },
          {
            "oauth2": [
              "teilen"
            ]
          }
        ]
      }
    },
    "/api/v1/sync/aenderungen": {
      "get": {
        "tags": [
          "Synchronisation"
        ],
        "summary": "Änderungsjournal",
        "operationId": "getSyncAenderungen",
        "description": "Alle Änderungen an „Meine Ablage“ nach cursor. cursor=0 liefert den vollständigen Bestand. Solange mehr=true, mit dem neuen cursor weiterlesen. 410: Cursor zu alt, neu mit 0 beginnen.\n\nRecht: `dateien:lesen` (OAuth: lesen).",
        "parameters": [
          {
            "name": "cursor",
            "in": "query",
            "description": "Letzter Stand",
            "schema": {
              "type": "integer",
              "minimum": 0
            },
            "example": 0
          },
          {
            "name": "limit",
            "in": "query",
            "description": "Höchstens (1 bis 5000)",
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Erfolg",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Aenderungen"
                }
              }
            }
          },
          "400": {
            "description": "Eingabe ungültig",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Fehler"
                }
              }
            }
          },
          "401": {
            "description": "Nicht angemeldet",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Fehler"
                }
              }
            }
          },
          "403": {
            "description": "Recht fehlt",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Fehler"
                }
              }
            }
          },
          "410": {
            "description": "Nicht mehr verfügbar",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Fehler"
                }
              }
            }
          },
          "429": {
            "description": "Rate-Limit überschritten",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Fehler"
                }
              }
            }
          }
        },
        "security": [
          {
            "apiSchluessel": []
          },
          {
            "oauth2": [
              "lesen"
            ]
          }
        ]
      }
    },
    "/api/v1/sync/warten": {
      "get": {
        "tags": [
          "Synchronisation"
        ],
        "summary": "Auf Änderungen warten",
        "operationId": "getSyncWarten",
        "description": "Lange Abfrage: antwortet, sobald sich nach cursor etwas ändert, spätestens nach timeout Sekunden (höchstens 55).\n\nRecht: `dateien:lesen` (OAuth: lesen).",
        "parameters": [
          {
            "name": "cursor",
            "in": "query",
            "description": "Letzter Stand",
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "timeout",
            "in": "query",
            "description": "Sekunden",
            "schema": {
              "type": "integer",
              "maximum": 55
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Erfolg",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "geaendert": {
                      "type": "boolean"
                    },
                    "cursor": {
                      "type": "integer"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Nicht angemeldet",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Fehler"
                }
              }
            }
          },
          "403": {
            "description": "Recht fehlt",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Fehler"
                }
              }
            }
          },
          "429": {
            "description": "Rate-Limit überschritten",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Fehler"
                }
              }
            }
          }
        },
        "security": [
          {
            "apiSchluessel": []
          },
          {
            "oauth2": [
              "lesen"
            ]
          }
        ]
      }
    },
    "/api/v1/sync/geraet": {
      "post": {
        "tags": [
          "Synchronisation"
        ],
        "summary": "Gerät melden",
        "operationId": "postSyncGeraet",
        "description": "Desktop-App meldet Gerätename und Version (Übersicht „Geräte“ im Konto).\n\nRecht: `dateien:lesen` (OAuth: lesen).",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "name"
                ],
                "properties": {
                  "name": {
                    "type": "string"
                  },
                  "plattform": {
                    "type": "string"
                  },
                  "version": {
                    "type": "string"
                  }
                }
              },
              "example": {
                "name": "BUERO-PC",
                "plattform": "windows",
                "version": "1.0.0"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Erfolg",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "gespeichert": {
                      "type": "boolean"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Nicht angemeldet",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Fehler"
                }
              }
            }
          },
          "403": {
            "description": "Recht fehlt",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Fehler"
                }
              }
            }
          },
          "429": {
            "description": "Rate-Limit überschritten",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Fehler"
                }
              }
            }
          }
        },
        "security": [
          {
            "apiSchluessel": []
          },
          {
            "oauth2": [
              "lesen"
            ]
          }
        ]
      }
    },
    "/api/v1/ereignisse": {
      "get": {
        "tags": [
          "Webhook-Endpunkte"
        ],
        "summary": "Ereignistypen",
        "operationId": "getEreignisse",
        "description": "Jeder gültige Zugang.",
        "responses": {
          "200": {
            "description": "Erfolg",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "daten": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "typ": {
                            "type": "string"
                          },
                          "titel": {
                            "type": "string"
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Nicht angemeldet",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Fehler"
                }
              }
            }
          },
          "429": {
            "description": "Rate-Limit überschritten",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Fehler"
                }
              }
            }
          }
        },
        "security": [
          {
            "apiSchluessel": []
          },
          {
            "oauth2": [
              "lesen"
            ]
          }
        ]
      }
    },
    "/api/v1/webhooks": {
      "get": {
        "tags": [
          "Webhook-Endpunkte"
        ],
        "summary": "Webhooks auflisten",
        "operationId": "getWebhooks",
        "description": "Recht: `webhooks:verwalten` (OAuth: schreiben).",
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "description": "Anzahl je Seite",
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          },
          {
            "name": "offset",
            "in": "query",
            "description": "Versatz",
            "schema": {
              "type": "integer",
              "minimum": 0,
              "default": 0
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Erfolg",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "daten": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Webhook"
                      }
                    },
                    "seite": {
                      "$ref": "#/components/schemas/Seite"
                    }
                  },
                  "required": [
                    "daten",
                    "seite"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Nicht angemeldet",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Fehler"
                }
              }
            }
          },
          "403": {
            "description": "Recht fehlt",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Fehler"
                }
              }
            }
          },
          "429": {
            "description": "Rate-Limit überschritten",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Fehler"
                }
              }
            }
          }
        },
        "security": [
          {
            "apiSchluessel": []
          },
          {
            "oauth2": [
              "schreiben"
            ]
          }
        ]
      },
      "post": {
        "tags": [
          "Webhook-Endpunkte"
        ],
        "summary": "Webhook anlegen",
        "operationId": "postWebhooks",
        "description": "Nur https-Ziele. Das Geheimnis steht nur in dieser Antwort.\n\nRecht: `webhooks:verwalten` (OAuth: schreiben).",
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "description": "Optional: gleiche Anfrage mit gleichem Schlüssel wird nur einmal ausgeführt (24 h).",
            "schema": {
              "type": "string",
              "maxLength": 200
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "url",
                  "ereignisse"
                ],
                "properties": {
                  "url": {
                    "type": "string",
                    "format": "uri"
                  },
                  "ereignisse": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "enum": [
                        "datei.hochgeladen",
                        "datei.geaendert",
                        "datei.geloescht",
                        "ordner.angelegt",
                        "freigabe.erhalten",
                        "link.upload",
                        "upload.fertig",
                        "speicher.fast_voll",
                        "team.hinzugefuegt"
                      ]
                    }
                  },
                  "beschreibung": {
                    "type": "string"
                  }
                }
              },
              "example": {
                "url": "https://example.com/hooks/agile",
                "ereignisse": [
                  "datei.hochgeladen",
                  "link.upload"
                ]
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Erfolg",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Webhook"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "geheimnis": {
                          "type": "string"
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Eingabe ungültig",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Fehler"
                }
              }
            }
          },
          "401": {
            "description": "Nicht angemeldet",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Fehler"
                }
              }
            }
          },
          "403": {
            "description": "Recht fehlt",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Fehler"
                }
              }
            }
          },
          "409": {
            "description": "Konflikt (Name vergeben, Datei geändert)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Fehler"
                }
              }
            }
          },
          "429": {
            "description": "Rate-Limit überschritten",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Fehler"
                }
              }
            }
          }
        },
        "security": [
          {
            "apiSchluessel": []
          },
          {
            "oauth2": [
              "schreiben"
            ]
          }
        ]
      }
    },
    "/api/v1/webhooks/{id}": {
      "delete": {
        "tags": [
          "Webhook-Endpunkte"
        ],
        "summary": "Webhook löschen",
        "operationId": "deleteWebhooksId",
        "description": "Recht: `webhooks:verwalten` (OAuth: schreiben).",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Webhook-id",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Erledigt, ohne Inhalt"
          },
          "401": {
            "description": "Nicht angemeldet",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Fehler"
                }
              }
            }
          },
          "403": {
            "description": "Recht fehlt",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Fehler"
                }
              }
            }
          },
          "404": {
            "description": "Nicht gefunden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Fehler"
                }
              }
            }
          },
          "429": {
            "description": "Rate-Limit überschritten",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Fehler"
                }
              }
            }
          }
        },
        "security": [
          {
            "apiSchluessel": []
          },
          {
            "oauth2": [
              "schreiben"
            ]
          }
        ]
      }
    },
    "/api/v1/webhooks/{id}/zustellungen": {
      "get": {
        "tags": [
          "Webhook-Endpunkte"
        ],
        "summary": "Zustellprotokoll",
        "operationId": "getWebhooksIdZustellungen",
        "description": "Recht: `webhooks:verwalten` (OAuth: schreiben).",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Webhook-id",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "description": "Anzahl je Seite",
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          },
          {
            "name": "offset",
            "in": "query",
            "description": "Versatz",
            "schema": {
              "type": "integer",
              "minimum": 0,
              "default": 0
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Erfolg",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "daten": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Zustellung"
                      }
                    },
                    "seite": {
                      "$ref": "#/components/schemas/Seite"
                    }
                  },
                  "required": [
                    "daten",
                    "seite"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Nicht angemeldet",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Fehler"
                }
              }
            }
          },
          "403": {
            "description": "Recht fehlt",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Fehler"
                }
              }
            }
          },
          "404": {
            "description": "Nicht gefunden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Fehler"
                }
              }
            }
          },
          "429": {
            "description": "Rate-Limit überschritten",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Fehler"
                }
              }
            }
          }
        },
        "security": [
          {
            "apiSchluessel": []
          },
          {
            "oauth2": [
              "schreiben"
            ]
          }
        ]
      }
    },
    "/api/v1/webhooks/{id}/test": {
      "post": {
        "tags": [
          "Webhook-Endpunkte"
        ],
        "summary": "Testereignis senden",
        "operationId": "postWebhooksIdTest",
        "description": "Recht: `webhooks:verwalten` (OAuth: schreiben).",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Webhook-id",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Erfolg",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string"
                    },
                    "versuche": {
                      "type": "integer"
                    },
                    "letzter_status": {
                      "type": [
                        "integer",
                        "null"
                      ]
                    },
                    "fehler": {
                      "type": [
                        "string",
                        "null"
                      ]
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Nicht angemeldet",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Fehler"
                }
              }
            }
          },
          "403": {
            "description": "Recht fehlt",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Fehler"
                }
              }
            }
          },
          "404": {
            "description": "Nicht gefunden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Fehler"
                }
              }
            }
          },
          "429": {
            "description": "Rate-Limit überschritten",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Fehler"
                }
              }
            }
          }
        },
        "security": [
          {
            "apiSchluessel": []
          },
          {
            "oauth2": [
              "schreiben"
            ]
          }
        ]
      }
    }
  },
  "webhooks": {
    "datei.hochgeladen": {
      "post": {
        "operationId": "webhookDateiHochgeladen",
        "security": [],
        "summary": "Datei hochgeladen",
        "description": "Ereignis `datei.hochgeladen`. Signatur im Header Agile-Signature prüfen.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WebhookEreignis"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Empfang bestätigt"
          }
        }
      }
    },
    "datei.geaendert": {
      "post": {
        "operationId": "webhookDateiGeaendert",
        "security": [],
        "summary": "Datei geändert (neue Version, umbenannt, verschoben)",
        "description": "Ereignis `datei.geaendert`. Signatur im Header Agile-Signature prüfen.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WebhookEreignis"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Empfang bestätigt"
          }
        }
      }
    },
    "datei.geloescht": {
      "post": {
        "operationId": "webhookDateiGeloescht",
        "security": [],
        "summary": "In den Papierkorb gelegt",
        "description": "Ereignis `datei.geloescht`. Signatur im Header Agile-Signature prüfen.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WebhookEreignis"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Empfang bestätigt"
          }
        }
      }
    },
    "ordner.angelegt": {
      "post": {
        "operationId": "webhookOrdnerAngelegt",
        "security": [],
        "summary": "Ordner angelegt",
        "description": "Ereignis `ordner.angelegt`. Signatur im Header Agile-Signature prüfen.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WebhookEreignis"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Empfang bestätigt"
          }
        }
      }
    },
    "freigabe.erhalten": {
      "post": {
        "operationId": "webhookFreigabeErhalten",
        "security": [],
        "summary": "Etwas wurde mit Ihnen geteilt",
        "description": "Ereignis `freigabe.erhalten`. Signatur im Header Agile-Signature prüfen.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WebhookEreignis"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Empfang bestätigt"
          }
        }
      }
    },
    "link.upload": {
      "post": {
        "operationId": "webhookLinkUpload",
        "security": [],
        "summary": "Upload über Ihren Upload-Link",
        "description": "Ereignis `link.upload`. Signatur im Header Agile-Signature prüfen.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WebhookEreignis"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Empfang bestätigt"
          }
        }
      }
    },
    "speicher.fast_voll": {
      "post": {
        "operationId": "webhookSpeicherFastVoll",
        "security": [],
        "summary": "Speicher fast voll",
        "description": "Ereignis `speicher.fast_voll`. Signatur im Header Agile-Signature prüfen.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WebhookEreignis"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Empfang bestätigt"
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "Fehler": {
        "type": "object",
        "required": [
          "fehler"
        ],
        "properties": {
          "fehler": {
            "type": "object",
            "required": [
              "code",
              "nachricht"
            ],
            "properties": {
              "code": {
                "type": "string",
                "description": "Maschinenlesbar, z. B. anmeldung, recht, eingabe, konflikt, name_vergeben, speicher_voll, limit"
              },
              "nachricht": {
                "type": "string"
              },
              "details": {}
            }
          }
        },
        "example": {
          "fehler": {
            "code": "konflikt",
            "nachricht": "Die Datei wurde inzwischen geändert. Ihre Fassung wurde nicht übernommen.",
            "details": {
              "aktuelle_version": "6b2d0c1a-1111-4c5a-9a3e-2f0a3b9d1c22"
            }
          }
        }
      },
      "Seite": {
        "type": "object",
        "properties": {
          "limit": {
            "type": "integer"
          },
          "offset": {
            "type": "integer"
          },
          "gesamt": {
            "type": "integer"
          }
        }
      },
      "Eintrag": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "typ": {
            "type": "string",
            "enum": [
              "datei",
              "ordner"
            ]
          },
          "name": {
            "type": "string"
          },
          "art": {
            "type": "string",
            "description": "Grobe Art für Symbole",
            "enum": [
              "ordner",
              "bild",
              "video",
              "audio",
              "pdf",
              "dokument",
              "tabelle",
              "praesentation",
              "text",
              "archiv",
              "datei"
            ]
          },
          "groesse": {
            "type": "integer",
            "description": "Byte"
          },
          "mime": {
            "type": [
              "string",
              "null"
            ]
          },
          "sha256": {
            "type": [
              "string",
              "null"
            ],
            "description": "SHA-256 des Inhalts (hex)"
          },
          "version_id": {
            "type": [
              "string",
              "null"
            ],
            "description": "Aktuelle Version"
          },
          "eltern_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "geaendert_am": {
            "type": "string",
            "format": "date-time"
          },
          "erstellt_am": {
            "type": "string",
            "format": "date-time"
          },
          "aktualisiert_am": {
            "type": "string",
            "format": "date-time"
          },
          "favorit": {
            "type": "boolean"
          },
          "geteilt": {
            "type": "boolean",
            "description": "Hat Freigaben oder aktive Links"
          },
          "wurzel": {
            "type": "boolean",
            "description": "true für „Meine Ablage“"
          },
          "besitzer": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "name": {
                "type": "string"
              },
              "email": {
                "type": "string"
              }
            }
          },
          "rolle": {
            "type": "string",
            "description": "Ihre Rolle",
            "enum": [
              "besitzer",
              "bearbeiter",
              "betrachter"
            ]
          },
          "papierkorb_seit": {
            "type": "string",
            "format": "date-time"
          },
          "pfad": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "name": {
                  "type": "string"
                }
              }
            }
          }
        },
        "example": {
          "id": "3f1c0b7e-8a52-4c5a-9a3e-2f0a3b9d1c11",
          "typ": "datei",
          "name": "Angebot.pdf",
          "art": "pdf",
          "groesse": 482113,
          "mime": "application/pdf",
          "sha256": "9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08",
          "version_id": "6b2d0c1a-1111-4c5a-9a3e-2f0a3b9d1c22",
          "eltern_id": "0d4e5f6a-2222-4c5a-9a3e-2f0a3b9d1c33",
          "geaendert_am": "2026-10-11T08:30:00.000Z",
          "erstellt_am": "2026-10-11T08:30:00.000Z",
          "aktualisiert_am": "2026-10-11T08:30:00.000Z",
          "favorit": false,
          "geteilt": true,
          "wurzel": false,
          "besitzer": {
            "id": "7a8b9c0d-3333-4c5a-9a3e-2f0a3b9d1c44",
            "name": "Max Muster",
            "email": "max@example.com"
          }
        }
      },
      "Ordnerinhalt": {
        "type": "object",
        "properties": {
          "ordner": {
            "$ref": "#/components/schemas/Eintrag"
          },
          "rolle": {
            "type": "string",
            "enum": [
              "besitzer",
              "bearbeiter",
              "betrachter"
            ]
          },
          "pfad": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "name": {
                  "type": "string"
                }
              }
            }
          },
          "daten": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Eintrag"
            }
          },
          "seite": {
            "$ref": "#/components/schemas/Seite"
          }
        }
      },
      "Version": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "groesse": {
            "type": "integer"
          },
          "sha256": {
            "type": "string"
          },
          "mime": {
            "type": [
              "string",
              "null"
            ]
          },
          "geaendert_am": {
            "type": "string"
          },
          "erstellt_am": {
            "type": "string"
          },
          "aktuell": {
            "type": "boolean"
          },
          "behalten": {
            "type": "boolean"
          },
          "ueber": {
            "type": [
              "string",
              "null"
            ],
            "description": "web, desktop, webdav, api, mcp, link, kopie, wiederhergestellt"
          },
          "autor": {
            "type": [
              "object",
              "null"
            ]
          }
        }
      },
      "Vorschau": {
        "oneOf": [
          {
            "type": "object",
            "properties": {
              "art": {
                "type": "string",
                "const": "text"
              },
              "text": {
                "type": "string"
              },
              "gekuerzt": {
                "type": "boolean"
              },
              "sprache": {
                "type": "string"
              }
            }
          },
          {
            "type": "object",
            "properties": {
              "art": {
                "type": "string",
                "const": "html"
              },
              "html": {
                "type": "string",
                "description": "Bereinigtes HTML"
              },
              "gekuerzt": {
                "type": "boolean"
              }
            }
          },
          {
            "type": "object",
            "properties": {
              "art": {
                "type": "string",
                "const": "tabelle"
              },
              "blaetter": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "name": {
                      "type": "string"
                    },
                    "zeilen": {
                      "type": "array",
                      "items": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          {
            "type": "object",
            "properties": {
              "art": {
                "type": "string",
                "const": "folien"
              },
              "folien": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              }
            }
          },
          {
            "type": "object",
            "properties": {
              "art": {
                "type": "string",
                "const": "keine"
              },
              "grund": {
                "type": "string"
              }
            }
          }
        ]
      },
      "Speicher": {
        "type": "object",
        "properties": {
          "belegt": {
            "type": "integer"
          },
          "kontingent": {
            "type": "integer"
          },
          "reserviert": {
            "type": "integer"
          },
          "prozent": {
            "type": "number"
          },
          "nach_art": {
            "type": "object"
          },
          "papierkorb_bytes": {
            "type": "integer"
          },
          "alte_versionen": {
            "type": "object",
            "properties": {
              "bytes": {
                "type": "integer"
              },
              "anzahl": {
                "type": "integer"
              }
            }
          },
          "hinweis": {
            "type": "string"
          }
        }
      },
      "Ich": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "email": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "erstellt_am": {
            "type": "string"
          },
          "wurzel_id": {
            "type": "string",
            "description": "id von „Meine Ablage“"
          },
          "speicher": {
            "$ref": "#/components/schemas/Speicher"
          },
          "zugang": {
            "type": "object",
            "properties": {
              "art": {
                "type": "string",
                "enum": [
                  "schluessel",
                  "oauth",
                  "sitzung"
                ]
              },
              "rechte": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              }
            }
          }
        }
      },
      "Benachrichtigung": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer"
          },
          "typ": {
            "type": "string"
          },
          "titel": {
            "type": "string"
          },
          "text": {
            "type": "string"
          },
          "url": {
            "type": [
              "string",
              "null"
            ]
          },
          "erstellt_am": {
            "type": "string"
          },
          "gelesen": {
            "type": "boolean"
          }
        }
      },
      "Freigaben": {
        "type": "object",
        "properties": {
          "besitzer": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "name": {
                "type": "string"
              },
              "email": {
                "type": "string"
              }
            }
          },
          "freigaben": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string"
                },
                "art": {
                  "type": "string",
                  "enum": [
                    "person",
                    "team",
                    "einladung"
                  ]
                },
                "rolle": {
                  "type": "string",
                  "enum": [
                    "betrachter",
                    "bearbeiter"
                  ]
                },
                "person": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "name": {
                      "type": "string"
                    },
                    "email": {
                      "type": "string"
                    }
                  }
                },
                "team": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "name": {
                      "type": "string"
                    },
                    "mitglieder": {
                      "type": "integer"
                    }
                  }
                },
                "email": {
                  "type": "string"
                },
                "erstellt_am": {
                  "type": "string"
                }
              }
            }
          }
        }
      },
      "FreigabeEingabe": {
        "type": "object",
        "properties": {
          "email": {
            "type": "string",
            "format": "email"
          },
          "team_id": {
            "type": "string",
            "format": "uuid"
          },
          "rolle": {
            "type": "string",
            "enum": [
              "betrachter",
              "bearbeiter"
            ],
            "default": "betrachter"
          },
          "nachricht": {
            "type": "string"
          },
          "benachrichtigen": {
            "type": "boolean",
            "default": true
          }
        },
        "description": "Entweder email oder team_id"
      },
      "Link": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "eintrag_id": {
            "type": "string"
          },
          "url": {
            "type": "string",
            "description": "Öffentliche Adresse"
          },
          "modus": {
            "type": "string",
            "enum": [
              "ansehen",
              "herunterladen",
              "hochladen"
            ]
          },
          "passwort": {
            "type": "boolean"
          },
          "laeuft_ab_am": {
            "type": [
              "string",
              "null"
            ]
          },
          "max_downloads": {
            "type": [
              "integer",
              "null"
            ]
          },
          "downloads": {
            "type": "integer"
          },
          "uploads": {
            "type": "integer"
          },
          "bezeichnung": {
            "type": [
              "string",
              "null"
            ]
          },
          "erstellt_am": {
            "type": "string"
          },
          "zuletzt_aufgerufen": {
            "type": [
              "string",
              "null"
            ]
          },
          "aktiv": {
            "type": "boolean"
          },
          "abgelaufen": {
            "type": "boolean"
          }
        }
      },
      "LinkEingabe": {
        "type": "object",
        "properties": {
          "modus": {
            "type": "string",
            "enum": [
              "ansehen",
              "herunterladen",
              "hochladen"
            ]
          },
          "passwort": {
            "type": [
              "string",
              "null"
            ],
            "minLength": 4
          },
          "laeuft_ab_am": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "max_downloads": {
            "type": [
              "integer",
              "null"
            ]
          },
          "bezeichnung": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      },
      "Upload": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "groesse": {
            "type": "integer"
          },
          "teil_groesse": {
            "type": "integer"
          },
          "teile_gesamt": {
            "type": "integer"
          },
          "teile_erhalten": {
            "type": "array",
            "items": {
              "type": "integer"
            }
          },
          "fehlende_teile": {
            "type": "array",
            "items": {
              "type": "integer"
            }
          },
          "status": {
            "type": "string",
            "enum": [
              "offen",
              "verarbeitung",
              "fertig",
              "abgebrochen"
            ]
          },
          "ergebnis_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "laeuft_ab_am": {
            "type": "string"
          }
        }
      },
      "UploadEingabe": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string"
          },
          "groesse": {
            "type": "integer"
          },
          "ordner_id": {
            "type": "string",
            "format": "uuid"
          },
          "pfad": {
            "type": "string",
            "description": "Unterordner, wird angelegt"
          },
          "datei_id": {
            "type": "string",
            "description": "Neue Version dieser Datei",
            "format": "uuid"
          },
          "teil_groesse": {
            "type": "integer",
            "minimum": 1048576,
            "maximum": 67108864,
            "default": 8388608
          },
          "sha256": {
            "type": "string",
            "description": "Optional: Prüfsumme des Inhalts"
          },
          "geaendert_am": {
            "type": "string",
            "format": "date-time"
          },
          "if_match": {
            "type": "string",
            "description": "Erwartete version_id"
          },
          "konflikt": {
            "type": "string",
            "enum": [
              "fehler",
              "umbenennen",
              "ersetzen"
            ]
          }
        },
        "required": [
          "groesse"
        ]
      },
      "Team": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "meine_rolle": {
            "type": "string",
            "enum": [
              "admin",
              "mitglied"
            ]
          },
          "mitglieder": {
            "type": "integer"
          },
          "erstellt_am": {
            "type": "string"
          }
        }
      },
      "TeamDetail": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "meine_rolle": {
            "type": "string"
          },
          "mitglieder": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string"
                },
                "name": {
                  "type": "string"
                },
                "email": {
                  "type": "string"
                },
                "rolle": {
                  "type": "string"
                },
                "seit": {
                  "type": "string"
                }
              }
            }
          },
          "einladungen": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string"
                },
                "email": {
                  "type": "string"
                },
                "rolle": {
                  "type": "string"
                }
              }
            }
          },
          "freigaben": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string"
                },
                "name": {
                  "type": "string"
                },
                "typ": {
                  "type": "string"
                },
                "rolle": {
                  "type": "string"
                }
              }
            }
          }
        }
      },
      "Aenderungen": {
        "type": "object",
        "properties": {
          "eintraege": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string"
                },
                "eltern_id": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "typ": {
                  "type": "string",
                  "enum": [
                    "datei",
                    "ordner",
                    "wurzel"
                  ]
                },
                "name": {
                  "type": "string"
                },
                "groesse": {
                  "type": "integer"
                },
                "sha256": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "version_id": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "geaendert_am": {
                  "type": "string"
                },
                "geloescht": {
                  "type": "boolean"
                },
                "seq": {
                  "type": "integer"
                }
              }
            }
          },
          "cursor": {
            "type": "integer"
          },
          "mehr": {
            "type": "boolean"
          },
          "wurzel_id": {
            "type": "string"
          }
        }
      },
      "Webhook": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "url": {
            "type": "string"
          },
          "events": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "description": {
            "type": [
              "string",
              "null"
            ]
          },
          "active": {
            "type": "boolean"
          },
          "created_at": {
            "type": "string"
          },
          "fehlgeschlagen": {
            "type": "integer"
          }
        }
      },
      "Zustellung": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "event_id": {
            "type": "string"
          },
          "event_type": {
            "type": "string"
          },
          "status": {
            "type": "string",
            "enum": [
              "offen",
              "zugestellt",
              "fehlgeschlagen"
            ]
          },
          "attempts": {
            "type": "integer"
          },
          "last_status_code": {
            "type": [
              "integer",
              "null"
            ]
          },
          "last_error": {
            "type": [
              "string",
              "null"
            ]
          },
          "created_at": {
            "type": "string"
          },
          "delivered_at": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      },
      "WebhookEreignis": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "typ": {
            "type": "string",
            "enum": [
              "datei.hochgeladen",
              "datei.geaendert",
              "datei.geloescht",
              "ordner.angelegt",
              "freigabe.erhalten",
              "link.upload",
              "upload.fertig",
              "speicher.fast_voll",
              "team.hinzugefuegt"
            ]
          },
          "erstellt": {
            "type": "string",
            "format": "date-time"
          },
          "daten": {
            "type": "object"
          }
        },
        "description": "Body jeder Webhook-Zustellung",
        "example": {
          "id": "9b1f2c3d-0000-4000-8000-000000000001",
          "typ": "datei.hochgeladen",
          "erstellt": "2026-10-11T12:00:00Z",
          "daten": {
            "id": "3f1c0b7e-8a52-4c5a-9a3e-2f0a3b9d1c11",
            "name": "Angebot.pdf",
            "typ": "datei",
            "groesse": 482113
          }
        }
      }
    },
    "securitySchemes": {
      "apiSchluessel": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "agile_sto_…",
        "description": "API-Schlüssel aus Einstellungen › Entwickler."
      },
      "oauth2": {
        "type": "oauth2",
        "description": "Authorization Code mit PKCE (S256). Clients registrieren sich dynamisch unter /oauth/register.",
        "flows": {
          "authorizationCode": {
            "authorizationUrl": "https://storage.agiledeveloper.de/oauth/authorize",
            "tokenUrl": "https://storage.agiledeveloper.de/oauth/token",
            "refreshUrl": "https://storage.agiledeveloper.de/oauth/token",
            "scopes": {
              "lesen": "Lesen",
              "schreiben": "Ändern",
              "teilen": "Teilen"
            }
          }
        }
      }
    }
  }
}