{
    "openapi": "3.1.0",
    "info": {
        "title": "FlowAI API",
        "version": "v1",
        "description": "FlowAI-API für das FlowSuite-Pro-Abonnement: Modellkatalog und ein Chat-Endpunkt auf dem eigenen FlowAI, immer mit Gesprächsverlauf. Das eigenständige Routing-Produkt FlowModels hat eine eigene Anleitung, eigene Schlüssel und Euro-Abrechnung."
    },
    "servers": [
        {
            "url": "https://creativeskyline.de",
            "description": "FlowAI API"
        }
    ],
    "security": [
        {
            "bearerAuth": []
        }
    ],
    "tags": [
        {
            "name": "models",
            "description": "Modelle"
        },
        {
            "name": "chat",
            "description": "Chat"
        },
        {
            "name": "files",
            "description": "Dateien"
        },
        {
            "name": "webhooks",
            "description": "Webhooks"
        }
    ],
    "paths": {
        "/api/flowai/v1/models": {
            "get": {
                "operationId": "models-list",
                "summary": "Modelle auflisten",
                "description": "Listet die verfügbaren Modell-Aliase des abonnementgebundenen Schlüssels auf. Der Cursor ist jeweils der öffentliche Modell-Alias.",
                "tags": [
                    "models"
                ],
                "parameters": [
                    {
                        "name": "limit",
                        "in": "query",
                        "required": false,
                        "description": "Anzahl der Einträge von 1 bis 100, Standard 100",
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "after",
                        "in": "query",
                        "required": false,
                        "description": "Alias aus last_id der vorherigen Seite",
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Erfolgreiche Antwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                },
                                "example": {
                                    "object": "list",
                                    "data": [
                                        {
                                            "id": "flowai",
                                            "object": "model",
                                            "created": 1735000000,
                                            "owned_by": "creativeskyline",
                                            "pricing": {
                                                "prompt": "0.000001",
                                                "completion": "0.000002"
                                            }
                                        }
                                    ],
                                    "has_more": false,
                                    "first_id": "flowai",
                                    "last_id": "flowai",
                                    "flowai_request_id": "01HXYZ…ULID"
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Fehlerantwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/api/flowai/v1/models/{model_id}": {
            "get": {
                "operationId": "models-show",
                "summary": "Ein Modell abrufen",
                "description": "Liefert einen einzelnen Eintrag der Modellliste mit Preisen, Fähigkeiten, den tatsächlich geltenden FlowAI-Grenzen und dem Abschalttermin. Die Kennung ist der Modell-Alias; mit einem Routing-Schlüssel die vollständige Anbieterkennung einschließlich enthaltener Schrägstriche.",
                "tags": [
                    "models"
                ],
                "parameters": [
                    {
                        "name": "model_id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Erfolgreiche Antwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                },
                                "example": {
                                    "id": "claude",
                                    "object": "model",
                                    "created": 1735000000,
                                    "owned_by": "creativeskyline",
                                    "pricing": {
                                        "prompt": "0.000003",
                                        "completion": "0.000015"
                                    },
                                    "context_length": 200000,
                                    "max_output_tokens": 64000,
                                    "capabilities": {
                                        "reasoning": true,
                                        "reasoning_levels": [
                                            "low",
                                            "medium",
                                            "high"
                                        ],
                                        "web_search": false,
                                        "web_search_forced": false,
                                        "tools": true,
                                        "tool_choice": true,
                                        "parallel_tool_calls": true,
                                        "vision": true,
                                        "json_object": false,
                                        "json_schema": false,
                                        "sampling": true,
                                        "streaming": true
                                    },
                                    "supported_parameters": [
                                        "temperature",
                                        "top_p",
                                        "max_tokens",
                                        "tools",
                                        "tool_choice",
                                        "stream"
                                    ],
                                    "flowai_limits": {
                                        "input_tokens": 200000,
                                        "max_output_tokens": 64000,
                                        "max_messages": 50,
                                        "max_payload_bytes": 131072,
                                        "max_chars_per_message": 32000
                                    },
                                    "deprecated_at": null,
                                    "flowai_request_id": "01HXYZ…ULID"
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Fehlerantwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/api/flowai/v1/chat": {
            "post": {
                "operationId": "chat-send",
                "summary": "Nachricht senden",
                "description": "Sendet eine Nachricht an Ihr FlowAI und liefert die Antwort samt Kennung der Unterhaltung.",
                "tags": [
                    "chat"
                ],
                "responses": {
                    "200": {
                        "description": "Erfolgreiche Antwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                },
                                "example": {
                                    "object": "chat",
                                    "conversation": "018f1234-5678-7abc-9def-0123456789ab",
                                    "id": "018f9999-1111-7abc-9def-0123456789ab",
                                    "model": "claude",
                                    "status": "completed",
                                    "message": {
                                        "role": "assistant",
                                        "content": "Wir liefern innerhalb von zwei Werktagen."
                                    },
                                    "flowai_request_id": "01HXYZ…ULID"
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Fehlerantwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                },
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "message": {
                                        "type": "string",
                                        "description": "Die neue Nachricht, 1 bis 32.000 Zeichen"
                                    },
                                    "conversation": {
                                        "type": "string",
                                        "format": "uuid",
                                        "description": "Kennung aus einer vorherigen Antwort; ohne Angabe beginnt eine neue Unterhaltung"
                                    },
                                    "model": {
                                        "type": "string",
                                        "description": "Modell-Alias aus GET /models; ohne Angabe gilt flowai"
                                    },
                                    "stream": {
                                        "type": "boolean",
                                        "description": "true liefert die Antwort als Server-Sent Events; Standard false"
                                    }
                                },
                                "required": [
                                    "message"
                                ]
                            },
                            "example": {
                                "message": "Fasse unsere Lieferbedingungen zusammen.",
                                "model": "claude"
                            }
                        }
                    }
                }
            }
        },
        "/api/flowai/v1/chat/{conversation_uuid}": {
            "get": {
                "operationId": "chat-show",
                "summary": "Letzte Antwort einer Unterhaltung abrufen",
                "description": "Liefert den neuesten Zug einer Unterhaltung, ohne einen neuen zu starten.",
                "tags": [
                    "chat"
                ],
                "parameters": [
                    {
                        "name": "conversation_uuid",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Erfolgreiche Antwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                },
                                "example": {
                                    "object": "chat",
                                    "conversation": "018f1234-5678-7abc-9def-0123456789ab",
                                    "id": "018f9999-1111-7abc-9def-0123456789ab",
                                    "model": "claude",
                                    "status": "completed",
                                    "message": {
                                        "role": "assistant",
                                        "content": "Wir liefern innerhalb von zwei Werktagen."
                                    },
                                    "flowai_request_id": "01HXYZ…ULID"
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Fehlerantwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/api/flowai/v1/files": {
            "post": {
                "operationId": "files-create",
                "summary": "Datei hochladen",
                "description": "Speichert eine Datei für spätere FlowAI-Anfragen. Verwenden Sie multipart/form-data.",
                "tags": [
                    "files"
                ],
                "responses": {
                    "200": {
                        "description": "Erfolgreiche Antwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                },
                                "example": {
                                    "id": "file-018f1234-5678-7abc-9def-0123456789ab",
                                    "object": "file",
                                    "bytes": 2048,
                                    "created_at": 1735000000,
                                    "expires_at": null,
                                    "filename": "analyse.pdf",
                                    "purpose": "user_data",
                                    "status": "processed",
                                    "status_details": null,
                                    "flowai_request_id": "01HXYZ…ULID"
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Fehlerantwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                },
                "requestBody": {
                    "required": true,
                    "content": {
                        "multipart/form-data": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "file": {
                                        "type": "string",
                                        "format": "binary",
                                        "description": "Hochzuladende Datei"
                                    },
                                    "purpose": {
                                        "type": "string",
                                        "description": "user_data oder vision"
                                    }
                                },
                                "required": [
                                    "file",
                                    "purpose"
                                ]
                            }
                        }
                    }
                }
            },
            "get": {
                "operationId": "files-list",
                "summary": "Dateien auflisten",
                "description": "Listet die Dateien des Workspace mit stabilem Cursor auf.",
                "tags": [
                    "files"
                ],
                "parameters": [
                    {
                        "name": "purpose",
                        "in": "query",
                        "required": false,
                        "description": "Filter: user_data oder vision",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "order",
                        "in": "query",
                        "required": false,
                        "description": "Sortierung: asc oder desc",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "limit",
                        "in": "query",
                        "required": false,
                        "description": "Anzahl von 1 bis 100",
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "after",
                        "in": "query",
                        "required": false,
                        "description": "Öffentliche Datei-ID aus last_id",
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Erfolgreiche Antwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                },
                                "example": {
                                    "object": "list",
                                    "data": [
                                        {
                                            "id": "file-018f1234-5678-7abc-9def-0123456789ab",
                                            "object": "file",
                                            "bytes": 2048,
                                            "filename": "analyse.pdf",
                                            "purpose": "user_data",
                                            "status": "processed"
                                        }
                                    ],
                                    "has_more": false,
                                    "first_id": "file-018f1234-5678-7abc-9def-0123456789ab",
                                    "last_id": "file-018f1234-5678-7abc-9def-0123456789ab",
                                    "flowai_request_id": "01HXYZ…ULID"
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Fehlerantwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/api/flowai/v1/files/{file_uuid}": {
            "get": {
                "operationId": "files-show",
                "summary": "Dateimetadaten abrufen",
                "description": "Liefert Metadaten, aber nicht den Dateiinhalt.",
                "tags": [
                    "files"
                ],
                "parameters": [
                    {
                        "name": "file_uuid",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Erfolgreiche Antwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                },
                                "example": {
                                    "id": "file-018f1234-5678-7abc-9def-0123456789ab",
                                    "object": "file",
                                    "bytes": 2048,
                                    "created_at": 1735000000,
                                    "expires_at": null,
                                    "filename": "analyse.pdf",
                                    "purpose": "user_data",
                                    "status": "processed",
                                    "status_details": null,
                                    "flowai_request_id": "01HXYZ…ULID"
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Fehlerantwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            },
            "delete": {
                "operationId": "files-delete",
                "summary": "Datei löschen",
                "description": "Löscht die gespeicherten Bytes und ihre Metadaten.",
                "tags": [
                    "files"
                ],
                "parameters": [
                    {
                        "name": "file_uuid",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Erfolgreiche Antwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                },
                                "example": {
                                    "id": "file-018f1234-5678-7abc-9def-0123456789ab",
                                    "object": "file",
                                    "deleted": true,
                                    "flowai_request_id": "01HXYZ…ULID"
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Fehlerantwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/api/flowai/v1/files/{file_uuid}/content": {
            "get": {
                "operationId": "files-content",
                "summary": "Dateiinhalt herunterladen",
                "description": "Liefert die gespeicherten Bytes als Download mit dem ursprünglichen Medientyp.",
                "tags": [
                    "files"
                ],
                "parameters": [
                    {
                        "name": "file_uuid",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Erfolgreiche Antwort",
                        "content": {
                            "application/octet-stream": {
                                "schema": {
                                    "type": "string",
                                    "format": "binary"
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Fehlerantwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/api/flowai/v1/webhook_endpoints": {
            "post": {
                "operationId": "webhooks-create",
                "summary": "Webhook anlegen",
                "description": "Registriert ein HTTPS-Ziel und gibt das Signatur-Secret einmalig zurück.",
                "tags": [
                    "webhooks"
                ],
                "responses": {
                    "200": {
                        "description": "Erfolgreiche Antwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                },
                                "example": {
                                    "id": "018f1234-5678-7abc-9def-0123456789ab",
                                    "object": "webhook_endpoint",
                                    "url": "https://example.com/flowai",
                                    "events": [
                                        "response.completed"
                                    ],
                                    "description": "Produktiv",
                                    "is_active": true,
                                    "deactivated_at": null,
                                    "deactivation_reason": null,
                                    "last_delivered_at": null,
                                    "created": 1735000000,
                                    "secret": "whsec_example",
                                    "flowai_request_id": "01HXYZ…ULID"
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Fehlerantwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                },
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "url": {
                                        "type": "string",
                                        "description": "Öffentlich erreichbare HTTPS-Adresse, maximal 2.048 Zeichen"
                                    },
                                    "events": {
                                        "type": "array",
                                        "items": [],
                                        "description": "Mindestens ein unterstützter Ereignistyp"
                                    },
                                    "description": {
                                        "type": "string",
                                        "description": "Optionale Beschreibung, maximal 255 Zeichen"
                                    }
                                },
                                "required": [
                                    "url",
                                    "events"
                                ]
                            }
                        }
                    }
                }
            },
            "get": {
                "operationId": "webhooks-list",
                "summary": "Webhooks auflisten",
                "description": "Listet die Webhook-Ziele des Workspace ohne Secrets auf.",
                "tags": [
                    "webhooks"
                ],
                "parameters": [
                    {
                        "name": "limit",
                        "in": "query",
                        "required": false,
                        "description": "Anzahl von 1 bis 100",
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "after",
                        "in": "query",
                        "required": false,
                        "description": "UUID aus last_id",
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Erfolgreiche Antwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                },
                                "example": {
                                    "object": "list",
                                    "data": [
                                        {
                                            "id": "018f1234-5678-7abc-9def-0123456789ab",
                                            "object": "webhook_endpoint",
                                            "url": "https://example.com/flowai",
                                            "events": [
                                                "response.completed"
                                            ],
                                            "is_active": true
                                        }
                                    ],
                                    "has_more": false,
                                    "first_id": "018f1234-5678-7abc-9def-0123456789ab",
                                    "last_id": "018f1234-5678-7abc-9def-0123456789ab",
                                    "flowai_request_id": "01HXYZ…ULID"
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Fehlerantwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/api/flowai/v1/webhook_endpoints/{webhook_uuid}": {
            "get": {
                "operationId": "webhooks-show",
                "summary": "Webhook abrufen",
                "description": "Liefert ein Webhook-Ziel ohne Signatur-Secret.",
                "tags": [
                    "webhooks"
                ],
                "parameters": [
                    {
                        "name": "webhook_uuid",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Erfolgreiche Antwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                },
                                "example": {
                                    "id": "018f1234-5678-7abc-9def-0123456789ab",
                                    "object": "webhook_endpoint",
                                    "url": "https://example.com/flowai",
                                    "events": [
                                        "response.completed"
                                    ],
                                    "description": "Produktiv",
                                    "is_active": true,
                                    "deactivated_at": null,
                                    "deactivation_reason": null,
                                    "last_delivered_at": null,
                                    "created": 1735000000,
                                    "flowai_request_id": "01HXYZ…ULID"
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Fehlerantwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            },
            "patch": {
                "operationId": "webhooks-update",
                "summary": "Webhook ändern",
                "description": "Ändert Ziel, Ereignisse, Beschreibung oder Aktivierungsstatus.",
                "tags": [
                    "webhooks"
                ],
                "parameters": [
                    {
                        "name": "webhook_uuid",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Erfolgreiche Antwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                },
                                "example": {
                                    "id": "018f1234-5678-7abc-9def-0123456789ab",
                                    "object": "webhook_endpoint",
                                    "url": "https://example.com/flowai",
                                    "events": [
                                        "response.completed"
                                    ],
                                    "description": "Aktualisiert",
                                    "is_active": true,
                                    "deactivated_at": null,
                                    "deactivation_reason": null,
                                    "last_delivered_at": null,
                                    "created": 1735000000,
                                    "flowai_request_id": "01HXYZ…ULID"
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Fehlerantwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                },
                "requestBody": {
                    "required": false,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "url": {
                                        "type": "string",
                                        "description": "Neue öffentlich erreichbare HTTPS-Adresse"
                                    },
                                    "events": {
                                        "type": "array",
                                        "items": [],
                                        "description": "Neue Liste unterstützter Ereignistypen"
                                    },
                                    "description": {
                                        "type": "string",
                                        "description": "Neue Beschreibung oder null"
                                    },
                                    "is_active": {
                                        "type": "boolean",
                                        "description": "Deaktiviert oder reaktiviert das Ziel"
                                    }
                                }
                            }
                        }
                    }
                }
            },
            "delete": {
                "operationId": "webhooks-delete",
                "summary": "Webhook löschen",
                "description": "Löscht das Ziel und seinen Zustellungsverlauf.",
                "tags": [
                    "webhooks"
                ],
                "parameters": [
                    {
                        "name": "webhook_uuid",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Erfolgreiche Antwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                },
                                "example": {
                                    "id": "018f1234-5678-7abc-9def-0123456789ab",
                                    "object": "webhook_endpoint",
                                    "deleted": true,
                                    "flowai_request_id": "01HXYZ…ULID"
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Fehlerantwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/api/flowai/v1/webhook_endpoints/{webhook_uuid}/deliveries": {
            "get": {
                "operationId": "webhook-deliveries-list",
                "summary": "Zustellungen auflisten",
                "description": "Listet Zustellungsversuche mit Status und Fehlerdetails auf.",
                "tags": [
                    "webhooks"
                ],
                "parameters": [
                    {
                        "name": "webhook_uuid",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    },
                    {
                        "name": "status",
                        "in": "query",
                        "required": false,
                        "description": "pending, delivered, failed oder exhausted",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "limit",
                        "in": "query",
                        "required": false,
                        "description": "Anzahl von 1 bis 100",
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "after",
                        "in": "query",
                        "required": false,
                        "description": "UUID aus last_id",
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Erfolgreiche Antwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                },
                                "example": {
                                    "object": "list",
                                    "data": [
                                        {
                                            "id": "018f1234-5678-7abc-9def-0123456789ab",
                                            "object": "webhook_delivery",
                                            "event_type": "response.completed",
                                            "status": "delivered",
                                            "attempts": 1,
                                            "http_status": 200,
                                            "failure_kind": null,
                                            "created": 1735000000,
                                            "delivered_at": 1735000001,
                                            "failed_at": null,
                                            "next_attempt_at": null,
                                            "response_id": "resp_01HXYZ…"
                                        }
                                    ],
                                    "has_more": false,
                                    "first_id": "018f1234-5678-7abc-9def-0123456789ab",
                                    "last_id": "018f1234-5678-7abc-9def-0123456789ab",
                                    "flowai_request_id": "01HXYZ…ULID"
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Fehlerantwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/api/flowai/v1/webhook_endpoints/{webhook_uuid}/test": {
            "post": {
                "operationId": "webhooks-test",
                "summary": "Testzustellung senden",
                "description": "Stellt eine synthetische Zustellung vom Typ webhook.test in die Warteschlange. Das Ergebnis erscheint im Zustellungsverlauf wie jede andere Zustellung.",
                "tags": [
                    "webhooks"
                ],
                "parameters": [
                    {
                        "name": "webhook_uuid",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Erfolgreiche Antwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                },
                                "example": {
                                    "object": "webhook_delivery",
                                    "uuid": "018f1234-5678-7abc-9def-0123456789ab",
                                    "status": "pending",
                                    "flowai_request_id": "01HXYZ…ULID"
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Fehlerantwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/api/flowai/v1/webhook_endpoints/{webhook_uuid}/rotate_secret": {
            "post": {
                "operationId": "webhooks-rotate-secret",
                "summary": "Secret wechseln",
                "description": "Erzeugt ein neues Signatur-Secret und gibt es einmalig zurück. Das bisherige Secret bleibt bis zum genannten Zeitpunkt gültig. Benötigt einen Verwaltungsschlüssel.",
                "tags": [
                    "webhooks"
                ],
                "parameters": [
                    {
                        "name": "webhook_uuid",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Erfolgreiche Antwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                },
                                "example": {
                                    "object": "webhook_endpoint",
                                    "uuid": "018f1234-5678-7abc-9def-0123456789ab",
                                    "secret": "whsec_example",
                                    "secondary_secret_expires_at": 1735086400,
                                    "flowai_request_id": "01HXYZ…ULID"
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Fehlerantwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        }
    },
    "components": {
        "securitySchemes": {
            "bearerAuth": {
                "type": "http",
                "scheme": "bearer",
                "description": "API-Schlüssel (pk_… oder at_…) als Authorization: Bearer <Schlüssel>. Andere Übergabewege werden mit 401 abgelehnt."
            }
        },
        "schemas": {
            "Error": {
                "type": "object",
                "properties": {
                    "success": {
                        "type": "boolean"
                    },
                    "error": {
                        "type": "string"
                    },
                    "message": {
                        "type": "string"
                    },
                    "errors": {
                        "type": "object"
                    }
                }
            }
        }
    }
}