{
  "openapi": "3.1.0",
  "info": {
    "title": "MeinFeierPlaner Edge Functions",
    "version": "1.26.105",
    "description": "Maschinenlesbare HTTP-Contracts für Supabase Edge Functions von MeinFeierPlaner.\n\nProdukt- und Nutzungskontext: https://meinfeierplaner.app/llms.txt\n\nDie Web-App läuft unter https://meinfeierplaner.app — Edge Functions unter der gewählten server-URL (…/functions/v1/{functionName}).\n\nFür geschützte Aufrufe: Authorization: Bearer <Supabase Access JWT>. verify_jwt am Gateway ist bei vielen Functions false; die Function validiert JWT selbst.\n\nX-API-Key wird von diesen Edge Functions nicht ausgewertet (Schema nur für Konventionen / MCP)."
  },
  "servers": [
    {
      "url": "https://cjsxhtrpmmhukwfdakyj.supabase.co/functions/v1",
      "description": "Produktion (Supabase project_id)"
    },
    {
      "url": "https://ehhczsngamixradlwzvk.supabase.co/functions/v1",
      "description": "Dev / Preview (Beispiel-Ref)"
    }
  ],
  "tags": [
    {
      "name": "Account",
      "description": "Konto und Admin-Hilfsfunktionen"
    },
    {
      "name": "Billing",
      "description": "Stripe, Abo, Checkout"
    },
    {
      "name": "Events",
      "description": "Event-Bundles und Co-Admins"
    },
    {
      "name": "Gast",
      "description": "Öffentliche oder tokenbasierte Gast-APIs"
    },
    {
      "name": "KI",
      "description": "KI-Copywriter"
    },
    {
      "name": "API-Zugang",
      "description": "Nutzer-API-Schlüssel"
    },
    {
      "name": "Kommunikation",
      "description": "E-Mail, Broadcasts, Erinnerungen"
    },
    {
      "name": "PlatformAdmin",
      "description": "Nur is_admin / Plattform-Dashboard"
    },
    {
      "name": "Stripe",
      "description": "Stripe Webhooks"
    },
    {
      "name": "Support",
      "description": "Support-Tickets"
    }
  ],
  "components": {
    "securitySchemes": {
      "bearerJwt": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "JWT",
        "description": "Supabase Auth Access Token (Authorization: Bearer …)"
      },
      "stripeSignature": {
        "type": "apiKey",
        "in": "header",
        "name": "Stripe-Signature",
        "description": "Stripe Webhook Signatur-Header"
      },
      "apiKeyHeader": {
        "type": "apiKey",
        "in": "header",
        "name": "X-API-Key",
        "description": "Wird von diesen Edge Functions nicht ausgewertet. Konvention für MCP/externe Clients; nicht mit Supabase JWT verwechseln."
      }
    },
    "schemas": {
      "ErrorBody": {
        "type": "object",
        "properties": {
          "error": {
            "type": "string"
          }
        }
      },
      "GenericJson": {
        "type": "object",
        "additionalProperties": true
      }
    }
  },
  "paths": {
    "/admin-reset-password": {
      "post": {
        "operationId": "adminResetPassword",
        "tags": [
          "Account"
        ],
        "summary": "Recovery-E-Mail für Passwort-Reset senden (Admin)",
        "description": "Erfordert authentifizierten Aufrufer mit Berechtigung.",
        "security": [
          {
            "bearerJwt": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "user_id"
                ],
                "properties": {
                  "user_id": {
                    "type": "string"
                  },
                  "redirect_to": {
                    "type": "string",
                    "format": "uri"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericJson"
                }
              }
            }
          },
          "400": {
            "description": "Fehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "401": {
            "description": "Fehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "Fehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "404": {
            "description": "Fehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "405": {
            "description": "Fehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "429": {
            "description": "Fehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "500": {
            "description": "Fehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "503": {
            "description": "Fehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        }
      }
    },
    "/auth-send-email": {
      "post": {
        "operationId": "authSendEmail",
        "tags": [
          "Account"
        ],
        "summary": "Supabase Auth Send-Email-Hook (Resend HTTP)",
        "description": "Nur von Supabase Auth Hooks aufgerufen. Verifiziert SEND_EMAIL_HOOK_SECRET (standardwebhooks). HTML-only über Resend.",
        "security": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "description": "Supabase Auth Hook Payload (user + email_data)",
                "additionalProperties": true
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericJson"
                }
              }
            }
          },
          "400": {
            "description": "Fehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "401": {
            "description": "Fehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "Fehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "404": {
            "description": "Fehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "405": {
            "description": "Fehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "429": {
            "description": "Fehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "500": {
            "description": "Fehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "503": {
            "description": "Fehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        }
      }
    },
    "/admin-notify": {
      "post": {
        "operationId": "adminNotify",
        "tags": [
          "Kommunikation"
        ],
        "summary": "E-Mail- und Push-Benachrichtigungen an Veranstalter (RSVP, Gästebuch)",
        "description": "POST. `x-admin-notify-secret` (Kette aus guest-lookup) oder authentifizierter Aufrufer mit `can_manage_bundle`. Details und Payload siehe `supabase/functions/admin-notify/index.ts`.",
        "security": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "description": "Ereignis und Bundle-Kontext (siehe Implementierung)",
                "additionalProperties": true
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericJson"
                }
              }
            }
          },
          "400": {
            "description": "Fehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "401": {
            "description": "Fehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "Fehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "404": {
            "description": "Fehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "405": {
            "description": "Fehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "429": {
            "description": "Fehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "500": {
            "description": "Fehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "503": {
            "description": "Fehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        }
      }
    },
    "/admin-notify-digest": {
      "post": {
        "operationId": "adminNotifyDigest",
        "tags": [
          "Kommunikation"
        ],
        "summary": "Digest / gebündelte Admin-Benachrichtigungen",
        "description": "Cron oder intern; siehe `supabase/functions/admin-notify-digest/index.ts`.",
        "security": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericJson"
                }
              }
            }
          },
          "400": {
            "description": "Fehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "401": {
            "description": "Fehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "Fehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "404": {
            "description": "Fehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "405": {
            "description": "Fehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "429": {
            "description": "Fehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "500": {
            "description": "Fehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "503": {
            "description": "Fehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        }
      }
    },
    "/admin-push-register": {
      "post": {
        "operationId": "adminPushRegister",
        "tags": [
          "Kommunikation"
        ],
        "summary": "Web-Push-Abonnement für Veranstalter (Admin-Client)",
        "description": "Siehe `supabase/functions/admin-push-register/index.ts`.",
        "security": [
          {
            "bearerJwt": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericJson"
                }
              }
            }
          },
          "400": {
            "description": "Fehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "401": {
            "description": "Fehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "Fehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "404": {
            "description": "Fehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "405": {
            "description": "Fehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "429": {
            "description": "Fehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "500": {
            "description": "Fehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "503": {
            "description": "Fehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        }
      }
    },
    "/ai-copywriter": {
      "post": {
        "operationId": "aiCopywriter",
        "tags": [
          "KI"
        ],
        "summary": "KI-Textvorschläge für Einladungen (Bundle)",
        "description": "Health: action __health_ping__. Sonst Bearer JWT + can_manage_bundle für bundle_id. Workspace muss Premium mit gültigem Abo sein (Serverprüfung, wie `isWorkspacePremiumForModules` im Frontend). 403: JSON `{ error: \"PLAN_PREMIUM_REQUIRED\" }`. KI über Vercel AI Gateway (`AI_GATEWAY_API_KEY`), Standard `anthropic/claude-haiku-5.5` nur über Bedrock (EU-Zone scope zone/geoRegion eu, ZDR, Routing-Compliance bedrock+eu); Override `AI_MODEL` nur exakt `anthropic/claude-haiku-5.5` oder `anthropic/claude-haiku-4.5` (leer = Standard, sonst HTTP 400). Wunschtext höchstens 2000 Zeichen. Entwurf höchstens 2000 Zeichen sichtbarer Text (HTML wird vorher entfernt), sonst HTTP 413 `AI_INPUT_TOO_LONG`. Rohanfrage höchstens 8000 Zeichen, sonst HTTP 413 `AI_REQUEST_TOO_LONG`. Beides ohne Gateway-Aufruf. Ausgabe `max_tokens` fest 1024. Nutzerprüfung ohne ID: HTTP 401 `AI_COPYWRITER_UNAVAILABLE`. Fehler bei der Nutzerprüfung: HTTP 503 derselbe Code. Gateway-Timeout 25s: HTTP 503 `AI_PROVIDER_UNAVAILABLE`. Felder target (subject|email|whatsapp|social), tone (warm|formal|short).",
        "security": [
          {
            "bearerJwt": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "action": {
                    "type": "string",
                    "enum": [
                      "__health_ping__"
                    ]
                  },
                  "bundle_id": {
                    "type": "string"
                  },
                  "target": {
                    "type": "string",
                    "enum": [
                      "subject",
                      "email",
                      "whatsapp",
                      "social"
                    ]
                  },
                  "tone": {
                    "type": "string",
                    "enum": [
                      "warm",
                      "formal",
                      "short"
                    ]
                  },
                  "language": {
                    "type": "string"
                  },
                  "prompt": {
                    "type": "string"
                  },
                  "draft": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericJson"
                }
              }
            }
          },
          "400": {
            "description": "Fehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "401": {
            "description": "Fehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "Fehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "404": {
            "description": "Fehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "405": {
            "description": "Fehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "429": {
            "description": "Fehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "500": {
            "description": "Fehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "503": {
            "description": "Fehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        }
      }
    },
    "/api-access": {
      "post": {
        "operationId": "apiAccess",
        "tags": [
          "API-Zugang"
        ],
        "summary": "API-Schlüssel-Status, Provisionierung, Rotation",
        "description": "action: status | provision | rotate. Workspace-Plan basis oder premium.",
        "security": [
          {
            "bearerJwt": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "action": {
                    "type": "string",
                    "enum": [
                      "status",
                      "provision",
                      "rotate"
                    ]
                  },
                  "label": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericJson"
                }
              }
            }
          },
          "400": {
            "description": "Fehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "401": {
            "description": "Fehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "Fehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "404": {
            "description": "Fehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "405": {
            "description": "Fehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "429": {
            "description": "Fehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "500": {
            "description": "Fehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "503": {
            "description": "Fehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        }
      }
    },
    "/cancel-subscription": {
      "post": {
        "operationId": "cancelSubscription",
        "tags": [
          "Billing"
        ],
        "summary": "Stripe-Abonnement kündigen oder innerhalb der Widerrufsfrist widerrufen",
        "description": "target: workspace (Standard) = Workspace-Basis/Premium; api = separates API-Add-on (user_api_keys). action withdraw nur innerhalb von 14 Tagen ab Vertragsschluss: Abo endet sofort, Erstattung standardmäßig voll, Eingangsbestätigung per E-Mail. action cancel danach: Ende der bezahlten Laufzeit, bei Neukunden keine Erstattung. Ein zweites Jahr ohne Vertragsgrundlage wird nach dem Beenden vollständig erstattet. Schlägt die Erstattung fehl, ist der Status refund_pending und ein erneuter Versuch bleibt möglich. Ein Nachholen ohne gespeicherten Stand ist HTTP 409 mit error „Es gibt nichts nachzuholen.“. Scheitert Stripe, bevor die Metadaten geschrieben sind, ist das HTTP 503 mit einer Fehlermeldung und ohne refund_pending; ein erneuter Versuch ist dann kein 409. „Gespeichert“ steht nur, wenn die Metadaten geschrieben wurden. HTTP 401: generische Auth-Meldung (kein JWT-Rohtext). HTTP 500 catch: error=payment_unavailable.",
        "security": [
          {
            "bearerJwt": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "target": {
                    "type": "string",
                    "enum": [
                      "workspace",
                      "api"
                    ]
                  },
                  "action": {
                    "type": "string",
                    "enum": [
                      "cancel",
                      "withdraw"
                    ]
                  },
                  "resume": {
                    "type": "boolean"
                  },
                  "locale": {
                    "type": "string",
                    "enum": [
                      "de",
                      "en"
                    ]
                  },
                  "confirmationEmail": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericJson"
                }
              }
            }
          },
          "400": {
            "description": "Fehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "401": {
            "description": "Fehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "Fehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "404": {
            "description": "Fehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "405": {
            "description": "Fehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "429": {
            "description": "Fehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "500": {
            "description": "Catch: JSON { error: \"payment_unavailable\" }. Stripe/SDK-Rohtexte nur in Edge-Logs, nicht im Body.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "type": "string",
                      "enum": [
                        "payment_unavailable"
                      ]
                    }
                  }
                }
              }
            }
          },
          "503": {
            "description": "Fehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        }
      }
    },
    "/platform-admin-consumer-withdrawal": {
      "post": {
        "operationId": "platformAdminConsumerWithdrawal",
        "tags": [
          "Plattform-Admin"
        ],
        "summary": "Widerruf per Post oder E-Mail erfassen",
        "description": "Nur Plattform-Admin. Speichert den Eingang nur innerhalb der Frist, schickt die Bestätigung und führt danach Erstattung und Vertragsende aus. Kein Personenbezug im Alarm.",
        "security": [
          {
            "bearerJwt": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "subscriptionId": {
                    "type": "string"
                  },
                  "workspaceId": {
                    "type": "string"
                  },
                  "channel": {
                    "type": "string",
                    "enum": [
                      "mail",
                      "post"
                    ]
                  },
                  "requestedAt": {
                    "type": "string"
                  },
                  "customerName": {
                    "type": "string"
                  },
                  "contractLabel": {
                    "type": "string"
                  },
                  "confirmationEmail": {
                    "type": "string"
                  },
                  "locale": {
                    "type": "string",
                    "enum": [
                      "de",
                      "en"
                    ]
                  }
                },
                "required": [
                  "subscriptionId",
                  "workspaceId",
                  "channel",
                  "requestedAt"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericJson"
                }
              }
            }
          },
          "400": {
            "description": "Fehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "401": {
            "description": "Fehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "Fehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "404": {
            "description": "Fehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "405": {
            "description": "Fehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "429": {
            "description": "Fehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "500": {
            "description": "Fehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "503": {
            "description": "Fehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        }
      }
    },
    "/check-subscription": {
      "post": {
        "operationId": "checkSubscription",
        "tags": [
          "Billing"
        ],
        "summary": "Stripe-Abonnementstatus für eingeloggten Nutzer prüfen",
        "description": "HTTP 401: generische Auth-Meldung (kein JWT-Rohtext). HTTP 500 catch: error=payment_unavailable.",
        "security": [
          {
            "bearerJwt": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericJson"
                }
              }
            }
          },
          "400": {
            "description": "Fehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "401": {
            "description": "Fehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "Fehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "404": {
            "description": "Fehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "405": {
            "description": "Fehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "429": {
            "description": "Fehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "500": {
            "description": "Catch: JSON { error: \"payment_unavailable\" }. Stripe/SDK-Rohtexte nur in Edge-Logs, nicht im Body.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "type": "string",
                      "enum": [
                        "payment_unavailable"
                      ]
                    }
                  }
                }
              }
            }
          },
          "503": {
            "description": "Fehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        }
      }
    },
    "/clone-event-data": {
      "post": {
        "operationId": "cloneEventData",
        "tags": [
          "Events"
        ],
        "summary": "Event-Daten zwischen Bundles klonen",
        "security": [
          {
            "bearerJwt": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "sourceBundleId",
                  "targetBundleId"
                ],
                "properties": {
                  "sourceBundleId": {
                    "type": "string"
                  },
                  "targetBundleId": {
                    "type": "string"
                  },
                  "options": {
                    "type": "object",
                    "additionalProperties": true
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericJson"
                }
              }
            }
          },
          "400": {
            "description": "Fehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "401": {
            "description": "Fehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "Fehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "404": {
            "description": "Fehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "405": {
            "description": "Fehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "429": {
            "description": "Fehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "500": {
            "description": "Fehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "503": {
            "description": "Fehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        }
      }
    },
    "/create-checkout": {
      "post": {
        "operationId": "createCheckout",
        "tags": [
          "Billing"
        ],
        "summary": "Stripe Checkout Session erstellen",
        "description": "Body: priceId muss in STRIPE_ALLOWED_PRICE_IDS konfiguriert sein. withdrawalWaiverTextVersion und termRuleTextVersion müssen die gespeicherten Textstände sein. Ein pauschales withdrawalWaiverAccepted=true reicht nicht. Health-Ping action=__health_ping__ ist ausgenommen. locale de oder en steuert den Hinweis auf der Stripe-Seite. HTTP 400: error=withdrawal_waiver_required. HTTP 401: generische Auth-Meldung. HTTP 500 catch: error=payment_unavailable (kein Stripe-Rohtext).",
        "security": [
          {
            "bearerJwt": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "priceId"
                ],
                "properties": {
                  "priceId": {
                    "type": "string"
                  },
                  "withdrawalWaiverTextVersion": {
                    "type": "string"
                  },
                  "termRuleTextVersion": {
                    "type": "string"
                  },
                  "locale": {
                    "type": "string",
                    "enum": [
                      "de",
                      "en"
                    ]
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericJson"
                }
              }
            }
          },
          "400": {
            "description": "Fehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "401": {
            "description": "Fehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "Fehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "404": {
            "description": "Fehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "405": {
            "description": "Fehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "429": {
            "description": "Fehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "500": {
            "description": "Catch: JSON { error: \"payment_unavailable\" }. Stripe/SDK-Rohtexte nur in Edge-Logs, nicht im Body.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "type": "string",
                      "enum": [
                        "payment_unavailable"
                      ]
                    }
                  }
                }
              }
            }
          },
          "503": {
            "description": "Fehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        }
      }
    },
    "/delete-user-account": {
      "post": {
        "operationId": "deleteUserAccount",
        "tags": [
          "Billing"
        ],
        "summary": "DSGVO Art. 17 — Konto und Workspace löschen",
        "description": "Bearer JWT Pflicht. Soft-delete Bundles, auth.admin.deleteUser, Bestätigungs-Mail.",
        "security": [
          {
            "bearerJwt": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericJson"
                }
              }
            }
          },
          "400": {
            "description": "Fehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "401": {
            "description": "Fehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "Fehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "404": {
            "description": "Fehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "405": {
            "description": "Fehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "429": {
            "description": "Fehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "500": {
            "description": "Fehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "503": {
            "description": "Fehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        }
      }
    },
    "/customer-portal": {
      "post": {
        "operationId": "customerPortal",
        "tags": [
          "Billing"
        ],
        "summary": "Stripe Customer Portal URL",
        "description": "Optional return_path: nach dem Portal wird zu dieser App-Route zurücknavigiert (Allowlist). HTTP 401: generische Auth-Meldung. HTTP 422 mit error=billing_portal_no_customer: noch kein Stripe Customer (weder in Workspace-DB noch per E-Mail); Dashboard kann stattdessen create-checkout auslösen. HTTP 500 catch: error=payment_unavailable.",
        "security": [
          {
            "bearerJwt": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "return_path": {
                    "type": "string",
                    "enum": [
                      "/dashboard",
                      "/dashboard/api-access"
                    ],
                    "description": "Standard: /dashboard"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericJson"
                }
              }
            }
          },
          "400": {
            "description": "Fehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "401": {
            "description": "Fehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "Fehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "404": {
            "description": "Fehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "405": {
            "description": "Fehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "429": {
            "description": "Fehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "500": {
            "description": "Catch: JSON { error: \"payment_unavailable\" }. Stripe/SDK-Rohtexte nur in Edge-Logs, nicht im Body.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "type": "string",
                      "enum": [
                        "payment_unavailable"
                      ]
                    }
                  }
                }
              }
            }
          },
          "503": {
            "description": "Fehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        }
      }
    },
    "/contract-cancellation": {
      "post": {
        "operationId": "contractCancellation",
        "tags": [
          "Billing"
        ],
        "summary": "Kündigungserklärung entgegennehmen (§312k)",
        "description": "Ohne Pflicht-Login. Speichert Art, Vertrag, Zeitpunkt und Eingangszeit. Antwort bei Erfolg immer gleich (ok, reference, received_at, echo) — kein Hinweis, ob ein Konto existiert. 429 rate_limited, wenn das Limit greift oder der Zähler ausfällt (fail-closed). 503 request_failed, wenn nicht gespeichert werden konnte. Kein Stripe. Kontakt support@meinfeierplaner.app.",
        "security": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "idempotency_key",
                  "locale",
                  "cancellation_type",
                  "contract_kind",
                  "timing",
                  "full_name",
                  "email"
                ],
                "properties": {
                  "idempotency_key": {
                    "type": "string",
                    "format": "uuid"
                  },
                  "locale": {
                    "type": "string",
                    "enum": [
                      "de",
                      "en"
                    ]
                  },
                  "cancellation_type": {
                    "type": "string",
                    "enum": [
                      "ordinary",
                      "extraordinary"
                    ]
                  },
                  "extraordinary_reason": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "contract_kind": {
                    "type": "string",
                    "enum": [
                      "workspace_subscription",
                      "api_addon",
                      "unknown"
                    ]
                  },
                  "timing": {
                    "type": "string",
                    "enum": [
                      "earliest",
                      "requested_date"
                    ]
                  },
                  "requested_date": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "format": "date"
                  },
                  "full_name": {
                    "type": "string"
                  },
                  "email": {
                    "type": "string",
                    "format": "email"
                  },
                  "workspace_name": {
                    "type": [
                      "string",
                      "null"
                    ]
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericJson"
                }
              }
            }
          },
          "400": {
            "description": "Fehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "401": {
            "description": "Fehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "Fehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "404": {
            "description": "Fehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "405": {
            "description": "Fehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "429": {
            "description": "Fehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "500": {
            "description": "Fehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "503": {
            "description": "Fehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        }
      }
    },
    "/public-billing-portal": {
      "post": {
        "operationId": "publicBillingPortal",
        "tags": [
          "Billing"
        ],
        "summary": "Öffentlicher §312k-Kündigungsweg (Portal-Link per E-Mail)",
        "description": "Ohne Login: E-Mail, Rate-Limits per IP/E-Mail. Versendet signierten MFP-Portal-Link (24h) per Resend — Antwort immer HTTP 200 mit generischer Meldung (kein Stripe-URL im JSON). Hintergrund: EdgeRuntime.waitUntil.",
        "security": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "email"
                ],
                "properties": {
                  "email": {
                    "type": "string",
                    "format": "email"
                  },
                  "return_path": {
                    "type": "string",
                    "enum": [
                      "/vertraege-kuendigen"
                    ],
                    "description": "Standard: /vertraege-kuendigen"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericJson"
                }
              }
            }
          },
          "400": {
            "description": "Fehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "401": {
            "description": "Fehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "Fehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "404": {
            "description": "Fehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "405": {
            "description": "Fehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "429": {
            "description": "Fehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "500": {
            "description": "Fehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "503": {
            "description": "Fehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        }
      }
    },
    "/public-billing-portal-redeem": {
      "post": {
        "operationId": "publicBillingPortalRedeem",
        "tags": [
          "Billing"
        ],
        "summary": "§312k: Token gegen Stripe-Billing-Portal-Session tauschen",
        "description": "POST mit token (HMAC, nur jti+exp; Zuordnung serverseitig). Einmalnutzung nach erfolgreicher Stripe-Session (DB). Neutrale Fehler bei 400/429. Antwort { url } — kein Login.",
        "security": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "token"
                ],
                "properties": {
                  "token": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericJson"
                }
              }
            }
          },
          "400": {
            "description": "Fehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "401": {
            "description": "Fehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "Fehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "404": {
            "description": "Fehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "405": {
            "description": "Fehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "429": {
            "description": "Fehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "500": {
            "description": "Fehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "503": {
            "description": "Fehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        }
      }
    },
    "/event-admin-send-invite": {
      "post": {
        "operationId": "eventAdminSendInvite",
        "tags": [
          "Events"
        ],
        "summary": "Co-Admin / Einladung zu Event-Bundle senden",
        "security": [
          {
            "bearerJwt": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "event_bundle_id",
                  "email"
                ],
                "properties": {
                  "event_bundle_id": {
                    "type": "string"
                  },
                  "email": {
                    "type": "string",
                    "format": "email"
                  },
                  "role": {
                    "type": "string",
                    "default": "co_admin"
                  },
                  "guest_id": {
                    "type": [
                      "string",
                      "null"
                    ]
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericJson"
                }
              }
            }
          },
          "400": {
            "description": "Fehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "401": {
            "description": "Fehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "Fehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "404": {
            "description": "Fehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "405": {
            "description": "Fehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "429": {
            "description": "Fehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "500": {
            "description": "Fehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "503": {
            "description": "Fehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        }
      }
    },
    "/guest-lookup": {
      "post": {
        "operationId": "guestLookup",
        "tags": [
          "Gast"
        ],
        "summary": "Zentraler Gast-API-Multiplexer (action-basiert)",
        "description": "Autorisierung meist über invite_token, guest_session_token o. ä. im JSON-Body — nicht über User-JWT. phone_lookup verlangt bundle_id der Feier. Ohne Feier keine Gästesuche und kein Zugang. lookup (Namenssuche) antwortet bei Treffer und Nicht-Treffer gleich mit status verify_required und HTTP 200. Wichtige action-Werte u. a.: __health_ping__, bundle_active_check, guest_bundle_meta, token_lookup, phone_lookup, lookup, verify, rsvp, privacy_consent, check_privacy_consent, guestbook_*, photos_*, music_toggle_played, game_toggle_played, table_info, mobility_get, mobility_upsert, generate_tokens (Admin-JWT), gift_list_get, gift_claim, gift_unclaim, trauzeugen_area_get, trauzeugen_task_upsert, trauzeugen_task_toggle, trauzeugen_task_delete, trauzeugen_poll_create, trauzeugen_poll_vote, trauzeugen_poll_delete. photos_upload_limits, photos_insert und photos_signed_upload prüfen das Gast-Token und die Premium-Fotogalerie (Toggle fotogalerie). Ohne Freigabe: HTTP 403, code gallery_locked. Fotodateien gehen über die signierte URL aus photos_signed_upload. Vollständige Semantik im Quellcode.",
        "security": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "action"
                ],
                "properties": {
                  "action": {
                    "type": "string"
                  },
                  "bundle_id": {
                    "type": "string"
                  },
                  "guest_id": {
                    "type": "string"
                  },
                  "invite_token": {
                    "type": "string"
                  },
                  "guest_session_token": {
                    "type": "string"
                  },
                  "group_invite_token": {
                    "type": "string"
                  }
                },
                "additionalProperties": true
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericJson"
                }
              }
            }
          },
          "400": {
            "description": "Fehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "401": {
            "description": "Fehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "Fehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "404": {
            "description": "Fehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "405": {
            "description": "Fehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "429": {
            "description": "Fehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "500": {
            "description": "Fehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "503": {
            "description": "Fehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        }
      }
    },
    "/guest-push-register": {
      "post": {
        "operationId": "guestPushRegister",
        "tags": [
          "Gast"
        ],
        "summary": "Web-Push für Gast registrieren oder abmelden",
        "description": "action register (default) oder unregister; Gastlektor über guest_id, event_bundle_id, invite_token.",
        "security": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "action": {
                    "type": "string",
                    "enum": [
                      "register",
                      "unregister"
                    ]
                  },
                  "guest_id": {
                    "type": "string"
                  },
                  "event_bundle_id": {
                    "type": "string"
                  },
                  "invite_token": {
                    "type": "string"
                  },
                  "endpoint": {
                    "type": "string"
                  },
                  "subscription": {
                    "type": "object",
                    "additionalProperties": true
                  }
                },
                "additionalProperties": true
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericJson"
                }
              }
            }
          },
          "400": {
            "description": "Fehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "401": {
            "description": "Fehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "Fehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "404": {
            "description": "Fehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "405": {
            "description": "Fehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "429": {
            "description": "Fehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "500": {
            "description": "Fehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "503": {
            "description": "Fehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        }
      }
    },
    "/guest-push-send": {
      "post": {
        "operationId": "guestPushSend",
        "tags": [
          "Gast"
        ],
        "summary": "Web-Push an Gäste eines Bundles senden",
        "description": "Erfordert gültiges Bearer JWT mit Admin-/Berechtigungs-Claims (getClaims).",
        "security": [
          {
            "bearerJwt": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "event_bundle_id"
                ],
                "properties": {
                  "event_bundle_id": {
                    "type": "string"
                  },
                  "title": {
                    "type": "string"
                  },
                  "body": {
                    "type": "string"
                  },
                  "url": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericJson"
                }
              }
            }
          },
          "400": {
            "description": "Fehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "401": {
            "description": "Fehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "Fehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "404": {
            "description": "Fehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "405": {
            "description": "Fehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "429": {
            "description": "Fehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "500": {
            "description": "Fehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "503": {
            "description": "Fehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        }
      }
    },
    "/guest-shuffle": {
      "post": {
        "operationId": "guestShuffle",
        "tags": [
          "Gast"
        ],
        "summary": "Tisch-Shuffle steuern",
        "description": "Auth über guest_id, token, bundle_id im Body. action: start | next_round | restore.",
        "security": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "guest_id",
                  "token",
                  "bundle_id",
                  "action"
                ],
                "properties": {
                  "guest_id": {
                    "type": "string"
                  },
                  "token": {
                    "type": "string"
                  },
                  "bundle_id": {
                    "type": "string"
                  },
                  "action": {
                    "type": "string",
                    "enum": [
                      "start",
                      "next_round",
                      "restore"
                    ]
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericJson"
                }
              }
            }
          },
          "400": {
            "description": "Fehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "401": {
            "description": "Fehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "Fehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "404": {
            "description": "Fehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "405": {
            "description": "Fehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "429": {
            "description": "Fehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "500": {
            "description": "Fehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "503": {
            "description": "Fehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        }
      }
    },
    "/consent-banner-count": {
      "post": {
        "operationId": "consentBannerCount",
        "tags": [
          "Marketing"
        ],
        "summary": "Anonyme Zählung der Cookie-Banner-Wahl",
        "description": "Öffentlich, ohne Nutzer-JWT. Body nur path (ohne Query) und choice (notwendig|statistik|alle). Gastpfade unter /einladung und /event werden nicht gezählt. Unbekannte Pfade speichert der Server als /sonstige. Der Tag wird serverseitig als UTC-Datum gesetzt. Keine IP, kein User-Agent, kein Cookie, keine Kennung.",
        "security": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "path",
                  "choice"
                ],
                "properties": {
                  "path": {
                    "type": "string"
                  },
                  "choice": {
                    "type": "string",
                    "enum": [
                      "notwendig",
                      "statistik",
                      "alle"
                    ]
                  }
                },
                "additionalProperties": true
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericJson"
                }
              }
            }
          },
          "400": {
            "description": "Fehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "401": {
            "description": "Fehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "Fehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "404": {
            "description": "Fehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "405": {
            "description": "Fehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "429": {
            "description": "Fehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "500": {
            "description": "Fehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "503": {
            "description": "Fehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        }
      }
    },
    "/marketing-waitlist": {
      "post": {
        "operationId": "marketingWaitlist",
        "tags": [
          "Marketing"
        ],
        "summary": "Warteliste DOI-Anmeldung",
        "description": "Öffentlich. email Pflicht; optional occasion, locale. Rate-Limit pro IP.",
        "security": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "email"
                ],
                "properties": {
                  "email": {
                    "type": "string",
                    "format": "email"
                  },
                  "occasion": {
                    "type": "string",
                    "enum": [
                      "hochzeit",
                      "geburtstag",
                      "verein",
                      "firma",
                      "sonstiges"
                    ]
                  },
                  "locale": {
                    "type": "string"
                  }
                },
                "additionalProperties": true
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericJson"
                }
              }
            }
          },
          "400": {
            "description": "Fehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "401": {
            "description": "Fehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "Fehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "404": {
            "description": "Fehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "405": {
            "description": "Fehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "429": {
            "description": "Fehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "500": {
            "description": "Fehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "503": {
            "description": "Fehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        }
      }
    },
    "/bundle-retention-cleanup": {
      "post": {
        "operationId": "bundleRetentionCleanup",
        "tags": [
          "PlatformAdmin"
        ],
        "summary": "Cron: Bundle-Retention Hard-Delete und Erinnerungs-Mails",
        "description": "DSE-FC-1: cron_secret im Body = CRON_SECRET. Tag 76–89 Erinnerung, Tag 90+ Hard-Delete.",
        "security": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "cron_secret": {
                    "type": "string"
                  }
                },
                "additionalProperties": true
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericJson"
                }
              }
            }
          },
          "400": {
            "description": "Fehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "401": {
            "description": "Fehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "Fehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "404": {
            "description": "Fehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "405": {
            "description": "Fehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "429": {
            "description": "Fehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "500": {
            "description": "Fehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "503": {
            "description": "Fehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        }
      }
    },
    "/platform-admin-analytics": {
      "post": {
        "operationId": "platformAdminAnalytics",
        "tags": [
          "PlatformAdmin"
        ],
        "summary": "Aggregierte Event-Arten und Aktivierungstreppe (nur Plattform-Admin)",
        "description": "verifyAdmin + is_admin RPC. Antwort: by_kind, total_bundles, funnel (accounts, with_event, with_guest, with_invite_sent, with_paid).",
        "security": [
          {
            "bearerJwt": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericJson"
                }
              }
            }
          },
          "400": {
            "description": "Fehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "401": {
            "description": "Fehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "Fehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "404": {
            "description": "Fehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "405": {
            "description": "Fehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "429": {
            "description": "Fehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "500": {
            "description": "Fehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "503": {
            "description": "Fehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        }
      }
    },
    "/platform-admin-demo-manager": {
      "post": {
        "operationId": "platformAdminDemoManager",
        "tags": [
          "PlatformAdmin"
        ],
        "summary": "Demo-Workspaces verwalten",
        "description": "action create_demo_workspace | rotate_demo_password (weitere Felder siehe Code).",
        "security": [
          {
            "bearerJwt": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "action": {
                    "type": "string",
                    "enum": [
                      "create_demo_workspace",
                      "rotate_demo_password"
                    ]
                  },
                  "email": {
                    "type": "string"
                  },
                  "workspace_name": {
                    "type": "string"
                  },
                  "bundle_name": {
                    "type": "string"
                  },
                  "plan": {
                    "type": "string"
                  },
                  "subscription_status": {
                    "type": "string"
                  },
                  "workspace_id": {
                    "type": "string"
                  }
                },
                "additionalProperties": true
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericJson"
                }
              }
            }
          },
          "400": {
            "description": "Fehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "401": {
            "description": "Fehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "Fehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "404": {
            "description": "Fehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "405": {
            "description": "Fehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "429": {
            "description": "Fehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "500": {
            "description": "Fehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "503": {
            "description": "Fehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        }
      }
    },
    "/platform-admin-list": {
      "post": {
        "operationId": "platformAdminList",
        "tags": [
          "PlatformAdmin"
        ],
        "summary": "Workspaces paginieren und suchen",
        "security": [
          {
            "bearerJwt": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "page": {
                    "type": "integer",
                    "minimum": 1
                  },
                  "page_size": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 100
                  },
                  "search": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericJson"
                }
              }
            }
          },
          "400": {
            "description": "Fehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "401": {
            "description": "Fehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "Fehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "404": {
            "description": "Fehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "405": {
            "description": "Fehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "429": {
            "description": "Fehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "500": {
            "description": "Fehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "503": {
            "description": "Fehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        }
      }
    },
    "/platform-admin-marketing-assets": {
      "post": {
        "operationId": "platformAdminMarketingAssets",
        "tags": [
          "PlatformAdmin"
        ],
        "summary": "Marketing-Captures aus Test-Storage (list, signedUrl)",
        "description": "Nur Test-Instanz + is_admin. action=list oder signedUrl.",
        "security": [
          {
            "bearerJwt": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "action": {
                    "type": "string",
                    "enum": [
                      "list",
                      "signedUrl"
                    ]
                  },
                  "path": {
                    "type": "string"
                  },
                  "prefix": {
                    "type": "string"
                  },
                  "limit": {
                    "type": "integer"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericJson"
                }
              }
            }
          },
          "400": {
            "description": "Fehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "401": {
            "description": "Fehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "Fehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "404": {
            "description": "Fehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "405": {
            "description": "Fehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "429": {
            "description": "Fehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "500": {
            "description": "Fehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "503": {
            "description": "Fehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        }
      }
    },
    "/platform-admin-marketing-runner": {
      "post": {
        "operationId": "platformAdminMarketingRunner",
        "tags": [
          "PlatformAdmin"
        ],
        "summary": "Marketing-CI-Jobs starten und Status lesen",
        "description": "Nur Test-Instanz + is_admin. startJob, listJobs, getJob, cancelJob.",
        "security": [
          {
            "bearerJwt": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "action": {
                    "type": "string",
                    "enum": [
                      "startJob",
                      "listJobs",
                      "getJob",
                      "cancelJob"
                    ]
                  },
                  "job_type": {
                    "type": "string",
                    "enum": [
                      "journey",
                      "manifest",
                      "video"
                    ]
                  },
                  "preview_url": {
                    "type": "string"
                  },
                  "job_id": {
                    "type": "string"
                  },
                  "limit": {
                    "type": "integer"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericJson"
                }
              }
            }
          },
          "400": {
            "description": "Fehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "401": {
            "description": "Fehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "Fehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "404": {
            "description": "Fehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "405": {
            "description": "Fehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "429": {
            "description": "Fehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "500": {
            "description": "Fehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "503": {
            "description": "Fehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        }
      }
    },
    "/platform-admin-observability": {
      "post": {
        "operationId": "platformAdminObservability",
        "tags": [
          "PlatformAdmin"
        ],
        "summary": "Logs, Health, Deploy-Markierung",
        "description": "action=ingest: öffentliches Log-Ingest (service role serverseitig) ohne User-JWT. summary, health, events: Bearer + is_admin. mark_deploy: Bearer + is_admin ODER Header x-deploy-secret (DEPLOY_MARK_SECRET).",
        "security": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "action": {
                    "type": "string",
                    "enum": [
                      "ingest",
                      "summary",
                      "health",
                      "events",
                      "mark_deploy"
                    ]
                  },
                  "deploy_id": {
                    "type": "string"
                  },
                  "level": {
                    "type": "string"
                  },
                  "event_name": {
                    "type": "string"
                  },
                  "hours": {
                    "type": "number"
                  },
                  "limit": {
                    "type": "number"
                  },
                  "offset": {
                    "type": "number"
                  }
                },
                "additionalProperties": true
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericJson"
                }
              }
            }
          },
          "400": {
            "description": "Fehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "401": {
            "description": "Fehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "Fehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "404": {
            "description": "Fehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "405": {
            "description": "Fehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "429": {
            "description": "Fehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "500": {
            "description": "Fehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "503": {
            "description": "Fehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        }
      }
    },
    "/platform-admin-storage": {
      "post": {
        "operationId": "platformAdminStorage",
        "tags": [
          "PlatformAdmin"
        ],
        "summary": "Storage-Übersicht und Orphan-Bereinigung",
        "description": "action overview (default) oder cleanup_orphans; Parameter workspace_limit, orphan_preview_limit, dry_run.",
        "security": [
          {
            "bearerJwt": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "action": {
                    "type": "string",
                    "enum": [
                      "overview",
                      "cleanup_orphans"
                    ]
                  },
                  "workspace_limit": {
                    "type": "number"
                  },
                  "orphan_preview_limit": {
                    "type": "number"
                  },
                  "dry_run": {
                    "type": "boolean"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericJson"
                }
              }
            }
          },
          "400": {
            "description": "Fehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "401": {
            "description": "Fehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "Fehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "404": {
            "description": "Fehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "405": {
            "description": "Fehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "429": {
            "description": "Fehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "500": {
            "description": "Fehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "503": {
            "description": "Fehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        }
      }
    },
    "/platform-admin-stripe": {
      "post": {
        "operationId": "platformAdminStripe",
        "tags": [
          "PlatformAdmin"
        ],
        "summary": "Stripe-Kennzahlen (MRR, Umsatz) oder Kundenanzeigenamen (Admin-Liste)",
        "description": "verifyAdmin. Ohne action oder unbekannte action: MRR/Umsatz-Übersicht. action=customer_display_names mit stripe_customer_ids (max. 25 cus_*): nur Anzeigenamen, keine weiteren Stripe-Felder.",
        "security": [
          {
            "bearerJwt": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "action": {
                    "type": "string",
                    "enum": [
                      "customer_display_names"
                    ]
                  },
                  "stripe_customer_ids": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "maxItems": 25
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericJson"
                }
              }
            }
          },
          "400": {
            "description": "Fehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "401": {
            "description": "Fehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "Fehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "404": {
            "description": "Fehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "405": {
            "description": "Fehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "429": {
            "description": "Fehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "500": {
            "description": "Fehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "503": {
            "description": "Fehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        }
      }
    },
    "/platform-admin-pricing-campaigns": {
      "post": {
        "operationId": "platformAdminPricingCampaigns",
        "tags": [
          "PlatformAdmin"
        ],
        "summary": "Preis-Aktionen (Stripe-Coupons): listen, Entwurf, Test aktivieren, beenden",
        "description": "verifyAdmin. action=list (default), create (name + discount_percent oder discount_amount_cents), activate (campaign_id, target_status test_active|live_active) oder end (campaign_id).",
        "security": [
          {
            "bearerJwt": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "action": {
                    "type": "string",
                    "enum": [
                      "list",
                      "create",
                      "activate",
                      "end"
                    ]
                  },
                  "name": {
                    "type": "string"
                  },
                  "discount_percent": {
                    "type": "number"
                  },
                  "discount_amount_cents": {
                    "type": "number"
                  },
                  "campaign_id": {
                    "type": "string"
                  },
                  "target_status": {
                    "type": "string",
                    "enum": [
                      "test_active",
                      "live_active"
                    ]
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericJson"
                }
              }
            }
          },
          "400": {
            "description": "Fehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "401": {
            "description": "Fehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "Fehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "404": {
            "description": "Fehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "405": {
            "description": "Fehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "429": {
            "description": "Fehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "500": {
            "description": "Fehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "503": {
            "description": "Fehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        }
      }
    },
    "/platform-admin-product-updates": {
      "post": {
        "operationId": "platformAdminProductUpdates",
        "tags": [
          "PlatformAdmin"
        ],
        "summary": "Produkt-Meldungen (Änderungs-Informer): listen, speichern, veröffentlichen, zurückziehen, löschen",
        "description": "verifyAdmin. action=list (default), save (ohne id anlegen, mit id ändern), publish, unpublish oder delete. Mailversand ist nicht Teil dieser Function (Phase 3). Siehe `supabase/functions/platform-admin-product-updates/index.ts`.",
        "security": [
          {
            "bearerJwt": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "action": {
                    "type": "string",
                    "enum": [
                      "list",
                      "save",
                      "publish",
                      "unpublish",
                      "delete"
                    ]
                  },
                  "id": {
                    "type": "string",
                    "format": "uuid"
                  },
                  "version": {
                    "type": "string"
                  },
                  "title_de": {
                    "type": "string"
                  },
                  "title_en": {
                    "type": "string"
                  },
                  "body_de": {
                    "type": "string"
                  },
                  "body_en": {
                    "type": "string"
                  },
                  "highlights_de": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "highlights_en": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "cta_label_de": {
                    "type": "string",
                    "nullable": true
                  },
                  "cta_label_en": {
                    "type": "string",
                    "nullable": true
                  },
                  "cta_path": {
                    "type": "string",
                    "nullable": true,
                    "description": "Nur interne Pfade (^/…), kein //host"
                  },
                  "show_banner": {
                    "type": "boolean"
                  },
                  "email_planned": {
                    "type": "boolean"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericJson"
                }
              }
            }
          },
          "400": {
            "description": "Fehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "401": {
            "description": "Fehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "Fehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "404": {
            "description": "Fehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "405": {
            "description": "Fehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "429": {
            "description": "Fehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "500": {
            "description": "Fehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "503": {
            "description": "Fehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        }
      }
    },
    "/product-update-broadcast": {
      "post": {
        "operationId": "productUpdateBroadcast",
        "tags": [
          "PlatformAdmin"
        ],
        "summary": "Release-Mail zu einer Produkt-Meldung: zaehlen, Testmail, senden",
        "description": "verifyAdmin oder cron_secret im Body. action=count zaehlt offene Empfaenger, action=test schickt eine Testmail an die eigene Admin-Adresse (serverseitig aufgeloest, keine freie Zieladresse), ohne action wird gesendet. Nur veroeffentlichte Meldungen gehen raus. Pro Aufruf hoechstens 100 Adressen; `resume: true` heisst, ein erneuter Aufruf macht weiter. Doppelversand verhindert der Idempotenz-Schluessel je Person in email_campaign_send_log.",
        "security": [
          {
            "bearerJwt": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "update_id"
                ],
                "properties": {
                  "update_id": {
                    "type": "string",
                    "format": "uuid"
                  },
                  "action": {
                    "type": "string",
                    "enum": [
                      "count",
                      "test"
                    ]
                  },
                  "locale": {
                    "type": "string",
                    "enum": [
                      "de",
                      "en"
                    ],
                    "description": "Nur fuer action=test"
                  },
                  "cron_secret": {
                    "type": "string"
                  },
                  "dry_run": {
                    "type": "boolean"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericJson"
                }
              }
            }
          },
          "400": {
            "description": "Fehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "401": {
            "description": "Fehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "Fehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "404": {
            "description": "Fehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "405": {
            "description": "Fehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "429": {
            "description": "Fehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "500": {
            "description": "Fehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "503": {
            "description": "Fehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        }
      }
    },
    "/platform-admin-onboarding-winback": {
      "post": {
        "operationId": "platformAdminOnboardingWinback",
        "tags": [
          "PlatformAdmin"
        ],
        "summary": "Onboarding-Winback: Ablauf, Texte, Warteschlange, Stop, manueller Versand",
        "description": "verifyAdmin. action=get|save|queue|history|suppressed|suppress|unsuppress|send_test|resend.",
        "security": [
          {
            "bearerJwt": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "action": {
                    "type": "string",
                    "enum": [
                      "get",
                      "save",
                      "queue",
                      "history",
                      "suppressed",
                      "suppress",
                      "unsuppress",
                      "send_test",
                      "resend"
                    ]
                  },
                  "config": {
                    "type": "object",
                    "additionalProperties": true
                  },
                  "user_id": {
                    "type": "string"
                  },
                  "step": {
                    "type": "string",
                    "enum": [
                      "d2",
                      "d5",
                      "d12"
                    ]
                  },
                  "locale": {
                    "type": "string"
                  },
                  "limit": {
                    "type": "number"
                  },
                  "note": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericJson"
                }
              }
            }
          },
          "400": {
            "description": "Fehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "401": {
            "description": "Fehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "Fehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "404": {
            "description": "Fehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "405": {
            "description": "Fehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "429": {
            "description": "Fehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "500": {
            "description": "Fehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "503": {
            "description": "Fehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        }
      }
    },
    "/platform-admin-workspace": {
      "post": {
        "operationId": "platformAdminWorkspace",
        "tags": [
          "PlatformAdmin"
        ],
        "summary": "Workspace-Details, Umbenennen, Bundle wiederherstellen/löschen",
        "description": "workspace_id Pflicht. Optional restore_bundle_id, purge_bundle_id oder name.",
        "security": [
          {
            "bearerJwt": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "workspace_id"
                ],
                "properties": {
                  "workspace_id": {
                    "type": "string"
                  },
                  "restore_bundle_id": {
                    "type": "string"
                  },
                  "purge_bundle_id": {
                    "type": "string"
                  },
                  "name": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericJson"
                }
              }
            }
          },
          "400": {
            "description": "Fehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "401": {
            "description": "Fehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "Fehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "404": {
            "description": "Fehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "405": {
            "description": "Fehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "429": {
            "description": "Fehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "500": {
            "description": "Fehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "503": {
            "description": "Fehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        }
      }
    },
    "/platform-admin-social-calendar-ics": {
      "get": {
        "operationId": "platformAdminSocialCalendarIcs",
        "tags": [
          "PlatformAdmin"
        ],
        "summary": "iCalendar-Feed für Social-Posting-Kalender (Token-Query)",
        "description": "GET liefert text/calendar (RFC 5545). Query token = SOCIAL_CALENDAR_ICS_TOKEN (Edge-Secret). Optional from/to (ISO), status (Komma-Liste; Default approved,queued,posted). Kein JWT — für Apple-Kalender-Abo.",
        "security": [],
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "from",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "to",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "status",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "iCalendar VCALENDAR",
            "content": {
              "text/calendar": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "description": "Fehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "401": {
            "description": "Fehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "Fehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "404": {
            "description": "Fehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "405": {
            "description": "Fehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "429": {
            "description": "Fehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "500": {
            "description": "Fehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "503": {
            "description": "Fehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        }
      }
    },
    "/platform-admin-social-calendar-ics-link": {
      "get": {
        "operationId": "platformAdminSocialCalendarIcsLink",
        "tags": [
          "PlatformAdmin"
        ],
        "summary": "Abonnement-URLs für Social-Kalender (nur is_admin)",
        "description": "GET mit Bearer JWT (verifyAdmin). Liefert feedUrl (HTTPS) und webcalUrl für Apple Kalender. Token bleibt serverseitig — nie im Frontend-Bundle. POST wird aus Kompatibilität ebenfalls akzeptiert (gleiche Antwort).",
        "security": [
          {
            "bearerJwt": []
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericJson"
                }
              }
            }
          },
          "400": {
            "description": "Fehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "401": {
            "description": "Fehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "Fehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "404": {
            "description": "Fehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "405": {
            "description": "Fehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "429": {
            "description": "Fehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "500": {
            "description": "Fehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "503": {
            "description": "Fehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        }
      }
    },
    "/platform-admin-sentry-linear": {
      "post": {
        "operationId": "platformAdminSentryLinear",
        "tags": [
          "PlatformAdmin"
        ],
        "summary": "Sentry Issues listen oder Linear-Ticket erstellen",
        "description": "verifyAdmin. action=list_unresolved_issues (SENTRY_* Edge-Secrets) oder action=create_linear_ticket mit issue (id, title, permalink, optional culprit, level, count, userCount). LINEAR_API_KEY serverseitig.",
        "security": [
          {
            "bearerJwt": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "action"
                ],
                "properties": {
                  "action": {
                    "type": "string",
                    "enum": [
                      "list_unresolved_issues",
                      "create_linear_ticket"
                    ]
                  },
                  "issue": {
                    "type": "object",
                    "required": [
                      "id",
                      "title",
                      "permalink"
                    ],
                    "properties": {
                      "id": {
                        "type": "string"
                      },
                      "title": {
                        "type": "string"
                      },
                      "permalink": {
                        "type": "string"
                      },
                      "culprit": {
                        "type": "string"
                      },
                      "level": {
                        "type": "string"
                      },
                      "count": {
                        "type": "string"
                      },
                      "userCount": {
                        "type": "integer"
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericJson"
                }
              }
            }
          },
          "400": {
            "description": "Fehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "401": {
            "description": "Fehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "Fehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "404": {
            "description": "Fehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "405": {
            "description": "Fehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "429": {
            "description": "Fehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "500": {
            "description": "Fehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "503": {
            "description": "Fehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        }
      }
    },
    "/platform-ops-dispatch": {
      "post": {
        "operationId": "platformOpsDispatch",
        "tags": [
          "PlatformAdmin"
        ],
        "summary": "Interne Plattform-Ops (z. B. E-Mail-Dispatch)",
        "description": "Siehe `supabase/functions/platform-ops-dispatch/index.ts`.",
        "security": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericJson"
                }
              }
            }
          },
          "400": {
            "description": "Fehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "401": {
            "description": "Fehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "Fehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "404": {
            "description": "Fehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "405": {
            "description": "Fehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "429": {
            "description": "Fehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "500": {
            "description": "Fehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "503": {
            "description": "Fehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        }
      }
    },
    "/platform-workspace-cleanup": {
      "post": {
        "operationId": "platformWorkspaceCleanup",
        "tags": [
          "PlatformAdmin"
        ],
        "summary": "Workspace-Cleanup / Erinnerung / Cron",
        "description": "Cron-Secret o. ä.; siehe `supabase/functions/platform-workspace-cleanup/index.ts`.",
        "security": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericJson"
                }
              }
            }
          },
          "400": {
            "description": "Fehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "401": {
            "description": "Fehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "Fehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "404": {
            "description": "Fehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "405": {
            "description": "Fehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "429": {
            "description": "Fehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "500": {
            "description": "Fehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "503": {
            "description": "Fehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        }
      }
    },
    "/email-lifecycle-dispatch": {
      "post": {
        "operationId": "emailLifecycleDispatch",
        "tags": [
          "Kommunikation"
        ],
        "summary": "Lifecycle-Mails (Cron: Post-Event, Jahrestag, Onboarding-Winback)",
        "description": "Cron-Secret im Body; Post-Event, Jahrestag und Onboarding-Erinnerungen (d2/d5/d12). Siehe `supabase/functions/email-lifecycle-dispatch/index.ts`.",
        "security": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericJson"
                }
              }
            }
          },
          "400": {
            "description": "Fehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "401": {
            "description": "Fehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "Fehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "404": {
            "description": "Fehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "405": {
            "description": "Fehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "429": {
            "description": "Fehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "500": {
            "description": "Fehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "503": {
            "description": "Fehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        }
      }
    },
    "/resend-events": {
      "post": {
        "operationId": "resendEvents",
        "tags": [
          "Kommunikation"
        ],
        "summary": "Resend-Webhook / E-Mail-Events (Inbound)",
        "description": "Siehe `supabase/functions/resend-events/index.ts`.",
        "security": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericJson"
                }
              }
            }
          },
          "400": {
            "description": "Fehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "401": {
            "description": "Fehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "Fehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "404": {
            "description": "Fehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "405": {
            "description": "Fehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "429": {
            "description": "Fehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "500": {
            "description": "Fehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "503": {
            "description": "Fehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        }
      }
    },
    "/send-broadcast": {
      "post": {
        "operationId": "sendBroadcast",
        "tags": [
          "Kommunikation"
        ],
        "summary": "Broadcast-E-Mail auslösen",
        "description": "JWT: Plattform-Admin (`is_admin`) oder `can_manage_bundle` für das `event_bundle_id` des Broadcasts. Ohne Berechtigung 404 (keine Existenz-Enumeration).",
        "security": [
          {
            "bearerJwt": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "broadcast_id"
                ],
                "properties": {
                  "broadcast_id": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericJson"
                }
              }
            }
          },
          "400": {
            "description": "Fehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "401": {
            "description": "Fehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "Fehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "404": {
            "description": "Fehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "405": {
            "description": "Fehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "429": {
            "description": "Fehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "500": {
            "description": "Fehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "503": {
            "description": "Fehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        }
      }
    },
    "/send-invitations": {
      "post": {
        "operationId": "sendInvitations",
        "tags": [
          "Kommunikation"
        ],
        "summary": "Einladungs-E-Mails an Gäste senden",
        "description": "JWT: Plattform-Admin (`is_admin`) oder `can_manage_bundle` für `bundle_id`. Mit `bundle_id` müssen alle `guest_ids` zu diesem Bundle gehören (IDOR-Schutz).",
        "security": [
          {
            "bearerJwt": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "guest_ids",
                  "bundle_id"
                ],
                "properties": {
                  "guest_ids": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "bundle_id": {
                    "type": "string"
                  },
                  "subject": {
                    "type": "string"
                  },
                  "text": {
                    "type": "string"
                  },
                  "html": {
                    "type": "string"
                  },
                  "from_email": {
                    "type": "string"
                  },
                  "from_name": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericJson"
                }
              }
            }
          },
          "400": {
            "description": "Fehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "401": {
            "description": "Fehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "Fehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "404": {
            "description": "Fehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "405": {
            "description": "Fehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "429": {
            "description": "Fehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "500": {
            "description": "Fehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "503": {
            "description": "Fehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        }
      }
    },
    "/send-rsvp-reminders": {
      "post": {
        "operationId": "sendRsvpReminders",
        "tags": [
          "Kommunikation"
        ],
        "summary": "RSVP-Erinnerungen (Cron, Plattform-Admin oder Event-Admin)",
        "description": "Auth: (1) `cron_secret` im Body = Server-CRON_SECRET (hat Vorrang, auch wenn zusätzlich ein anon-Bearer mitkommt, z. B. pg_net-Cron). (2) Sonst Bearer JWT: Plattform-Admin `is_admin` (optional `bundle_id`); oder Event-Admin mit `can_manage_bundle` für `bundle_id` (Pflicht). Ohne bundle_id (Cron): alle Events, freie Workspaces werden übersprungen, Antwort 200 nur mit Zählern. Mit bundle_id: nur dieses Event; freier Workspace bleibt 403.",
        "security": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "cron_secret": {
                    "type": "string"
                  },
                  "bundle_id": {
                    "type": "string",
                    "description": "Event-Bundle-UUID; für normale Admins (nicht is_admin) erforderlich"
                  },
                  "action": {
                    "type": "string"
                  }
                },
                "additionalProperties": true
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericJson"
                }
              }
            }
          },
          "400": {
            "description": "Fehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "401": {
            "description": "Fehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "Fehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "404": {
            "description": "Fehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "405": {
            "description": "Fehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "429": {
            "description": "Fehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "500": {
            "description": "Fehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "503": {
            "description": "Fehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        }
      }
    },
    "/stripe-webhook": {
      "post": {
        "operationId": "stripeWebhook",
        "tags": [
          "Stripe"
        ],
        "summary": "Stripe Webhook Endpoint",
        "description": "Nur POST. Roher JSON-Body muss exakt dem Stripe-Signaturprozess entsprechen (kein Pretty-Print zwischen Signatur und Verifikation). Für interaktive Clients praktisch nicht testbar.",
        "security": [
          {
            "stripeSignature": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "description": "Stripe Event object",
                "additionalProperties": true
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericJson"
                }
              }
            }
          },
          "400": {
            "description": "Fehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "401": {
            "description": "Fehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "Fehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "404": {
            "description": "Fehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "405": {
            "description": "Fehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "429": {
            "description": "Fehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "500": {
            "description": "Fehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "503": {
            "description": "Fehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        }
      }
    },
    "/support-notification": {
      "post": {
        "operationId": "supportNotification",
        "tags": [
          "Support"
        ],
        "summary": "Support-Ticket Benachrichtigung (E-Mail)",
        "security": [
          {
            "bearerJwt": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "ticket_id",
                  "subject",
                  "message"
                ],
                "properties": {
                  "ticket_id": {
                    "type": "string"
                  },
                  "subject": {
                    "type": "string"
                  },
                  "message": {
                    "type": "string"
                  },
                  "sender_name": {
                    "type": "string"
                  },
                  "sender_email": {
                    "type": "string"
                  },
                  "page_url": {
                    "type": "string"
                  },
                  "screenshot_url": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GenericJson"
                }
              }
            }
          },
          "400": {
            "description": "Fehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "401": {
            "description": "Fehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "Fehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "404": {
            "description": "Fehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "405": {
            "description": "Fehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "429": {
            "description": "Fehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "500": {
            "description": "Fehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "503": {
            "description": "Fehler",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        }
      }
    }
  }
}
