{
    "openapi": "3.1.0",
    "info": {
        "title": "FlowSupport API",
        "version": "v1",
        "description": "REST API für die FlowSupport-Postfächer (WhatsApp und E-Mail): Unterhaltungen lesen, beantworten, zuweisen, mit Status und Labels versehen, interne Notizen führen und mit dem CRM verknüpfen."
    },
    "servers": [
        {
            "url": "https://api.flowsuite.one",
            "description": "FlowSuite API"
        }
    ],
    "security": [
        {
            "bearerAuth": []
        }
    ],
    "tags": [
        {
            "name": "context",
            "description": "Überblick"
        },
        {
            "name": "inboxes",
            "description": "Postfächer"
        },
        {
            "name": "conversations",
            "description": "Unterhaltungen"
        },
        {
            "name": "messages",
            "description": "Nachrichten"
        },
        {
            "name": "notes",
            "description": "Interne Notizen"
        },
        {
            "name": "catalogs",
            "description": "Labels und Vorlagen"
        },
        {
            "name": "reports",
            "description": "Auswertungen"
        }
    ],
    "paths": {
        "/flowsupport/context": {
            "get": {
                "operationId": "flowsupport-context",
                "summary": "Postfächer, Zustände und Grenzen abrufen",
                "description": "Liefert alle erreichbaren Postfächer mit der eigenen Rechtestufe, den Fähigkeiten ihres Kanals, dem Verbindungszustand und den zuweisbaren Teammitgliedern je Postfach, dazu die vier Zustände einer Unterhaltung, die beiden vergebbaren Freigabestufen sowie die Grenzen für Dateianhänge.",
                "tags": [
                    "context"
                ],
                "responses": {
                    "200": {
                        "description": "Erfolgreiche Antwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                },
                                "example": {
                                    "success": true,
                                    "data": {
                                        "inboxes": [
                                            {
                                                "uuid": "9d2f4c1a-7b3e-4f8a-9c5d-1e6a8b0c2d4f",
                                                "name": "Support",
                                                "channel": "whatsapp",
                                                "status": "ready",
                                                "capabilities": {
                                                    "text": true,
                                                    "files": true,
                                                    "new_conversation": true,
                                                    "groups": true,
                                                    "mentions": true,
                                                    "label_sync": true,
                                                    "quote_reply": false,
                                                    "reactions": false,
                                                    "edit_message": false,
                                                    "delete_message": false,
                                                    "recipient_kind": "phone",
                                                    "max_text_length": 5000,
                                                    "max_files": 5,
                                                    "max_file_kilobytes": 25600
                                                },
                                                "connection": {
                                                    "status": "ready",
                                                    "last_heartbeat_at": "2026-10-08T09:14:32+02:00",
                                                    "heartbeat_age_seconds": 21,
                                                    "stale": false,
                                                    "delivers_now": true
                                                },
                                                "level": "owner",
                                                "may_send": true,
                                                "may_manage": true,
                                                "may_share": true,
                                                "new_chat_blocked": false,
                                                "assignable_users": [
                                                    {
                                                        "user_uuid": "3f8b1c6e-2d44-4a9b-8e77-5c1a0b9d3e22",
                                                        "name": "Anna Berger"
                                                    }
                                                ]
                                            }
                                        ],
                                        "conversation_statuses": [
                                            "open",
                                            "in_progress",
                                            "waiting",
                                            "done"
                                        ],
                                        "share_levels": [
                                            "read",
                                            "reply"
                                        ],
                                        "attachment_limits": {
                                            "max_files": 5,
                                            "max_kilobytes": 25600,
                                            "mime_types": [
                                                "image/jpeg",
                                                "application/pdf"
                                            ]
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Fehlerantwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/flowsupport/inboxes": {
            "get": {
                "operationId": "flowsupport-inboxes-index",
                "summary": "Postfächer auflisten",
                "description": "Alle Postfächer, die dieser Schlüssel erreicht, mit der eigenen Rechtestufe, den Fähigkeiten des Kanals, dem Verbindungszustand und den Angaben, ob gesendet, freigegeben und verwaltet werden darf.",
                "tags": [
                    "inboxes"
                ],
                "responses": {
                    "200": {
                        "description": "Erfolgreiche Antwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                },
                                "example": {
                                    "success": true,
                                    "data": [
                                        {
                                            "uuid": "9d2f4c1a-7b3e-4f8a-9c5d-1e6a8b0c2d4f",
                                            "name": "Support",
                                            "channel": "whatsapp",
                                            "visibility": "private",
                                            "status": "ready",
                                            "own_number": "4915100000000",
                                            "owner_uuid": "3f8b1c6e-2d44-4a9b-8e77-5c1a0b9d3e22",
                                            "owner_name": "Anna Berger",
                                            "outbound_wait_hours": 4,
                                            "max_new_chats_per_hour": 10,
                                            "max_messages_per_hour": 100,
                                            "capabilities": {
                                                "text": true,
                                                "files": true,
                                                "new_conversation": true,
                                                "groups": true,
                                                "mentions": true,
                                                "label_sync": true,
                                                "quote_reply": false,
                                                "reactions": false,
                                                "edit_message": false,
                                                "delete_message": false,
                                                "recipient_kind": "phone",
                                                "max_text_length": 5000,
                                                "max_files": 5,
                                                "max_file_kilobytes": 25600
                                            },
                                            "connection": {
                                                "status": "ready",
                                                "last_heartbeat_at": "2026-10-08T09:14:32+02:00",
                                                "heartbeat_age_seconds": 21,
                                                "stale": false,
                                                "delivers_now": true
                                            },
                                            "level": "owner",
                                            "may_send": true,
                                            "may_manage": true,
                                            "may_share": true,
                                            "new_chat_blocked": false
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Fehlerantwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/flowsupport/inboxes/{uuid}": {
            "get": {
                "operationId": "flowsupport-inboxes-show",
                "summary": "Ein Postfach abrufen",
                "description": "Ein einzelnes Postfach mit der eigenen Rechtestufe und zusätzlich den Teammitgliedern, die in diesem Postfach zuständig sein können. Ein Postfach ohne Rechtestufe antwortet mit HTTP 404.",
                "tags": [
                    "inboxes"
                ],
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Erfolgreiche Antwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                },
                                "example": {
                                    "success": true,
                                    "data": {
                                        "uuid": "9d2f4c1a-7b3e-4f8a-9c5d-1e6a8b0c2d4f",
                                        "name": "Support",
                                        "status": "ready",
                                        "outbound_wait_hours": 4,
                                        "max_new_chats_per_hour": 10,
                                        "max_messages_per_hour": 100,
                                        "capabilities": {
                                            "text": true,
                                            "files": true,
                                            "new_conversation": true,
                                            "groups": true,
                                            "mentions": true,
                                            "label_sync": true,
                                            "quote_reply": false,
                                            "reactions": false,
                                            "edit_message": false,
                                            "delete_message": false,
                                            "recipient_kind": "phone",
                                            "max_text_length": 5000,
                                            "max_files": 5,
                                            "max_file_kilobytes": 25600
                                        },
                                        "connection": {
                                            "status": "ready",
                                            "last_heartbeat_at": "2026-10-08T09:14:32+02:00",
                                            "heartbeat_age_seconds": 21,
                                            "stale": false,
                                            "delivers_now": true
                                        },
                                        "level": "owner",
                                        "may_send": true,
                                        "assignable_users": [
                                            {
                                                "user_uuid": "3f8b1c6e-2d44-4a9b-8e77-5c1a0b9d3e22",
                                                "name": "Anna Berger"
                                            }
                                        ]
                                    }
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Fehlerantwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            },
            "patch": {
                "operationId": "flowsupport-inboxes-update",
                "summary": "Ein Postfach umbenennen",
                "description": "Ändert den Namen des Postfachs und die Adresse, die es als eigene anzeigt. Beide Felder werden zusammen gesendet: fehlt die eigene Adresse, wird sie geleert. Verlangt das Recht, Postfächer zu verwalten, auch vom Eigentümer des Postfachs; ohne dieses Recht antwortet die Route mit HTTP 403.",
                "tags": [
                    "inboxes"
                ],
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Erfolgreiche Antwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                },
                                "example": {
                                    "success": true,
                                    "data": {
                                        "uuid": "9d2f4c1a-7b3e-4f8a-9c5d-1e6a8b0c2d4f",
                                        "name": "Kundenservice",
                                        "own_number": "4915100000000",
                                        "status": "ready",
                                        "level": "owner"
                                    }
                                }
                            }
                        }
                    },
                    "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": "Der Name, höchstens 255 Zeichen."
                                    },
                                    "own_address": {
                                        "type": "string",
                                        "description": "Die eigene Adresse des Postfachs, bei WhatsApp die Rufnummer, höchstens 20 Zeichen. Fehlt das Feld oder ist es leer, wird die Adresse geleert. own_number wird als gleichbedeutender Name angenommen."
                                    }
                                },
                                "required": [
                                    "name"
                                ]
                            }
                        }
                    }
                }
            }
        },
        "/flowsupport/inboxes/{uuid}/pacing": {
            "put": {
                "operationId": "flowsupport-inboxes-pacing",
                "summary": "Den Sendetakt eines Postfachs setzen",
                "description": "Setzt die Wartefrist und die beiden Stundengrenzen. Die Grenzen lehnen nichts ab, sie bestimmen, wie schnell die Warteschlange an den Kanal übergeben wird. Alle drei Werte werden zusammen gesendet. Darf der Eigentümer des Postfachs und wer Postfächer verwalten darf. Wird das Postfach gerade verwendet, antwortet die Route mit HTTP 503 und dem Fehlercode inbox_busy; der Aufruf kann dann wiederholt werden.",
                "tags": [
                    "inboxes"
                ],
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Erfolgreiche Antwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                },
                                "example": {
                                    "success": true,
                                    "data": {
                                        "uuid": "9d2f4c1a-7b3e-4f8a-9c5d-1e6a8b0c2d4f",
                                        "name": "Support",
                                        "outbound_wait_hours": 24,
                                        "max_new_chats_per_hour": 20,
                                        "max_messages_per_hour": 200,
                                        "level": "owner"
                                    }
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Fehlerantwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                },
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "outbound_wait_hours": {
                                        "type": "integer",
                                        "description": "Wie viele Stunden eine Sendung auf den Kanal wartet, bevor sie verfällt. 1 bis 168."
                                    },
                                    "max_new_chats_per_hour": {
                                        "type": "integer",
                                        "description": "Wie viele neue Unterhaltungen das Postfach je Stunde beginnt. 1 bis 1000."
                                    },
                                    "max_messages_per_hour": {
                                        "type": "integer",
                                        "description": "Wie viele Nachrichten das Postfach je Stunde übergibt. 1 bis 1000."
                                    }
                                },
                                "required": [
                                    "outbound_wait_hours",
                                    "max_new_chats_per_hour",
                                    "max_messages_per_hour"
                                ]
                            }
                        }
                    }
                }
            }
        },
        "/flowsupport/inboxes/{uuid}/label-sync": {
            "get": {
                "operationId": "flowsupport-inbox-label-sync-show",
                "summary": "Den Label-Abgleich eines Postfachs abrufen",
                "description": "Der Stand des Abgleichs der Labels mit dem Kanal: ob er eingeschaltet ist, ob das Konto ihn unterstützt und der Bestand vollständig eingelesen wurde, sowie die Zahl der ausstehenden, fehlgeschlagenen und widersprüchlichen Übertragungen. Verlangt dasselbe Recht wie das Ändern.",
                "tags": [
                    "inboxes"
                ],
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Erfolgreiche Antwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                },
                                "example": {
                                    "success": true,
                                    "data": {
                                        "enabled": false,
                                        "supported": true,
                                        "initialized": true,
                                        "resync_requested": false,
                                        "pending": 0,
                                        "failed": 0,
                                        "conflicts": 0
                                    }
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Fehlerantwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            },
            "put": {
                "operationId": "flowsupport-inbox-label-sync-update",
                "summary": "Den Label-Abgleich ein- oder ausschalten",
                "description": "Schaltet den Abgleich der Labels mit dem Kanal ein oder aus. Das erste Einschalten führt die Labels des Postfachs mit denen auf dem Gerät zusammen und verlangt deshalb device_verified. Einschalten geht erst, wenn supported und initialized wahr sind, und nur mit höchstens 20 Labels. Ausschalten verwirft ausstehende Übertragungen. Darf der Eigentümer des Postfachs und wer Postfächer verwalten darf.",
                "tags": [
                    "inboxes"
                ],
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Erfolgreiche Antwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                },
                                "example": {
                                    "success": true,
                                    "data": {
                                        "enabled": true,
                                        "supported": true,
                                        "initialized": true,
                                        "resync_requested": false,
                                        "pending": 4,
                                        "failed": 0,
                                        "conflicts": 0
                                    }
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Fehlerantwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                },
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "enabled": {
                                        "type": "boolean",
                                        "description": "true schaltet den Abgleich ein, false aus."
                                    },
                                    "device_verified": {
                                        "type": "boolean",
                                        "description": "Bestätigt, dass der Abgleich am Gerät mit dem echten Konto geprüft wurde. Pflicht beim ersten Einschalten, sonst ohne Bedeutung."
                                    }
                                },
                                "required": [
                                    "enabled"
                                ]
                            }
                        }
                    }
                }
            }
        },
        "/flowsupport/inboxes/{uuid}/shares": {
            "get": {
                "operationId": "flowsupport-inbox-shares-index",
                "summary": "Freigaben eines Postfachs auflisten",
                "description": "Die vergebenen Rechtestufen eines Postfachs. Das Lesen dieser Liste verlangt dasselbe Recht wie das Ändern: wer nicht freigeben darf, erfährt auch nicht, wer sonst noch Zugriff hat. Der Eigentümer erscheint hier nicht, seine Stufe folgt aus dem Postfach selbst.",
                "tags": [
                    "inboxes"
                ],
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Erfolgreiche Antwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                },
                                "example": {
                                    "success": true,
                                    "data": [
                                        {
                                            "user_uuid": "3f8b1c6e-2d44-4a9b-8e77-5c1a0b9d3e22",
                                            "name": "Anna Berger",
                                            "email": "anna@example.com",
                                            "level": "reply",
                                            "granted_by_uuid": "7a2c0e19-55bb-4c31-9f80-2d6e4f1a8c33",
                                            "created_at": "2026-09-12T08:14:00+02:00"
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Fehlerantwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            },
            "post": {
                "operationId": "flowsupport-inbox-shares-store",
                "summary": "Ein Postfach freigeben",
                "description": "Gibt das Postfach einem Teammitglied auf einer Stufe frei. Eine zweite Freigabe an dieselbe Person ändert die Stufe, statt eine zweite Zeile anzulegen, und antwortet in beiden Fällen mit HTTP 201.",
                "tags": [
                    "inboxes"
                ],
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Erfolgreiche Antwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                },
                                "example": {
                                    "success": true,
                                    "data": {
                                        "user_uuid": "3f8b1c6e-2d44-4a9b-8e77-5c1a0b9d3e22",
                                        "name": "Anna Berger",
                                        "level": "reply",
                                        "created_at": "2026-09-12T08:14:00+02:00"
                                    }
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Fehlerantwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                },
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "user_uuid": {
                                        "type": "string",
                                        "description": "UUID des Teammitglieds. Eine Person außerhalb des Teams führt zu einem Validierungsfehler."
                                    },
                                    "level": {
                                        "type": "string",
                                        "description": "read oder reply. owner ist nicht vergebbar."
                                    }
                                },
                                "required": [
                                    "user_uuid",
                                    "level"
                                ]
                            }
                        }
                    }
                }
            }
        },
        "/flowsupport/inboxes/{uuid}/shares/{userUuid}": {
            "delete": {
                "operationId": "flowsupport-inbox-shares-destroy",
                "summary": "Eine Freigabe entziehen",
                "description": "Nimmt einem Teammitglied den Zugriff auf das Postfach. Eine Freigabe zu entziehen, die es nicht gibt, ist kein Fehler.",
                "tags": [
                    "inboxes"
                ],
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    },
                    {
                        "name": "userUuid",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Erfolgreiche Antwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                },
                                "example": {
                                    "success": true,
                                    "message": "Freigabe entzogen."
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Fehlerantwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/flowsupport/inboxes/{uuid}/suspend": {
            "post": {
                "operationId": "flowsupport-inboxes-suspend",
                "summary": "Ein Postfach stilllegen",
                "description": "Beendet Empfang und Sicht auf das Postfach. Nachrichten, Anhänge und Medien bleiben unverändert erhalten; entzogen wird die Sicht, nicht die Daten.",
                "tags": [
                    "inboxes"
                ],
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Erfolgreiche Antwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                },
                                "example": {
                                    "success": true,
                                    "message": "Postfach stillgelegt."
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Fehlerantwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/flowsupport/inboxes/{uuid}/request-deletion": {
            "post": {
                "operationId": "flowsupport-inboxes-request-deletion",
                "summary": "Ein Postfach zur Löschung vormerken",
                "description": "Merkt das Postfach mit allen Nachrichten und Medien zur Löschung vor. Dieser Schritt lässt sich über die API nicht zurücknehmen.",
                "tags": [
                    "inboxes"
                ],
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Erfolgreiche Antwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                },
                                "example": {
                                    "success": true,
                                    "message": "Postfach zur Löschung vorgemerkt."
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Fehlerantwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/flowsupport/conversations": {
            "get": {
                "operationId": "flowsupport-conversations-index",
                "summary": "Unterhaltungen auflisten",
                "description": "Die Unterhaltungen aller erreichbaren Postfächer, neueste Aktivität zuerst. Ohne Filter umfasst die Liste jedes Postfach, das dieser Schlüssel sieht.",
                "tags": [
                    "conversations"
                ],
                "parameters": [
                    {
                        "name": "inbox_uuid",
                        "in": "query",
                        "required": false,
                        "description": "Auf ein Postfach einschränken.",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "status",
                        "in": "query",
                        "required": false,
                        "description": "open, in_progress, waiting oder done.",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "assigned_user_uuid",
                        "in": "query",
                        "required": false,
                        "description": "Nur Unterhaltungen dieses Teammitglieds.",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "label_uuid",
                        "in": "query",
                        "required": false,
                        "description": "Nur Unterhaltungen mit diesem Label.",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "search",
                        "in": "query",
                        "required": false,
                        "description": "Sucht im Namen der Unterhaltung sowie in Name und Rufnummer der Gegenstelle.",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "unread",
                        "in": "query",
                        "required": false,
                        "description": "Nur Unterhaltungen mit ungelesenen eingehenden Nachrichten.",
                        "schema": {
                            "type": "boolean"
                        }
                    },
                    {
                        "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": "Seitenzahl, Standard 1.",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Erfolgreiche Antwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                },
                                "example": {
                                    "success": true,
                                    "data": [
                                        {
                                            "uuid": "c1b5a0d2-9e33-4f10-8a77-6b2c4d1e9f08",
                                            "name": "Frau Müller",
                                            "inbox_uuid": "9d2f4c1a-7b3e-4f8a-9c5d-1e6a8b0c2d4f",
                                            "inbox_name": "Support",
                                            "external_thread": "4915112345678@c.us",
                                            "is_group": false,
                                            "status": "open",
                                            "assigned_user_uuid": null,
                                            "linked_client_uuid": null,
                                            "labels": [],
                                            "unread_messages": 2,
                                            "last_message_at": "2026-09-20T15:02:00+02:00"
                                        }
                                    ],
                                    "meta": {
                                        "current_page": 1,
                                        "per_page": 50,
                                        "total": 1,
                                        "last_page": 1
                                    }
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Fehlerantwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            },
            "post": {
                "operationId": "flowsupport-conversations-store",
                "summary": "Eine Unterhaltung mit einer Rufnummer beginnen",
                "description": "Öffnet eine Unterhaltung mit einer Rufnummer, die uns nicht geschrieben hat. Drei Ausgänge: HTTP 200 mit der bereits bestehenden Unterhaltung, HTTP 201 mit der neu geöffneten Unterhaltung, oder HTTP 202 mit einem Prüfvorgang, wenn die Rufnummer erst vom Listener bei WhatsApp geprüft werden muss. Ist das Postfach nicht verbunden, sein Stundenlimit für neue Chats ausgeschöpft oder WhatsApps eigenes Kontingent erreicht, wird nichts abgelehnt: die Unterhaltung wird sofort angelegt und mit HTTP 202 samt `queued: true` und `estimated_start_at` zurückgegeben, Prüfung und Versand warten in der Warteschlange des Postfachs. Eine unlesbare, nicht erreichbare oder mehrdeutige Rufnummer antwortet mit HTTP 422.",
                "tags": [
                    "conversations"
                ],
                "responses": {
                    "200": {
                        "description": "Erfolgreiche Antwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                },
                                "example": {
                                    "success": true,
                                    "data": {
                                        "uuid": "a4f7c2b8-1d09-4e66-b3a1-7c5f2e0d9b44",
                                        "status": "pending",
                                        "number": "+4915112345678",
                                        "open": true,
                                        "conversation_uuid": null
                                    },
                                    "message": "Die Rufnummer wird geprüft. Den Stand liefert der Abruf des Vorgangs."
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Fehlerantwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                },
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "inbox_uuid": {
                                        "type": "string",
                                        "description": "Das Postfach, aus dem geschrieben wird. Verlangt die Berechtigung zum Senden."
                                    },
                                    "phone": {
                                        "type": "string",
                                        "description": "Die Rufnummer, wie sie getippt wurde. Die Plattform liest sie selbst in die internationale Form."
                                    },
                                    "name": {
                                        "type": "string",
                                        "description": "Anzeigename der Gegenstelle, falls bekannt."
                                    },
                                    "contact_uuid": {
                                        "type": "string",
                                        "description": "CRM-Kontakt, mit dem die Gegenstelle verknüpft wird."
                                    }
                                },
                                "required": [
                                    "inbox_uuid",
                                    "phone"
                                ]
                            }
                        }
                    }
                }
            }
        },
        "/flowsupport/conversations/{uuid}": {
            "get": {
                "operationId": "flowsupport-conversations-show",
                "summary": "Eine Unterhaltung abrufen",
                "description": "Eine Unterhaltung mit ihren Gegenstellen, Labels, CRM-Verknüpfungen, der Zahl ungelesener Nachrichten und den Rechten dieses Schlüssels an ihr.",
                "tags": [
                    "conversations"
                ],
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Erfolgreiche Antwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                },
                                "example": {
                                    "success": true,
                                    "data": {
                                        "uuid": "c1b5a0d2-9e33-4f10-8a77-6b2c4d1e9f08",
                                        "name": "Frau Müller",
                                        "status": "open",
                                        "unread_messages": 2,
                                        "participants": [
                                            {
                                                "uuid": "5d0a7e13-88f2-4c9b-a610-3e7b1d4c6f20",
                                                "name": "Frau Müller",
                                                "number": "+4915112345678",
                                                "external_address": "4915112345678@c.us",
                                                "linked_contact_uuid": null
                                            }
                                        ],
                                        "permissions": {
                                            "may_change_status": true,
                                            "may_assign": true,
                                            "may_link": true,
                                            "may_write_labels": true
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Fehlerantwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/flowsupport/conversations/{uuid}/status": {
            "put": {
                "operationId": "flowsupport-conversations-status",
                "summary": "Den Zustand einer Unterhaltung ändern",
                "description": "Setzt den Bearbeitungszustand. Eine abgeschlossene Unterhaltung wird von einer neuen eingehenden Nachricht automatisch wieder geöffnet.",
                "tags": [
                    "conversations"
                ],
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Erfolgreiche Antwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                },
                                "example": {
                                    "success": true,
                                    "data": {
                                        "uuid": "c1b5a0d2-9e33-4f10-8a77-6b2c4d1e9f08",
                                        "status": "done"
                                    }
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Fehlerantwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                },
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "status": {
                                        "type": "string",
                                        "description": "open, in_progress, waiting oder done."
                                    }
                                },
                                "required": [
                                    "status"
                                ]
                            }
                        }
                    }
                }
            }
        },
        "/flowsupport/conversations/{uuid}/assignee": {
            "put": {
                "operationId": "flowsupport-conversations-assignee",
                "summary": "Die Zuständigkeit setzen oder aufheben",
                "description": "Übergibt die Unterhaltung an ein Teammitglied oder hebt die Zuständigkeit auf. Ein Mitglied ohne Zugriff auf dieses Postfach wird mit HTTP 422 abgelehnt, statt stillschweigend eingetragen zu werden.",
                "tags": [
                    "conversations"
                ],
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Erfolgreiche Antwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                },
                                "example": {
                                    "success": true,
                                    "data": {
                                        "uuid": "c1b5a0d2-9e33-4f10-8a77-6b2c4d1e9f08",
                                        "assigned_user_uuid": "3f8b1c6e-2d44-4a9b-8e77-5c1a0b9d3e22",
                                        "assigned_user_name": "Anna Berger"
                                    }
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Fehlerantwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                },
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "assigned_user_uuid": {
                                        "type": "string",
                                        "description": "UUID des Teammitglieds, oder null zum Aufheben. Das Feld muss vorhanden sein."
                                    }
                                },
                                "required": [
                                    "assigned_user_uuid"
                                ]
                            }
                        }
                    }
                }
            }
        },
        "/flowsupport/conversations/{uuid}/labels": {
            "put": {
                "operationId": "flowsupport-conversations-labels",
                "summary": "Die Labels einer Unterhaltung setzen",
                "description": "Die übergebene Liste ist der gewünschte Endzustand, kein Umschalter: Fehlendes wird gesetzt, nicht Genanntes entfernt. Dieselbe Anfrage zweimal zu senden ändert deshalb nichts. Ein Label, das nicht zu diesem Postfach gehört, wird mit HTTP 422 abgelehnt.",
                "tags": [
                    "conversations"
                ],
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Erfolgreiche Antwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                },
                                "example": {
                                    "success": true,
                                    "data": {
                                        "uuid": "c1b5a0d2-9e33-4f10-8a77-6b2c4d1e9f08",
                                        "labels": [
                                            {
                                                "uuid": "e9b3f7a1-40cd-4b52-9d18-6a0c2f5e7b33",
                                                "name": "Dringend",
                                                "color": 3
                                            }
                                        ]
                                    }
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Fehlerantwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                },
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "label_uuids": {
                                        "type": "array",
                                        "items": [],
                                        "description": "Liste der Label-UUIDs, höchstens 50. Eine leere Liste entfernt alle Labels."
                                    }
                                },
                                "required": [
                                    "label_uuids"
                                ]
                            }
                        }
                    }
                }
            }
        },
        "/flowsupport/conversations/{uuid}/links": {
            "put": {
                "operationId": "flowsupport-conversations-links",
                "summary": "Die CRM-Verknüpfungen setzen",
                "description": "Verknüpft die Unterhaltung mit Kunde, Projekt, Kontakt oder Lead. Ein weggelassenes Feld bleibt unverändert, ein ausdrückliches null hebt die Verknüpfung auf. Ein Datensatz, den dieser Schlüssel nicht verknüpfen darf, wird mit HTTP 422 abgelehnt, statt stillschweigend nichts zu bewirken.",
                "tags": [
                    "conversations"
                ],
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Erfolgreiche Antwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                },
                                "example": {
                                    "success": true,
                                    "data": {
                                        "uuid": "c1b5a0d2-9e33-4f10-8a77-6b2c4d1e9f08",
                                        "linked_client_uuid": "b7d1e4f0-3a92-4c58-88b1-2f6d0a9c4e71",
                                        "linked_project_uuid": null,
                                        "linked_contact_uuid": null,
                                        "linked_lead_uuid": null
                                    }
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Fehlerantwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                },
                "requestBody": {
                    "required": false,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "client_uuid": {
                                        "type": "string",
                                        "description": "CRM-Kunde, oder null zum Aufheben."
                                    },
                                    "project_uuid": {
                                        "type": "string",
                                        "description": "Projekt des verknüpften Kunden, oder null."
                                    },
                                    "contact_uuid": {
                                        "type": "string",
                                        "description": "CRM-Kontakt, oder null."
                                    },
                                    "lead_uuid": {
                                        "type": "string",
                                        "description": "Lead, oder null."
                                    },
                                    "prefer": {
                                        "type": "string",
                                        "description": "client oder lead. Entscheidet, welche Seite gewinnt, wenn beides gesetzt wird. Standard ist client."
                                    }
                                }
                            }
                        }
                    }
                }
            }
        },
        "/flowsupport/conversations/{uuid}/read": {
            "post": {
                "operationId": "flowsupport-conversations-read",
                "summary": "Eine Unterhaltung als gelesen markieren",
                "description": "Setzt die Leseposition auf die neueste Nachricht. Die Antwort nennt die verbleibende Zahl ungelesener Nachrichten.",
                "tags": [
                    "conversations"
                ],
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Erfolgreiche Antwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                },
                                "example": {
                                    "success": true,
                                    "data": {
                                        "unread_messages": 0
                                    }
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Fehlerantwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/flowsupport/conversations/{uuid}/messages": {
            "get": {
                "operationId": "flowsupport-messages-index",
                "summary": "Den Verlauf einer Unterhaltung abrufen",
                "description": "Die Nachrichten einer Unterhaltung, neueste zuerst. Kanalinterne Protokollzeilen erscheinen nicht, genauso wenig wie in der Oberfläche. Jede Nachricht nennt ihren Kanal (channel: whatsapp oder email). E-Mails tragen zusätzlich subject, from, to und cc (Adressen als Objekte mit email und name), eigene E-Mails außerdem send_status. Bei WhatsApp-Nachrichten sind diese Felder null. Den HTML-Inhalt und den Quelltext einer E-Mail liefern die beiden Endpunkte /messages/{uuid}/html und /messages/{uuid}/raw.",
                "tags": [
                    "messages"
                ],
                "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": "Seitenzahl, Standard 1.",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Erfolgreiche Antwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                },
                                "example": {
                                    "success": true,
                                    "data": [
                                        {
                                            "uuid": "2e8c1f04-77ab-4d39-9c52-0b4a6e3d15f7",
                                            "conversation_uuid": "c1b5a0d2-9e33-4f10-8a77-6b2c4d1e9f08",
                                            "from_me": false,
                                            "type": "chat",
                                            "body": "Guten Tag, ist meine Rechnung angekommen?",
                                            "revoked": false,
                                            "sender_uuid": "5d0a7e13-88f2-4c9b-a610-3e7b1d4c6f20",
                                            "sender_name": "Frau Müller",
                                            "attachments": [],
                                            "sent_at": "2026-09-20T15:02:00+02:00",
                                            "channel": "whatsapp",
                                            "subject": null,
                                            "from": null,
                                            "to": null,
                                            "cc": null,
                                            "send_status": null
                                        },
                                        {
                                            "uuid": "6a1f9d27-3c84-4e5b-b2a0-9d7e4c1f8b63",
                                            "conversation_uuid": "e4c2a7f1-5b98-4d03-8e16-2f9a0c7b3d54",
                                            "from_me": false,
                                            "type": "email",
                                            "body": "Hallo, wann kommt die Rechnung?",
                                            "revoked": false,
                                            "sender_uuid": "7b3e1c90-4d26-4a8f-9e51-0c6d2b8a4f17",
                                            "sender_name": "Klara Kundin",
                                            "attachments": [],
                                            "sent_at": "2026-09-20T14:40:00+02:00",
                                            "channel": "email",
                                            "subject": "Frage zur Rechnung",
                                            "from": {
                                                "email": "kundin@kunde.example",
                                                "name": "Klara Kundin"
                                            },
                                            "to": [
                                                {
                                                    "email": "support@firma.example",
                                                    "name": null
                                                }
                                            ],
                                            "cc": [],
                                            "send_status": null
                                        }
                                    ],
                                    "meta": {
                                        "current_page": 1,
                                        "per_page": 50,
                                        "total": 2,
                                        "last_page": 1
                                    }
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Fehlerantwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            },
            "post": {
                "operationId": "flowsupport-messages-store",
                "summary": "Eine Antwort senden",
                "description": "WhatsApp: legt eine Antwort in die Zustellwarteschlange und antwortet mit HTTP 202. Text und Dateien werden zu je einem eigenen Eintrag. E-Mail: übergibt die Antwort sofort an den Versand des E-Mail-Kontos und antwortet mit HTTP 202 und der eigenen Nachricht ({\"success\": true, \"data\": {\"channel\": \"email\", \"message_uuid\": \"...\", \"subject\": \"Re: Frage zur Rechnung\", \"send_status\": \"queued\", \"message\": {...}}}); message hat die Form eines Eintrags aus dem Verlauf. Ohne Empfänger in to geht eine Antwort an Reply-To, sonst an den Absender der neuesten Nachricht. „Allen antworten“ ergänzt die übrigen Empfänger aus An und Cc, eigene Adressen fallen immer heraus. Fehlt reply_all, gilt die Vorgabe des Postfachs. Ohne subject entsteht der Betreff aus der Unterhaltung („Re:“ bzw. „Fwd:“). Ist für das Konto kein Versand eingerichtet, antwortet der Aufruf mit HTTP 422 und dem Code sending_not_configured. Dateien kommen als multipart/form-data oder als UUIDs vorab hochgeladener Dateien; eine Adresse, die der Aufrufer wählt, wird nie abgerufen.",
                "tags": [
                    "messages"
                ],
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Erfolgreiche Antwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                },
                                "example": {
                                    "success": true,
                                    "data": {
                                        "submission_uuid": "8b4d2c70-19ae-4f63-b0d5-7c3e1a9f6042",
                                        "items": [
                                            {
                                                "uuid": "f0a6d329-5b17-41e8-9c2d-8e4b7a0f3512",
                                                "kind": "text",
                                                "position": 0,
                                                "status": "pending",
                                                "status_label": "In der Warteschlange",
                                                "body": "Guten Tag, wir kümmern uns darum.",
                                                "attachment": null,
                                                "expires_at": "2026-09-20T19:02:00+02:00"
                                            }
                                        ]
                                    }
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Fehlerantwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                },
                "requestBody": {
                    "required": false,
                    "content": {
                        "multipart/form-data": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "body": {
                                        "type": "string",
                                        "description": "WhatsApp: der Text, höchstens 5000 Zeichen, Pflicht, wenn keine Datei mitgeschickt wird. E-Mail: gleichbedeutend mit text."
                                    },
                                    "html": {
                                        "type": "string",
                                        "description": "Nur E-Mail: der Inhalt als HTML, höchstens 200.000 Zeichen. Wird vor dem Versand bereinigt (keine Skripte, keine aktiven Inhalte). Nicht zusammen mit text oder body. Eines von html, text oder body ist Pflicht, außer bei Dateien oder einer Weiterleitung."
                                    },
                                    "text": {
                                        "type": "string",
                                        "description": "Nur E-Mail: der Inhalt als reiner Text, höchstens 100.000 Zeichen. Zeilenumbrüche bleiben erhalten."
                                    },
                                    "subject": {
                                        "type": "string",
                                        "description": "Nur E-Mail: eigener Betreff, höchstens 998 Zeichen, Zeilenumbrüche werden zu Leerzeichen. Ohne Angabe gilt der abgeleitete Betreff."
                                    },
                                    "to": {
                                        "type": "array",
                                        "items": [],
                                        "description": "Nur E-Mail: zusätzliche Empfänger einer Antwort bzw. die Empfänger einer Weiterleitung (dann Pflicht). Höchstens 50 gültige Adressen."
                                    },
                                    "cc": {
                                        "type": "array",
                                        "items": [],
                                        "description": "Nur E-Mail: Empfänger in Kopie, höchstens 50 gültige Adressen."
                                    },
                                    "bcc": {
                                        "type": "array",
                                        "items": [],
                                        "description": "Nur E-Mail: Empfänger in Blindkopie, höchstens 50 gültige Adressen."
                                    },
                                    "reply_all": {
                                        "type": "boolean",
                                        "description": "Nur E-Mail: allen antworten. Ohne Angabe gilt die Vorgabe des Postfachs. Nicht zusammen mit forward_of."
                                    },
                                    "forward_of": {
                                        "type": "string",
                                        "description": "Nur E-Mail: UUID einer Nachricht derselben Unterhaltung, die weitergeleitet wird, samt ihrer Anhänge. Eine Nachricht einer anderen Unterhaltung wird mit HTTP 422 abgelehnt."
                                    },
                                    "attachments": {
                                        "type": "array",
                                        "items": {
                                            "type": "string",
                                            "format": "binary"
                                        },
                                        "description": "WhatsApp: bis zu fünf Dateien, E-Mail: bis zu zehn. Je höchstens 25 MB, nur die im Überblick genannten Dateitypen."
                                    },
                                    "upload_uuids": {
                                        "type": "array",
                                        "items": [],
                                        "description": "UUIDs vorab hochgeladener Dateien dieses Postfachs, in der Reihenfolge des Versands. Zusammen mit attachments höchstens fünf (WhatsApp) bzw. zehn (E-Mail)."
                                    },
                                    "request_id": {
                                        "type": "string",
                                        "description": "UUID zur Wiederholungssicherheit. Dieselbe Anfrage mit demselben Wert liefert die ursprüngliche Einreichung zurück, statt ein zweites Mal zu senden."
                                    }
                                }
                            }
                        }
                    }
                }
            }
        },
        "/flowsupport/conversations/{uuid}/messages/{outboundUuid}/retry": {
            "post": {
                "operationId": "flowsupport-messages-retry",
                "summary": "Eine Zustellung erneut versuchen",
                "description": "Stellt einen fehlgeschlagenen oder abgelaufenen Eintrag zurück in die Warteschlange. Ein Eintrag in einem anderen Zustand wird mit HTTP 409 abgelehnt.",
                "tags": [
                    "messages"
                ],
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    },
                    {
                        "name": "outboundUuid",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Erfolgreiche Antwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                },
                                "example": {
                                    "success": true,
                                    "message": "Erneuter Zustellversuch angestoßen.",
                                    "data": {
                                        "uuid": "f0a6d329-5b17-41e8-9c2d-8e4b7a0f3512",
                                        "status": "pending"
                                    }
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Fehlerantwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/flowsupport/conversations/{uuid}/messages/{outboundUuid}/cancel": {
            "post": {
                "operationId": "flowsupport-messages-cancel",
                "summary": "Eine Zustellung abbrechen",
                "description": "Bricht einen noch nicht abgeschickten Eintrag ab. Ein bereits zugestellter Eintrag wird mit HTTP 409 abgelehnt.",
                "tags": [
                    "messages"
                ],
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    },
                    {
                        "name": "outboundUuid",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Erfolgreiche Antwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                },
                                "example": {
                                    "success": true,
                                    "message": "Ausgehende Nachricht abgebrochen.",
                                    "data": {
                                        "uuid": "f0a6d329-5b17-41e8-9c2d-8e4b7a0f3512",
                                        "status": "cancelled"
                                    }
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Fehlerantwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/flowsupport/messages/search": {
            "get": {
                "operationId": "flowsupport-messages-search",
                "summary": "Nachrichten durchsuchen",
                "description": "Volltextsuche über die Nachrichtentexte aller erreichbaren Postfächer. Suchbegriffe unter drei Zeichen stehen nicht im Index und liefern nichts. Ist der Index nicht verfügbar, meldet die Antwort available: false statt eines Fehlers.",
                "tags": [
                    "messages"
                ],
                "parameters": [
                    {
                        "name": "q",
                        "in": "query",
                        "required": true,
                        "description": "Der Suchbegriff.",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "per_page",
                        "in": "query",
                        "required": false,
                        "description": "Treffer pro Seite, 1 bis 200, Standard 50.",
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "page",
                        "in": "query",
                        "required": false,
                        "description": "Seitenzahl, Standard 1.",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Erfolgreiche Antwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                },
                                "example": {
                                    "success": true,
                                    "available": true,
                                    "data": [
                                        {
                                            "uuid": "2e8c1f04-77ab-4d39-9c52-0b4a6e3d15f7",
                                            "conversation_uuid": "c1b5a0d2-9e33-4f10-8a77-6b2c4d1e9f08",
                                            "body": "Die Rechnung liegt bei.",
                                            "sent_at": "2026-09-20T15:02:00+02:00"
                                        }
                                    ],
                                    "meta": {
                                        "current_page": 1,
                                        "per_page": 50,
                                        "has_more": false
                                    }
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Fehlerantwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/flowsupport/messages/{uuid}/attachments/{attachmentUuid}/download": {
            "get": {
                "operationId": "flowsupport-messages-attachment-download",
                "summary": "Einen Anhang abrufen",
                "description": "Liefert eine zeitlich begrenzte Adresse für die Datei eines Anhangs, gültig für 15 Minuten. Der Anhang einer widerrufenen Nachricht antwortet mit HTTP 404.",
                "tags": [
                    "messages"
                ],
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    },
                    {
                        "name": "attachmentUuid",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    },
                    {
                        "name": "variant",
                        "in": "query",
                        "required": false,
                        "description": "original, thumb oder playback. Standard ist original; fehlt die gewünschte Fassung, wird das Original geliefert.",
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Erfolgreiche Antwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                },
                                "example": {
                                    "success": true,
                                    "data": {
                                        "url": "https://media.example.com/9d2f4c1a/attachments/bild.jpg?signature=...",
                                        "expires_in": 900,
                                        "mime_type": "image/jpeg",
                                        "filename": "bild.jpg"
                                    }
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Fehlerantwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/flowsupport/messages/{uuid}/html": {
            "get": {
                "operationId": "flowsupport-messages-html",
                "summary": "Den HTML-Inhalt einer E-Mail abrufen",
                "description": "Liefert den bereinigten HTML-Inhalt einer E-Mail als eigenständiges Dokument (Content-Type: text/html; charset=utf-8). Eine strenge Content-Security-Policy verhindert Skripte, Formulare, das Einbetten in fremde Seiten und jedes Nachladen, auch von externen Bildern. Ist der HTML-Inhalt zu groß für die Ablage, enthält das Dokument den Volltext. Eine WhatsApp-Nachricht antwortet mit HTTP 404.",
                "tags": [
                    "messages"
                ],
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Erfolgreiche Antwort",
                        "content": {
                            "application/octet-stream": {
                                "schema": {
                                    "type": "string",
                                    "format": "binary"
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Fehlerantwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/flowsupport/messages/{uuid}/raw": {
            "get": {
                "operationId": "flowsupport-messages-raw",
                "summary": "Den Quelltext einer E-Mail herunterladen",
                "description": "Lädt die Originalnachricht im Format RFC 822 herunter (Content-Type: message/rfc822, Dateiname .eml). Bei einer eigenen E-Mail ist das bis zum Abgleich mit dem Ordner „Gesendet“ die Fassung, die versendet wurde. Eine WhatsApp-Nachricht oder eine Nachricht ohne gespeicherten Quelltext antwortet mit HTTP 404.",
                "tags": [
                    "messages"
                ],
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Erfolgreiche Antwort",
                        "content": {
                            "application/octet-stream": {
                                "schema": {
                                    "type": "string",
                                    "format": "binary"
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Fehlerantwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/flowsupport/inboxes/{uuid}/uploads": {
            "post": {
                "operationId": "flowsupport-uploads-store",
                "summary": "Eine Datei vorab hochladen",
                "description": "Nimmt eine Datei als multipart/form-data entgegen und hält sie 60 Minuten für dieses Postfach bereit. Die zurückgegebene uuid wird beim Senden oder an einer Notiz unter upload_uuids genannt. Verlangt mindestens die Stufe reply. Es gelten die Grenzen des Versands: höchstens 25 MB und die im Überblick genannten Dateitypen. Dieselbe Datei erneut hochgeladen liefert denselben Eintrag.",
                "tags": [
                    "messages"
                ],
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Erfolgreiche Antwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                },
                                "example": {
                                    "success": true,
                                    "data": {
                                        "uuid": "3f9a1c52-6d0e-4b87-a2f4-1c7e9b5d0a36",
                                        "inbox_uuid": "9d2f4c1a-6b3e-4a17-8f0d-2c5b7e9a1f34",
                                        "filename": "angebot.pdf",
                                        "mime_type": "application/pdf",
                                        "size": 184223,
                                        "expired": false,
                                        "expires_at": "2026-09-20T16:02:00+02:00"
                                    }
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Fehlerantwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                },
                "requestBody": {
                    "required": true,
                    "content": {
                        "multipart/form-data": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "file": {
                                        "type": "string",
                                        "format": "binary",
                                        "description": "Die Datei."
                                    }
                                },
                                "required": [
                                    "file"
                                ]
                            }
                        }
                    }
                }
            }
        },
        "/flowsupport/inboxes/{uuid}/uploads/inline": {
            "post": {
                "operationId": "flowsupport-uploads-store-inline",
                "summary": "Eine kleine Datei als Base64 vorab hochladen",
                "description": "Wie der Upload als multipart, aber mit dem Inhalt als Base64 in einem JSON-Rumpf. Gedacht für Aufrufer ohne multipart. Der Dateityp wird am Inhalt erkannt, nicht am Namen. Die Größe ist auf rund 2,8 MB begrenzt; größere Dateien nimmt der Upload als multipart.",
                "tags": [
                    "messages"
                ],
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Erfolgreiche Antwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                },
                                "example": {
                                    "success": true,
                                    "data": {
                                        "uuid": "3f9a1c52-6d0e-4b87-a2f4-1c7e9b5d0a36",
                                        "inbox_uuid": "9d2f4c1a-6b3e-4a17-8f0d-2c5b7e9a1f34",
                                        "filename": "foto.jpg",
                                        "mime_type": "image/jpeg",
                                        "size": 48211,
                                        "expired": false,
                                        "expires_at": "2026-09-20T16:02:00+02:00"
                                    }
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Fehlerantwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                },
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "filename": {
                                        "type": "string",
                                        "description": "Der Dateiname, wie ihn der Empfänger sehen soll, höchstens 180 Zeichen."
                                    },
                                    "content_base64": {
                                        "type": "string",
                                        "description": "Der Dateiinhalt als Standard-Base64. Ein data:-Präfix und Leerraum sind erlaubt."
                                    }
                                },
                                "required": [
                                    "filename",
                                    "content_base64"
                                ]
                            }
                        }
                    }
                }
            }
        },
        "/flowsupport/uploads/{uuid}": {
            "get": {
                "operationId": "flowsupport-uploads-show",
                "summary": "Eine vorab hochgeladene Datei ansehen",
                "description": "Name, Typ, Größe und Ablauf einer vorab hochgeladenen Datei. Nur wer sie hochgeladen hat, sieht sie; alle anderen erhalten HTTP 404.",
                "tags": [
                    "messages"
                ],
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Erfolgreiche Antwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                },
                                "example": {
                                    "success": true,
                                    "data": {
                                        "uuid": "3f9a1c52-6d0e-4b87-a2f4-1c7e9b5d0a36",
                                        "filename": "angebot.pdf",
                                        "mime_type": "application/pdf",
                                        "size": 184223,
                                        "expired": false,
                                        "expires_at": "2026-09-20T16:02:00+02:00"
                                    }
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Fehlerantwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            },
            "delete": {
                "operationId": "flowsupport-uploads-destroy",
                "summary": "Eine vorab hochgeladene Datei verwerfen",
                "description": "Entfernt eine vorab hochgeladene Datei sofort, statt ihren Ablauf abzuwarten. Bereits eingereihte Sendungen und geschriebene Notizen bleiben davon unberührt.",
                "tags": [
                    "messages"
                ],
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Erfolgreiche Antwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                },
                                "example": {
                                    "success": true,
                                    "message": "Datei verworfen."
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Fehlerantwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/flowsupport/number-lookups/{uuid}": {
            "get": {
                "operationId": "flowsupport-number-lookups-show",
                "summary": "Den Stand einer Rufnummernprüfung abrufen",
                "description": "Der Stand eines Prüfvorgangs, den das Beginnen einer Unterhaltung mit HTTP 202 angelegt hat. Solange open true ist, arbeitet der Listener noch daran. Sobald eine Unterhaltung entstanden ist, nennt conversation_uuid sie.",
                "tags": [
                    "messages"
                ],
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Erfolgreiche Antwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                },
                                "example": {
                                    "success": true,
                                    "data": {
                                        "uuid": "a4f7c2b8-1d09-4e66-b3a1-7c5f2e0d9b44",
                                        "status": "resolved",
                                        "number": "+4915112345678",
                                        "open": false,
                                        "conversation_uuid": "c1b5a0d2-9e33-4f10-8a77-6b2c4d1e9f08",
                                        "error_code": null
                                    }
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Fehlerantwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/flowsupport/conversations/{uuid}/notes": {
            "get": {
                "operationId": "flowsupport-notes-index",
                "summary": "Notizen einer Unterhaltung auflisten",
                "description": "Die internen Notizen einer Unterhaltung, neueste zuerst.",
                "tags": [
                    "notes"
                ],
                "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": "Seitenzahl, Standard 1.",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Erfolgreiche Antwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                },
                                "example": {
                                    "success": true,
                                    "data": [
                                        {
                                            "uuid": "6c2f9b81-3e07-4a5d-9210-8f4b7c0e2d63",
                                            "conversation_uuid": "c1b5a0d2-9e33-4f10-8a77-6b2c4d1e9f08",
                                            "note": "Kundin ruft morgen zurück.",
                                            "author_uuid": "3f8b1c6e-2d44-4a9b-8e77-5c1a0b9d3e22",
                                            "author_name": "Anna Berger",
                                            "attachments": [],
                                            "edited_at": null,
                                            "created_at": "2026-09-20T15:10:00+02:00"
                                        }
                                    ],
                                    "meta": {
                                        "current_page": 1,
                                        "per_page": 50,
                                        "total": 1,
                                        "last_page": 1
                                    }
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Fehlerantwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            },
            "post": {
                "operationId": "flowsupport-notes-store",
                "summary": "Eine Notiz schreiben",
                "description": "Legt eine interne Notiz an, mit Text, Dateien oder beidem. Verlangt mindestens die Stufe reply auf dem Postfach. Dateien werden vorab hochgeladen und hier über ihre UUIDs genannt. Konnte eine Datei nicht gespeichert werden, steht das unter warnings.",
                "tags": [
                    "notes"
                ],
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Erfolgreiche Antwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                },
                                "example": {
                                    "success": true,
                                    "data": {
                                        "uuid": "6c2f9b81-3e07-4a5d-9210-8f4b7c0e2d63",
                                        "note": "Kundin ruft morgen zurück.",
                                        "author_name": "Anna Berger",
                                        "created_at": "2026-09-20T15:10:00+02:00"
                                    }
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Fehlerantwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                },
                "requestBody": {
                    "required": false,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "note": {
                                        "type": "string",
                                        "description": "Der Text, höchstens 5000 Zeichen. Pflicht, wenn keine Datei genannt wird."
                                    },
                                    "upload_uuids": {
                                        "type": "array",
                                        "items": [],
                                        "description": "UUIDs vorab hochgeladener Dateien dieses Postfachs, höchstens fünf. Videos sind an Notizen nicht erlaubt."
                                    }
                                }
                            }
                        }
                    }
                }
            }
        },
        "/flowsupport/conversations/{uuid}/notes/{noteUuid}": {
            "patch": {
                "operationId": "flowsupport-notes-update",
                "summary": "Eine Notiz ändern",
                "description": "Schreibt eine Notiz um. Nur die Person, die sie verfasst hat, darf das; jeder andere erhält HTTP 403.",
                "tags": [
                    "notes"
                ],
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    },
                    {
                        "name": "noteUuid",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Erfolgreiche Antwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                },
                                "example": {
                                    "success": true,
                                    "data": {
                                        "uuid": "6c2f9b81-3e07-4a5d-9210-8f4b7c0e2d63",
                                        "note": "Kundin ruft übermorgen zurück.",
                                        "edited_at": "2026-09-20T16:00:00+02:00"
                                    }
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Fehlerantwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                },
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "note": {
                                        "type": "string",
                                        "description": "Der neue Text, höchstens 5000 Zeichen."
                                    }
                                },
                                "required": [
                                    "note"
                                ]
                            }
                        }
                    }
                }
            },
            "delete": {
                "operationId": "flowsupport-notes-destroy",
                "summary": "Eine Notiz entfernen",
                "description": "Entfernt eine Notiz. Die verfassende Person darf das, der Eigentümer des Postfachs ebenfalls.",
                "tags": [
                    "notes"
                ],
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    },
                    {
                        "name": "noteUuid",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Erfolgreiche Antwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                },
                                "example": {
                                    "success": true,
                                    "message": "Notiz entfernt."
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Fehlerantwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/flowsupport/labels": {
            "get": {
                "operationId": "flowsupport-labels-index",
                "summary": "Labels auflisten",
                "description": "Die Labels aller erreichbaren Postfächer, alphabetisch.",
                "tags": [
                    "catalogs"
                ],
                "parameters": [
                    {
                        "name": "inbox_uuid",
                        "in": "query",
                        "required": false,
                        "description": "Auf ein Postfach einschränken.",
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Erfolgreiche Antwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                },
                                "example": {
                                    "success": true,
                                    "data": [
                                        {
                                            "uuid": "e9b3f7a1-40cd-4b52-9d18-6a0c2f5e7b33",
                                            "name": "Dringend",
                                            "color": 3,
                                            "inbox_uuid": "9d2f4c1a-7b3e-4f8a-9c5d-1e6a8b0c2d4f"
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Fehlerantwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            },
            "post": {
                "operationId": "flowsupport-labels-store",
                "summary": "Ein Label anlegen",
                "description": "Legt ein Label in einem Postfach an. Verlangt mindestens die Stufe reply. Ist die Synchronisierung mit WhatsApp aktiv, gilt die Obergrenze von 20 Labels je Postfach.",
                "tags": [
                    "catalogs"
                ],
                "responses": {
                    "200": {
                        "description": "Erfolgreiche Antwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                },
                                "example": {
                                    "success": true,
                                    "data": {
                                        "uuid": "e9b3f7a1-40cd-4b52-9d18-6a0c2f5e7b33",
                                        "name": "Dringend",
                                        "color": 3
                                    }
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Fehlerantwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                },
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "inbox_uuid": {
                                        "type": "string",
                                        "description": "Das Postfach, zu dem das Label gehört."
                                    },
                                    "name": {
                                        "type": "string",
                                        "description": "Der Name, höchstens 100 Zeichen."
                                    },
                                    "color": {
                                        "type": "integer",
                                        "description": "Die Farbe aus der Palette des Kanals, 0 bis 19."
                                    }
                                },
                                "required": [
                                    "inbox_uuid",
                                    "name",
                                    "color"
                                ]
                            }
                        }
                    }
                }
            }
        },
        "/flowsupport/labels/{uuid}": {
            "patch": {
                "operationId": "flowsupport-labels-update",
                "summary": "Ein Label umbenennen oder umfärben",
                "description": "Ändert Name und Farbe. Das Postfach eines Labels ist nicht änderbar.",
                "tags": [
                    "catalogs"
                ],
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Erfolgreiche Antwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                },
                                "example": {
                                    "success": true,
                                    "data": {
                                        "uuid": "e9b3f7a1-40cd-4b52-9d18-6a0c2f5e7b33",
                                        "name": "Eilig",
                                        "color": 5
                                    }
                                }
                            }
                        }
                    },
                    "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": "Der Name, höchstens 100 Zeichen."
                                    },
                                    "color": {
                                        "type": "integer",
                                        "description": "Die Farbe, 0 bis 19."
                                    }
                                },
                                "required": [
                                    "name",
                                    "color"
                                ]
                            }
                        }
                    }
                }
            },
            "delete": {
                "operationId": "flowsupport-labels-destroy",
                "summary": "Ein Label löschen",
                "description": "Löscht das Label und entfernt es von allen Unterhaltungen des Postfachs.",
                "tags": [
                    "catalogs"
                ],
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Erfolgreiche Antwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                },
                                "example": {
                                    "success": true,
                                    "message": "Label gelöscht."
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Fehlerantwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/flowsupport/templates": {
            "get": {
                "operationId": "flowsupport-templates-index",
                "summary": "Antwortvorlagen auflisten",
                "description": "Die sichtbaren Textbausteine, am häufigsten benutzte zuerst. may_edit sagt, ob dieser Schlüssel die Vorlage auch ändern darf.",
                "tags": [
                    "catalogs"
                ],
                "parameters": [
                    {
                        "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": "Seitenzahl, Standard 1.",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Erfolgreiche Antwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                },
                                "example": {
                                    "success": true,
                                    "data": [
                                        {
                                            "uuid": "1a7e5c93-6b20-4d18-8f45-9c0d3e7a2b61",
                                            "name": "Begrüßung",
                                            "content": "Guten Tag, wie können wir helfen?",
                                            "is_private": false,
                                            "inbox_uuid": null,
                                            "usage_count": 12,
                                            "author_name": "Anna Berger",
                                            "may_edit": true
                                        }
                                    ],
                                    "meta": {
                                        "current_page": 1,
                                        "per_page": 50,
                                        "total": 1,
                                        "last_page": 1
                                    }
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Fehlerantwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            },
            "post": {
                "operationId": "flowsupport-templates-store",
                "summary": "Eine Antwortvorlage anlegen",
                "description": "Legt einen Textbaustein an. Ohne inbox_uuid gilt er teamweit. Wird er an ein Postfach gebunden, verlangt das mindestens die Stufe reply auf genau diesem Postfach.",
                "tags": [
                    "catalogs"
                ],
                "responses": {
                    "200": {
                        "description": "Erfolgreiche Antwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                },
                                "example": {
                                    "success": true,
                                    "data": {
                                        "uuid": "1a7e5c93-6b20-4d18-8f45-9c0d3e7a2b61",
                                        "name": "Begrüßung",
                                        "content": "Guten Tag, wie können wir helfen?",
                                        "is_private": false,
                                        "may_edit": true
                                    }
                                }
                            }
                        }
                    },
                    "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": "Der Name, höchstens 120 Zeichen."
                                    },
                                    "content": {
                                        "type": "string",
                                        "description": "Der Text, höchstens 5000 Zeichen."
                                    },
                                    "is_private": {
                                        "type": "boolean",
                                        "description": "true hält die Vorlage bei ihrer Verfasserin. Standard ist false."
                                    },
                                    "inbox_uuid": {
                                        "type": "string",
                                        "description": "Bindet die Vorlage an ein Postfach."
                                    }
                                },
                                "required": [
                                    "name",
                                    "content"
                                ]
                            }
                        }
                    }
                }
            }
        },
        "/flowsupport/templates/{uuid}": {
            "patch": {
                "operationId": "flowsupport-templates-update",
                "summary": "Eine Antwortvorlage ändern",
                "description": "Schreibt Name, Text und Sichtbarkeit zusammen. Ändern darf sie die Person, die sie verfasst hat, und der Inhaber des Teams. Das Postfach einer Vorlage ist nicht änderbar.",
                "tags": [
                    "catalogs"
                ],
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Erfolgreiche Antwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                },
                                "example": {
                                    "success": true,
                                    "data": {
                                        "uuid": "1a7e5c93-6b20-4d18-8f45-9c0d3e7a2b61",
                                        "name": "Begrüßung kurz",
                                        "content": "Guten Tag.",
                                        "may_edit": true
                                    }
                                }
                            }
                        }
                    },
                    "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": "Der Name, höchstens 120 Zeichen."
                                    },
                                    "content": {
                                        "type": "string",
                                        "description": "Der Text, höchstens 5000 Zeichen."
                                    },
                                    "is_private": {
                                        "type": "boolean",
                                        "description": "Sichtbarkeit. Ohne Angabe bleibt der bisherige Wert."
                                    }
                                },
                                "required": [
                                    "name",
                                    "content"
                                ]
                            }
                        }
                    }
                }
            },
            "delete": {
                "operationId": "flowsupport-templates-destroy",
                "summary": "Eine Antwortvorlage löschen",
                "description": "Löscht den Textbaustein. Es gelten dieselben Rechte wie beim Ändern.",
                "tags": [
                    "catalogs"
                ],
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Erfolgreiche Antwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                },
                                "example": {
                                    "success": true,
                                    "message": "Vorlage gelöscht."
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Fehlerantwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/flowsupport/reports/open": {
            "get": {
                "operationId": "flowsupport-reports-open",
                "summary": "Offene Unterhaltungen",
                "description": "Was noch auf eine Antwort wartet: die Zahl der offenen Unterhaltungen, davon die unzugewiesenen, und die zwanzig zuletzt aktiven als Liste.",
                "tags": [
                    "reports"
                ],
                "parameters": [
                    {
                        "name": "inbox_uuid",
                        "in": "query",
                        "required": false,
                        "description": "Auf ein Postfach einschränken.",
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Erfolgreiche Antwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                },
                                "example": {
                                    "success": true,
                                    "data": {
                                        "open": 7,
                                        "unassigned": 3,
                                        "conversations": [
                                            {
                                                "uuid": "c1b5a0d2-9e33-4f10-8a77-6b2c4d1e9f08",
                                                "name": "Frau Müller",
                                                "status": "open",
                                                "last_message_at": "2026-09-20T15:02:00+02:00"
                                            }
                                        ]
                                    }
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Fehlerantwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/flowsupport/reports/assignments": {
            "get": {
                "operationId": "flowsupport-reports-assignments",
                "summary": "Zuständigkeiten",
                "description": "Wer wie viele offene Unterhaltungen trägt, und wie viele davon auf den eigenen Schlüssel entfallen. Die Zeile mit user_uuid null sammelt die unzugewiesenen.",
                "tags": [
                    "reports"
                ],
                "parameters": [
                    {
                        "name": "inbox_uuid",
                        "in": "query",
                        "required": false,
                        "description": "Auf ein Postfach einschränken.",
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Erfolgreiche Antwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                },
                                "example": {
                                    "success": true,
                                    "data": {
                                        "mine": 2,
                                        "assignments": [
                                            {
                                                "user_uuid": "3f8b1c6e-2d44-4a9b-8e77-5c1a0b9d3e22",
                                                "name": "Anna Berger",
                                                "open": 2
                                            },
                                            {
                                                "user_uuid": null,
                                                "name": null,
                                                "open": 3
                                            }
                                        ]
                                    }
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Fehlerantwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/flowsupport/reports/outbound": {
            "get": {
                "operationId": "flowsupport-reports-outbound",
                "summary": "Zustellwarteschlange",
                "description": "Die Zahl der Einträge je Zustellzustand, damit eine noch nicht zugestellte Antwort sichtbar ist, bevor eine weitere geschrieben wird. Nachrichtentexte gehören nicht dazu.",
                "tags": [
                    "reports"
                ],
                "parameters": [
                    {
                        "name": "inbox_uuid",
                        "in": "query",
                        "required": false,
                        "description": "Auf ein Postfach einschränken.",
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Erfolgreiche Antwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                },
                                "example": {
                                    "success": true,
                                    "data": {
                                        "queue": {
                                            "pending": 2,
                                            "failed": 1
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "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"
                    }
                }
            }
        }
    }
}