{
    "openapi": "3.1.0",
    "info": {
        "title": "FlowSend API",
        "version": "v1",
        "description": "REST API zur Verwaltung von Subscribern, Listen, Tags, Kampagnen, Vorlagen und der Absenderdomäne. Perfekt für Newsletter-Integrationen, Marketing-Automationen und Daten-Synchronisation."
    },
    "servers": [
        {
            "url": "https://api.flowsuite.one",
            "description": "FlowSuite API"
        }
    ],
    "security": [
        {
            "bearerAuth": []
        }
    ],
    "tags": [
        {
            "name": "subscribers",
            "description": "Subscriber"
        },
        {
            "name": "subscribers-bulk",
            "description": "Bulk-Operationen"
        },
        {
            "name": "lists",
            "description": "Listen"
        },
        {
            "name": "tags",
            "description": "Tags"
        },
        {
            "name": "campaigns",
            "description": "Kampagnen"
        },
        {
            "name": "templates",
            "description": "Vorlagen"
        },
        {
            "name": "sender-domains",
            "description": "Absenderdomäne"
        },
        {
            "name": "insights",
            "description": "Kontext und Berichte"
        }
    ],
    "paths": {
        "/flowsend/subscribers": {
            "get": {
                "operationId": "subscribers-list",
                "summary": "Subscriber auflisten",
                "description": "Ruft eine paginierte Liste aller Subscriber ab.",
                "tags": [
                    "subscribers"
                ],
                "parameters": [
                    {
                        "name": "status",
                        "in": "query",
                        "required": false,
                        "description": "Filter: subscribed, unsubscribed, bounced, complained, pending",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "source",
                        "in": "query",
                        "required": false,
                        "description": "Filter: manual, import, api, form, crm_sync",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "email",
                        "in": "query",
                        "required": false,
                        "description": "Exakter Filter nach normalisierter E-Mail-Adresse",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "search",
                        "in": "query",
                        "required": false,
                        "description": "Suchbegriff (E-Mail, Name, Telefon)",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "lists[]",
                        "in": "query",
                        "required": false,
                        "description": "Array von Listen-UUIDs",
                        "schema": {
                            "type": "array",
                            "items": []
                        }
                    },
                    {
                        "name": "tags[]",
                        "in": "query",
                        "required": false,
                        "description": "Array von Tag-UUIDs",
                        "schema": {
                            "type": "array",
                            "items": []
                        }
                    },
                    {
                        "name": "per_page",
                        "in": "query",
                        "required": false,
                        "description": "Anzahl pro Seite (1-200, Standard: 50)",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Erfolgreiche Antwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                },
                                "example": {
                                    "success": true,
                                    "data": {
                                        "uuid": "550e8400-...",
                                        "email": "max@example.com",
                                        "firstname": "Max",
                                        "lastname": "Mustermann",
                                        "full_name": "Max Mustermann",
                                        "status": "subscribed",
                                        "source": "api",
                                        "lists": [
                                            {
                                                "uuid": "...",
                                                "title": "Newsletter"
                                            }
                                        ],
                                        "tags": [
                                            {
                                                "uuid": "...",
                                                "title": "VIP-Kunde"
                                            }
                                        ],
                                        "created_at": "2024-01-15T10:30:00+00:00"
                                    }
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Fehlerantwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            },
            "post": {
                "operationId": "subscribers-create",
                "summary": "Subscriber erstellen",
                "description": "Erstellt einen neuen Subscriber.",
                "tags": [
                    "subscribers"
                ],
                "responses": {
                    "200": {
                        "description": "Erfolgreiche Antwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Fehlerantwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                },
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "email": {
                                        "type": "string",
                                        "description": "E-Mail-Adresse des Subscribers"
                                    },
                                    "prefix": {
                                        "type": "string",
                                        "description": "Anrede (z.B. Herr, Frau)"
                                    },
                                    "firstname": {
                                        "type": "string",
                                        "description": "Vorname"
                                    },
                                    "lastname": {
                                        "type": "string",
                                        "description": "Nachname"
                                    },
                                    "phone": {
                                        "type": "string",
                                        "description": "Telefonnummer"
                                    },
                                    "status": {
                                        "type": "string",
                                        "description": "Status (Standard: subscribed)"
                                    },
                                    "lists": {
                                        "type": "array",
                                        "items": [],
                                        "description": "Liste von Listen-UUIDs"
                                    },
                                    "tags": {
                                        "type": "array",
                                        "items": [],
                                        "description": "Liste von Tag-UUIDs"
                                    },
                                    "meta": {
                                        "type": "array",
                                        "items": [],
                                        "description": "Meta-Daten als Array von {key, value}-Objekten"
                                    }
                                },
                                "required": [
                                    "email"
                                ]
                            }
                        }
                    }
                }
            }
        },
        "/flowsend/subscribers/by-client/{client_uuid}": {
            "get": {
                "operationId": "subscribers-preview-client",
                "summary": "CRM-Kundenempfänger prüfen",
                "description": "Benötigt FlowSend- und FlowCRM-Zugriff. Prüft dieselbe Kundenzuordnung wie PUT, ohne Änderungen zu speichern. Liefert bestehende UUID, Tags und Listen auch bei einem zulässigen Adresswechsel. Bei einer geplanten Neuanlage ist uuid null. Geschützte Adresswechsel und Zuordnungskonflikte liefern 409; fehlende, gelöschte oder anonymisierte Kunden 404.",
                "tags": [
                    "subscribers"
                ],
                "parameters": [
                    {
                        "name": "client_uuid",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Erfolgreiche Antwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Fehlerantwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            },
            "put": {
                "operationId": "subscribers-upsert-client",
                "summary": "CRM-Kundenempfänger abgleichen",
                "description": "Benötigt FlowSend- und FlowCRM-Zugriff. Löst die aktuelle Hauptadresse eines CRM-Kunden desselben Teams auf. Wiederholungen liefern denselben Empfänger: 201 bei Anlage, 200 bei Wiederverwendung. Unklare Zuordnungen oder geschützte Adresswechsel liefern 409; fehlende, gelöschte oder anonymisierte Kunden 404. Listen, Tags und bestehende Newsletter-Status werden nicht zurückgesetzt. Der Request benötigt keinen Body.",
                "tags": [
                    "subscribers"
                ],
                "parameters": [
                    {
                        "name": "client_uuid",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Erfolgreiche Antwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Fehlerantwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/flowsend/subscribers/{uuid}": {
            "get": {
                "operationId": "subscribers-show",
                "summary": "Subscriber abrufen",
                "description": "Ruft Details eines einzelnen Subscribers ab.",
                "tags": [
                    "subscribers"
                ],
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Erfolgreiche Antwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Fehlerantwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            },
            "put": {
                "operationId": "subscribers-update",
                "summary": "Subscriber aktualisieren",
                "description": "Aktualisiert einen bestehenden Subscriber.",
                "tags": [
                    "subscribers"
                ],
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Erfolgreiche Antwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Fehlerantwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                },
                "requestBody": {
                    "required": false,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "email": {
                                        "type": "string",
                                        "description": "E-Mail-Adresse"
                                    },
                                    "firstname": {
                                        "type": "string",
                                        "description": "Vorname"
                                    },
                                    "lastname": {
                                        "type": "string",
                                        "description": "Nachname"
                                    },
                                    "status": {
                                        "type": "string",
                                        "description": "Status (subscribed, unsubscribed)"
                                    }
                                }
                            }
                        }
                    }
                }
            },
            "delete": {
                "operationId": "subscribers-delete",
                "summary": "Subscriber löschen",
                "description": "Löscht einen Subscriber unwiderruflich.",
                "tags": [
                    "subscribers"
                ],
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Erfolgreiche Antwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Fehlerantwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/flowsend/subscribers/{uuid}/lists": {
            "put": {
                "operationId": "subscribers-sync-lists",
                "summary": "Subscriber-Listen synchronisieren",
                "description": "Ersetzt alle Listen-Zuordnungen des Subscribers (vollständige Synchronisation).",
                "tags": [
                    "subscribers"
                ],
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Erfolgreiche Antwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Fehlerantwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                },
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "list_uuids": {
                                        "type": "array",
                                        "items": [],
                                        "description": "Liste von Listen-UUIDs (ersetzt bestehende Zuordnungen)"
                                    }
                                },
                                "required": [
                                    "list_uuids"
                                ]
                            }
                        }
                    }
                }
            }
        },
        "/flowsend/subscribers/{uuid}/resend-double-opt-in": {
            "post": {
                "operationId": "subscribers-resend-double-opt-in",
                "summary": "Double-Opt-in erneut senden",
                "description": "Schickt die Bestätigungsmail des Double-Opt-in-Verfahrens erneut und erzeugt dabei einen frischen Bestätigungslink. Nur für Empfänger sinnvoll, die noch nicht bestätigt haben; ein bereits bestätigter Empfänger führt zu 422. Ob ein Empfänger auf seine Bestätigung wartet, steht im Feld double_opt_in.awaiting_confirmation der Empfängerantwort. Der Request benötigt keinen Body.",
                "tags": [
                    "subscribers"
                ],
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Erfolgreiche Antwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Fehlerantwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/flowsend/subscribers/{uuid}/tags": {
            "put": {
                "operationId": "subscribers-sync-tags",
                "summary": "Subscriber-Tags synchronisieren",
                "description": "Ersetzt alle Tag-Zuordnungen des Subscribers (vollständige Synchronisation).",
                "tags": [
                    "subscribers"
                ],
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Erfolgreiche Antwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Fehlerantwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                },
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "tag_uuids": {
                                        "type": "array",
                                        "items": [],
                                        "description": "Liste von Tag-UUIDs (ersetzt bestehende Zuordnungen)"
                                    }
                                },
                                "required": [
                                    "tag_uuids"
                                ]
                            }
                        }
                    }
                }
            }
        },
        "/flowsend/subscribers/bulk/add-to-lists": {
            "post": {
                "operationId": "bulk-add-to-lists",
                "summary": "Subscriber zu Listen hinzufügen",
                "description": "Fügt mehrere Subscriber gleichzeitig zu mehreren Listen hinzu. Das gilt unabhängig vom Status, auch für unsubscribed, bounced und complained: der Status bleibt unverändert, und Kampagnen erreichen weiterhin nur subscribed. affected_count nennt alle gefundenen Subscriber.",
                "tags": [
                    "subscribers-bulk"
                ],
                "responses": {
                    "200": {
                        "description": "Erfolgreiche Antwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Fehlerantwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                },
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "subscriber_uuids": {
                                        "type": "array",
                                        "items": [],
                                        "description": "UUIDs der Subscriber"
                                    },
                                    "list_uuids": {
                                        "type": "array",
                                        "items": [],
                                        "description": "UUIDs der Ziel-Listen"
                                    }
                                },
                                "required": [
                                    "subscriber_uuids",
                                    "list_uuids"
                                ]
                            }
                        }
                    }
                }
            }
        },
        "/flowsend/subscribers/bulk/add-tags": {
            "post": {
                "operationId": "bulk-add-tags",
                "summary": "Tags zu Subscribern hinzufügen",
                "description": "Weist mehreren Subscribern gleichzeitig mehrere Tags zu. Das gilt unabhängig vom Status, auch für unsubscribed, bounced und complained: der Status bleibt unverändert, und Kampagnen erreichen weiterhin nur subscribed. affected_count nennt alle gefundenen Subscriber.",
                "tags": [
                    "subscribers-bulk"
                ],
                "responses": {
                    "200": {
                        "description": "Erfolgreiche Antwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Fehlerantwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                },
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "subscriber_uuids": {
                                        "type": "array",
                                        "items": [],
                                        "description": "UUIDs der Subscriber"
                                    },
                                    "tag_uuids": {
                                        "type": "array",
                                        "items": [],
                                        "description": "UUIDs der Ziel-Tags"
                                    }
                                },
                                "required": [
                                    "subscriber_uuids",
                                    "tag_uuids"
                                ]
                            }
                        }
                    }
                }
            }
        },
        "/flowsend/subscribers/bulk/remove-from-lists": {
            "post": {
                "operationId": "bulk-remove-from-lists",
                "summary": "Subscriber aus Listen entfernen",
                "description": "Entfernt mehrere Subscriber gleichzeitig aus mehreren Listen.",
                "tags": [
                    "subscribers-bulk"
                ],
                "responses": {
                    "200": {
                        "description": "Erfolgreiche Antwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Fehlerantwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                },
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "subscriber_uuids": {
                                        "type": "array",
                                        "items": [],
                                        "description": "UUIDs der Subscriber"
                                    },
                                    "list_uuids": {
                                        "type": "array",
                                        "items": [],
                                        "description": "UUIDs der Listen"
                                    }
                                },
                                "required": [
                                    "subscriber_uuids",
                                    "list_uuids"
                                ]
                            }
                        }
                    }
                }
            }
        },
        "/flowsend/subscribers/bulk/remove-tags": {
            "post": {
                "operationId": "bulk-remove-tags",
                "summary": "Tags von Subscribern entfernen",
                "description": "Entfernt mehrere Tags gleichzeitig von mehreren Subscribern.",
                "tags": [
                    "subscribers-bulk"
                ],
                "responses": {
                    "200": {
                        "description": "Erfolgreiche Antwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Fehlerantwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                },
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "subscriber_uuids": {
                                        "type": "array",
                                        "items": [],
                                        "description": "UUIDs der Subscriber"
                                    },
                                    "tag_uuids": {
                                        "type": "array",
                                        "items": [],
                                        "description": "UUIDs der Tags"
                                    }
                                },
                                "required": [
                                    "subscriber_uuids",
                                    "tag_uuids"
                                ]
                            }
                        }
                    }
                }
            }
        },
        "/flowsend/subscribers/bulk/delete": {
            "post": {
                "operationId": "bulk-delete",
                "summary": "Subscriber bulk-löschen",
                "description": "Löscht mehrere Subscriber gleichzeitig. Diese Aktion ist unwiderruflich.",
                "tags": [
                    "subscribers-bulk"
                ],
                "responses": {
                    "200": {
                        "description": "Erfolgreiche Antwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Fehlerantwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                },
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "subscriber_uuids": {
                                        "type": "array",
                                        "items": [],
                                        "description": "UUIDs der zu löschenden Subscriber"
                                    }
                                },
                                "required": [
                                    "subscriber_uuids"
                                ]
                            }
                        }
                    }
                }
            }
        },
        "/flowsend/subscribers/bulk/status": {
            "post": {
                "operationId": "bulk-status",
                "summary": "Status mehrerer Subscriber ändern",
                "description": "Setzt den Status mehrerer Subscriber auf einmal. Zulässig sind nur subscribed und pending. Subscriber, die bereits unsubscribed, bounced oder complained sind, bleiben unverändert: diese Zustände entstehen durch die Entscheidung der Empfängerin oder durch den Versanddienst und werden nie überschrieben. Die Antwort nennt selected_count, affected_count und skipped_count.",
                "tags": [
                    "subscribers-bulk"
                ],
                "responses": {
                    "200": {
                        "description": "Erfolgreiche Antwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Fehlerantwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                },
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "subscriber_uuids": {
                                        "type": "array",
                                        "items": [],
                                        "description": "UUIDs der zu ändernden Subscriber (1 bis 500)"
                                    },
                                    "status": {
                                        "type": "string",
                                        "description": "Neuer Status: subscribed oder pending"
                                    }
                                },
                                "required": [
                                    "subscriber_uuids",
                                    "status"
                                ]
                            }
                        }
                    }
                }
            }
        },
        "/flowsend/lists": {
            "get": {
                "operationId": "lists-list",
                "summary": "Listen abrufen",
                "description": "Ruft alle Listen ab, inklusive Subscriber-Anzahl.",
                "tags": [
                    "lists"
                ],
                "parameters": [
                    {
                        "name": "per_page",
                        "in": "query",
                        "required": false,
                        "description": "Einträge pro Seite (1 bis 500, Standard 500). Die Antwort enthält zusätzlich einen <code>meta</code>-Block mit <code>current_page</code>, <code>per_page</code>, <code>total</code> und <code>last_page</code>.",
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "page",
                        "in": "query",
                        "required": false,
                        "description": "Seitennummer, beginnend bei 1",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Erfolgreiche Antwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Fehlerantwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            },
            "post": {
                "operationId": "lists-create",
                "summary": "Liste erstellen",
                "description": "Erstellt eine neue Liste.",
                "tags": [
                    "lists"
                ],
                "responses": {
                    "200": {
                        "description": "Erfolgreiche Antwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Fehlerantwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                },
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "title": {
                                        "type": "string",
                                        "description": "Name der Liste"
                                    },
                                    "slug": {
                                        "type": "string",
                                        "description": "URL-Slug (optional, wird automatisch generiert)"
                                    },
                                    "description": {
                                        "type": "string",
                                        "description": "Beschreibung der Liste"
                                    }
                                },
                                "required": [
                                    "title"
                                ]
                            }
                        }
                    }
                }
            }
        },
        "/flowsend/lists/{uuid}": {
            "get": {
                "operationId": "lists-show",
                "summary": "Listen-Details abrufen",
                "description": "Ruft Details einer bestimmten Liste ab.",
                "tags": [
                    "lists"
                ],
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Erfolgreiche Antwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Fehlerantwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            },
            "put": {
                "operationId": "lists-update",
                "summary": "Liste aktualisieren",
                "description": "Aktualisiert eine bestehende Liste.",
                "tags": [
                    "lists"
                ],
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Erfolgreiche Antwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Fehlerantwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                },
                "requestBody": {
                    "required": false,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "title": {
                                        "type": "string",
                                        "description": "Name der Liste"
                                    },
                                    "description": {
                                        "type": "string",
                                        "description": "Beschreibung"
                                    }
                                }
                            }
                        }
                    }
                }
            },
            "delete": {
                "operationId": "lists-delete",
                "summary": "Liste löschen",
                "description": "Löscht eine Liste. Subscriber in dieser Liste werden nicht gelöscht.",
                "tags": [
                    "lists"
                ],
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Erfolgreiche Antwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Fehlerantwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/flowsend/lists/{uuid}/subscribers": {
            "get": {
                "operationId": "lists-subscribers",
                "summary": "Abonnenten einer Liste",
                "description": "Listet die Abonnenten der Liste seitenweise auf. Die Antwort enthält einen meta-Block mit den Seitenangaben.",
                "tags": [
                    "lists"
                ],
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    },
                    {
                        "name": "per_page",
                        "in": "query",
                        "required": false,
                        "description": "Einträge pro Seite (1 bis 200, Standard 50)",
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "page",
                        "in": "query",
                        "required": false,
                        "description": "Seitennummer, beginnend bei 1",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Erfolgreiche Antwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Fehlerantwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            },
            "post": {
                "operationId": "lists-add-subscribers",
                "summary": "Abonnenten zur Liste hinzufügen",
                "description": "Fügt vorhandene Abonnenten der Liste hinzu. Bereits enthaltene Abonnenten bleiben unverändert, unbekannte oder teamfremde UUIDs werden übergangen.",
                "tags": [
                    "lists"
                ],
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Erfolgreiche Antwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Fehlerantwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                },
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "subscriber_uuids": {
                                        "type": "array",
                                        "items": [],
                                        "description": "UUIDs der hinzuzufügenden Abonnenten"
                                    }
                                },
                                "required": [
                                    "subscriber_uuids"
                                ]
                            }
                        }
                    }
                }
            },
            "delete": {
                "operationId": "lists-remove-subscribers",
                "summary": "Abonnenten aus der Liste entfernen",
                "description": "Löst die Zugehörigkeit der angegebenen Abonnenten zu dieser Liste. Die Abonnenten selbst, ihr Status und ihre übrigen Listen und Tags bleiben unverändert: aus einer Liste entfernt zu werden ist nicht dasselbe wie eine Abmeldung. Unbekannte oder teamfremde UUIDs werden übergangen, removed_count nennt die tatsächlich gelösten Zuordnungen.",
                "tags": [
                    "lists"
                ],
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Erfolgreiche Antwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Fehlerantwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                },
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "subscriber_uuids": {
                                        "type": "array",
                                        "items": [],
                                        "description": "UUIDs der zu entfernenden Abonnenten (1 bis 500)"
                                    }
                                },
                                "required": [
                                    "subscriber_uuids"
                                ]
                            }
                        }
                    }
                }
            }
        },
        "/flowsend/tags": {
            "get": {
                "operationId": "tags-list",
                "summary": "Tags abrufen",
                "description": "Ruft alle Tags ab, inklusive Subscriber-Anzahl.",
                "tags": [
                    "tags"
                ],
                "parameters": [
                    {
                        "name": "per_page",
                        "in": "query",
                        "required": false,
                        "description": "Einträge pro Seite (1 bis 500, Standard 500). Die Antwort enthält zusätzlich einen <code>meta</code>-Block mit <code>current_page</code>, <code>per_page</code>, <code>total</code> und <code>last_page</code>.",
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "page",
                        "in": "query",
                        "required": false,
                        "description": "Seitennummer, beginnend bei 1",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Erfolgreiche Antwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Fehlerantwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            },
            "post": {
                "operationId": "tags-create",
                "summary": "Tag erstellen",
                "description": "Erstellt einen neuen Tag.",
                "tags": [
                    "tags"
                ],
                "responses": {
                    "200": {
                        "description": "Erfolgreiche Antwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Fehlerantwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                },
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "title": {
                                        "type": "string",
                                        "description": "Name des Tags"
                                    },
                                    "slug": {
                                        "type": "string",
                                        "description": "URL-Slug (optional, wird automatisch generiert)"
                                    },
                                    "description": {
                                        "type": "string",
                                        "description": "Beschreibung des Tags"
                                    }
                                },
                                "required": [
                                    "title"
                                ]
                            }
                        }
                    }
                }
            }
        },
        "/flowsend/tags/{uuid}": {
            "get": {
                "operationId": "tags-show",
                "summary": "Tag-Details abrufen",
                "description": "Ruft Details eines bestimmten Tags ab.",
                "tags": [
                    "tags"
                ],
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Erfolgreiche Antwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Fehlerantwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            },
            "put": {
                "operationId": "tags-update",
                "summary": "Tag aktualisieren",
                "description": "Aktualisiert einen bestehenden Tag.",
                "tags": [
                    "tags"
                ],
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Erfolgreiche Antwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Fehlerantwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                },
                "requestBody": {
                    "required": false,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "title": {
                                        "type": "string",
                                        "description": "Name des Tags"
                                    },
                                    "description": {
                                        "type": "string",
                                        "description": "Beschreibung"
                                    }
                                }
                            }
                        }
                    }
                }
            },
            "delete": {
                "operationId": "tags-delete",
                "summary": "Tag löschen",
                "description": "Löscht einen Tag. Subscriber mit diesem Tag verlieren die Zuordnung.",
                "tags": [
                    "tags"
                ],
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Erfolgreiche Antwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Fehlerantwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/flowsend/tags/{uuid}/subscribers": {
            "get": {
                "operationId": "tags-subscribers",
                "summary": "Abonnenten eines Tags",
                "description": "Listet die Abonnenten mit diesem Tag seitenweise auf. Die Antwort enthält einen meta-Block mit den Seitenangaben.",
                "tags": [
                    "tags"
                ],
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    },
                    {
                        "name": "per_page",
                        "in": "query",
                        "required": false,
                        "description": "Einträge pro Seite (1 bis 200, Standard 50)",
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "page",
                        "in": "query",
                        "required": false,
                        "description": "Seitennummer, beginnend bei 1",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Erfolgreiche Antwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Fehlerantwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/flowsend/campaigns": {
            "get": {
                "operationId": "campaigns-list",
                "summary": "Kampagnen abrufen",
                "description": "Ruft die Kampagnen des Teams seitenweise ab, neueste zuerst. Die Antwort enthält einen meta-Block mit den Seitenangaben.",
                "tags": [
                    "campaigns"
                ],
                "parameters": [
                    {
                        "name": "status",
                        "in": "query",
                        "required": false,
                        "description": "Filter: draft, scheduled, sending, sent, cancelled, failed",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "search",
                        "in": "query",
                        "required": false,
                        "description": "Suchbegriff in Name und Betreff",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "per_page",
                        "in": "query",
                        "required": false,
                        "description": "Einträge pro Seite (1 bis 200, Standard 25)",
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "page",
                        "in": "query",
                        "required": false,
                        "description": "Seitennummer, beginnend bei 1",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Erfolgreiche Antwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Fehlerantwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            },
            "post": {
                "operationId": "campaigns-create",
                "summary": "Kampagne anlegen",
                "description": "Legt eine Kampagne als Entwurf an. Der Inhalt ist ein Templatical-Dokument in content_json; es wird gegen das Schema geprüft und bereinigt, bevor etwas gespeichert wird. content_html erzeugt FlowSend selbst und nimmt es nicht entgegen. Mit template_uuid startet der Entwurf aus einer sichtbaren Vorlage; ausdrücklich mitgeschickter Inhalt hat dabei Vorrang. Einzelne Blöcke änderst du danach mit POST /campaigns/{uuid}/content/operations.",
                "tags": [
                    "campaigns"
                ],
                "responses": {
                    "200": {
                        "description": "Erfolgreiche Antwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Fehlerantwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                },
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "name": {
                                        "type": "string",
                                        "description": "Interner Name der Kampagne"
                                    },
                                    "subject": {
                                        "type": "string",
                                        "description": "Betreffzeile"
                                    },
                                    "preview_text": {
                                        "type": "string",
                                        "description": "Vorschautext im Posteingang. Wird als Preheader in den Inhalt übernommen (settings.preheaderText) und folgt dessen Änderungen."
                                    },
                                    "from_name": {
                                        "type": "string",
                                        "description": "Absendername"
                                    },
                                    "from_email": {
                                        "type": "string",
                                        "description": "Absenderadresse; muss zur verifizierten Absenderdomäne passen"
                                    },
                                    "editor_type": {
                                        "type": "string",
                                        "description": "Nur noch visual; andere Werte liefern 422"
                                    },
                                    "content_json": {
                                        "type": "object",
                                        "description": "Dokument im Templatical-Format {\"blocks\": [...], \"settings\": {...}}, als Objekt oder JSON-Zeichenkette. Wird gegen das Templatical-Schema geprüft; das alte Builder-Format (root/childrenIds) liefert 422 legacy_content_format."
                                    },
                                    "template_uuid": {
                                        "type": "string",
                                        "description": "UUID einer eigenen oder System-Vorlage, aus der der Inhalt übernommen wird"
                                    },
                                    "list_uuids": {
                                        "type": "array",
                                        "items": [],
                                        "description": "UUIDs der Empfängerlisten"
                                    },
                                    "include_tag_uuids": {
                                        "type": "array",
                                        "items": [],
                                        "description": "UUIDs der Tags, die eingeschlossen werden"
                                    },
                                    "exclude_tag_uuids": {
                                        "type": "array",
                                        "items": [],
                                        "description": "UUIDs der Tags, die ausgeschlossen werden"
                                    }
                                },
                                "required": [
                                    "name"
                                ]
                            }
                        }
                    }
                }
            }
        },
        "/flowsend/campaigns/{uuid}": {
            "get": {
                "operationId": "campaigns-show",
                "summary": "Kampagne abrufen",
                "description": "Liefert die Kampagne samt Inhalt, Empfängerauswahl, Statistik und der Liste blockers. Ein leeres blockers bedeutet, dass die Kampagne versandbereit ist; current_recipients nennt die aktuelle Reichweite. content.content_json ist immer ein Templatical-Dokument (Objekt), content.revision der aktuelle Stand, content.content_html die daraus erzeugte Vorschau.",
                "tags": [
                    "campaigns"
                ],
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Erfolgreiche Antwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Fehlerantwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            },
            "put": {
                "operationId": "campaigns-update",
                "summary": "Kampagne ändern",
                "description": "Ändert einen Entwurf. Nur Kampagnen in den Zuständen draft, scheduled und failed sind änderbar; alles andere ist Versandgeschichte und liefert 422. Ausgelassene Felder behalten ihren Wert, ein leeres list_uuids löscht die Listenauswahl. Ein mitgeschicktes content_json ersetzt das ganze Dokument; der bisherige Stand wird als Version gesichert und offene Editoren laden neu. Für einzelne Blöcke ist POST /campaigns/{uuid}/content/operations der bessere Weg.",
                "tags": [
                    "campaigns"
                ],
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Erfolgreiche Antwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Fehlerantwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                },
                "requestBody": {
                    "required": false,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "name": {
                                        "type": "string",
                                        "description": "Interner Name"
                                    },
                                    "subject": {
                                        "type": "string",
                                        "description": "Betreffzeile"
                                    },
                                    "preview_text": {
                                        "type": "string",
                                        "description": "Vorschautext im Posteingang. Wird als Preheader in den Inhalt übernommen (settings.preheaderText) und folgt dessen Änderungen."
                                    },
                                    "from_name": {
                                        "type": "string",
                                        "description": "Absendername"
                                    },
                                    "from_email": {
                                        "type": "string",
                                        "description": "Absenderadresse"
                                    },
                                    "editor_type": {
                                        "type": "string",
                                        "description": "Nur noch visual; andere Werte liefern 422"
                                    },
                                    "content_json": {
                                        "type": "object",
                                        "description": "Dokument im Templatical-Format {\"blocks\": [...], \"settings\": {...}}, als Objekt oder JSON-Zeichenkette. Wird gegen das Templatical-Schema geprüft; das alte Builder-Format (root/childrenIds) liefert 422 legacy_content_format."
                                    },
                                    "list_uuids": {
                                        "type": "array",
                                        "items": [],
                                        "description": "Ersetzt die Listenauswahl"
                                    },
                                    "include_tag_uuids": {
                                        "type": "array",
                                        "items": [],
                                        "description": "Ersetzt die eingeschlossenen Tags"
                                    },
                                    "exclude_tag_uuids": {
                                        "type": "array",
                                        "items": [],
                                        "description": "Ersetzt die ausgeschlossenen Tags"
                                    }
                                }
                            }
                        }
                    }
                }
            },
            "delete": {
                "operationId": "campaigns-delete",
                "summary": "Kampagne löschen",
                "description": "Löscht eine Kampagne. Nur Entwürfe und abgebrochene Kampagnen dürfen gelöscht werden; eine versendete Kampagne ist Versandgeschichte und liefert 422.",
                "tags": [
                    "campaigns"
                ],
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Erfolgreiche Antwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Fehlerantwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/flowsend/campaigns/{uuid}/duplicate": {
            "post": {
                "operationId": "campaigns-duplicate",
                "summary": "Kampagne duplizieren",
                "description": "Legt eine Kopie mit Inhalt und Empfängerauswahl als neuen Entwurf an. Versandzeitpunkt, Zählerstände und Versandhistorie werden nicht kopiert. Der Request benötigt keinen Body.",
                "tags": [
                    "campaigns"
                ],
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Erfolgreiche Antwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Fehlerantwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/flowsend/campaigns/{uuid}/send-test": {
            "post": {
                "operationId": "campaigns-send-test",
                "summary": "Testmail versenden",
                "description": "Versendet die Kampagne an bis zu fünf Testadressen. Die Empfängerauswahl wird dabei übergangen und die Zählerstände der Kampagne bleiben unberührt. Die Antwort nennt je Adresse ein eigenes Ergebnis, weil der Versanddienst eine annehmen und eine andere ablehnen kann; scheitert mindestens eine, ist die Antwort 422.",
                "tags": [
                    "campaigns"
                ],
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Erfolgreiche Antwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Fehlerantwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                },
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "emails": {
                                        "type": "array",
                                        "items": [],
                                        "description": "Ein bis fünf Testadressen"
                                    },
                                    "subscriber_uuid": {
                                        "type": "string",
                                        "description": "UUID eines echten Empfängers, mit dessen Daten die Platzhalter gefüllt werden"
                                    }
                                },
                                "required": [
                                    "emails"
                                ]
                            }
                        }
                    }
                }
            }
        },
        "/flowsend/campaigns/{uuid}/send": {
            "post": {
                "operationId": "campaigns-send",
                "summary": "Kampagne sofort versenden",
                "description": "Stellt die Kampagne sofort in den Versand. Ist sie nicht versandbereit, antwortet der Endpunkt mit 422 und einer Liste blockers, die jeden Grund einzeln benennt, etwa fehlender Betreff, fehlender Inhalt, fehlende Liste oder ein überschrittenes Monatslimit. Der Request benötigt keinen Body.",
                "tags": [
                    "campaigns"
                ],
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Erfolgreiche Antwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Fehlerantwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/flowsend/campaigns/{uuid}/schedule": {
            "post": {
                "operationId": "campaigns-schedule",
                "summary": "Kampagne planen",
                "description": "Plant den Versand auf einen Zeitpunkt in der Zukunft. Dieselbe Versandbereitschaft wie beim sofortigen Versand wird geprüft und bei einem Hindernis mit 422 und blockers beantwortet.",
                "tags": [
                    "campaigns"
                ],
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Erfolgreiche Antwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Fehlerantwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                },
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "scheduled_at": {
                                        "type": "string",
                                        "description": "Versandzeitpunkt als Datum mit Uhrzeit, muss in der Zukunft liegen"
                                    }
                                },
                                "required": [
                                    "scheduled_at"
                                ]
                            }
                        }
                    }
                }
            }
        },
        "/flowsend/campaigns/{uuid}/cancel": {
            "post": {
                "operationId": "campaigns-cancel",
                "summary": "Versand abbrechen",
                "description": "Bricht eine geplante oder laufende Kampagne ab. Eine Kampagne, die weder geplant noch im Versand ist, liefert 422. Bereits zugestellte Mails lassen sich nicht zurückholen. Der Request benötigt keinen Body.",
                "tags": [
                    "campaigns"
                ],
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Erfolgreiche Antwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Fehlerantwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/flowsend/campaigns/{uuid}/recipients": {
            "get": {
                "operationId": "campaigns-recipients",
                "summary": "Empfänger der Kampagne",
                "description": "Liefert die Empfänger, die die Kampagne mit der aktuellen Auswahl erreichen würde, seitenweise. Es ist dieselbe Abfrage, die auch der Versand benutzt, deshalb können Vorschau und Versand nicht auseinanderlaufen. Die Gesamtzahl steht im meta-Block als recipient_count.",
                "tags": [
                    "campaigns"
                ],
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    },
                    {
                        "name": "per_page",
                        "in": "query",
                        "required": false,
                        "description": "Einträge pro Seite (1 bis 200, Standard 50)",
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "page",
                        "in": "query",
                        "required": false,
                        "description": "Seitennummer, beginnend bei 1",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Erfolgreiche Antwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Fehlerantwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/flowsend/campaigns/{uuid}/stats": {
            "get": {
                "operationId": "campaigns-stats",
                "summary": "Statistik der Kampagne",
                "description": "Liefert Zustellzahlen, Öffnungen, Klicks, Abmeldungen und Bounces sowie die aktuelle Reichweite und die Liste blockers.",
                "tags": [
                    "campaigns"
                ],
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Erfolgreiche Antwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Fehlerantwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/flowsend/campaigns/{uuid}/events": {
            "get": {
                "operationId": "campaigns-events",
                "summary": "Versandereignisse der Kampagne",
                "description": "Listet die einzelnen Zustellereignisse seitenweise auf, neueste zuerst. Jedes Ereignis nennt seinen Typ, den Zeitpunkt und die UUID des betroffenen Empfängers.",
                "tags": [
                    "campaigns"
                ],
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    },
                    {
                        "name": "type",
                        "in": "query",
                        "required": false,
                        "description": "Filter: delivered, opened, clicked, unsubscribed, bounced, complained, rejected, processed",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "per_page",
                        "in": "query",
                        "required": false,
                        "description": "Einträge pro Seite (1 bis 200, Standard 50)",
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "page",
                        "in": "query",
                        "required": false,
                        "description": "Seitennummer, beginnend bei 1",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Erfolgreiche Antwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Fehlerantwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/flowsend/campaigns/{uuid}/content": {
            "get": {
                "operationId": "campaigns-content",
                "summary": "Kampagne: Inhalt blockweise lesen",
                "description": "Liefert das Templatical-Dokument mit revision, einer Übersicht der Einstellungen und blocks: jeder Block in Lesereihenfolge mit block_id, Typ, Platz (parent mit sectionId und column) und seinen Inhaltsfeldern unter den Templatical-Namen. Ein Altdokument wird dabei im Speicher umgewandelt. Der Pflicht-Fußbereich mit Impressum und Abmeldelink ist kein Block.",
                "tags": [
                    "campaigns"
                ],
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Erfolgreiche Antwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Fehlerantwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/flowsend/campaigns/{uuid}/content/operations": {
            "post": {
                "operationId": "campaigns-content-operations",
                "summary": "Kampagne: Inhalt mit Operationen ändern",
                "description": "Wendet einen Stapel Templatical-Operationen an: alles oder nichts, geprüft gegen das Schema, bereinigt und mit neuer revision gespeichert. Der bisherige Stand wird als Version gesichert, offene Editoren zeigen die Änderung sofort. Eine Ablehnung nennt die Operation (opIndex ab 0) und den Grund: 409 bei unbekanntem Block, fehlendem Anker, veralteter expected_revision oder einem Block, den gerade jemand im Editor bearbeitet; 422 bei einer ungültigen Operation. Die Antwort enthält die neue revision, die neu angelegten Blöcke (created) und die Blockübersicht. Nur Kampagnen in den Zuständen draft, scheduled und failed; über MCP nur Entwürfe.",
                "tags": [
                    "campaigns"
                ],
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Erfolgreiche Antwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Fehlerantwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                },
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "operations": {
                                        "type": "array",
                                        "items": [],
                                        "description": "Templatical-Operationen, angewendet in Reihenfolge und alles oder nichts: <code>{\"op\": \"updateBlock\", \"blockId\": \"b1\", \"set\": {\"content\": \"&lt;p&gt;Hallo&lt;/p&gt;\"}}</code>, <code>{\"op\": \"addBlock\", \"block\": {\"type\": \"paragraph\", \"content\": \"&lt;p&gt;Neu&lt;/p&gt;\"}, \"parent\": null, \"after\": \"b1\"}</code>, <code>{\"op\": \"moveBlock\", \"blockId\": \"b2\", \"parent\": {\"sectionId\": \"s1\", \"column\": 0}, \"after\": null}</code>, <code>{\"op\": \"deleteBlock\", \"blockId\": \"b2\"}</code>, <code>{\"op\": \"updateSettings\", \"set\": {\"preheaderText\": \"…\"}}</code>, <code>{\"op\": \"setContent\", \"content\": {…}}</code> (nur mit expected_revision). Höchstens 80 je Aufruf. Ohne id vergibt FlowSend eine."
                                    },
                                    "expected_revision": {
                                        "type": "integer",
                                        "description": "Stand, auf dem die Operationen geplant wurden; weicht der aktuelle ab, kommt 409 stale_revision. Pflicht für setContent."
                                    }
                                },
                                "required": [
                                    "operations"
                                ]
                            }
                        }
                    }
                }
            }
        },
        "/flowsend/templates": {
            "get": {
                "operationId": "templates-list",
                "summary": "Vorlagen abrufen",
                "description": "Listet die eigenen Vorlagen und die geteilten Systemvorlagen seitenweise auf.",
                "tags": [
                    "templates"
                ],
                "parameters": [
                    {
                        "name": "scope",
                        "in": "query",
                        "required": false,
                        "description": "all (Standard), own oder system",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "category",
                        "in": "query",
                        "required": false,
                        "description": "Filter: newsletter, welcome, announcement, promo, custom",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "editor_type",
                        "in": "query",
                        "required": false,
                        "description": "Filter: visual (noch nicht umgestellte Altbestände tragen richtext oder html)",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "is_active",
                        "in": "query",
                        "required": false,
                        "description": "Filter nach aktiven oder deaktivierten Vorlagen",
                        "schema": {
                            "type": "boolean"
                        }
                    },
                    {
                        "name": "search",
                        "in": "query",
                        "required": false,
                        "description": "Suchbegriff in Name und Beschreibung",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "per_page",
                        "in": "query",
                        "required": false,
                        "description": "Einträge pro Seite (1 bis 200, Standard 25)",
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "page",
                        "in": "query",
                        "required": false,
                        "description": "Seitennummer, beginnend bei 1",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Erfolgreiche Antwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Fehlerantwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            },
            "post": {
                "operationId": "templates-create",
                "summary": "Vorlage anlegen",
                "description": "Legt eine eigene Vorlage an. Der Inhalt ist ein Templatical-Dokument in content_json, das gegen das Schema geprüft und bereinigt wird; das alte Builder-Format liefert 422. content_html ist die erzeugte Vorschau und nur lesbar. HTML-Exporte anderer Anbieter importierst du in FlowSend über „HTML importieren“.",
                "tags": [
                    "templates"
                ],
                "responses": {
                    "200": {
                        "description": "Erfolgreiche Antwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Fehlerantwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                },
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "name": {
                                        "type": "string",
                                        "description": "Name der Vorlage"
                                    },
                                    "category": {
                                        "type": "string",
                                        "description": "newsletter, welcome, announcement, promo oder custom (Standard)"
                                    },
                                    "description": {
                                        "type": "string",
                                        "description": "Beschreibung"
                                    },
                                    "editor_type": {
                                        "type": "string",
                                        "description": "Nur noch visual; andere Werte liefern 422"
                                    },
                                    "content_json": {
                                        "type": "object",
                                        "description": "Dokument im Templatical-Format {\"blocks\": [...], \"settings\": {...}}, als Objekt oder JSON-Zeichenkette. Wird gegen das Templatical-Schema geprüft; das alte Builder-Format (root/childrenIds) liefert 422 legacy_content_format."
                                    },
                                    "is_active": {
                                        "type": "boolean",
                                        "description": "Ob die Vorlage in der Auswahl erscheint (Standard: true)"
                                    }
                                },
                                "required": [
                                    "name"
                                ]
                            }
                        }
                    }
                }
            }
        },
        "/flowsend/templates/{uuid}": {
            "get": {
                "operationId": "templates-show",
                "summary": "Vorlage abrufen",
                "description": "Liefert eine eigene oder geteilte Systemvorlage samt ihrem gespeicherten Inhalt. Das Feld editable sagt, ob die Vorlage geändert werden darf.",
                "tags": [
                    "templates"
                ],
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Erfolgreiche Antwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Fehlerantwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            },
            "put": {
                "operationId": "templates-update",
                "summary": "Vorlage ändern",
                "description": "Ändert eine eigene Vorlage. Eine Systemvorlage gehört allen Teams und liefert 422; dupliziere sie zuerst. Ein mitgeschicktes content_json (Templatical) ersetzt das ganze Dokument; vorher wird der bisherige Stand als Version gesichert.",
                "tags": [
                    "templates"
                ],
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Erfolgreiche Antwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Fehlerantwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                },
                "requestBody": {
                    "required": false,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "name": {
                                        "type": "string",
                                        "description": "Name der Vorlage"
                                    },
                                    "category": {
                                        "type": "string",
                                        "description": "newsletter, welcome, announcement, promo oder custom"
                                    },
                                    "description": {
                                        "type": "string",
                                        "description": "Beschreibung"
                                    },
                                    "editor_type": {
                                        "type": "string",
                                        "description": "Nur noch visual; andere Werte liefern 422"
                                    },
                                    "content_json": {
                                        "type": "object",
                                        "description": "Dokument im Templatical-Format {\"blocks\": [...], \"settings\": {...}}, als Objekt oder JSON-Zeichenkette. Wird gegen das Templatical-Schema geprüft; das alte Builder-Format (root/childrenIds) liefert 422 legacy_content_format."
                                    },
                                    "is_active": {
                                        "type": "boolean",
                                        "description": "Ob die Vorlage in der Auswahl erscheint"
                                    }
                                }
                            }
                        }
                    }
                }
            },
            "delete": {
                "operationId": "templates-delete",
                "summary": "Vorlage löschen",
                "description": "Löscht eine eigene Vorlage. Systemvorlagen sind über diesen Weg nicht erreichbar und liefern 404.",
                "tags": [
                    "templates"
                ],
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Erfolgreiche Antwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Fehlerantwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/flowsend/templates/{uuid}/duplicate": {
            "post": {
                "operationId": "templates-duplicate",
                "summary": "Vorlage duplizieren",
                "description": "Erzeugt aus einer eigenen oder geteilten Systemvorlage eine eigene Kopie, die sich frei ändern lässt. Das Vorschaubild der Kopie entsteht im Hintergrund. Der Request benötigt keinen Body.",
                "tags": [
                    "templates"
                ],
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Erfolgreiche Antwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Fehlerantwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/flowsend/templates/{uuid}/content": {
            "get": {
                "operationId": "templates-content",
                "summary": "Vorlage: Inhalt blockweise lesen",
                "description": "Liefert das Templatical-Dokument mit revision, einer Übersicht der Einstellungen und blocks: jeder Block in Lesereihenfolge mit block_id, Typ, Platz (parent mit sectionId und column) und seinen Inhaltsfeldern unter den Templatical-Namen. Ein Altdokument wird dabei im Speicher umgewandelt. Der Pflicht-Fußbereich mit Impressum und Abmeldelink ist kein Block.",
                "tags": [
                    "templates"
                ],
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Erfolgreiche Antwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Fehlerantwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/flowsend/templates/{uuid}/content/operations": {
            "post": {
                "operationId": "templates-content-operations",
                "summary": "Vorlage: Inhalt mit Operationen ändern",
                "description": "Wendet einen Stapel Templatical-Operationen an: alles oder nichts, geprüft gegen das Schema, bereinigt und mit neuer revision gespeichert. Der bisherige Stand wird als Version gesichert, offene Editoren zeigen die Änderung sofort. Eine Ablehnung nennt die Operation (opIndex ab 0) und den Grund: 409 bei unbekanntem Block, fehlendem Anker, veralteter expected_revision oder einem Block, den gerade jemand im Editor bearbeitet; 422 bei einer ungültigen Operation. Die Antwort enthält die neue revision, die neu angelegten Blöcke (created) und die Blockübersicht. Systemvorlagen liefern 422; dupliziere sie zuerst.",
                "tags": [
                    "templates"
                ],
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Erfolgreiche Antwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Fehlerantwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                },
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "operations": {
                                        "type": "array",
                                        "items": [],
                                        "description": "Templatical-Operationen, angewendet in Reihenfolge und alles oder nichts: <code>{\"op\": \"updateBlock\", \"blockId\": \"b1\", \"set\": {\"content\": \"&lt;p&gt;Hallo&lt;/p&gt;\"}}</code>, <code>{\"op\": \"addBlock\", \"block\": {\"type\": \"paragraph\", \"content\": \"&lt;p&gt;Neu&lt;/p&gt;\"}, \"parent\": null, \"after\": \"b1\"}</code>, <code>{\"op\": \"moveBlock\", \"blockId\": \"b2\", \"parent\": {\"sectionId\": \"s1\", \"column\": 0}, \"after\": null}</code>, <code>{\"op\": \"deleteBlock\", \"blockId\": \"b2\"}</code>, <code>{\"op\": \"updateSettings\", \"set\": {\"preheaderText\": \"…\"}}</code>, <code>{\"op\": \"setContent\", \"content\": {…}}</code> (nur mit expected_revision). Höchstens 80 je Aufruf. Ohne id vergibt FlowSend eine."
                                    },
                                    "expected_revision": {
                                        "type": "integer",
                                        "description": "Stand, auf dem die Operationen geplant wurden; weicht der aktuelle ab, kommt 409 stale_revision. Pflicht für setContent."
                                    }
                                },
                                "required": [
                                    "operations"
                                ]
                            }
                        }
                    }
                }
            }
        },
        "/flowsend/sender-domains": {
            "get": {
                "operationId": "sender-domains-list",
                "summary": "Absenderdomäne auflisten",
                "description": "Liefert die konfigurierte Absenderdomäne als Liste mit null oder einem Eintrag, ohne den Versanddienst abzufragen.",
                "tags": [
                    "sender-domains"
                ],
                "responses": {
                    "200": {
                        "description": "Erfolgreiche Antwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Fehlerantwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            },
            "post": {
                "operationId": "sender-domains-create",
                "summary": "Absenderdomäne hinzufügen",
                "description": "Meldet eine Absenderdomäne beim Versanddienst an und liefert die zu veröffentlichenden DNS-Einträge zurück. Ist bereits eine Domäne konfiguriert, antwortet der Endpunkt mit 422.",
                "tags": [
                    "sender-domains"
                ],
                "responses": {
                    "200": {
                        "description": "Erfolgreiche Antwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Fehlerantwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                },
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "domain": {
                                        "type": "string",
                                        "description": "Die Domäne, etwa beispiel.de"
                                    }
                                },
                                "required": [
                                    "domain"
                                ]
                            }
                        }
                    }
                }
            }
        },
        "/flowsend/sender-domains/current": {
            "get": {
                "operationId": "sender-domains-show",
                "summary": "Absenderdomäne abrufen",
                "description": "Liefert die Domäne samt DNS-Einträgen und fragt dabei den Versanddienst nach dem aktuellen Prüfstand. Ist der Dienst nicht erreichbar, kommt der gespeicherte Stand mit reachable: false zurück.",
                "tags": [
                    "sender-domains"
                ],
                "responses": {
                    "200": {
                        "description": "Erfolgreiche Antwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Fehlerantwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            },
            "delete": {
                "operationId": "sender-domains-delete",
                "summary": "Absenderdomäne entfernen",
                "description": "Entfernt die Absenderdomäne. Der lokale Stand wird in jedem Fall gelöscht; ob der Versanddienst die Domäne ebenfalls freigegeben hat, steht im Feld provider_removed. Ist es false, muss die Domäne beim Dienst von Hand entfernt werden, bevor sie erneut hinzugefügt werden kann.",
                "tags": [
                    "sender-domains"
                ],
                "responses": {
                    "200": {
                        "description": "Erfolgreiche Antwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Fehlerantwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/flowsend/sender-domains/current/verify": {
            "post": {
                "operationId": "sender-domains-verify",
                "summary": "Absenderdomäne prüfen",
                "description": "Fordert den Versanddienst auf, die veröffentlichten DNS-Einträge erneut zu prüfen. Der Request benötigt keinen Body.",
                "tags": [
                    "sender-domains"
                ],
                "responses": {
                    "200": {
                        "description": "Erfolgreiche Antwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Fehlerantwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/flowsend/context": {
            "get": {
                "operationId": "context",
                "summary": "Kontext abrufen",
                "description": "Liefert in einem Aufruf alles, was vor einem Schreibzugriff bekannt sein muss: die Feldverträge je Datensatztyp, die zulässigen Empfänger- und Kampagnenstatus, die geschützten Einwilligungszustände, die Vorlagenkategorien, den Double-Opt-in-Zustand, die Absenderdomäne und das Monatslimit.",
                "tags": [
                    "insights"
                ],
                "responses": {
                    "200": {
                        "description": "Erfolgreiche Antwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Fehlerantwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/flowsend/limit": {
            "get": {
                "operationId": "limit",
                "summary": "Monatslimit abrufen",
                "description": "Liefert das monatliche Versandkontingent: limit, bereits verbrauchte sent, verbleibende remaining, das Kennzeichen reached und die Auslastung in Prozent.",
                "tags": [
                    "insights"
                ],
                "responses": {
                    "200": {
                        "description": "Erfolgreiche Antwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Fehlerantwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/flowsend/reports/overview": {
            "get": {
                "operationId": "reports-overview",
                "summary": "Übersicht",
                "description": "Zählt Empfänger je Status, Listen, Tags und Kampagnen je Zustand und nennt das Monatslimit.",
                "tags": [
                    "insights"
                ],
                "responses": {
                    "200": {
                        "description": "Erfolgreiche Antwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Fehlerantwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/flowsend/reports/audience": {
            "get": {
                "operationId": "reports-audience",
                "summary": "Reichweite schätzen",
                "description": "Zählt, wie viele Empfänger eine Auswahl aus Listen und Tags tatsächlich erreicht. Es ist dieselbe Abfrage, die auch der Versand benutzt: abgemeldete, unzustellbare und noch nicht bestätigte Empfänger zählen nicht mit. Ohne Auswahl ergibt sich die Zahl aller angemeldeten Empfänger.",
                "tags": [
                    "insights"
                ],
                "parameters": [
                    {
                        "name": "list_uuids[]",
                        "in": "query",
                        "required": false,
                        "description": "UUIDs der Empfängerlisten",
                        "schema": {
                            "type": "array",
                            "items": []
                        }
                    },
                    {
                        "name": "include_tag_uuids[]",
                        "in": "query",
                        "required": false,
                        "description": "UUIDs der einzuschließenden Tags",
                        "schema": {
                            "type": "array",
                            "items": []
                        }
                    },
                    {
                        "name": "exclude_tag_uuids[]",
                        "in": "query",
                        "required": false,
                        "description": "UUIDs der auszuschließenden Tags",
                        "schema": {
                            "type": "array",
                            "items": []
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Erfolgreiche Antwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "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"
                    }
                }
            }
        }
    }
}