{
    "openapi": "3.1.0",
    "info": {
        "title": "FlowCRM API",
        "version": "v1",
        "description": "REST API zur Verwaltung von Kundendaten, Leads, Kanban-Boards und Timeline-Einträgen. Perfekt für CRM-Integrationen, Lead-Ingest-Pipelines, Automatisierungen und individuelle Kundenmanagement-Anwendungen."
    },
    "servers": [
        {
            "url": "https://api.flowsuite.one",
            "description": "FlowSuite API"
        }
    ],
    "security": [
        {
            "bearerAuth": []
        }
    ],
    "tags": [
        {
            "name": "customers",
            "description": "Kunden-Verwaltung"
        },
        {
            "name": "timeline",
            "description": "Timeline-Verwaltung"
        },
        {
            "name": "contacts",
            "description": "Kontakt-Verwaltung"
        },
        {
            "name": "projects",
            "description": "Projekt-Verwaltung"
        },
        {
            "name": "project-timeline",
            "description": "Projekt-Timeline"
        },
        {
            "name": "record-extras",
            "description": "Aufgaben, Metadaten und Dateien"
        },
        {
            "name": "tags",
            "description": "Tags"
        },
        {
            "name": "leads",
            "description": "Leads-Verwaltung"
        },
        {
            "name": "lead-relations",
            "description": "Lead-Beziehungen"
        },
        {
            "name": "lead-status",
            "description": "Lead-Status"
        },
        {
            "name": "lead-timeline",
            "description": "Lead-Timeline"
        },
        {
            "name": "lead-convert",
            "description": "Lead-Konvertierung"
        },
        {
            "name": "lead-reports",
            "description": "Lead-Berichte"
        },
        {
            "name": "lead-boards",
            "description": "Lead-Boards"
        },
        {
            "name": "flowdoc",
            "description": "FlowDocs"
        }
    ],
    "paths": {
        "/clients": {
            "get": {
                "operationId": "customers-list",
                "summary": "Kunden auflisten",
                "description": "Ruft die Kunden Ihres Teams ab, ohne weitere Angabe nur die aktiven. Mit status=archived erhalten Sie die archivierten Kunden, mit status=all beide. Jeder Kunde enthält seine Tags und Quellen. Verwenden Sie für die Adressierung einzelner Kunden ausschließlich das Feld uuid.",
                "tags": [
                    "customers"
                ],
                "parameters": [
                    {
                        "name": "status",
                        "in": "query",
                        "required": false,
                        "description": "Welche Kunden geliefert werden: <code>active</code> (Standard), <code>archived</code> oder <code>all</code> für beide. Jeder andere Wert führt zu 422",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "per_page",
                        "in": "query",
                        "required": false,
                        "description": "Einträge pro Seite (1 bis 500, Standard 500). Die Antwort enthält zusätzlich einen <code>meta</code>-Block mit <code>current_page</code>, <code>per_page</code>, <code>total</code> und <code>last_page</code>.",
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "page",
                        "in": "query",
                        "required": false,
                        "description": "Seitennummer, beginnend bei 1",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Erfolgreiche Antwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                },
                                "example": {
                                    "success": true,
                                    "count": 1,
                                    "data": [
                                        {
                                            "uuid": "123e4567-e89b-12d3-a456-426614174000",
                                            "name": "Mustermann GmbH",
                                            "email": "info@mustermann.de",
                                            "phone": "+49 123 456789",
                                            "contact_person": null,
                                            "source": null,
                                            "whmcs_client_id": null,
                                            "external_id": null,
                                            "stripe_customer_id": null,
                                            "website": "https://mustermann.de",
                                            "address_line_1": null,
                                            "address_line_2": null,
                                            "postal_code": "10115",
                                            "city": "Berlin",
                                            "state": null,
                                            "country": "DE",
                                            "currency": "EUR",
                                            "tax_id": null,
                                            "notes": null,
                                            "status": "active",
                                            "tags": [],
                                            "sources": [],
                                            "created_at": "2026-07-21T10:00:00+00:00",
                                            "updated_at": "2026-07-21T10:00:00+00:00"
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Fehlerantwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            },
            "post": {
                "operationId": "customers-create",
                "summary": "Kunde anlegen (Find-or-Create)",
                "description": "Legt einen Kunden im Team des Tokens an. Idempotent per Find-or-Create: Zuerst wird über eine gesetzte external_id gesucht, danach über die E-Mail-Adresse (teamweit, Gross-/Kleinschreibung egal). Wird ein bestehender Kunde gefunden, auch ein archivierter, gibt die Antwort diesen mit created: false zurück und synchronisiert nur die mitgesendeten tag_uuids und sources. Nur bei einer echten Neuanlage ist created: true (HTTP 201). Kollidiert die E-Mail oder external_id mit einem Kunden im Papierkorb, antwortet der Endpunkt mit HTTP 409.",
                "tags": [
                    "customers"
                ],
                "responses": {
                    "200": {
                        "description": "Erfolgreiche Antwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                },
                                "example": {
                                    "success": true,
                                    "created": true,
                                    "data": {
                                        "uuid": "8c1a5d2e-0f4b-4a9c-9d3e-2b7f0a6c1e44",
                                        "name": "Mustermann GmbH",
                                        "email": "info@mustermann.de",
                                        "phone": "+49 30 123456",
                                        "contact_person": "Erika Musterfrau",
                                        "source": "messe-2026",
                                        "whmcs_client_id": null,
                                        "external_id": "MSG-4711",
                                        "stripe_customer_id": null,
                                        "website": null,
                                        "address_line_1": "Hauptstrasse 1",
                                        "address_line_2": null,
                                        "postal_code": "10115",
                                        "city": "Berlin",
                                        "state": null,
                                        "country": "DE",
                                        "currency": "EUR",
                                        "tax_id": null,
                                        "notes": null,
                                        "status": "active",
                                        "tags": [
                                            {
                                                "uuid": "b2c1a7a6-1249-4827-b533-ef1c65c1e273",
                                                "title": "VIP",
                                                "slug": "vip",
                                                "source": "api"
                                            }
                                        ],
                                        "sources": [
                                            "messe-2026"
                                        ],
                                        "created_at": "2026-07-21T10:00:00+00:00",
                                        "updated_at": "2026-07-21T10:00:00+00:00"
                                    }
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Fehlerantwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                },
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "name": {
                                        "type": "string",
                                        "description": "Name des Kunden"
                                    },
                                    "email": {
                                        "type": "string",
                                        "description": "E-Mail-Adresse (dient als Find-or-Create-Schlüssel)"
                                    },
                                    "phone": {
                                        "type": "string",
                                        "description": "Telefonnummer"
                                    },
                                    "source": {
                                        "type": "string",
                                        "description": "Einzelne Herkunftsquelle als Freitext"
                                    },
                                    "external_id": {
                                        "type": "string",
                                        "description": "Maschinen-Kennung für den Upsert-Abgleich (hat Vorrang vor der E-Mail)"
                                    },
                                    "match_by_email": {
                                        "type": "boolean",
                                        "description": "Standard <code>true</code>. <code>false</code> überspringt zusammen mit <code>external_id</code> den Abgleich über die E-Mail und legt einen eigenen Kunden an"
                                    },
                                    "whmcs_client_id": {
                                        "type": "integer",
                                        "description": "Optionale WHMCS-Kunden-ID"
                                    },
                                    "address_line_1": {
                                        "type": "string",
                                        "description": "Adresszeile 1"
                                    },
                                    "address_line_2": {
                                        "type": "string",
                                        "description": "Adresszeile 2"
                                    },
                                    "postal_code": {
                                        "type": "string",
                                        "description": "Postleitzahl"
                                    },
                                    "city": {
                                        "type": "string",
                                        "description": "Ort"
                                    },
                                    "country": {
                                        "type": "string",
                                        "description": "Land (ISO-Code oder Name)"
                                    },
                                    "contact_person": {
                                        "type": "string",
                                        "description": "Ansprechpartner"
                                    },
                                    "tax_id": {
                                        "type": "string",
                                        "description": "Steuernummer"
                                    },
                                    "vat_id": {
                                        "type": "string",
                                        "description": "USt-IdNr. des Kunden (max. 32 Zeichen). Für E-Rechnungen mit Reverse Charge erforderlich"
                                    },
                                    "tax_treatment": {
                                        "type": "string",
                                        "description": "Steuerbehandlung: standard (mit Umsatzsteuer, Vorgabe) | reverse_charge (EU, Steuerschuld beim Empfänger) | reverse_charge_domestic (§ 13b UStG Inland) | intra_community_supply (steuerfreie innergemeinschaftliche Lieferung) | export (steuerfreie Ausfuhr) | non_taxable_abroad (nicht im Inland steuerbar) | tax_exempt (steuerfrei nach § 4 UStG). Alle Werte außer standard erzeugen Belege ohne Umsatzsteuer. reverse_charge, reverse_charge_domestic und intra_community_supply nur für Geschäftskunden (B2B). reverse_charge_domestic und tax_exempt gibt es nur nach deutschem Recht: Ein Team, für das laut Steuerprofil kein deutsches Recht gilt, kann sie nicht neu setzen (422), ein schon gespeicherter Wert bleibt erlaubt."
                                    },
                                    "billing_language": {
                                        "type": "string",
                                        "description": "Rechnungssprache des Kunden: de (Vorgabe) | en | pt. Gilt als Belegsprache neuer Rechnungen, wenn dort keine angegeben ist"
                                    },
                                    "tag_uuids": {
                                        "type": "array",
                                        "items": [],
                                        "description": "Liste team-eigener Tag-UUIDs aus <code>GET /tags</code>, die dem Kunden zugeordnet werden. Eine unbekannte, teamfremde oder gelöschte UUID führt zu HTTP 422, es wird dann nichts angelegt"
                                    },
                                    "sources": {
                                        "type": "array",
                                        "items": [],
                                        "description": "Liste von Herkunftsquellen als Freitext"
                                    },
                                    "stripe_customer_id": {
                                        "type": "string",
                                        "description": "Optionale Stripe-Kunden-ID (Präfix cus_), wird in die Zahlungszuordnung geschrieben"
                                    }
                                },
                                "required": [
                                    "name",
                                    "email"
                                ]
                            }
                        }
                    }
                }
            }
        },
        "/clients/search": {
            "get": {
                "operationId": "customers-search",
                "summary": "Kunden suchen",
                "description": "Durchsucht die Kunden Ihres Teams nach Name, E-Mail-Adresse, Telefonnummer oder Webseite. Ohne weitere Angabe werden nur aktive Kunden gefunden, status bezieht archivierte ein.",
                "tags": [
                    "customers"
                ],
                "parameters": [
                    {
                        "name": "search",
                        "in": "query",
                        "required": true,
                        "description": "Suchbegriff für die Kundensuche",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "status",
                        "in": "query",
                        "required": false,
                        "description": "Welche Kunden geliefert werden: <code>active</code> (Standard), <code>archived</code> oder <code>all</code> für beide. Jeder andere Wert führt zu 422",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "per_page",
                        "in": "query",
                        "required": false,
                        "description": "Einträge pro Seite (1 bis 500, Standard 500). Die Antwort enthält zusätzlich einen <code>meta</code>-Block mit <code>current_page</code>, <code>per_page</code>, <code>total</code> und <code>last_page</code>.",
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "page",
                        "in": "query",
                        "required": false,
                        "description": "Seitennummer, beginnend bei 1",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Erfolgreiche Antwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Fehlerantwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/clients/{uuid}": {
            "patch": {
                "operationId": "customers-update",
                "summary": "Kunde aktualisieren",
                "description": "Aktualisiert einen team-eigenen Kunden anhand seiner UUID. Nur explizit gesendete Felder werden geschrieben, ausgelassene Felder bleiben unverändert; ein Feld mit dem Wert null gilt als nicht gesendet. Archivieren und reaktivieren: Ein inaktiver Kunde heißt in FlowSuite archiviert. status: archived archiviert den Kunden und seine Projekte, status: active reaktiviert ihn; die Projekte bleiben dabei archiviert und werden einzeln reaktiviert. Ein nach DSGVO gelöschter Kunde lässt sich nicht reaktivieren (422). Breaking Change: Der frühere numerische Pfad /clients/{id} wurde ersatzlos entfernt (HTTP 404); es gilt ausschließlich der UUID-Pfad.",
                "tags": [
                    "customers"
                ],
                "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": "8c1a5d2e-0f4b-4a9c-9d3e-2b7f0a6c1e44",
                                        "name": "Mustermann GmbH",
                                        "email": "info@mustermann.de",
                                        "phone": "+49 30 999888",
                                        "contact_person": "Erika Musterfrau",
                                        "source": "messe-2026",
                                        "whmcs_client_id": null,
                                        "external_id": "MSG-4711",
                                        "stripe_customer_id": null,
                                        "website": null,
                                        "address_line_1": "Hauptstrasse 1",
                                        "address_line_2": null,
                                        "postal_code": "10115",
                                        "city": "Berlin",
                                        "state": null,
                                        "country": "DE",
                                        "currency": "EUR",
                                        "tax_id": null,
                                        "notes": null,
                                        "status": "active",
                                        "tags": [],
                                        "sources": [],
                                        "created_at": "2026-07-21T10:00:00+00:00",
                                        "updated_at": "2026-07-21T11:30:00+00:00"
                                    }
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Fehlerantwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                },
                "requestBody": {
                    "required": false,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "name": {
                                        "type": "string",
                                        "description": "Name des Kunden"
                                    },
                                    "email": {
                                        "type": "string",
                                        "description": "E-Mail-Adresse"
                                    },
                                    "contact_person": {
                                        "type": "string",
                                        "description": "Ansprechpartner"
                                    },
                                    "phone": {
                                        "type": "string",
                                        "description": "Telefonnummer"
                                    },
                                    "website": {
                                        "type": "string",
                                        "description": "Webseite"
                                    },
                                    "notes": {
                                        "type": "string",
                                        "description": "Interne Notizen zum Kunden"
                                    },
                                    "status": {
                                        "type": "string",
                                        "description": "active | archived. Archiviert oder reaktiviert den Kunden, siehe Beschreibung"
                                    },
                                    "tag_uuids": {
                                        "type": "array",
                                        "items": [],
                                        "description": "Tag-UUIDs, die dem Kunden zusätzlich zugeordnet werden. Vorhandene Tags bleiben erhalten; entfernt wird über <code>PATCH /clients/{uuid}/metadata</code> mit <code>remove_tag_uuids</code>"
                                    },
                                    "sources": {
                                        "type": "array",
                                        "items": [],
                                        "description": "Herkunftsquellen als Freitext, die dem Kunden zusätzlich zugeordnet werden"
                                    },
                                    "address_line_1": {
                                        "type": "string",
                                        "description": "Adresszeile 1"
                                    },
                                    "address_line_2": {
                                        "type": "string",
                                        "description": "Adresszeile 2"
                                    },
                                    "postal_code": {
                                        "type": "string",
                                        "description": "Postleitzahl"
                                    },
                                    "city": {
                                        "type": "string",
                                        "description": "Ort"
                                    },
                                    "state": {
                                        "type": "string",
                                        "description": "Bundesland / Region"
                                    },
                                    "country": {
                                        "type": "string",
                                        "description": "Land"
                                    },
                                    "tax_id": {
                                        "type": "string",
                                        "description": "Steuernummer"
                                    },
                                    "vat_id": {
                                        "type": "string",
                                        "description": "USt-IdNr. des Kunden (max. 32 Zeichen). Für E-Rechnungen mit Reverse Charge erforderlich"
                                    },
                                    "tax_treatment": {
                                        "type": "string",
                                        "description": "Steuerbehandlung: standard | reverse_charge | reverse_charge_domestic | intra_community_supply | export | non_taxable_abroad | tax_exempt. reverse_charge, reverse_charge_domestic und intra_community_supply nur für Geschäftskunden (B2B). reverse_charge_domestic und tax_exempt gibt es nur nach deutschem Recht: Ein Team, für das laut Steuerprofil kein deutsches Recht gilt, kann sie nicht neu setzen (422), ein schon gespeicherter Wert bleibt erlaubt."
                                    },
                                    "billing_language": {
                                        "type": "string",
                                        "description": "Rechnungssprache des Kunden: de | en | pt"
                                    }
                                }
                            }
                        }
                    }
                }
            },
            "get": {
                "operationId": "customers-show",
                "summary": "Kunde abrufen",
                "description": "Ruft einen einzelnen Kunden Ihres Teams über seine uuid ab. Unbekannte oder teamfremde Kunden führen zu 404.",
                "tags": [
                    "customers"
                ],
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Erfolgreiche Antwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Fehlerantwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            },
            "delete": {
                "operationId": "customers-delete",
                "summary": "Kunde löschen (DSGVO)",
                "description": "Löscht den Kunden im Sinne der DSGVO. Aufbewahrungspflichtige Buchhaltungsbelege bleiben erhalten. Ein auf diesem Weg gelöschter Kunde lässt sich nicht wiederherstellen. Soll ein Kunde nur aus dem aktiven Bestand verschwinden, archivieren Sie ihn stattdessen über PATCH /clients/{uuid} mit status: archived.",
                "tags": [
                    "customers"
                ],
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    },
                    {
                        "name": "include_export",
                        "in": "query",
                        "required": false,
                        "description": "Bei <code>true</code> enthält die Antwort zusätzlich den DSGVO-Datenexport des Kunden",
                        "schema": {
                            "type": "boolean"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Erfolgreiche Antwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Fehlerantwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/clients/lookup": {
            "get": {
                "operationId": "customers-lookup",
                "summary": "Kunde nachschlagen",
                "description": "Exakte Suche nach genau einem Kunden, ohne jemals einen anzulegen. Ohne weitere Angabe werden nur aktive Kunden gefunden, status bezieht archivierte ein. Mindestens einer der Parameter ist erforderlich. Bei mehreren Angaben gilt die feste Reihenfolge external_id, dann customer_number, dann Zusatzfeld (custom_field_uuid mit custom_field_value), dann email (ohne Beachtung der Groß- und Kleinschreibung). duplicate_count nennt die Zahl der Treffer, data enthält den ältesten.",
                "tags": [
                    "customers"
                ],
                "parameters": [
                    {
                        "name": "external_id",
                        "in": "query",
                        "required": false,
                        "description": "Externe Kennung des Kunden (max. 255)",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "customer_number",
                        "in": "query",
                        "required": false,
                        "description": "Kundennummer (max. 255)",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "custom_field_uuid",
                        "in": "query",
                        "required": false,
                        "description": "UUID eines Zusatzfeldes dieses Teams. Nur zusammen mit <code>custom_field_value</code>. Eine fremde UUID verhält sich wie eine unbekannte (422). Referenz- und Mehrfachauswahlfelder werden nicht unterstützt",
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    },
                    {
                        "name": "custom_field_value",
                        "in": "query",
                        "required": false,
                        "description": "Exakter Wert des Zusatzfeldes, genau so, wie er geschrieben wird (Datum als JJJJ-MM-TT, Auswahlfeld als Optionswert). Nur zusammen mit <code>custom_field_uuid</code>",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "email",
                        "in": "query",
                        "required": false,
                        "description": "E-Mail-Adresse (max. 255)",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "status",
                        "in": "query",
                        "required": false,
                        "description": "Welche Kunden geliefert werden: <code>active</code> (Standard), <code>archived</code> oder <code>all</code> für beide. Jeder andere Wert führt zu 422",
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Erfolgreiche Antwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Fehlerantwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/clients/{uuid}/restore": {
            "post": {
                "operationId": "customers-restore",
                "summary": "Kunde wiederherstellen",
                "description": "Holt einen Kunden aus dem Papierkorb zurück. Für archivierte Kunden ist dieser Endpunkt nicht gedacht, sie werden über PATCH /clients/{uuid} mit status: active reaktiviert. Ein nicht gelöschter Kunde wird unverändert zurückgegeben; die Antwort weist aus, ob eine Wiederherstellung stattgefunden hat. Nach DSGVO gelöschte Kunden sind davon ausgenommen.",
                "tags": [
                    "customers"
                ],
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Erfolgreiche Antwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Fehlerantwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/clients/{uuid}/timeline": {
            "get": {
                "operationId": "timeline-list",
                "summary": "Timeline-Einträge auflisten",
                "description": "Ruft alle Timeline-Einträge für einen bestimmten Kunden chronologisch sortiert ab. Jeder Eintrag enthält seine uuid für Ändern und Löschen.",
                "tags": [
                    "timeline"
                ],
                "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,
                                    "client": {
                                        "uuid": "5b1c8a52-7f0e-4d0b-b5a4-2f6f0e7d9c10",
                                        "name": "Muster GmbH"
                                    },
                                    "timeline": [
                                        {
                                            "uuid": "0d6f5b0e-3c1a-4a52-9a53-0c8c1f1f2a11",
                                            "type": "note",
                                            "title": "",
                                            "content": "Angebot per E-Mail verschickt.",
                                            "event_date": "2026-10-07T09:30:00.000000Z",
                                            "formatted_date": "07.10.2026 09:30",
                                            "relative_date": "vor 2 Stunden",
                                            "user": "Max Mustermann",
                                            "automatic": false,
                                            "editable": true,
                                            "created_at": "2026-10-07T09:31:12.000000Z"
                                        }
                                    ],
                                    "count": 1
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Fehlerantwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            },
            "post": {
                "operationId": "timeline-create",
                "summary": "Timeline-Eintrag erstellen",
                "description": "Erstellt einen neuen Timeline-Eintrag für den angegebenen Kunden. Erfordert wie jede Timeline-Änderung das FlowCRM-Schreibrecht, sonst HTTP 403. Existiert bereits ein eigener Eintrag mit identischem Inhalt und identischem event_date, wird kein zweiter angelegt: Die Antwort ist dann HTTP 200 mit duplicate: true und dem vorhandenen Eintrag. Ohne event_date entsteht immer ein neuer Eintrag.",
                "tags": [
                    "timeline"
                ],
                "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": "Timeline entry created successfully",
                                    "duplicate": false,
                                    "timeline_entry": {
                                        "uuid": "0d6f5b0e-3c1a-4a52-9a53-0c8c1f1f2a11",
                                        "type": "note",
                                        "title": "",
                                        "content": "Angebot per E-Mail verschickt.",
                                        "event_date": "2026-10-07T09:30:00.000000Z",
                                        "formatted_date": "07.10.2026 09:30",
                                        "relative_date": "vor 2 Stunden",
                                        "user": "Max Mustermann",
                                        "automatic": false,
                                        "editable": true,
                                        "created_at": "2026-10-07T09:31:12.000000Z"
                                    }
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Fehlerantwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                },
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "content": {
                                        "type": "string",
                                        "description": "Text des Eintrags. Ältere Clients, die nur title senden, bleiben gültig: Der Titel wird dann als Text übernommen."
                                    },
                                    "event_date": {
                                        "type": "string",
                                        "description": "Ereignisdatum (ISO 8601, Standard: jetzt)"
                                    },
                                    "title": {
                                        "type": "string",
                                        "description": "Veraltet. Neben content wird er verworfen, allein gesendet wird er als content gespeichert."
                                    }
                                },
                                "required": [
                                    "content"
                                ]
                            }
                        }
                    }
                }
            }
        },
        "/clients/{uuid}/timeline/{entry_uuid}": {
            "patch": {
                "operationId": "timeline-update",
                "summary": "Timeline-Eintrag ändern",
                "description": "Korrigiert einen eigenen, manuell verfassten Eintrag. Einträge anderer Personen und automatisch erzeugte Einträge, etwa aus einer Besprechungszuordnung, antworten mit HTTP 403 und behalten ihre Quelle.",
                "tags": [
                    "timeline"
                ],
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    },
                    {
                        "name": "entry_uuid",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Erfolgreiche Antwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Fehlerantwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                },
                "requestBody": {
                    "required": false,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "content": {
                                        "type": "string",
                                        "description": "Neuer Inhalt"
                                    },
                                    "title": {
                                        "type": "string",
                                        "description": "Veraltet. Wird angenommen und nicht gespeichert."
                                    },
                                    "type": {
                                        "type": "string",
                                        "description": "note, meeting, email, call, text, coffee, food, networking, party oder other"
                                    },
                                    "event_date": {
                                        "type": "string",
                                        "description": "Neuer Zeitpunkt"
                                    }
                                }
                            }
                        }
                    }
                }
            },
            "delete": {
                "operationId": "timeline-delete",
                "summary": "Timeline-Eintrag löschen",
                "description": "Entfernt einen eigenen, manuell verfassten Eintrag.",
                "tags": [
                    "timeline"
                ],
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    },
                    {
                        "name": "entry_uuid",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Erfolgreiche Antwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Fehlerantwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/clients/{uuid}/timeline/bulk-delete": {
            "post": {
                "operationId": "timeline-bulk-delete",
                "summary": "Mehrere Timeline-Einträge löschen",
                "description": "Entfernt bis zu 200 eigene, manuell verfasste Einträge eines Kunden in einem Aufruf. Für jeden Eintrag gilt dieselbe Regel wie beim einzelnen Löschen. Fremde, automatisch erzeugte und unbekannte Einträge brechen den Aufruf nicht ab, sondern erscheinen mit ihrem Ergebnis in results.",
                "tags": [
                    "timeline"
                ],
                "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,
                                    "deleted": 1,
                                    "skipped": 1,
                                    "results": [
                                        {
                                            "uuid": "0d6f5b0e-3c1a-4a52-9a53-0c8c1f1f2a11",
                                            "status": "deleted"
                                        },
                                        {
                                            "uuid": "7a2e4c90-91d3-4f6b-8e0a-5b3c2d1e0f99",
                                            "status": "forbidden",
                                            "message": "Nur eigene Timeline-Einträge können bearbeitet werden."
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Fehlerantwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                },
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "entry_uuids": {
                                        "type": "array",
                                        "items": [],
                                        "description": "Liste der zu löschenden Eintrags-UUIDs (1 bis 200, jede nur einmal)"
                                    }
                                },
                                "required": [
                                    "entry_uuids"
                                ]
                            }
                        }
                    }
                }
            }
        },
        "/clients/{uuid}/timeline/search": {
            "get": {
                "operationId": "timeline-search",
                "summary": "Timeline durchsuchen",
                "description": "Durchsucht die Timeline-Einträge eines Kunden nach Inhalt. Bei älteren Einträgen wird auch der frühere Titel durchsucht. Die Treffer haben dieselbe Form wie in der Liste.",
                "tags": [
                    "timeline"
                ],
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    },
                    {
                        "name": "search",
                        "in": "query",
                        "required": true,
                        "description": "Suchbegriff",
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Erfolgreiche Antwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Fehlerantwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/contacts": {
            "get": {
                "operationId": "contacts-list",
                "summary": "Kontakte auflisten",
                "description": "Listet die Kontakte auf, die der verwendete Schlüssel sehen darf: geteilte Teamkontakte und die eigenen privaten Kontakte.",
                "tags": [
                    "contacts"
                ],
                "parameters": [
                    {
                        "name": "search",
                        "in": "query",
                        "required": false,
                        "description": "Sucht in Vorname, Nachname, Firma sowie in hinterlegten E-Mail-Adressen und Rufnummern",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "client_uuid",
                        "in": "query",
                        "required": false,
                        "description": "Nur Kontakte des angegebenen Kunden",
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    },
                    {
                        "name": "status",
                        "in": "query",
                        "required": false,
                        "description": "<code>active</code> (Standard), <code>archived</code> oder <code>all</code>",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "visibility",
                        "in": "query",
                        "required": false,
                        "description": "<code>team</code> oder <code>private</code>; ohne Angabe beides",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "custom_field_uuid",
                        "in": "query",
                        "required": false,
                        "description": "UUID eines Zusatzfeldes dieses Teams. Nur zusammen mit <code>custom_field_value</code>. Eine fremde UUID verhält sich wie eine unbekannte (422). Referenz- und Mehrfachauswahlfelder werden nicht unterstützt",
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    },
                    {
                        "name": "custom_field_value",
                        "in": "query",
                        "required": false,
                        "description": "Exakter Wert des Zusatzfeldes (Datum als JJJJ-MM-TT, Auswahlfeld als Optionswert). Nur zusammen mit <code>custom_field_uuid</code>",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "per_page",
                        "in": "query",
                        "required": false,
                        "description": "Einträge pro Seite (1 bis 200, Standard 50)",
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "page",
                        "in": "query",
                        "required": false,
                        "description": "Seitennummer, beginnend bei 1",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Erfolgreiche Antwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                },
                                "example": {
                                    "success": true,
                                    "data": [
                                        {
                                            "uuid": "123e4567-e89b-12d3-a456-426614174000",
                                            "first_name": "Anna",
                                            "last_name": "Beispiel",
                                            "company": "Mustermann GmbH",
                                            "visibility": "team",
                                            "status": "active",
                                            "external_source": null,
                                            "external_id": null,
                                            "emails": [
                                                {
                                                    "uuid": "7a3f1c44-1b2d-4e8a-9c11-5d6e7f8a9b0c",
                                                    "label": "Geschäftlich",
                                                    "email": "anna@mustermann.de",
                                                    "is_primary": 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": "contacts-create",
                "summary": "Kontakt anlegen",
                "description": "Legt einen Kontakt an. Mindestens Vor- oder Nachname ist erforderlich. Wird client_uuid gesetzt, entsteht direkt ein Teamkontakt beim angegebenen Kunden. E-Mail, Quellen, Zusatzfelder und externe Kennung werden im selben Schritt geschrieben. Mit external_source und external_id ist der Aufruf wiederholbar: Ein bereits bekannter Kontakt wird unverändert mit created: false und HTTP 200 zurückgegeben, auch wenn er archiviert ist (status weist das aus), neue Kontakte antworten mit 201. Zu einem gelöschten Kontakt gehörende Kennungen führen zu 409 und werden weder wiederhergestellt noch neu angelegt. Externe Kennungen gelten nur für Teamkontakte, bei privaten Kontakten führen sie zu 422.",
                "tags": [
                    "contacts"
                ],
                "responses": {
                    "200": {
                        "description": "Erfolgreiche Antwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Fehlerantwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                },
                "requestBody": {
                    "required": false,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "first_name": {
                                        "type": "string",
                                        "description": "Vorname"
                                    },
                                    "last_name": {
                                        "type": "string",
                                        "description": "Nachname"
                                    },
                                    "salutation": {
                                        "type": "string",
                                        "description": "Herr, Frau, Divers, Firma oder keine"
                                    },
                                    "title": {
                                        "type": "string",
                                        "description": "Titel, etwa Dr. oder Prof."
                                    },
                                    "job_title": {
                                        "type": "string",
                                        "description": "Position im Unternehmen"
                                    },
                                    "company": {
                                        "type": "string",
                                        "description": "Firmenname"
                                    },
                                    "description": {
                                        "type": "string",
                                        "description": "Freitext zur Person"
                                    },
                                    "birth_day": {
                                        "type": "integer",
                                        "description": "Geburtstag, 1 bis 31"
                                    },
                                    "birth_month": {
                                        "type": "integer",
                                        "description": "Geburtsmonat, 1 bis 12"
                                    },
                                    "birth_year": {
                                        "type": "integer",
                                        "description": "Geburtsjahr"
                                    },
                                    "client_uuid": {
                                        "type": "string",
                                        "format": "uuid",
                                        "description": "Kunde, zu dem der Kontakt gehört"
                                    },
                                    "visibility": {
                                        "type": "string",
                                        "description": "<code>team</code> (Standard) oder <code>private</code>"
                                    },
                                    "email": {
                                        "type": "string",
                                        "description": "E-Mail-Adresse, wird als primäre Adresse gespeichert"
                                    },
                                    "sources": {
                                        "type": "array",
                                        "items": [],
                                        "description": "Herkunftsquellen als Freitext (max. 20)"
                                    },
                                    "custom_fields": {
                                        "type": "array",
                                        "items": [],
                                        "description": "Zusatzfelder wie bei Leads: Einträge mit <code>definition_uuid</code> oder <code>name</code> und <code>value</code>"
                                    },
                                    "external_source": {
                                        "type": "string",
                                        "description": "Herkunftssystem der externen Kennung. Nur zusammen mit <code>external_id</code>"
                                    },
                                    "external_id": {
                                        "type": "string",
                                        "description": "Kennung im Herkunftssystem, eindeutig je Team und <code>external_source</code>. Nur zusammen mit <code>external_source</code>"
                                    }
                                }
                            }
                        }
                    }
                }
            }
        },
        "/contacts/{uuid}": {
            "get": {
                "operationId": "contacts-show",
                "summary": "Kontakt abrufen",
                "description": "Liefert einen Kontakt mit allen Wertesammlungen: E-Mail-Adressen, Rufnummern, Anschriften, Links, Profile, Daten und Freifelder.",
                "tags": [
                    "contacts"
                ],
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Erfolgreiche Antwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Fehlerantwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            },
            "patch": {
                "operationId": "contacts-update",
                "summary": "Kontakt aktualisieren",
                "description": "Ändert nur die gesendeten Felder. Über status lässt sich ein Kontakt archivieren und wieder aktivieren. Vor- und Nachname dürfen nicht gleichzeitig leer werden.",
                "tags": [
                    "contacts"
                ],
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Erfolgreiche Antwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Fehlerantwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                },
                "requestBody": {
                    "required": false,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "first_name": {
                                        "type": "string",
                                        "description": "Vorname"
                                    },
                                    "last_name": {
                                        "type": "string",
                                        "description": "Nachname"
                                    },
                                    "salutation": {
                                        "type": "string",
                                        "description": "Herr, Frau, Divers, Firma oder keine"
                                    },
                                    "title": {
                                        "type": "string",
                                        "description": "Titel"
                                    },
                                    "job_title": {
                                        "type": "string",
                                        "description": "Position im Unternehmen"
                                    },
                                    "company": {
                                        "type": "string",
                                        "description": "Firmenname"
                                    },
                                    "description": {
                                        "type": "string",
                                        "description": "Freitext zur Person"
                                    },
                                    "birth_day": {
                                        "type": "integer",
                                        "description": "Geburtstag"
                                    },
                                    "birth_month": {
                                        "type": "integer",
                                        "description": "Geburtsmonat"
                                    },
                                    "birth_year": {
                                        "type": "integer",
                                        "description": "Geburtsjahr"
                                    },
                                    "status": {
                                        "type": "string",
                                        "description": "<code>active</code> oder <code>archived</code>"
                                    }
                                }
                            }
                        }
                    }
                }
            },
            "delete": {
                "operationId": "contacts-delete",
                "summary": "Kontakt löschen",
                "description": "Verschiebt den Kontakt in den Papierkorb, genau wie die Kontaktliste in der Oberfläche. Wer den Kontakt nur vorübergehend ausblenden möchte, setzt stattdessen status: archived.",
                "tags": [
                    "contacts"
                ],
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Erfolgreiche Antwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Fehlerantwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/contacts/{uuid}/client": {
            "put": {
                "operationId": "contacts-assign-client",
                "summary": "Kontakt einem Kunden zuordnen",
                "description": "Ordnet den Kontakt einem Kunden zu oder löst die Zuordnung mit client_uuid: null. Ein bisher privater Kontakt wird dabei bewusst mit dem Team geteilt. Ist beim Kunden noch kein Ansprechpartner hinterlegt, übernimmt er den Namen dieses Kontakts.",
                "tags": [
                    "contacts"
                ],
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Erfolgreiche Antwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Fehlerantwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                },
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "client_uuid": {
                                        "type": "string",
                                        "format": "uuid",
                                        "description": "Kunde, oder <code>null</code> zum Lösen der Zuordnung"
                                    }
                                },
                                "required": [
                                    "client_uuid"
                                ]
                            }
                        }
                    }
                }
            }
        },
        "/contacts/{uuid}/values/{collection}": {
            "post": {
                "operationId": "contacts-value-create",
                "summary": "Kontaktwert hinzufügen",
                "description": "Fügt genau einen Wert einer Sammlung hinzu. Mögliche Sammlungen: emails, phones, addresses, links, socials, dates, customs. Pro Sammlung kann höchstens ein Wert is_primary sein; ein neuer Hauptwert löst den bisherigen ab.",
                "tags": [
                    "contacts"
                ],
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    },
                    {
                        "name": "collection",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Erfolgreiche Antwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Fehlerantwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                },
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "label": {
                                        "type": "string",
                                        "description": "Bezeichnung, etwa Arbeit oder Privat. Bei <code>socials</code> stattdessen <code>platform</code>"
                                    },
                                    "email": {
                                        "type": "string",
                                        "description": "Nur bei <code>emails</code>"
                                    },
                                    "phone": {
                                        "type": "string",
                                        "description": "Nur bei <code>phones</code>"
                                    },
                                    "url": {
                                        "type": "string",
                                        "description": "Nur bei <code>links</code> und <code>socials</code>"
                                    },
                                    "date": {
                                        "type": "string",
                                        "description": "Nur bei <code>dates</code>, im Format JJJJ-MM-TT"
                                    },
                                    "value": {
                                        "type": "string",
                                        "description": "Nur bei <code>customs</code>"
                                    },
                                    "is_primary": {
                                        "type": "boolean",
                                        "description": "Nur bei <code>emails</code>, <code>phones</code> und <code>addresses</code>"
                                    }
                                },
                                "required": [
                                    "label"
                                ]
                            }
                        }
                    }
                }
            }
        },
        "/contacts/{uuid}/values/{collection}/{value_uuid}": {
            "patch": {
                "operationId": "contacts-value-update",
                "summary": "Kontaktwert ändern",
                "description": "Ändert genau einen Wert. Es müssen nur die tatsächlich geänderten Felder gesendet werden. Bei Anschriften werden hinterlegte Koordinaten verworfen, sobald sich ein Adressfeld ändert.",
                "tags": [
                    "contacts"
                ],
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    },
                    {
                        "name": "collection",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "value_uuid",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Erfolgreiche Antwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Fehlerantwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                },
                "requestBody": {
                    "required": false,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "label": {
                                        "type": "string",
                                        "description": "Bezeichnung des Werts"
                                    },
                                    "is_primary": {
                                        "type": "boolean",
                                        "description": "Macht den Wert zum Hauptwert der Sammlung"
                                    }
                                }
                            }
                        }
                    }
                }
            },
            "delete": {
                "operationId": "contacts-value-delete",
                "summary": "Kontaktwert entfernen",
                "description": "Entfernt genau einen Wert aus der angegebenen Sammlung.",
                "tags": [
                    "contacts"
                ],
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    },
                    {
                        "name": "collection",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "value_uuid",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Erfolgreiche Antwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Fehlerantwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/clients/{uuid}/projects": {
            "get": {
                "operationId": "projects-list",
                "summary": "Kundenprojekte auflisten",
                "description": "Listet alle Projekte des angegebenen Kunden auf, inklusive Status, Beschreibung und einem modules-Array mit aktiven Integrationen (flowcall, flowtime, flowtasks).",
                "tags": [
                    "projects"
                ],
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Erfolgreiche Antwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Fehlerantwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            },
            "post": {
                "operationId": "projects-create-for-client",
                "summary": "Projekt beim Kunden anlegen",
                "description": "Wie „Projekt anlegen\", der Kunde steht jedoch bereits im Pfad und muss nicht im Rumpf wiederholt werden.",
                "tags": [
                    "projects"
                ],
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Erfolgreiche Antwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Fehlerantwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                },
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "name": {
                                        "type": "string",
                                        "description": "Name des Projekts"
                                    },
                                    "description": {
                                        "type": "string",
                                        "description": "Beschreibung"
                                    },
                                    "notes": {
                                        "type": "string",
                                        "description": "Interne Notizen"
                                    }
                                },
                                "required": [
                                    "name"
                                ]
                            }
                        }
                    }
                }
            }
        },
        "/projects": {
            "get": {
                "operationId": "projects-list-all",
                "summary": "Alle Projekte auflisten",
                "description": "Listet die Projekte des Teams über alle Kunden hinweg.",
                "tags": [
                    "projects"
                ],
                "parameters": [
                    {
                        "name": "client_uuid",
                        "in": "query",
                        "required": false,
                        "description": "Nur Projekte des angegebenen Kunden",
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    },
                    {
                        "name": "search",
                        "in": "query",
                        "required": false,
                        "description": "Sucht im Projektnamen",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "status",
                        "in": "query",
                        "required": false,
                        "description": "<code>active</code> (Standard), <code>archived</code> oder <code>all</code>",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "per_page",
                        "in": "query",
                        "required": false,
                        "description": "Einträge pro Seite (1 bis 200, Standard 50)",
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "page",
                        "in": "query",
                        "required": false,
                        "description": "Seitennummer, beginnend bei 1",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Erfolgreiche Antwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Fehlerantwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            },
            "post": {
                "operationId": "projects-create",
                "summary": "Projekt anlegen",
                "description": "Legt ein Projekt beim angegebenen Kunden an.",
                "tags": [
                    "projects"
                ],
                "responses": {
                    "200": {
                        "description": "Erfolgreiche Antwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Fehlerantwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                },
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "name": {
                                        "type": "string",
                                        "description": "Name des Projekts"
                                    },
                                    "client_uuid": {
                                        "type": "string",
                                        "format": "uuid",
                                        "description": "Kunde, zu dem das Projekt gehört"
                                    },
                                    "description": {
                                        "type": "string",
                                        "description": "Beschreibung"
                                    },
                                    "notes": {
                                        "type": "string",
                                        "description": "Interne Notizen"
                                    },
                                    "budget_type": {
                                        "type": "string",
                                        "description": "<code>hours</code> oder <code>amount</code>"
                                    },
                                    "budget_value": {
                                        "type": "number",
                                        "description": "Budgetwert"
                                    },
                                    "budget_currency": {
                                        "type": "string",
                                        "description": "Währung als dreistelliger Code"
                                    },
                                    "budget_interval": {
                                        "type": "string",
                                        "description": "<code>total</code>, <code>monthly</code> oder <code>daily</code>"
                                    },
                                    "budget_enforcement": {
                                        "type": "string",
                                        "description": "<code>soft</code> oder <code>hard</code>"
                                    }
                                },
                                "required": [
                                    "name",
                                    "client_uuid"
                                ]
                            }
                        }
                    }
                }
            }
        },
        "/projects/{uuid}": {
            "get": {
                "operationId": "projects-show",
                "summary": "Projekt abrufen",
                "description": "Liefert ein einzelnes Projekt samt Budgetangaben und aktiven Modulen.",
                "tags": [
                    "projects"
                ],
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Erfolgreiche Antwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Fehlerantwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            },
            "patch": {
                "operationId": "projects-update",
                "summary": "Projekt aktualisieren",
                "description": "Ändert nur die gesendeten Felder. Über client_uuid lässt sich ein Projekt einem anderen Kunden desselben Teams zuordnen, über status archivieren und wieder aktivieren.",
                "tags": [
                    "projects"
                ],
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Erfolgreiche Antwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Fehlerantwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                },
                "requestBody": {
                    "required": false,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "name": {
                                        "type": "string",
                                        "description": "Name des Projekts"
                                    },
                                    "description": {
                                        "type": "string",
                                        "description": "Beschreibung"
                                    },
                                    "notes": {
                                        "type": "string",
                                        "description": "Interne Notizen"
                                    },
                                    "client_uuid": {
                                        "type": "string",
                                        "format": "uuid",
                                        "description": "Neuer Kunde des Projekts"
                                    },
                                    "status": {
                                        "type": "string",
                                        "description": "<code>active</code> oder <code>archived</code>"
                                    },
                                    "budget_type": {
                                        "type": "string",
                                        "description": "<code>hours</code> oder <code>amount</code>"
                                    },
                                    "budget_value": {
                                        "type": "number",
                                        "description": "Budgetwert"
                                    },
                                    "budget_currency": {
                                        "type": "string",
                                        "description": "Währung als dreistelliger Code"
                                    },
                                    "budget_interval": {
                                        "type": "string",
                                        "description": "<code>total</code>, <code>monthly</code> oder <code>daily</code>"
                                    },
                                    "budget_enforcement": {
                                        "type": "string",
                                        "description": "<code>soft</code> oder <code>hard</code>"
                                    }
                                }
                            }
                        }
                    }
                }
            },
            "delete": {
                "operationId": "projects-archive",
                "summary": "Projekt archivieren",
                "description": "Archiviert das Projekt. Es bleibt erhalten, weil Zeiterfassung, Rechnungen und Aufgabenboards weiter darauf verweisen.",
                "tags": [
                    "projects"
                ],
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Erfolgreiche Antwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Fehlerantwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/clients/{uuid}/projects/{project_uuid}/timeline": {
            "get": {
                "operationId": "project-timeline-list",
                "summary": "Projekt-Timeline abrufen",
                "description": "Ruft alle Timeline-Einträge für ein bestimmtes Projekt ab, analog zur Kunden-Timeline und in derselben Form, einschließlich uuid je Eintrag.",
                "tags": [
                    "project-timeline"
                ],
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    },
                    {
                        "name": "project_uuid",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Erfolgreiche Antwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Fehlerantwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            },
            "post": {
                "operationId": "project-timeline-create",
                "summary": "Projekt-Timeline-Eintrag erstellen",
                "description": "Hängt einen Eintrag an die Projekt-Timeline an. Verfasser und Team ergeben sich aus dem Schlüssel und können nicht im Rumpf gesetzt werden. Ein eigener Eintrag mit identischem Inhalt, Typ und event_date wird nicht doppelt angelegt; die Antwort ist dann HTTP 200 mit duplicate: true.",
                "tags": [
                    "project-timeline"
                ],
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    },
                    {
                        "name": "project_uuid",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Erfolgreiche Antwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Fehlerantwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                },
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "content": {
                                        "type": "string",
                                        "description": "Inhalt des Eintrags"
                                    },
                                    "title": {
                                        "type": "string",
                                        "description": "Veraltet. Wird angenommen und nicht gespeichert."
                                    },
                                    "type": {
                                        "type": "string",
                                        "description": "note (Standard), meeting, email, call, text, coffee, food, networking, party oder other"
                                    },
                                    "event_date": {
                                        "type": "string",
                                        "description": "Zeitpunkt des Ereignisses; ohne Angabe jetzt"
                                    }
                                },
                                "required": [
                                    "content"
                                ]
                            }
                        }
                    }
                }
            }
        },
        "/clients/{uuid}/projects/{project_uuid}/timeline/{entry_uuid}": {
            "patch": {
                "operationId": "project-timeline-update",
                "summary": "Projekt-Timeline-Eintrag ändern",
                "description": "Korrigiert einen eigenen, manuell verfassten Eintrag. Einträge anderer Personen und automatisch erzeugte Einträge antworten mit HTTP 403.",
                "tags": [
                    "project-timeline"
                ],
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    },
                    {
                        "name": "project_uuid",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    },
                    {
                        "name": "entry_uuid",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Erfolgreiche Antwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Fehlerantwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                },
                "requestBody": {
                    "required": false,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "content": {
                                        "type": "string",
                                        "description": "Neuer Inhalt"
                                    },
                                    "title": {
                                        "type": "string",
                                        "description": "Veraltet. Wird angenommen und nicht gespeichert."
                                    },
                                    "type": {
                                        "type": "string",
                                        "description": "Neuer Typ"
                                    },
                                    "event_date": {
                                        "type": "string",
                                        "description": "Neuer Zeitpunkt"
                                    }
                                }
                            }
                        }
                    }
                }
            },
            "delete": {
                "operationId": "project-timeline-delete",
                "summary": "Projekt-Timeline-Eintrag löschen",
                "description": "Entfernt einen eigenen, manuell verfassten Eintrag.",
                "tags": [
                    "project-timeline"
                ],
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    },
                    {
                        "name": "project_uuid",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    },
                    {
                        "name": "entry_uuid",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Erfolgreiche Antwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Fehlerantwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/clients/{uuid}/projects/{project_uuid}/timeline/bulk-delete": {
            "post": {
                "operationId": "project-timeline-bulk-delete",
                "summary": "Mehrere Projekt-Timeline-Einträge löschen",
                "description": "Entfernt bis zu 200 eigene, manuell verfasste Einträge eines Projekts in einem Aufruf. Regeln und Antwort entsprechen dem Sammel-Löschen der Kunden-Timeline.",
                "tags": [
                    "project-timeline"
                ],
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    },
                    {
                        "name": "project_uuid",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Erfolgreiche Antwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Fehlerantwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                },
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "entry_uuids": {
                                        "type": "array",
                                        "items": [],
                                        "description": "Liste der zu löschenden Eintrags-UUIDs (1 bis 200, jede nur einmal)"
                                    }
                                },
                                "required": [
                                    "entry_uuids"
                                ]
                            }
                        }
                    }
                }
            }
        },
        "/clients/{uuid}/todos": {
            "get": {
                "operationId": "clients-todos-list",
                "summary": "Aufgaben auflisten (Kunden)",
                "description": "Listet die Aufgaben des Datensatzes auf. Erledigte Aufgaben erscheinen nur mit include_completed=1.",
                "tags": [
                    "record-extras"
                ],
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    },
                    {
                        "name": "include_completed",
                        "in": "query",
                        "required": false,
                        "description": "Erledigte Aufgaben mit ausgeben",
                        "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": "Seitennummer, beginnend bei 1",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Erfolgreiche Antwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Fehlerantwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            },
            "post": {
                "operationId": "clients-todos-create",
                "summary": "Aufgabe anlegen (Kunden)",
                "description": "Legt eine Aufgabe am Datensatz an. Zuständige werden über ihre Benutzer-UUID benannt und müssen zum Team des Schlüssels gehören. Mit recurring_interval entsteht eine Serie, also eine Aufgabe, die sich nach jedem Erledigen selbst auf den nächsten Termin setzt. Eine Serie braucht ein due_date und kann nicht bereits erledigt angelegt werden; beides antwortet sonst mit HTTP 422.",
                "tags": [
                    "record-extras"
                ],
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Erfolgreiche Antwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Fehlerantwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                },
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "title": {
                                        "type": "string",
                                        "description": "Titel der Aufgabe"
                                    },
                                    "description": {
                                        "type": "string",
                                        "description": "Beschreibung"
                                    },
                                    "due_date": {
                                        "type": "string",
                                        "description": "Fälligkeit im Format JJJJ-MM-TT"
                                    },
                                    "priority": {
                                        "type": "string",
                                        "description": "<code>high</code>, <code>medium</code> (Standard) oder <code>low</code>"
                                    },
                                    "completed": {
                                        "type": "boolean",
                                        "description": "Direkt als erledigt anlegen. Nicht zusammen mit <code>recurring_interval</code>"
                                    },
                                    "recurring_interval": {
                                        "type": "string",
                                        "description": "Wiederholung der Aufgabe: <code>daily</code>, <code>every_2_days</code>, <code>weekly</code>, <code>every_2_weeks</code>, <code>monthly</code>, <code>every_2_months</code>, <code>quarterly</code>, <code>half_yearly</code> oder <code>yearly</code>. Erfordert <code>due_date</code>"
                                    },
                                    "assigned_user_uuids": {
                                        "type": "array",
                                        "items": [],
                                        "description": "Benutzer-UUIDs der Zuständigen"
                                    }
                                },
                                "required": [
                                    "title"
                                ]
                            }
                        }
                    }
                }
            }
        },
        "/clients/{uuid}/todos/{todo_uuid}": {
            "patch": {
                "operationId": "clients-todos-update",
                "summary": "Aufgabe aktualisieren (Kunden)",
                "description": "Ändert nur die gesendeten Felder. Über completed wird eine Aufgabe erledigt oder wieder geöffnet. Ein weggelassenes assigned_user_uuids lässt die Zuständigkeit unverändert, ein leeres Feld hebt sie auf. Bei einer Serie (Aufgabe mit recurring_interval) erledigt completed: true nur die aktuelle Wiederholung: Die Aufgabe bleibt offen, ihr due_date rückt um ein Intervall vor, und die erledigte Wiederholung wird als eigene, erledigte Aufgabe abgelegt. data ist immer die adressierte Aufgabe, bei einer Serie also weiterhin mit completed: false und dem neuen due_date. Die erledigte Wiederholung steht daneben im Antwortfeld completed_occurrence; in allen anderen Fällen ist es null. Wieder öffnen (completed: false) wirkt auf einfache Aufgaben und auf erledigte Wiederholungen, die Serie selbst ist nie erledigt. Das due_date einer Serie lässt sich nicht direkt ändern (HTTP 422). Ein wiederholter Aufruf würde auch die nächste Wiederholung erledigen: Wer expected_due_date mitsendet, erhält stattdessen HTTP 409 mit dem aktuellen Termin in current_due_date, sobald die Serie bereits weitergerückt ist.",
                "tags": [
                    "record-extras"
                ],
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    },
                    {
                        "name": "todo_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": "3f6c1b2a-9d4e-4c7f-8a1b-5e2d7c9f0a11",
                                        "title": "Wochenbericht senden",
                                        "description": null,
                                        "due_date": "2026-10-16",
                                        "priority": "medium",
                                        "completed": false,
                                        "completed_at": null,
                                        "recurring_interval": "weekly",
                                        "assigned_user_uuids": [],
                                        "created_at": "2026-10-01T08:00:00+00:00",
                                        "updated_at": "2026-10-09T09:30:00+00:00"
                                    },
                                    "completed_occurrence": {
                                        "uuid": "b81d4c7e-2a5f-4e3b-9c6d-1f0a8e7b6c22",
                                        "title": "Wochenbericht senden",
                                        "description": null,
                                        "due_date": "2026-10-09",
                                        "priority": "medium",
                                        "completed": true,
                                        "completed_at": "2026-10-09T09:30:00+00:00",
                                        "recurring_interval": null,
                                        "assigned_user_uuids": [],
                                        "created_at": "2026-10-09T09:30:00+00:00",
                                        "updated_at": "2026-10-09T09:30:00+00:00"
                                    }
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Fehlerantwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                },
                "requestBody": {
                    "required": false,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "title": {
                                        "type": "string",
                                        "description": "Titel der Aufgabe"
                                    },
                                    "description": {
                                        "type": "string",
                                        "description": "Beschreibung"
                                    },
                                    "due_date": {
                                        "type": "string",
                                        "description": "Fälligkeit im Format JJJJ-MM-TT"
                                    },
                                    "priority": {
                                        "type": "string",
                                        "description": "<code>high</code>, <code>medium</code> oder <code>low</code>"
                                    },
                                    "completed": {
                                        "type": "boolean",
                                        "description": "Erledigt-Zustand. Bei einer Serie erledigt <code>true</code> nur die aktuelle Wiederholung"
                                    },
                                    "recurring_interval": {
                                        "type": "string",
                                        "description": "Wiederholung der Aufgabe: <code>daily</code>, <code>every_2_days</code>, <code>weekly</code>, <code>every_2_weeks</code>, <code>monthly</code>, <code>every_2_months</code>, <code>quarterly</code>, <code>half_yearly</code> oder <code>yearly</code>. Erfordert ein <code>due_date</code>; <code>null</code> beendet die Serie"
                                    },
                                    "expected_due_date": {
                                        "type": "string",
                                        "description": "Nur beim Erledigen einer Serie: der Termin im Format JJJJ-MM-TT, den der Aufrufer gerade sieht. Weicht er vom aktuellen <code>due_date</code> ab, antwortet der Endpunkt mit HTTP 409 und erledigt nichts"
                                    },
                                    "assigned_user_uuids": {
                                        "type": "array",
                                        "items": [],
                                        "description": "Benutzer-UUIDs der Zuständigen"
                                    }
                                }
                            }
                        }
                    }
                }
            },
            "delete": {
                "operationId": "clients-todos-delete",
                "summary": "Aufgabe löschen (Kunden)",
                "description": "Entfernt die Aufgabe.",
                "tags": [
                    "record-extras"
                ],
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    },
                    {
                        "name": "todo_uuid",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Erfolgreiche Antwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Fehlerantwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/clients/{uuid}/metadata": {
            "get": {
                "operationId": "clients-metadata-show",
                "summary": "Metadaten abrufen (Kunden)",
                "description": "Liefert Tags, Quellen und Zusatzfelder des Datensatzes sowie die im Team verfügbaren Tags und Zusatzfeld-Definitionen. Eine Definition mit api_managed: true kann nur über die API beschrieben werden und ist in der Oberfläche schreibgeschützt. Zusatzfelder vom Typ reference werden mit der UUID und dem Namen des Ziels beantwortet. Jede Definition nennt ihren type: text, textarea, number, url, dropdown, multiselect, reference, date oder currency. Bei dropdown und multiselect nennt options die wählbaren Optionen mit label und value; der Wert eines multiselect-Feldes ist eine Liste von Options-Werten wie [\"gold\", \"silber\"]. Bei number und currency steht in decimals die Zahl der erlaubten Nachkommastellen, bei currency zusätzlich in currency der feste ISO-4217-Code des Feldes; für alle anderen Typen sind beide Angaben null. Werte vom Typ date haben das Format JJJJ-MM-TT, Werte vom Typ currency sind eine Dezimalzahl mit Punkt als Dezimaltrenner und nennen den Währungscode in currency.",
                "tags": [
                    "record-extras"
                ],
                "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": {
                                        "tags": [],
                                        "available_tags": [],
                                        "sources": [
                                            "messe-2026"
                                        ],
                                        "custom_field_definitions": [
                                            {
                                                "uuid": "7c1f9a3b-42d5-4e88-9a10-b6c3f2d51e04",
                                                "name": "Branche",
                                                "type": "text",
                                                "reference_source": null,
                                                "decimals": null,
                                                "currency": null,
                                                "options": []
                                            },
                                            {
                                                "uuid": "5e2a9c71-3b0d-4f86-a1c4-7d9e0b6f2a38",
                                                "name": "Vertragsende",
                                                "type": "date",
                                                "reference_source": null,
                                                "decimals": null,
                                                "currency": null,
                                                "options": []
                                            },
                                            {
                                                "uuid": "b84d1f06-9a2e-4c53-8e7b-0f3a6d5c9e12",
                                                "name": "Jahresbudget",
                                                "type": "currency",
                                                "reference_source": null,
                                                "decimals": 2,
                                                "currency": "EUR",
                                                "options": []
                                            }
                                        ],
                                        "custom_field_values": [
                                            {
                                                "definition_uuid": "5e2a9c71-3b0d-4f86-a1c4-7d9e0b6f2a38",
                                                "name": "Vertragsende",
                                                "type": "date",
                                                "value": "2026-12-31",
                                                "currency": null,
                                                "reference": null
                                            },
                                            {
                                                "definition_uuid": "b84d1f06-9a2e-4c53-8e7b-0f3a6d5c9e12",
                                                "name": "Jahresbudget",
                                                "type": "currency",
                                                "value": "12500.00",
                                                "currency": "EUR",
                                                "reference": null
                                            }
                                        ]
                                    }
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Fehlerantwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            },
            "patch": {
                "operationId": "clients-metadata-update",
                "summary": "Metadaten ändern (Kunden)",
                "description": "Ergänzt oder entfernt gezielt einzelne Tags, Quellen und Zusatzfeldwerte. Nichts wird als Ganzes ersetzt, ein leerer Wert löscht das jeweilige Zusatzfeld. Zusatzfelder werden über definition_uuid oder ihren eindeutigen name benannt; bei Referenzfeldern ist der Wert die UUID des Ziels. Felder vom Typ multiselect erwarten eine Liste von Options-Werten aus options, die die bisherige Auswahl vollständig ersetzt; eine leere Liste löscht das Feld. Felder vom Typ date erwarten ein Datum im Format JJJJ-MM-TT, Felder vom Typ currency einen Betrag als Zahl oder Zahl-String ohne Währungszeichen und ohne Tausendertrennzeichen. Der Betrag darf höchstens so viele Nachkommastellen haben, wie die Definition in decimals nennt, und wird auf diese Stellenzahl aufgefüllt gespeichert. Ein Wert, der nicht zum Typ passt, führt zu HTTP 422 mit dem Feldbezug custom_fields.{index}; es wird dann nichts geändert.",
                "tags": [
                    "record-extras"
                ],
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Erfolgreiche Antwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Fehlerantwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                },
                "requestBody": {
                    "required": false,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "add_tag_uuids": {
                                        "type": "array",
                                        "items": [],
                                        "description": "Tags, die ergänzt werden"
                                    },
                                    "remove_tag_uuids": {
                                        "type": "array",
                                        "items": [],
                                        "description": "Tags, die entfernt werden"
                                    },
                                    "add_sources": {
                                        "type": "array",
                                        "items": [],
                                        "description": "Quellen, die ergänzt werden"
                                    },
                                    "remove_sources": {
                                        "type": "array",
                                        "items": [],
                                        "description": "Quellen, die entfernt werden"
                                    },
                                    "custom_fields": {
                                        "type": "array",
                                        "items": [],
                                        "description": "Einträge aus <code>definition_uuid</code> oder <code>name</code> und <code>value</code>. Bei <code>date</code> ist <code>value</code> ein Datum wie <code>\"2026-12-31\"</code>, bei <code>currency</code> ein Betrag wie <code>12500.5</code> oder <code>\"12500.50\"</code>, bei <code>multiselect</code> eine Liste wie <code>[\"gold\", \"silber\"]</code>"
                                    }
                                }
                            }
                        }
                    }
                }
            }
        },
        "/clients/{uuid}/files": {
            "get": {
                "operationId": "clients-files-list",
                "summary": "Dateien auflisten (Kunden)",
                "description": "Listet die Dateien des Datensatzes auf. has_document_source zeigt an, ob die Datei aus Markdown erzeugt wurde und damit überarbeitet statt ersetzt werden kann.",
                "tags": [
                    "record-extras"
                ],
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    },
                    {
                        "name": "per_page",
                        "in": "query",
                        "required": false,
                        "description": "Einträge pro Seite (1 bis 200, Standard 50)",
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "page",
                        "in": "query",
                        "required": false,
                        "description": "Seitennummer, beginnend bei 1",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Erfolgreiche Antwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Fehlerantwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            },
            "post": {
                "operationId": "clients-files-upload",
                "summary": "Datei hochladen (Kunden)",
                "description": "Hängt eine hochgeladene Datei an den Datensatz. Übertragung als multipart/form-data, höchstens 50 MB. Nicht zugelassene Dateitypen antworten mit HTTP 422.",
                "tags": [
                    "record-extras"
                ],
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Erfolgreiche Antwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Fehlerantwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                },
                "requestBody": {
                    "required": true,
                    "content": {
                        "multipart/form-data": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "file": {
                                        "type": "string",
                                        "format": "binary",
                                        "description": "Die hochzuladende Datei"
                                    },
                                    "name": {
                                        "type": "string",
                                        "description": "Abweichender Dateiname"
                                    }
                                },
                                "required": [
                                    "file"
                                ]
                            }
                        }
                    }
                }
            }
        },
        "/clients/{uuid}/files/{file_uuid}/download": {
            "get": {
                "operationId": "clients-files-download",
                "summary": "Abruflink für eine Datei (Kunden)",
                "description": "Liefert einen kurzlebigen Abruflink samt Gültigkeitsdauer in Sekunden. Die Antwort enthält den Link, nicht die Bytes.",
                "tags": [
                    "record-extras"
                ],
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    },
                    {
                        "name": "file_uuid",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Erfolgreiche Antwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Fehlerantwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/clients/{uuid}/files/{file_uuid}/text": {
            "get": {
                "operationId": "clients-files-text",
                "summary": "Text einer Datei lesen (Kunden)",
                "description": "Gibt den bereits extrahierten Text der Datei in Abschnitten von 20.000 Zeichen zurück. Der Endpunkt liest nur; er stößt keine neue Extraktion an.",
                "tags": [
                    "record-extras"
                ],
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    },
                    {
                        "name": "file_uuid",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    },
                    {
                        "name": "offset",
                        "in": "query",
                        "required": false,
                        "description": "Startposition im Text; <code>next_offset</code> der Antwort führt zum nächsten Abschnitt",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Erfolgreiche Antwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Fehlerantwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/clients/{uuid}/documents": {
            "post": {
                "operationId": "clients-documents-render",
                "summary": "Dokument aus Markdown erzeugen (Kunden)",
                "description": "Erzeugt aus Markdown ein PDF oder ein Word-Dokument und legt es am Datensatz ab. Mit file_uuid wird eine bestehende, ebenfalls so erzeugte Fassung überarbeitet statt eine zweite daneben zu legen.",
                "tags": [
                    "record-extras"
                ],
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Erfolgreiche Antwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Fehlerantwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                },
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "title": {
                                        "type": "string",
                                        "description": "Titel und zugleich Dateiname ohne Endung"
                                    },
                                    "source_markdown": {
                                        "type": "string",
                                        "description": "Der Inhalt als Markdown"
                                    },
                                    "format": {
                                        "type": "string",
                                        "description": "<code>pdf</code> oder <code>docx</code>"
                                    },
                                    "file_uuid": {
                                        "type": "string",
                                        "format": "uuid",
                                        "description": "Bestehende Fassung, die ersetzt wird"
                                    }
                                },
                                "required": [
                                    "title",
                                    "source_markdown",
                                    "format"
                                ]
                            }
                        }
                    }
                }
            }
        },
        "/contacts/{uuid}/todos": {
            "get": {
                "operationId": "contacts-todos-list",
                "summary": "Aufgaben auflisten (Kontakte)",
                "description": "Listet die Aufgaben des Datensatzes auf. Erledigte Aufgaben erscheinen nur mit include_completed=1.",
                "tags": [
                    "record-extras"
                ],
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    },
                    {
                        "name": "include_completed",
                        "in": "query",
                        "required": false,
                        "description": "Erledigte Aufgaben mit ausgeben",
                        "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": "Seitennummer, beginnend bei 1",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Erfolgreiche Antwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Fehlerantwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            },
            "post": {
                "operationId": "contacts-todos-create",
                "summary": "Aufgabe anlegen (Kontakte)",
                "description": "Legt eine Aufgabe am Datensatz an. Zuständige werden über ihre Benutzer-UUID benannt und müssen zum Team des Schlüssels gehören. Mit recurring_interval entsteht eine Serie, also eine Aufgabe, die sich nach jedem Erledigen selbst auf den nächsten Termin setzt. Eine Serie braucht ein due_date und kann nicht bereits erledigt angelegt werden; beides antwortet sonst mit HTTP 422.",
                "tags": [
                    "record-extras"
                ],
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Erfolgreiche Antwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Fehlerantwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                },
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "title": {
                                        "type": "string",
                                        "description": "Titel der Aufgabe"
                                    },
                                    "description": {
                                        "type": "string",
                                        "description": "Beschreibung"
                                    },
                                    "due_date": {
                                        "type": "string",
                                        "description": "Fälligkeit im Format JJJJ-MM-TT"
                                    },
                                    "priority": {
                                        "type": "string",
                                        "description": "<code>high</code>, <code>medium</code> (Standard) oder <code>low</code>"
                                    },
                                    "completed": {
                                        "type": "boolean",
                                        "description": "Direkt als erledigt anlegen. Nicht zusammen mit <code>recurring_interval</code>"
                                    },
                                    "recurring_interval": {
                                        "type": "string",
                                        "description": "Wiederholung der Aufgabe: <code>daily</code>, <code>every_2_days</code>, <code>weekly</code>, <code>every_2_weeks</code>, <code>monthly</code>, <code>every_2_months</code>, <code>quarterly</code>, <code>half_yearly</code> oder <code>yearly</code>. Erfordert <code>due_date</code>"
                                    },
                                    "assigned_user_uuids": {
                                        "type": "array",
                                        "items": [],
                                        "description": "Benutzer-UUIDs der Zuständigen"
                                    }
                                },
                                "required": [
                                    "title"
                                ]
                            }
                        }
                    }
                }
            }
        },
        "/contacts/{uuid}/todos/{todo_uuid}": {
            "patch": {
                "operationId": "contacts-todos-update",
                "summary": "Aufgabe aktualisieren (Kontakte)",
                "description": "Ändert nur die gesendeten Felder. Über completed wird eine Aufgabe erledigt oder wieder geöffnet. Ein weggelassenes assigned_user_uuids lässt die Zuständigkeit unverändert, ein leeres Feld hebt sie auf. Bei einer Serie (Aufgabe mit recurring_interval) erledigt completed: true nur die aktuelle Wiederholung: Die Aufgabe bleibt offen, ihr due_date rückt um ein Intervall vor, und die erledigte Wiederholung wird als eigene, erledigte Aufgabe abgelegt. data ist immer die adressierte Aufgabe, bei einer Serie also weiterhin mit completed: false und dem neuen due_date. Die erledigte Wiederholung steht daneben im Antwortfeld completed_occurrence; in allen anderen Fällen ist es null. Wieder öffnen (completed: false) wirkt auf einfache Aufgaben und auf erledigte Wiederholungen, die Serie selbst ist nie erledigt. Das due_date einer Serie lässt sich nicht direkt ändern (HTTP 422). Ein wiederholter Aufruf würde auch die nächste Wiederholung erledigen: Wer expected_due_date mitsendet, erhält stattdessen HTTP 409 mit dem aktuellen Termin in current_due_date, sobald die Serie bereits weitergerückt ist.",
                "tags": [
                    "record-extras"
                ],
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    },
                    {
                        "name": "todo_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": "3f6c1b2a-9d4e-4c7f-8a1b-5e2d7c9f0a11",
                                        "title": "Wochenbericht senden",
                                        "description": null,
                                        "due_date": "2026-10-16",
                                        "priority": "medium",
                                        "completed": false,
                                        "completed_at": null,
                                        "recurring_interval": "weekly",
                                        "assigned_user_uuids": [],
                                        "created_at": "2026-10-01T08:00:00+00:00",
                                        "updated_at": "2026-10-09T09:30:00+00:00"
                                    },
                                    "completed_occurrence": {
                                        "uuid": "b81d4c7e-2a5f-4e3b-9c6d-1f0a8e7b6c22",
                                        "title": "Wochenbericht senden",
                                        "description": null,
                                        "due_date": "2026-10-09",
                                        "priority": "medium",
                                        "completed": true,
                                        "completed_at": "2026-10-09T09:30:00+00:00",
                                        "recurring_interval": null,
                                        "assigned_user_uuids": [],
                                        "created_at": "2026-10-09T09:30:00+00:00",
                                        "updated_at": "2026-10-09T09:30:00+00:00"
                                    }
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Fehlerantwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                },
                "requestBody": {
                    "required": false,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "title": {
                                        "type": "string",
                                        "description": "Titel der Aufgabe"
                                    },
                                    "description": {
                                        "type": "string",
                                        "description": "Beschreibung"
                                    },
                                    "due_date": {
                                        "type": "string",
                                        "description": "Fälligkeit im Format JJJJ-MM-TT"
                                    },
                                    "priority": {
                                        "type": "string",
                                        "description": "<code>high</code>, <code>medium</code> oder <code>low</code>"
                                    },
                                    "completed": {
                                        "type": "boolean",
                                        "description": "Erledigt-Zustand. Bei einer Serie erledigt <code>true</code> nur die aktuelle Wiederholung"
                                    },
                                    "recurring_interval": {
                                        "type": "string",
                                        "description": "Wiederholung der Aufgabe: <code>daily</code>, <code>every_2_days</code>, <code>weekly</code>, <code>every_2_weeks</code>, <code>monthly</code>, <code>every_2_months</code>, <code>quarterly</code>, <code>half_yearly</code> oder <code>yearly</code>. Erfordert ein <code>due_date</code>; <code>null</code> beendet die Serie"
                                    },
                                    "expected_due_date": {
                                        "type": "string",
                                        "description": "Nur beim Erledigen einer Serie: der Termin im Format JJJJ-MM-TT, den der Aufrufer gerade sieht. Weicht er vom aktuellen <code>due_date</code> ab, antwortet der Endpunkt mit HTTP 409 und erledigt nichts"
                                    },
                                    "assigned_user_uuids": {
                                        "type": "array",
                                        "items": [],
                                        "description": "Benutzer-UUIDs der Zuständigen"
                                    }
                                }
                            }
                        }
                    }
                }
            },
            "delete": {
                "operationId": "contacts-todos-delete",
                "summary": "Aufgabe löschen (Kontakte)",
                "description": "Entfernt die Aufgabe.",
                "tags": [
                    "record-extras"
                ],
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    },
                    {
                        "name": "todo_uuid",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Erfolgreiche Antwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Fehlerantwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/contacts/{uuid}/metadata": {
            "get": {
                "operationId": "contacts-metadata-show",
                "summary": "Metadaten abrufen (Kontakte)",
                "description": "Liefert Tags, Quellen und Zusatzfelder des Datensatzes sowie die im Team verfügbaren Tags und Zusatzfeld-Definitionen. Eine Definition mit api_managed: true kann nur über die API beschrieben werden und ist in der Oberfläche schreibgeschützt. Zusatzfelder vom Typ reference werden mit der UUID und dem Namen des Ziels beantwortet. Jede Definition nennt ihren type: text, textarea, number, url, dropdown, multiselect, reference, date oder currency. Bei dropdown und multiselect nennt options die wählbaren Optionen mit label und value; der Wert eines multiselect-Feldes ist eine Liste von Options-Werten wie [\"gold\", \"silber\"]. Bei number und currency steht in decimals die Zahl der erlaubten Nachkommastellen, bei currency zusätzlich in currency der feste ISO-4217-Code des Feldes; für alle anderen Typen sind beide Angaben null. Werte vom Typ date haben das Format JJJJ-MM-TT, Werte vom Typ currency sind eine Dezimalzahl mit Punkt als Dezimaltrenner und nennen den Währungscode in currency.",
                "tags": [
                    "record-extras"
                ],
                "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": {
                                        "tags": [],
                                        "available_tags": [],
                                        "sources": [
                                            "messe-2026"
                                        ],
                                        "custom_field_definitions": [
                                            {
                                                "uuid": "7c1f9a3b-42d5-4e88-9a10-b6c3f2d51e04",
                                                "name": "Branche",
                                                "type": "text",
                                                "reference_source": null,
                                                "decimals": null,
                                                "currency": null,
                                                "options": []
                                            },
                                            {
                                                "uuid": "5e2a9c71-3b0d-4f86-a1c4-7d9e0b6f2a38",
                                                "name": "Vertragsende",
                                                "type": "date",
                                                "reference_source": null,
                                                "decimals": null,
                                                "currency": null,
                                                "options": []
                                            },
                                            {
                                                "uuid": "b84d1f06-9a2e-4c53-8e7b-0f3a6d5c9e12",
                                                "name": "Jahresbudget",
                                                "type": "currency",
                                                "reference_source": null,
                                                "decimals": 2,
                                                "currency": "EUR",
                                                "options": []
                                            }
                                        ],
                                        "custom_field_values": [
                                            {
                                                "definition_uuid": "5e2a9c71-3b0d-4f86-a1c4-7d9e0b6f2a38",
                                                "name": "Vertragsende",
                                                "type": "date",
                                                "value": "2026-12-31",
                                                "currency": null,
                                                "reference": null
                                            },
                                            {
                                                "definition_uuid": "b84d1f06-9a2e-4c53-8e7b-0f3a6d5c9e12",
                                                "name": "Jahresbudget",
                                                "type": "currency",
                                                "value": "12500.00",
                                                "currency": "EUR",
                                                "reference": null
                                            }
                                        ]
                                    }
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Fehlerantwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            },
            "patch": {
                "operationId": "contacts-metadata-update",
                "summary": "Metadaten ändern (Kontakte)",
                "description": "Ergänzt oder entfernt gezielt einzelne Tags, Quellen und Zusatzfeldwerte. Nichts wird als Ganzes ersetzt, ein leerer Wert löscht das jeweilige Zusatzfeld. Zusatzfelder werden über definition_uuid oder ihren eindeutigen name benannt; bei Referenzfeldern ist der Wert die UUID des Ziels. Felder vom Typ multiselect erwarten eine Liste von Options-Werten aus options, die die bisherige Auswahl vollständig ersetzt; eine leere Liste löscht das Feld. Felder vom Typ date erwarten ein Datum im Format JJJJ-MM-TT, Felder vom Typ currency einen Betrag als Zahl oder Zahl-String ohne Währungszeichen und ohne Tausendertrennzeichen. Der Betrag darf höchstens so viele Nachkommastellen haben, wie die Definition in decimals nennt, und wird auf diese Stellenzahl aufgefüllt gespeichert. Ein Wert, der nicht zum Typ passt, führt zu HTTP 422 mit dem Feldbezug custom_fields.{index}; es wird dann nichts geändert.",
                "tags": [
                    "record-extras"
                ],
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Erfolgreiche Antwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Fehlerantwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                },
                "requestBody": {
                    "required": false,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "add_tag_uuids": {
                                        "type": "array",
                                        "items": [],
                                        "description": "Tags, die ergänzt werden"
                                    },
                                    "remove_tag_uuids": {
                                        "type": "array",
                                        "items": [],
                                        "description": "Tags, die entfernt werden"
                                    },
                                    "add_sources": {
                                        "type": "array",
                                        "items": [],
                                        "description": "Quellen, die ergänzt werden"
                                    },
                                    "remove_sources": {
                                        "type": "array",
                                        "items": [],
                                        "description": "Quellen, die entfernt werden"
                                    },
                                    "custom_fields": {
                                        "type": "array",
                                        "items": [],
                                        "description": "Einträge aus <code>definition_uuid</code> oder <code>name</code> und <code>value</code>. Bei <code>date</code> ist <code>value</code> ein Datum wie <code>\"2026-12-31\"</code>, bei <code>currency</code> ein Betrag wie <code>12500.5</code> oder <code>\"12500.50\"</code>, bei <code>multiselect</code> eine Liste wie <code>[\"gold\", \"silber\"]</code>"
                                    }
                                }
                            }
                        }
                    }
                }
            }
        },
        "/contacts/{uuid}/files": {
            "get": {
                "operationId": "contacts-files-list",
                "summary": "Dateien auflisten (Kontakte)",
                "description": "Listet die Dateien des Datensatzes auf. has_document_source zeigt an, ob die Datei aus Markdown erzeugt wurde und damit überarbeitet statt ersetzt werden kann.",
                "tags": [
                    "record-extras"
                ],
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    },
                    {
                        "name": "per_page",
                        "in": "query",
                        "required": false,
                        "description": "Einträge pro Seite (1 bis 200, Standard 50)",
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "page",
                        "in": "query",
                        "required": false,
                        "description": "Seitennummer, beginnend bei 1",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Erfolgreiche Antwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Fehlerantwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            },
            "post": {
                "operationId": "contacts-files-upload",
                "summary": "Datei hochladen (Kontakte)",
                "description": "Hängt eine hochgeladene Datei an den Datensatz. Übertragung als multipart/form-data, höchstens 50 MB. Nicht zugelassene Dateitypen antworten mit HTTP 422.",
                "tags": [
                    "record-extras"
                ],
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Erfolgreiche Antwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Fehlerantwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                },
                "requestBody": {
                    "required": true,
                    "content": {
                        "multipart/form-data": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "file": {
                                        "type": "string",
                                        "format": "binary",
                                        "description": "Die hochzuladende Datei"
                                    },
                                    "name": {
                                        "type": "string",
                                        "description": "Abweichender Dateiname"
                                    }
                                },
                                "required": [
                                    "file"
                                ]
                            }
                        }
                    }
                }
            }
        },
        "/contacts/{uuid}/files/{file_uuid}/download": {
            "get": {
                "operationId": "contacts-files-download",
                "summary": "Abruflink für eine Datei (Kontakte)",
                "description": "Liefert einen kurzlebigen Abruflink samt Gültigkeitsdauer in Sekunden. Die Antwort enthält den Link, nicht die Bytes.",
                "tags": [
                    "record-extras"
                ],
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    },
                    {
                        "name": "file_uuid",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Erfolgreiche Antwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Fehlerantwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/contacts/{uuid}/files/{file_uuid}/text": {
            "get": {
                "operationId": "contacts-files-text",
                "summary": "Text einer Datei lesen (Kontakte)",
                "description": "Gibt den bereits extrahierten Text der Datei in Abschnitten von 20.000 Zeichen zurück. Der Endpunkt liest nur; er stößt keine neue Extraktion an.",
                "tags": [
                    "record-extras"
                ],
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    },
                    {
                        "name": "file_uuid",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    },
                    {
                        "name": "offset",
                        "in": "query",
                        "required": false,
                        "description": "Startposition im Text; <code>next_offset</code> der Antwort führt zum nächsten Abschnitt",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Erfolgreiche Antwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Fehlerantwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/contacts/{uuid}/documents": {
            "post": {
                "operationId": "contacts-documents-render",
                "summary": "Dokument aus Markdown erzeugen (Kontakte)",
                "description": "Erzeugt aus Markdown ein PDF oder ein Word-Dokument und legt es am Datensatz ab. Mit file_uuid wird eine bestehende, ebenfalls so erzeugte Fassung überarbeitet statt eine zweite daneben zu legen.",
                "tags": [
                    "record-extras"
                ],
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Erfolgreiche Antwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Fehlerantwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                },
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "title": {
                                        "type": "string",
                                        "description": "Titel und zugleich Dateiname ohne Endung"
                                    },
                                    "source_markdown": {
                                        "type": "string",
                                        "description": "Der Inhalt als Markdown"
                                    },
                                    "format": {
                                        "type": "string",
                                        "description": "<code>pdf</code> oder <code>docx</code>"
                                    },
                                    "file_uuid": {
                                        "type": "string",
                                        "format": "uuid",
                                        "description": "Bestehende Fassung, die ersetzt wird"
                                    }
                                },
                                "required": [
                                    "title",
                                    "source_markdown",
                                    "format"
                                ]
                            }
                        }
                    }
                }
            }
        },
        "/projects/{uuid}/todos": {
            "get": {
                "operationId": "projects-todos-list",
                "summary": "Aufgaben auflisten (Projekte)",
                "description": "Listet die Aufgaben des Datensatzes auf. Erledigte Aufgaben erscheinen nur mit include_completed=1.",
                "tags": [
                    "record-extras"
                ],
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    },
                    {
                        "name": "include_completed",
                        "in": "query",
                        "required": false,
                        "description": "Erledigte Aufgaben mit ausgeben",
                        "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": "Seitennummer, beginnend bei 1",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Erfolgreiche Antwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Fehlerantwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            },
            "post": {
                "operationId": "projects-todos-create",
                "summary": "Aufgabe anlegen (Projekte)",
                "description": "Legt eine Aufgabe am Datensatz an. Zuständige werden über ihre Benutzer-UUID benannt und müssen zum Team des Schlüssels gehören. Mit recurring_interval entsteht eine Serie, also eine Aufgabe, die sich nach jedem Erledigen selbst auf den nächsten Termin setzt. Eine Serie braucht ein due_date und kann nicht bereits erledigt angelegt werden; beides antwortet sonst mit HTTP 422.",
                "tags": [
                    "record-extras"
                ],
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Erfolgreiche Antwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Fehlerantwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                },
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "title": {
                                        "type": "string",
                                        "description": "Titel der Aufgabe"
                                    },
                                    "description": {
                                        "type": "string",
                                        "description": "Beschreibung"
                                    },
                                    "due_date": {
                                        "type": "string",
                                        "description": "Fälligkeit im Format JJJJ-MM-TT"
                                    },
                                    "priority": {
                                        "type": "string",
                                        "description": "<code>high</code>, <code>medium</code> (Standard) oder <code>low</code>"
                                    },
                                    "completed": {
                                        "type": "boolean",
                                        "description": "Direkt als erledigt anlegen. Nicht zusammen mit <code>recurring_interval</code>"
                                    },
                                    "recurring_interval": {
                                        "type": "string",
                                        "description": "Wiederholung der Aufgabe: <code>daily</code>, <code>every_2_days</code>, <code>weekly</code>, <code>every_2_weeks</code>, <code>monthly</code>, <code>every_2_months</code>, <code>quarterly</code>, <code>half_yearly</code> oder <code>yearly</code>. Erfordert <code>due_date</code>"
                                    },
                                    "assigned_user_uuids": {
                                        "type": "array",
                                        "items": [],
                                        "description": "Benutzer-UUIDs der Zuständigen"
                                    }
                                },
                                "required": [
                                    "title"
                                ]
                            }
                        }
                    }
                }
            }
        },
        "/projects/{uuid}/todos/{todo_uuid}": {
            "patch": {
                "operationId": "projects-todos-update",
                "summary": "Aufgabe aktualisieren (Projekte)",
                "description": "Ändert nur die gesendeten Felder. Über completed wird eine Aufgabe erledigt oder wieder geöffnet. Ein weggelassenes assigned_user_uuids lässt die Zuständigkeit unverändert, ein leeres Feld hebt sie auf. Bei einer Serie (Aufgabe mit recurring_interval) erledigt completed: true nur die aktuelle Wiederholung: Die Aufgabe bleibt offen, ihr due_date rückt um ein Intervall vor, und die erledigte Wiederholung wird als eigene, erledigte Aufgabe abgelegt. data ist immer die adressierte Aufgabe, bei einer Serie also weiterhin mit completed: false und dem neuen due_date. Die erledigte Wiederholung steht daneben im Antwortfeld completed_occurrence; in allen anderen Fällen ist es null. Wieder öffnen (completed: false) wirkt auf einfache Aufgaben und auf erledigte Wiederholungen, die Serie selbst ist nie erledigt. Das due_date einer Serie lässt sich nicht direkt ändern (HTTP 422). Ein wiederholter Aufruf würde auch die nächste Wiederholung erledigen: Wer expected_due_date mitsendet, erhält stattdessen HTTP 409 mit dem aktuellen Termin in current_due_date, sobald die Serie bereits weitergerückt ist.",
                "tags": [
                    "record-extras"
                ],
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    },
                    {
                        "name": "todo_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": "3f6c1b2a-9d4e-4c7f-8a1b-5e2d7c9f0a11",
                                        "title": "Wochenbericht senden",
                                        "description": null,
                                        "due_date": "2026-10-16",
                                        "priority": "medium",
                                        "completed": false,
                                        "completed_at": null,
                                        "recurring_interval": "weekly",
                                        "assigned_user_uuids": [],
                                        "created_at": "2026-10-01T08:00:00+00:00",
                                        "updated_at": "2026-10-09T09:30:00+00:00"
                                    },
                                    "completed_occurrence": {
                                        "uuid": "b81d4c7e-2a5f-4e3b-9c6d-1f0a8e7b6c22",
                                        "title": "Wochenbericht senden",
                                        "description": null,
                                        "due_date": "2026-10-09",
                                        "priority": "medium",
                                        "completed": true,
                                        "completed_at": "2026-10-09T09:30:00+00:00",
                                        "recurring_interval": null,
                                        "assigned_user_uuids": [],
                                        "created_at": "2026-10-09T09:30:00+00:00",
                                        "updated_at": "2026-10-09T09:30:00+00:00"
                                    }
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Fehlerantwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                },
                "requestBody": {
                    "required": false,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "title": {
                                        "type": "string",
                                        "description": "Titel der Aufgabe"
                                    },
                                    "description": {
                                        "type": "string",
                                        "description": "Beschreibung"
                                    },
                                    "due_date": {
                                        "type": "string",
                                        "description": "Fälligkeit im Format JJJJ-MM-TT"
                                    },
                                    "priority": {
                                        "type": "string",
                                        "description": "<code>high</code>, <code>medium</code> oder <code>low</code>"
                                    },
                                    "completed": {
                                        "type": "boolean",
                                        "description": "Erledigt-Zustand. Bei einer Serie erledigt <code>true</code> nur die aktuelle Wiederholung"
                                    },
                                    "recurring_interval": {
                                        "type": "string",
                                        "description": "Wiederholung der Aufgabe: <code>daily</code>, <code>every_2_days</code>, <code>weekly</code>, <code>every_2_weeks</code>, <code>monthly</code>, <code>every_2_months</code>, <code>quarterly</code>, <code>half_yearly</code> oder <code>yearly</code>. Erfordert ein <code>due_date</code>; <code>null</code> beendet die Serie"
                                    },
                                    "expected_due_date": {
                                        "type": "string",
                                        "description": "Nur beim Erledigen einer Serie: der Termin im Format JJJJ-MM-TT, den der Aufrufer gerade sieht. Weicht er vom aktuellen <code>due_date</code> ab, antwortet der Endpunkt mit HTTP 409 und erledigt nichts"
                                    },
                                    "assigned_user_uuids": {
                                        "type": "array",
                                        "items": [],
                                        "description": "Benutzer-UUIDs der Zuständigen"
                                    }
                                }
                            }
                        }
                    }
                }
            },
            "delete": {
                "operationId": "projects-todos-delete",
                "summary": "Aufgabe löschen (Projekte)",
                "description": "Entfernt die Aufgabe.",
                "tags": [
                    "record-extras"
                ],
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    },
                    {
                        "name": "todo_uuid",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Erfolgreiche Antwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Fehlerantwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/projects/{uuid}/metadata": {
            "get": {
                "operationId": "projects-metadata-show",
                "summary": "Metadaten abrufen (Projekte)",
                "description": "Liefert Tags, Quellen und Zusatzfelder des Datensatzes sowie die im Team verfügbaren Tags und Zusatzfeld-Definitionen. Eine Definition mit api_managed: true kann nur über die API beschrieben werden und ist in der Oberfläche schreibgeschützt. Zusatzfelder vom Typ reference werden mit der UUID und dem Namen des Ziels beantwortet. Jede Definition nennt ihren type: text, textarea, number, url, dropdown, multiselect, reference, date oder currency. Bei dropdown und multiselect nennt options die wählbaren Optionen mit label und value; der Wert eines multiselect-Feldes ist eine Liste von Options-Werten wie [\"gold\", \"silber\"]. Bei number und currency steht in decimals die Zahl der erlaubten Nachkommastellen, bei currency zusätzlich in currency der feste ISO-4217-Code des Feldes; für alle anderen Typen sind beide Angaben null. Werte vom Typ date haben das Format JJJJ-MM-TT, Werte vom Typ currency sind eine Dezimalzahl mit Punkt als Dezimaltrenner und nennen den Währungscode in currency.",
                "tags": [
                    "record-extras"
                ],
                "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": {
                                        "tags": [],
                                        "available_tags": [],
                                        "sources": [
                                            "messe-2026"
                                        ],
                                        "custom_field_definitions": [
                                            {
                                                "uuid": "7c1f9a3b-42d5-4e88-9a10-b6c3f2d51e04",
                                                "name": "Branche",
                                                "type": "text",
                                                "reference_source": null,
                                                "decimals": null,
                                                "currency": null,
                                                "options": []
                                            },
                                            {
                                                "uuid": "5e2a9c71-3b0d-4f86-a1c4-7d9e0b6f2a38",
                                                "name": "Vertragsende",
                                                "type": "date",
                                                "reference_source": null,
                                                "decimals": null,
                                                "currency": null,
                                                "options": []
                                            },
                                            {
                                                "uuid": "b84d1f06-9a2e-4c53-8e7b-0f3a6d5c9e12",
                                                "name": "Jahresbudget",
                                                "type": "currency",
                                                "reference_source": null,
                                                "decimals": 2,
                                                "currency": "EUR",
                                                "options": []
                                            }
                                        ],
                                        "custom_field_values": [
                                            {
                                                "definition_uuid": "5e2a9c71-3b0d-4f86-a1c4-7d9e0b6f2a38",
                                                "name": "Vertragsende",
                                                "type": "date",
                                                "value": "2026-12-31",
                                                "currency": null,
                                                "reference": null
                                            },
                                            {
                                                "definition_uuid": "b84d1f06-9a2e-4c53-8e7b-0f3a6d5c9e12",
                                                "name": "Jahresbudget",
                                                "type": "currency",
                                                "value": "12500.00",
                                                "currency": "EUR",
                                                "reference": null
                                            }
                                        ]
                                    }
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Fehlerantwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            },
            "patch": {
                "operationId": "projects-metadata-update",
                "summary": "Metadaten ändern (Projekte)",
                "description": "Ergänzt oder entfernt gezielt einzelne Tags, Quellen und Zusatzfeldwerte. Nichts wird als Ganzes ersetzt, ein leerer Wert löscht das jeweilige Zusatzfeld. Zusatzfelder werden über definition_uuid oder ihren eindeutigen name benannt; bei Referenzfeldern ist der Wert die UUID des Ziels. Felder vom Typ multiselect erwarten eine Liste von Options-Werten aus options, die die bisherige Auswahl vollständig ersetzt; eine leere Liste löscht das Feld. Felder vom Typ date erwarten ein Datum im Format JJJJ-MM-TT, Felder vom Typ currency einen Betrag als Zahl oder Zahl-String ohne Währungszeichen und ohne Tausendertrennzeichen. Der Betrag darf höchstens so viele Nachkommastellen haben, wie die Definition in decimals nennt, und wird auf diese Stellenzahl aufgefüllt gespeichert. Ein Wert, der nicht zum Typ passt, führt zu HTTP 422 mit dem Feldbezug custom_fields.{index}; es wird dann nichts geändert.",
                "tags": [
                    "record-extras"
                ],
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Erfolgreiche Antwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Fehlerantwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                },
                "requestBody": {
                    "required": false,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "add_tag_uuids": {
                                        "type": "array",
                                        "items": [],
                                        "description": "Tags, die ergänzt werden"
                                    },
                                    "remove_tag_uuids": {
                                        "type": "array",
                                        "items": [],
                                        "description": "Tags, die entfernt werden"
                                    },
                                    "add_sources": {
                                        "type": "array",
                                        "items": [],
                                        "description": "Quellen, die ergänzt werden"
                                    },
                                    "remove_sources": {
                                        "type": "array",
                                        "items": [],
                                        "description": "Quellen, die entfernt werden"
                                    },
                                    "custom_fields": {
                                        "type": "array",
                                        "items": [],
                                        "description": "Einträge aus <code>definition_uuid</code> oder <code>name</code> und <code>value</code>. Bei <code>date</code> ist <code>value</code> ein Datum wie <code>\"2026-12-31\"</code>, bei <code>currency</code> ein Betrag wie <code>12500.5</code> oder <code>\"12500.50\"</code>, bei <code>multiselect</code> eine Liste wie <code>[\"gold\", \"silber\"]</code>"
                                    }
                                }
                            }
                        }
                    }
                }
            }
        },
        "/projects/{uuid}/files": {
            "get": {
                "operationId": "projects-files-list",
                "summary": "Dateien auflisten (Projekte)",
                "description": "Listet die Dateien des Datensatzes auf. has_document_source zeigt an, ob die Datei aus Markdown erzeugt wurde und damit überarbeitet statt ersetzt werden kann.",
                "tags": [
                    "record-extras"
                ],
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    },
                    {
                        "name": "per_page",
                        "in": "query",
                        "required": false,
                        "description": "Einträge pro Seite (1 bis 200, Standard 50)",
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "page",
                        "in": "query",
                        "required": false,
                        "description": "Seitennummer, beginnend bei 1",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Erfolgreiche Antwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Fehlerantwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            },
            "post": {
                "operationId": "projects-files-upload",
                "summary": "Datei hochladen (Projekte)",
                "description": "Hängt eine hochgeladene Datei an den Datensatz. Übertragung als multipart/form-data, höchstens 50 MB. Nicht zugelassene Dateitypen antworten mit HTTP 422.",
                "tags": [
                    "record-extras"
                ],
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Erfolgreiche Antwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Fehlerantwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                },
                "requestBody": {
                    "required": true,
                    "content": {
                        "multipart/form-data": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "file": {
                                        "type": "string",
                                        "format": "binary",
                                        "description": "Die hochzuladende Datei"
                                    },
                                    "name": {
                                        "type": "string",
                                        "description": "Abweichender Dateiname"
                                    }
                                },
                                "required": [
                                    "file"
                                ]
                            }
                        }
                    }
                }
            }
        },
        "/projects/{uuid}/files/{file_uuid}/download": {
            "get": {
                "operationId": "projects-files-download",
                "summary": "Abruflink für eine Datei (Projekte)",
                "description": "Liefert einen kurzlebigen Abruflink samt Gültigkeitsdauer in Sekunden. Die Antwort enthält den Link, nicht die Bytes.",
                "tags": [
                    "record-extras"
                ],
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    },
                    {
                        "name": "file_uuid",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Erfolgreiche Antwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Fehlerantwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/projects/{uuid}/files/{file_uuid}/text": {
            "get": {
                "operationId": "projects-files-text",
                "summary": "Text einer Datei lesen (Projekte)",
                "description": "Gibt den bereits extrahierten Text der Datei in Abschnitten von 20.000 Zeichen zurück. Der Endpunkt liest nur; er stößt keine neue Extraktion an.",
                "tags": [
                    "record-extras"
                ],
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    },
                    {
                        "name": "file_uuid",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    },
                    {
                        "name": "offset",
                        "in": "query",
                        "required": false,
                        "description": "Startposition im Text; <code>next_offset</code> der Antwort führt zum nächsten Abschnitt",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Erfolgreiche Antwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Fehlerantwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/projects/{uuid}/documents": {
            "post": {
                "operationId": "projects-documents-render",
                "summary": "Dokument aus Markdown erzeugen (Projekte)",
                "description": "Erzeugt aus Markdown ein PDF oder ein Word-Dokument und legt es am Datensatz ab. Mit file_uuid wird eine bestehende, ebenfalls so erzeugte Fassung überarbeitet statt eine zweite daneben zu legen.",
                "tags": [
                    "record-extras"
                ],
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Erfolgreiche Antwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Fehlerantwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                },
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "title": {
                                        "type": "string",
                                        "description": "Titel und zugleich Dateiname ohne Endung"
                                    },
                                    "source_markdown": {
                                        "type": "string",
                                        "description": "Der Inhalt als Markdown"
                                    },
                                    "format": {
                                        "type": "string",
                                        "description": "<code>pdf</code> oder <code>docx</code>"
                                    },
                                    "file_uuid": {
                                        "type": "string",
                                        "format": "uuid",
                                        "description": "Bestehende Fassung, die ersetzt wird"
                                    }
                                },
                                "required": [
                                    "title",
                                    "source_markdown",
                                    "format"
                                ]
                            }
                        }
                    }
                }
            }
        },
        "/tags": {
            "get": {
                "operationId": "tags-list",
                "summary": "Tags auflisten",
                "description": "Listet die Tags Ihres Teams alphabetisch nach Titel. Die Liste dient dazu, die uuid eines Tags zu ermitteln, bevor es an einem Kunden, Kontakt oder Lead gesetzt wird. Es genügt der FlowCRM-Zugriff; FlowSend wird dafür nicht benötigt.",
                "tags": [
                    "tags"
                ],
                "parameters": [
                    {
                        "name": "search",
                        "in": "query",
                        "required": false,
                        "description": "Liefert nur Tags, deren Titel den Text enthält",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "per_page",
                        "in": "query",
                        "required": false,
                        "description": "Einträge pro Seite (1 bis 200, Standard 50)",
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "page",
                        "in": "query",
                        "required": false,
                        "description": "Seitennummer, beginnend bei 1",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Erfolgreiche Antwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                },
                                "example": {
                                    "success": true,
                                    "data": [
                                        {
                                            "uuid": "b2c1a7a6-1249-4827-b533-ef1c65c1e273",
                                            "title": "VIP",
                                            "slug": "vip",
                                            "description": null
                                        }
                                    ],
                                    "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": "tags-create",
                "summary": "Tag anlegen (Find-or-Create)",
                "description": "Legt ein Tag für Ihr Team an. Der Aufruf lässt sich gefahrlos wiederholen: Gibt es bereits ein Tag mit diesem Namen, wird es mit created: false und HTTP 200 zurückgegeben; Groß- und Kleinschreibung sowie Sonderzeichen spielen beim Vergleich keine Rolle. Ein zuvor gelöschtes Tag gleichen Namens wird zurückgeholt (restored: true, HTTP 201), ohne seine früheren Zuordnungen. Eine echte Neuanlage antwortet mit created: true und HTTP 201. Erfordert das FlowCRM-Schreibrecht. Umbenennen und Löschen von Tags bleibt der FlowSend-API vorbehalten.",
                "tags": [
                    "tags"
                ],
                "responses": {
                    "200": {
                        "description": "Erfolgreiche Antwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                },
                                "example": {
                                    "success": true,
                                    "created": true,
                                    "restored": false,
                                    "data": {
                                        "uuid": "b2c1a7a6-1249-4827-b533-ef1c65c1e273",
                                        "title": "VIP",
                                        "slug": "vip",
                                        "description": null
                                    }
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Fehlerantwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                },
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "title": {
                                        "type": "string",
                                        "description": "Name des Tags, höchstens 100 Zeichen, mit mindestens einem Buchstaben oder einer Ziffer"
                                    },
                                    "description": {
                                        "type": "string",
                                        "description": "Beschreibung, höchstens 1.000 Zeichen. Wird nur bei einer Neuanlage gespeichert"
                                    }
                                },
                                "required": [
                                    "title"
                                ]
                            }
                        }
                    }
                }
            }
        },
        "/leads": {
            "get": {
                "operationId": "leads-list",
                "summary": "Leads auflisten",
                "description": "Listet die Leads des Teams paginiert auf. Standardmässig wird nur die offene Pipeline gezeigt (abgeschlossene und konvertierte Leads ausgeblendet); mit pipeline=false wird der volle Satz zurückgegeben. Als Spam markierte Leads fehlen in der Liste, außer mit include_spam=1 oder bei einer exakten Suche nach external_source und external_id: Diese findet einen Lead immer, auch wenn er als Spam markiert ist, damit eine Integration vor dem Anlegen kein Duplikat erzeugt. Die Antwort folgt dem Standard-Paginierungsformat mit data, links und meta.",
                "tags": [
                    "leads"
                ],
                "parameters": [
                    {
                        "name": "pipeline",
                        "in": "query",
                        "required": false,
                        "description": "Standard true (nur offene Pipeline). false zeigt alle Leads inkl. abgeschlossener",
                        "schema": {
                            "type": "boolean"
                        }
                    },
                    {
                        "name": "include_spam",
                        "in": "query",
                        "required": false,
                        "description": "Standard false. 1 nimmt als Spam markierte Leads in die Liste auf (erkennbar an spam_at). Bei einer exakten Suche nach external_source und external_id sind Spam-Leads immer enthalten",
                        "schema": {
                            "type": "boolean"
                        }
                    },
                    {
                        "name": "search",
                        "in": "query",
                        "required": false,
                        "description": "Volltextsuche über Firmenname, Vor-/Nachname und E-Mail",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "external_source",
                        "in": "query",
                        "required": false,
                        "description": "Exakter Filter auf die Herkunft der externen Kennung. Unterliegt dem Pipeline-Standard, für abgeschlossene oder konvertierte Leads pipeline=false mitsenden",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "external_id",
                        "in": "query",
                        "required": false,
                        "description": "Exakter Filter auf die externe Kennung. Unterliegt dem Pipeline-Standard, für abgeschlossene oder konvertierte Leads pipeline=false mitsenden",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "source",
                        "in": "query",
                        "required": false,
                        "description": "Filter auf eine Quelle oder mehrere per Komma getrennt",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "tag_uuid",
                        "in": "query",
                        "required": false,
                        "description": "Filter auf eine team-eigene Tag-UUID",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "assigned_user_uuid",
                        "in": "query",
                        "required": false,
                        "description": "Filter auf die UUID des zugewiesenen Benutzers. Eine UUID ausserhalb des Teams liefert eine leere Liste. Breaking Change: assigned_user_id wird nicht mehr akzeptiert (422)",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "created_from",
                        "in": "query",
                        "required": false,
                        "description": "Erstellt ab (Datum, YYYY-MM-DD)",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "created_to",
                        "in": "query",
                        "required": false,
                        "description": "Erstellt bis (Datum, YYYY-MM-DD)",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "updated_from",
                        "in": "query",
                        "required": false,
                        "description": "Geändert ab (Datum, YYYY-MM-DD)",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "updated_to",
                        "in": "query",
                        "required": false,
                        "description": "Geändert bis (Datum, YYYY-MM-DD)",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "per_page",
                        "in": "query",
                        "required": false,
                        "description": "Einträge pro Seite (Standard 50, Maximum 100)",
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "include",
                        "in": "query",
                        "required": false,
                        "description": "Zusätzliche Relationen, per Komma: contacts, sources, tags, status, board_cards, assigned_user, notes, custom_fields",
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Erfolgreiche Antwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                },
                                "example": {
                                    "data": [
                                        {
                                            "uuid": "9b1c7f3e-2a4d-4c8b-8e1a-6f0d2c9b4a11",
                                            "type": "company",
                                            "company_name": "Mustermann GmbH",
                                            "first_name": null,
                                            "last_name": null,
                                            "name": "Mustermann GmbH",
                                            "email": "info@mustermann.de",
                                            "phone": "+49 30 123456",
                                            "website": null,
                                            "address_line_1": null,
                                            "address_line_2": null,
                                            "postal_code": null,
                                            "city": "Berlin",
                                            "state": null,
                                            "country": "DE",
                                            "country_display": null,
                                            "deal_value": "5000.00",
                                            "deal_currency": "EUR",
                                            "notes": null,
                                            "external_source": "messe-2026",
                                            "external_id": "MSG-4711",
                                            "possible_duplicate": false,
                                            "last_api_ingested_at": null,
                                            "spam_at": null,
                                            "lost_at": null,
                                            "lost_reason": null,
                                            "lost_note": null,
                                            "sources": [],
                                            "tags": [],
                                            "contacts": [],
                                            "board_cards": [],
                                            "assigned_user": null,
                                            "notes_log": [],
                                            "created_at": "2026-07-21T10:00:00+00:00",
                                            "updated_at": "2026-07-21T10:00:00+00:00"
                                        }
                                    ],
                                    "links": {
                                        "first": "/api/leads?page=1",
                                        "last": "/api/leads?page=1",
                                        "prev": null,
                                        "next": null
                                    },
                                    "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": "leads-create",
                "summary": "Lead anlegen (Upsert)",
                "description": "Legt einen Lead an oder aktualisiert per external_source + external_id idempotent einen bestehenden (Merge nur der gesendeten Felder). Der Status kann hier nie gesetzt werden; ein neuer Lead startet in der Stufe Kalt der Standard-Pipeline. Ein optionales doc-Objekt befüllt beim erstmaligen Anlegen das FlowDoc des Leads, nicht bei einem idempotenten Wiederholungs-POST. Das frühere docs[]-Array wird nicht mehr akzeptiert (422), weil ein Lead genau ein FlowDoc hat. Die Antwort trägt created (bool) und duplicate_warning (Objekt mit matches oder null). HTTP 201 bei Neuanlage, 200 bei idempotenter Aktualisierung.",
                "tags": [
                    "leads"
                ],
                "responses": {
                    "200": {
                        "description": "Erfolgreiche Antwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                },
                                "example": {
                                    "success": true,
                                    "created": true,
                                    "data": {
                                        "uuid": "9b1c7f3e-2a4d-4c8b-8e1a-6f0d2c9b4a11",
                                        "type": "company",
                                        "company_name": "Mustermann GmbH",
                                        "first_name": null,
                                        "last_name": null,
                                        "name": "Mustermann GmbH",
                                        "email": "info@mustermann.de",
                                        "phone": "+49 30 123456",
                                        "website": "https://mustermann.de",
                                        "address_line_1": "Hauptstrasse 1",
                                        "address_line_2": null,
                                        "postal_code": "10115",
                                        "city": "Berlin",
                                        "state": null,
                                        "country": "DE",
                                        "country_display": "Deutschland",
                                        "deal_value": "5000.00",
                                        "deal_currency": "EUR",
                                        "notes": "Interessent von der Messe",
                                        "external_source": "messe-2026",
                                        "external_id": "MSG-4711",
                                        "possible_duplicate": false,
                                        "last_api_ingested_at": "2026-07-21T10:00:00+00:00",
                                        "status": {
                                            "uuid": "1f2e3d4c-5b6a-4790-8123-45a6b7c8d9e0",
                                            "key": "kalt",
                                            "name": "Kalt",
                                            "display_name": "Kalt",
                                            "color": "#94a3b8",
                                            "is_won": false,
                                            "is_lost": false,
                                            "is_closed": false,
                                            "is_system": false
                                        },
                                        "sources": [
                                            "messe-2026"
                                        ],
                                        "tags": [
                                            {
                                                "uuid": "b2c1a7a6-1249-4827-b533-ef1c65c1e273",
                                                "title": "VIP",
                                                "source": "api"
                                            }
                                        ],
                                        "contacts": [
                                            {
                                                "uuid": "4f8a2b6c-9d1e-4c3a-8b5f-0a7e6d2c1b9e",
                                                "first_name": "Erika",
                                                "last_name": "Musterfrau",
                                                "email": "erika@mustermann.de",
                                                "phone": null,
                                                "role": "Einkauf"
                                            }
                                        ],
                                        "board_cards": [],
                                        "assigned_user": null,
                                        "notes_log": [],
                                        "created_at": "2026-07-21T10:00:00+00:00",
                                        "updated_at": "2026-07-21T10:00:00+00:00"
                                    },
                                    "duplicate_warning": null
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Fehlerantwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                },
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "type": {
                                        "type": "string",
                                        "description": "company oder person"
                                    },
                                    "company_name": {
                                        "type": "string",
                                        "description": "Firmenname (Pflicht wenn type=company)"
                                    },
                                    "first_name": {
                                        "type": "string",
                                        "description": "Vorname (Pflicht wenn type=person)"
                                    },
                                    "last_name": {
                                        "type": "string",
                                        "description": "Nachname"
                                    },
                                    "email": {
                                        "type": "string",
                                        "description": "E-Mail-Adresse"
                                    },
                                    "phone": {
                                        "type": "string",
                                        "description": "Telefonnummer"
                                    },
                                    "website": {
                                        "type": "string",
                                        "description": "Webseite"
                                    },
                                    "address_line_1": {
                                        "type": "string",
                                        "description": "Adresszeile 1"
                                    },
                                    "address_line_2": {
                                        "type": "string",
                                        "description": "Adresszeile 2"
                                    },
                                    "postal_code": {
                                        "type": "string",
                                        "description": "Postleitzahl"
                                    },
                                    "city": {
                                        "type": "string",
                                        "description": "Ort"
                                    },
                                    "state": {
                                        "type": "string",
                                        "description": "Bundesland / Region"
                                    },
                                    "country": {
                                        "type": "string",
                                        "description": "Land (ISO-Code)"
                                    },
                                    "country_display": {
                                        "type": "string",
                                        "description": "Anzeigename des Landes"
                                    },
                                    "deal_value": {
                                        "type": "number",
                                        "description": "Potenzieller Auftragswert"
                                    },
                                    "deal_currency": {
                                        "type": "string",
                                        "description": "Währung (3-stelliger ISO-Code)"
                                    },
                                    "notes": {
                                        "type": "string",
                                        "description": "Freitext-Notiz am Lead"
                                    },
                                    "external_source": {
                                        "type": "string",
                                        "description": "Quellsystem-Kennung, Teil des Idempotenzschlüssels"
                                    },
                                    "external_id": {
                                        "type": "string",
                                        "description": "Datensatz-Kennung im Quellsystem, Teil des Idempotenzschlüssels"
                                    },
                                    "source_payload": {
                                        "type": "object",
                                        "description": "Roh-Payload der Quelle. Wird gespeichert, erscheint aber nie in der Antwort"
                                    },
                                    "sources": {
                                        "type": "array",
                                        "items": [],
                                        "description": "Liste von Herkunftsquellen als Freitext (max. 20 Einträge)"
                                    },
                                    "tag_uuids": {
                                        "type": "array",
                                        "items": [],
                                        "description": "Liste team-eigener Tag-UUIDs (max. 50 Einträge)"
                                    },
                                    "assigned_user_uuid": {
                                        "type": "string",
                                        "description": "UUID eines Team-Mitglieds als zugewiesener Benutzer. Benutzer außerhalb des Teams werden mit 422 abgelehnt. Breaking Change: assigned_user_id wird nicht mehr akzeptiert (Validierungsfehler)"
                                    },
                                    "contacts": {
                                        "type": "array",
                                        "items": [],
                                        "description": "Ansprechpartner-Objekte (first_name, last_name, email, phone, role; max. 50 Einträge)"
                                    },
                                    "custom_fields": {
                                        "type": "array",
                                        "items": [],
                                        "description": "Custom-Field-Werte (definition_uuid oder name, plus value). Bei Feldern vom Typ reference ist value die UUID des Ziels (Kunde, Kontakt, Projekt oder Team-Mitglied), zum Beispiel {\"definition_uuid\": \"...\", \"value\": \"3f7c1a02-9b64-4d1e-a5c8-2e7b90d41f6a\"}. Bei Feldern vom Typ date ist value ein Datum im Format JJJJ-MM-TT, bei Feldern vom Typ currency ein Betrag als Zahl oder Zahl-String ohne Währungszeichen und ohne Tausendertrennzeichen, mit höchstens den in der Definition festgelegten Nachkommastellen, bei Feldern vom Typ multiselect eine Liste von Options-Werten wie [\"gold\", \"silber\"]; ein unpassender Wert führt zu 422 und es wird kein Lead angelegt. Breaking Change: definition_id wird nicht mehr akzeptiert, und eine numerische Ziel-ID in value wird bei Referenzfeldern ebenfalls mit 422 abgelehnt"
                                    },
                                    "doc": {
                                        "type": "object",
                                        "description": "Das FlowDoc des Leads, nur bei Neuanlage. Einziges Feld ist content als Markdown-String; ein Titel ist nicht vorgesehen. Breaking Change: das frühere docs[]-Array wird mit 422 abgelehnt"
                                    }
                                },
                                "required": [
                                    "type"
                                ]
                            }
                        }
                    }
                }
            }
        },
        "/leads/{uuid}": {
            "get": {
                "operationId": "leads-show",
                "summary": "Lead abrufen",
                "description": "Ruft einen einzelnen team-eigenen Lead per UUID ab. Status, Quellen, Tags, Ansprechpartner und zugewiesener Benutzer sind enthalten. Custom-Field-Werte nur mit include=custom_fields; Referenzfelder werden ausschließlich per UUID adressiert.",
                "tags": [
                    "leads"
                ],
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    },
                    {
                        "name": "include",
                        "in": "query",
                        "required": false,
                        "description": "custom_fields, um die Custom-Field-Werte mitzuladen. Referenzfelder liefern die UUID des Ziels in value und referenced_uuid sowie den Anzeigenamen in referenced_name; ist das Ziel nicht mehr vorhanden, ist referenced_uuid null. Felder vom Typ date liefern das Datum als JJJJ-MM-TT, Felder vom Typ currency den Betrag als Dezimalzahl mit Punkt in value und den ISO-4217-Code des Feldes in currency, Felder vom Typ multiselect die Liste der gewählten Options-Werte in value",
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Erfolgreiche Antwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                },
                                "example": {
                                    "success": true,
                                    "data": {
                                        "uuid": "9b1c7f3e-2a4d-4c8b-8e1a-6f0d2c9b4a11",
                                        "type": "company",
                                        "company_name": "Mustermann GmbH",
                                        "first_name": null,
                                        "last_name": null,
                                        "name": "Mustermann GmbH",
                                        "email": "info@mustermann.de",
                                        "phone": "+49 30 123456",
                                        "website": "https://mustermann.de",
                                        "address_line_1": "Hauptstrasse 1",
                                        "address_line_2": null,
                                        "postal_code": "10115",
                                        "city": "Berlin",
                                        "state": null,
                                        "country": "DE",
                                        "country_display": "Deutschland",
                                        "deal_value": "5000.00",
                                        "deal_currency": "EUR",
                                        "notes": "Interessent von der Messe",
                                        "external_source": "messe-2026",
                                        "external_id": "MSG-4711",
                                        "possible_duplicate": false,
                                        "last_api_ingested_at": "2026-07-21T10:00:00+00:00",
                                        "status": {
                                            "uuid": "1f2e3d4c-5b6a-4790-8123-45a6b7c8d9e0",
                                            "key": "kalt",
                                            "name": "Kalt",
                                            "display_name": "Kalt",
                                            "color": "#94a3b8",
                                            "is_won": false,
                                            "is_lost": false,
                                            "is_closed": false,
                                            "is_system": false
                                        },
                                        "sources": [
                                            "messe-2026"
                                        ],
                                        "tags": [],
                                        "contacts": [],
                                        "board_cards": [],
                                        "assigned_user": null,
                                        "notes_log": [],
                                        "custom_fields": [
                                            {
                                                "definition_uuid": "7c1f9a3b-42d5-4e88-9a10-b6c3f2d51e04",
                                                "name": "Branche",
                                                "type": "text",
                                                "value": "Gastronomie"
                                            },
                                            {
                                                "definition_uuid": "0d5b8e21-6c74-4f39-8a2b-91e7c40d3f55",
                                                "name": "Stammkunde",
                                                "type": "reference",
                                                "value": "3f7c1a02-9b64-4d1e-a5c8-2e7b90d41f6a",
                                                "referenced_uuid": "3f7c1a02-9b64-4d1e-a5c8-2e7b90d41f6a",
                                                "referenced_name": "Mustermann GmbH"
                                            },
                                            {
                                                "definition_uuid": "5e2a9c71-3b0d-4f86-a1c4-7d9e0b6f2a38",
                                                "name": "Wunschtermin",
                                                "type": "date",
                                                "value": "2026-12-31"
                                            },
                                            {
                                                "definition_uuid": "b84d1f06-9a2e-4c53-8e7b-0f3a6d5c9e12",
                                                "name": "Jahresbudget",
                                                "type": "currency",
                                                "value": "12500.00",
                                                "currency": "EUR"
                                            }
                                        ],
                                        "created_at": "2026-07-21T10:00:00+00:00",
                                        "updated_at": "2026-07-21T10:00:00+00:00"
                                    }
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Fehlerantwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            },
            "patch": {
                "operationId": "leads-update",
                "summary": "Lead aktualisieren",
                "description": "Aktualisiert die Kernfelder eines team-eigenen Leads (Teil-Update, nur gesendete Felder). Der Status kann hier nicht gesetzt werden (status und status_id werden mit 422 abgelehnt), dafür dient der Status-Endpunkt. Die Antwort trägt zusätzlich duplicate_warning.",
                "tags": [
                    "leads"
                ],
                "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": "9b1c7f3e-2a4d-4c8b-8e1a-6f0d2c9b4a11",
                                        "type": "company",
                                        "company_name": "Mustermann GmbH",
                                        "name": "Mustermann GmbH",
                                        "email": "kontakt@mustermann.de",
                                        "phone": "+49 30 123456",
                                        "deal_value": "7500.00",
                                        "deal_currency": "EUR",
                                        "external_source": "messe-2026",
                                        "external_id": "MSG-4711",
                                        "possible_duplicate": false,
                                        "status": {
                                            "uuid": "1f2e3d4c-5b6a-4790-8123-45a6b7c8d9e0",
                                            "key": "kalt",
                                            "name": "Kalt",
                                            "display_name": "Kalt",
                                            "color": "#94a3b8",
                                            "is_won": false,
                                            "is_lost": false,
                                            "is_closed": false,
                                            "is_system": false
                                        },
                                        "sources": [],
                                        "tags": [],
                                        "contacts": [],
                                        "board_cards": [],
                                        "assigned_user": null,
                                        "notes_log": [],
                                        "created_at": "2026-07-21T10:00:00+00:00",
                                        "updated_at": "2026-07-21T12:00:00+00:00"
                                    },
                                    "duplicate_warning": null
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Fehlerantwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                },
                "requestBody": {
                    "required": false,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "type": {
                                        "type": "string",
                                        "description": "company oder person"
                                    },
                                    "company_name": {
                                        "type": "string",
                                        "description": "Firmenname"
                                    },
                                    "first_name": {
                                        "type": "string",
                                        "description": "Vorname"
                                    },
                                    "last_name": {
                                        "type": "string",
                                        "description": "Nachname"
                                    },
                                    "email": {
                                        "type": "string",
                                        "description": "E-Mail-Adresse"
                                    },
                                    "phone": {
                                        "type": "string",
                                        "description": "Telefonnummer"
                                    },
                                    "website": {
                                        "type": "string",
                                        "description": "Webseite"
                                    },
                                    "address_line_1": {
                                        "type": "string",
                                        "description": "Adresszeile 1"
                                    },
                                    "address_line_2": {
                                        "type": "string",
                                        "description": "Adresszeile 2"
                                    },
                                    "postal_code": {
                                        "type": "string",
                                        "description": "Postleitzahl"
                                    },
                                    "city": {
                                        "type": "string",
                                        "description": "Ort"
                                    },
                                    "state": {
                                        "type": "string",
                                        "description": "Bundesland / Region"
                                    },
                                    "country": {
                                        "type": "string",
                                        "description": "Land (ISO-Code)"
                                    },
                                    "country_display": {
                                        "type": "string",
                                        "description": "Anzeigename des Landes"
                                    },
                                    "deal_value": {
                                        "type": "number",
                                        "description": "Potenzieller Auftragswert"
                                    },
                                    "deal_currency": {
                                        "type": "string",
                                        "description": "Währung (3-stelliger ISO-Code)"
                                    },
                                    "notes": {
                                        "type": "string",
                                        "description": "Freitext-Notiz"
                                    },
                                    "external_source": {
                                        "type": "string",
                                        "description": "Quellsystem-Kennung"
                                    },
                                    "external_id": {
                                        "type": "string",
                                        "description": "Datensatz-Kennung im Quellsystem"
                                    },
                                    "source_payload": {
                                        "type": "object",
                                        "description": "Roh-Payload der Quelle. Wird gespeichert, erscheint aber nie in der Antwort"
                                    },
                                    "sources": {
                                        "type": "array",
                                        "items": [],
                                        "description": "Herkunftsquellen, additiv (fügt nur hinzu, entfernt nie; zum Ersetzen dient PUT /sources; max. 20 Einträge)"
                                    },
                                    "tag_uuids": {
                                        "type": "array",
                                        "items": [],
                                        "description": "Team-eigene Tag-UUIDs, additiv (zum Ersetzen dient PUT /tags; max. 50 Einträge)"
                                    },
                                    "assigned_user_uuid": {
                                        "type": "string",
                                        "description": "UUID eines Team-Mitglieds als zugewiesener Benutzer; null entfernt die Zuweisung. Benutzer außerhalb des Teams werden mit 422 abgelehnt. Breaking Change: assigned_user_id wird nicht mehr akzeptiert (Validierungsfehler)"
                                    },
                                    "contacts": {
                                        "type": "array",
                                        "items": [],
                                        "description": "Ansprechpartner-Objekte (first_name, last_name, email, phone, role), additiv: legt neue Ansprechpartner an, verändert oder löscht keine bestehenden (dafür die /contacts-Endpunkte; max. 50 Einträge)"
                                    },
                                    "custom_fields": {
                                        "type": "array",
                                        "items": [],
                                        "description": "Custom-Field-Werte (definition_uuid oder name, plus value). Bei Feldern vom Typ reference ist value die UUID des Ziels (Kunde, Kontakt, Projekt oder Team-Mitglied). Bei Feldern vom Typ date ist value ein Datum im Format JJJJ-MM-TT, bei Feldern vom Typ currency ein Betrag als Zahl oder Zahl-String ohne Währungszeichen und ohne Tausendertrennzeichen, bei Feldern vom Typ multiselect eine Liste von Options-Werten (ersetzt die bisherige Auswahl); ein unpassender Wert führt zu 422. Breaking Change: definition_id wird nicht mehr akzeptiert, und eine numerische Ziel-ID in value wird bei Referenzfeldern ebenfalls mit 422 abgelehnt"
                                    }
                                }
                            }
                        }
                    }
                }
            },
            "delete": {
                "operationId": "leads-delete",
                "summary": "Lead löschen",
                "description": "Löscht einen team-eigenen Lead (Soft-Delete).",
                "tags": [
                    "leads"
                ],
                "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": "Lead gelöscht."
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Fehlerantwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/leads/{uuid}/sources": {
            "put": {
                "operationId": "leads-sources-sync",
                "summary": "Quellen synchronisieren",
                "description": "Voller Sync der Quellen des Leads: die gesendete Liste ersetzt die gespeicherte. Ein leeres Array leert die Quellen. Trimmen, Leer-Entfernen und Deduplizieren übernimmt der Server.",
                "tags": [
                    "lead-relations"
                ],
                "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": "9b1c7f3e-2a4d-4c8b-8e1a-6f0d2c9b4a11",
                                        "type": "company",
                                        "name": "Mustermann GmbH",
                                        "sources": [
                                            "messe-2026",
                                            "empfehlung"
                                        ],
                                        "tags": [],
                                        "created_at": "2026-07-21T10:00:00+00:00",
                                        "updated_at": "2026-07-21T12:10:00+00:00"
                                    }
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Fehlerantwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                },
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "sources": {
                                        "type": "array",
                                        "items": [],
                                        "description": "Vollständige Liste der Quellen (Freitext, max. 50 Einträge). Muss vorhanden sein; leeres Array leert die Quellen"
                                    }
                                },
                                "required": [
                                    "sources"
                                ]
                            }
                        }
                    }
                }
            }
        },
        "/leads/{uuid}/tags": {
            "put": {
                "operationId": "leads-tags-sync",
                "summary": "Tags synchronisieren",
                "description": "Voller Sync der Tags des Leads über team-eigene Tag-UUIDs: die gesendete Liste ersetzt die gespeicherte. Behaltene Tags behalten ihre Pivot-Quelle, neu angehängte erhalten source=api, ausgelassene werden entfernt. Ein leeres Array entfernt alle Tags. Eine Fremd-Team-UUID wird mit 422 abgelehnt.",
                "tags": [
                    "lead-relations"
                ],
                "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": "9b1c7f3e-2a4d-4c8b-8e1a-6f0d2c9b4a11",
                                        "type": "company",
                                        "name": "Mustermann GmbH",
                                        "sources": [],
                                        "tags": [
                                            {
                                                "uuid": "b2c1a7a6-1249-4827-b533-ef1c65c1e273",
                                                "title": "VIP",
                                                "source": "api"
                                            }
                                        ],
                                        "created_at": "2026-07-21T10:00:00+00:00",
                                        "updated_at": "2026-07-21T12:12:00+00:00"
                                    }
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Fehlerantwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                },
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "tag_uuids": {
                                        "type": "array",
                                        "items": [],
                                        "description": "Vollständige Liste team-eigener Tag-UUIDs (max. 50 Einträge). Muss vorhanden sein; leeres Array entfernt alle Tags"
                                    }
                                },
                                "required": [
                                    "tag_uuids"
                                ]
                            }
                        }
                    }
                }
            }
        },
        "/leads/{uuid}/contacts": {
            "get": {
                "operationId": "leads-contacts-list",
                "summary": "Ansprechpartner auflisten",
                "description": "Listet die Ansprechpartner eines team-eigenen Leads auf.",
                "tags": [
                    "lead-relations"
                ],
                "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": "4f8a2b6c-9d1e-4c3a-8b5f-0a7e6d2c1b9e",
                                            "first_name": "Erika",
                                            "last_name": "Musterfrau",
                                            "email": "erika@mustermann.de",
                                            "phone": null,
                                            "role": "Einkauf",
                                            "created_at": "2026-07-21T10:00:00+00:00",
                                            "updated_at": "2026-07-21T10:00:00+00:00"
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Fehlerantwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            },
            "post": {
                "operationId": "leads-contacts-create",
                "summary": "Ansprechpartner anlegen",
                "description": "Legt einen Ansprechpartner am Lead an. Nur first_name ist Pflicht.",
                "tags": [
                    "lead-relations"
                ],
                "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": "5a9b3c7d-0e2f-4d4b-9c6a-1b8f7e3d2c0f",
                                        "first_name": "Max",
                                        "last_name": "Mustermann",
                                        "email": null,
                                        "phone": "+49 170 111222",
                                        "role": "Geschäftsführung",
                                        "created_at": "2026-07-21T12:20:00+00:00",
                                        "updated_at": "2026-07-21T12:20:00+00:00"
                                    }
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Fehlerantwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                },
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "first_name": {
                                        "type": "string",
                                        "description": "Vorname"
                                    },
                                    "last_name": {
                                        "type": "string",
                                        "description": "Nachname"
                                    },
                                    "email": {
                                        "type": "string",
                                        "description": "E-Mail-Adresse"
                                    },
                                    "phone": {
                                        "type": "string",
                                        "description": "Telefonnummer"
                                    },
                                    "role": {
                                        "type": "string",
                                        "description": "Rolle / Funktion"
                                    }
                                },
                                "required": [
                                    "first_name"
                                ]
                            }
                        }
                    }
                }
            }
        },
        "/leads/{uuid}/contacts/{contactUuid}": {
            "patch": {
                "operationId": "leads-contacts-update",
                "summary": "Ansprechpartner aktualisieren",
                "description": "Aktualisiert einen Ansprechpartner (Teil-Update). first_name darf, wenn gesendet, nicht leer sein. Der Ansprechpartner wird per UUID innerhalb des Leads adressiert; numerische IDs werden nicht mehr akzeptiert (HTTP 404).",
                "tags": [
                    "lead-relations"
                ],
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    },
                    {
                        "name": "contactUuid",
                        "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": "5a9b3c7d-0e2f-4d4b-9c6a-1b8f7e3d2c0f",
                                        "first_name": "Max",
                                        "last_name": "Mustermann",
                                        "email": "max@mustermann.de",
                                        "phone": "+49 170 111222",
                                        "role": "Geschäftsführung",
                                        "created_at": "2026-07-21T12:20:00+00:00",
                                        "updated_at": "2026-07-21T12:25:00+00:00"
                                    }
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Fehlerantwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                },
                "requestBody": {
                    "required": false,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "first_name": {
                                        "type": "string",
                                        "description": "Vorname (darf nicht geleert werden)"
                                    },
                                    "last_name": {
                                        "type": "string",
                                        "description": "Nachname"
                                    },
                                    "email": {
                                        "type": "string",
                                        "description": "E-Mail-Adresse"
                                    },
                                    "phone": {
                                        "type": "string",
                                        "description": "Telefonnummer"
                                    },
                                    "role": {
                                        "type": "string",
                                        "description": "Rolle / Funktion"
                                    }
                                }
                            }
                        }
                    }
                }
            },
            "delete": {
                "operationId": "leads-contacts-delete",
                "summary": "Ansprechpartner entfernen",
                "description": "Entfernt einen Ansprechpartner des Leads.",
                "tags": [
                    "lead-relations"
                ],
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    },
                    {
                        "name": "contactUuid",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Erfolgreiche Antwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                },
                                "example": {
                                    "success": true,
                                    "message": "Kontaktperson entfernt."
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Fehlerantwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/leads/{uuid}/notes": {
            "get": {
                "operationId": "leads-notes-list",
                "summary": "Notizen auflisten",
                "description": "Listet die Notizen des Leads auf, neueste zuerst. Der Autor wird als Objekt (uuid, name) mitgeliefert.",
                "tags": [
                    "lead-relations"
                ],
                "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": [
                                        {
                                            "body": "Rückruf für Freitag vereinbart.",
                                            "user": {
                                                "uuid": "2b7c4d8e-1f3a-4e5c-0d7b-2c9a8f4e3d1a",
                                                "name": "Sascha"
                                            },
                                            "created_at": "2026-07-21T12:30:00+00:00"
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Fehlerantwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            },
            "post": {
                "operationId": "leads-notes-create",
                "summary": "Notiz anhängen",
                "description": "Hängt eine Notiz an den Lead an. Notizen sind append-only, es gibt kein Bearbeiten oder Löschen. Der Autor ist immer der Token-Benutzer.",
                "tags": [
                    "lead-relations"
                ],
                "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": {
                                        "body": "Angebot per E-Mail versendet.",
                                        "user": {
                                            "uuid": "2b7c4d8e-1f3a-4e5c-0d7b-2c9a8f4e3d1a",
                                            "name": "Sascha"
                                        },
                                        "created_at": "2026-07-21T12:35:00+00:00"
                                    }
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Fehlerantwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                },
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "body": {
                                        "type": "string",
                                        "description": "Notizinhalt (max. 65535 Zeichen)"
                                    }
                                },
                                "required": [
                                    "body"
                                ]
                            }
                        }
                    }
                }
            }
        },
        "/leads/{uuid}/status": {
            "put": {
                "operationId": "leads-status-set",
                "summary": "Status setzen",
                "description": "Setzt den Status eines team-eigenen Leads auf einen team-eigenen Status, adressiert per Status-UUID. converted wird mit 422 abgelehnt; eine UUID, die die Validierung passiert, aber keinen auffindbaren Status trifft, liefert 404. Optional lost_reason und lost_note, nur bei einer Verloren-Stufe (sonst 422).",
                "tags": [
                    "lead-status"
                ],
                "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": "9b1c7f3e-2a4d-4c8b-8e1a-6f0d2c9b4a11",
                                        "type": "company",
                                        "name": "Mustermann GmbH",
                                        "status": {
                                            "uuid": "3c4d5e6f-7a8b-49c0-8d1e-2f3a4b5c6d7e",
                                            "key": null,
                                            "name": "Angebot",
                                            "display_name": "Proposal",
                                            "color": "#f59e0b",
                                            "is_won": false,
                                            "is_lost": false,
                                            "is_closed": false,
                                            "is_system": false,
                                            "is_inbox": false,
                                            "pipeline": {
                                                "uuid": "5d6e7f80-91a2-4b3c-8d4e-5f6a7b8c9d0e",
                                                "name": "Standard"
                                            }
                                        },
                                        "spam_at": null,
                                        "lost_at": null,
                                        "lost_reason": null,
                                        "lost_note": null,
                                        "sources": [],
                                        "tags": [],
                                        "contacts": [],
                                        "board_cards": [],
                                        "assigned_user": null,
                                        "notes_log": [],
                                        "created_at": "2026-07-21T10:00:00+00:00",
                                        "updated_at": "2026-07-21T12:40:00+00:00"
                                    }
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Fehlerantwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                },
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "status_uuid": {
                                        "type": "string",
                                        "description": "UUID eines team-eigenen Lead-Status"
                                    },
                                    "lost_reason": {
                                        "type": "string",
                                        "description": "UUID eines aktiven, team-eigenen Verlustgrunds (siehe GET /leads/lost-reasons). Nur bei einer Verloren-Stufe erlaubt; eine fremde oder deaktivierte UUID wird mit 422 abgelehnt"
                                    },
                                    "lost_note": {
                                        "type": "string",
                                        "description": "Freitext zum Verlust, höchstens 2.000 Zeichen. Nur bei einer Verloren-Stufe erlaubt"
                                    }
                                },
                                "required": [
                                    "status_uuid"
                                ]
                            }
                        }
                    }
                }
            }
        },
        "/leads/pipelines": {
            "get": {
                "operationId": "leads-pipelines-list",
                "summary": "Pipelines mit Stufen",
                "description": "Alle Pipelines des Teams in ihrer Reihenfolge, jede mit ihren Stufen (Status) in deren Reihenfolge. Die Standard-Pipeline trägt is_default, die Eingangsstufe einer Pipeline is_inbox. Die UUID einer Stufe ist die status_uuid für den Status-Endpunkt.",
                "tags": [
                    "lead-status"
                ],
                "responses": {
                    "200": {
                        "description": "Erfolgreiche Antwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                },
                                "example": {
                                    "success": true,
                                    "data": [
                                        {
                                            "uuid": "5d6e7f80-91a2-4b3c-8d4e-5f6a7b8c9d0e",
                                            "name": "Standard",
                                            "color": "#6366F1",
                                            "sort_order": 0,
                                            "is_default": true,
                                            "stages": [
                                                {
                                                    "uuid": "1f2e3d4c-5b6a-4790-8123-45a6b7c8d9e0",
                                                    "key": "neu",
                                                    "name": "Neu",
                                                    "display_name": "Neu",
                                                    "color": "#3b82f6",
                                                    "sort_order": 0,
                                                    "is_inbox": true,
                                                    "is_won": false,
                                                    "is_lost": false,
                                                    "is_closed": false,
                                                    "is_system": false
                                                },
                                                {
                                                    "uuid": "7a8b9c0d-1e2f-4a3b-8c4d-5e6f7a8b9c0d",
                                                    "key": "verloren",
                                                    "name": "Verloren",
                                                    "display_name": "Verloren",
                                                    "color": "#ef4444",
                                                    "sort_order": 8,
                                                    "is_inbox": false,
                                                    "is_won": false,
                                                    "is_lost": true,
                                                    "is_closed": true,
                                                    "is_system": false
                                                }
                                            ]
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Fehlerantwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/leads/lost-reasons": {
            "get": {
                "operationId": "leads-lost-reasons-list",
                "summary": "Verlustgründe",
                "description": "Die Verlustgründe des Teams in ihrer Reihenfolge. Deaktivierte Gründe fehlen, außer mit include_inactive=1; beim Statuswechsel werden nur aktive Gründe angenommen.",
                "tags": [
                    "lead-status"
                ],
                "parameters": [
                    {
                        "name": "include_inactive",
                        "in": "query",
                        "required": false,
                        "description": "Standard false. 1 nimmt deaktivierte Gründe mit auf (is_active: false)",
                        "schema": {
                            "type": "boolean"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Erfolgreiche Antwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                },
                                "example": {
                                    "success": true,
                                    "data": [
                                        {
                                            "uuid": "2b3c4d5e-6f7a-4b8c-9d0e-1f2a3b4c5d6e",
                                            "name": "Zu teuer",
                                            "sort_order": 0,
                                            "is_active": true
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Fehlerantwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/leads/{uuid}/timeline": {
            "get": {
                "operationId": "leads-timeline-list",
                "summary": "Timeline abrufen",
                "description": "Ruft die Timeline-Einträge eines team-eigenen Leads paginiert ab (neueste zuerst).",
                "tags": [
                    "lead-timeline"
                ],
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    },
                    {
                        "name": "per_page",
                        "in": "query",
                        "required": false,
                        "description": "Einträge pro Seite (Standard 50, Maximum 100)",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Erfolgreiche Antwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                },
                                "example": {
                                    "success": true,
                                    "lead": {
                                        "uuid": "9b1c7f3e-2a4d-4c8b-8e1a-6f0d2c9b4a11",
                                        "name": "Mustermann GmbH"
                                    },
                                    "data": [
                                        {
                                            "type": "note",
                                            "type_label": "Notiz",
                                            "type_emoji": "📝",
                                            "content": "Erstkontakt auf der Messe.",
                                            "event_date": "2026-07-21T09:00:00+00:00",
                                            "formatted_date": "21.07.2026 09:00",
                                            "relative_date": "vor 4 Stunden",
                                            "user": "Sascha",
                                            "created_at": "2026-07-21T09:00:00+00: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": "leads-timeline-create",
                "summary": "Timeline-Eintrag anlegen",
                "description": "Hängt einen Timeline-Eintrag an den Lead an. type wird gegen die erlaubte Timeline-Typenliste geprüft; fehlt type, wird note verwendet. Bei einem konvertierten Lead antwortet der Endpunkt mit HTTP 409.",
                "tags": [
                    "lead-timeline"
                ],
                "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": {
                                        "type": "call",
                                        "type_label": "Anruf",
                                        "type_emoji": "📞",
                                        "content": "Telefonat, Angebot angekündigt.",
                                        "event_date": "2026-07-21T13:00:00+00:00",
                                        "formatted_date": "21.07.2026 13:00",
                                        "relative_date": "gerade eben",
                                        "user": "Sascha",
                                        "created_at": "2026-07-21T13:00:00+00:00"
                                    }
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Fehlerantwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                },
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "content": {
                                        "type": "string",
                                        "description": "Inhalt des Eintrags"
                                    },
                                    "type": {
                                        "type": "string",
                                        "description": "Timeline-Typ aus der erlaubten Vokabel (Standard note)"
                                    },
                                    "event_date": {
                                        "type": "string",
                                        "description": "Ereignisdatum (ISO 8601, Standard: jetzt)"
                                    }
                                },
                                "required": [
                                    "content"
                                ]
                            }
                        }
                    }
                }
            }
        },
        "/leads/{uuid}/convert": {
            "post": {
                "operationId": "leads-convert",
                "summary": "Lead in Kunden konvertieren",
                "description": "Konvertiert den Lead in einen neuen Kunden. Ohne client_name wird der Name aus dem Lead abgeleitet (Firmenname bei Firma, Vor- und Nachname bei Person). Die Antwort ist der neue Kunde (CmmClient) mit HTTP 201. Ein bereits konvertierter Lead ergibt 409, er weist seinen Kunden über converted_client_uuid aus. Eine bereits an einen anderen Kunden vergebene external_id ergibt 422.",
                "tags": [
                    "lead-convert"
                ],
                "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": "d4e5f6a7-8b9c-40d1-8e2f-3a4b5c6d7e8f",
                                        "name": "Mustermann GmbH",
                                        "email": "info@mustermann.de",
                                        "phone": "+49 30 123456",
                                        "contact_person": null,
                                        "source": "messe-2026",
                                        "whmcs_client_id": null,
                                        "external_id": null,
                                        "stripe_customer_id": null,
                                        "website": null,
                                        "address_line_1": "Hauptstrasse 1",
                                        "address_line_2": null,
                                        "postal_code": "10115",
                                        "city": "Berlin",
                                        "state": null,
                                        "country": "DE",
                                        "currency": "EUR",
                                        "tax_id": null,
                                        "notes": null,
                                        "status": "active",
                                        "tags": [],
                                        "sources": [
                                            "messe-2026"
                                        ],
                                        "created_at": "2026-07-21T13:10:00+00:00",
                                        "updated_at": "2026-07-21T13:10:00+00:00"
                                    }
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Fehlerantwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                },
                "requestBody": {
                    "required": false,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "client_name": {
                                        "type": "string",
                                        "description": "Expliziter Kundenname (überschreibt den abgeleiteten Namen)"
                                    },
                                    "external_id": {
                                        "type": "string",
                                        "description": "Externe Kennung für den neuen Kunden, eindeutig je Team (auch gegenüber Kunden im Papierkorb)"
                                    },
                                    "transfer_contacts": {
                                        "type": "boolean",
                                        "description": "Ansprechpartner mit übernehmen"
                                    },
                                    "transfer_todos": {
                                        "type": "boolean",
                                        "description": "Aufgaben mit übernehmen"
                                    },
                                    "transfer_docs": {
                                        "type": "boolean",
                                        "description": "FlowDocs mit übernehmen"
                                    },
                                    "transfer_custom_fields": {
                                        "type": "boolean",
                                        "description": "Custom-Field-Werte mit übernehmen"
                                    }
                                }
                            }
                        }
                    }
                }
            }
        },
        "/leads/reports/funnel": {
            "get": {
                "operationId": "leads-report-funnel",
                "summary": "Trichter je Status",
                "description": "Anzahl und Wert der offenen Leads je Status, in der Reihenfolge der Statusliste, dazu die Zahl der Leads ohne Status. name ist der gespeicherte Statusname, display_name der Name in der Sprache der Anfrage (Standardstatus übersetzt, eigene Namen sobald eine Übersetzung vorliegt, sonst name).",
                "tags": [
                    "lead-reports"
                ],
                "responses": {
                    "200": {
                        "description": "Erfolgreiche Antwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                },
                                "example": {
                                    "success": true,
                                    "data": {
                                        "stages": [
                                            {
                                                "status_uuid": "123e4567-e89b-12d3-a456-426614174000",
                                                "name": "Erstkontakt",
                                                "display_name": "Erstkontakt",
                                                "leads": 12,
                                                "value": 48000
                                            }
                                        ],
                                        "without_status": 3
                                    }
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Fehlerantwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/leads/reports/assignments": {
            "get": {
                "operationId": "leads-report-assignments",
                "summary": "Verteilung auf Zuständige",
                "description": "Anzahl und Wert der offenen Leads je zuständiger Person. Nicht zugewiesene Leads erscheinen als eigene Zeile mit user: null, damit genau diese Lücke sichtbar bleibt.",
                "tags": [
                    "lead-reports"
                ],
                "responses": {
                    "200": {
                        "description": "Erfolgreiche Antwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Fehlerantwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/leads/reports/sources": {
            "get": {
                "operationId": "leads-report-sources",
                "summary": "Herkunft der Leads",
                "description": "Anzahl der Leads je Quelle, absteigend sortiert.",
                "tags": [
                    "lead-reports"
                ],
                "responses": {
                    "200": {
                        "description": "Erfolgreiche Antwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Fehlerantwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/leads/{uuid}/duplicates": {
            "get": {
                "operationId": "leads-duplicates",
                "summary": "Mögliche Dubletten finden",
                "description": "Andere offene Leads mit derselben E-Mail-Adresse oder demselben Firmennamen, höchstens zwanzig. Bewusst eng gefasst: verglichen wird exakt, nicht ähnlich, weil über das Zusammenführen ein Mensch entscheidet.",
                "tags": [
                    "lead-reports"
                ],
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Erfolgreiche Antwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Fehlerantwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/lead-boards": {
            "get": {
                "operationId": "lead-boards-list",
                "summary": "Boards auflisten",
                "description": "Listet die Boards des Teams auf. Mit include=columns oder include=columns.cards werden Spalten bzw. Spalten samt Karten mitgeladen.",
                "tags": [
                    "lead-boards"
                ],
                "parameters": [
                    {
                        "name": "include",
                        "in": "query",
                        "required": false,
                        "description": "columns oder columns.cards",
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Erfolgreiche Antwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                },
                                "example": {
                                    "success": true,
                                    "data": [
                                        {
                                            "uuid": "aa11bb22-cc33-4d44-8e55-6f66aa77bb88",
                                            "name": "Vertrieb",
                                            "is_default": true,
                                            "sort_order": 0,
                                            "created_at": "2026-07-01T08:00:00+00:00",
                                            "updated_at": "2026-07-01T08:00:00+00:00"
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Fehlerantwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            },
            "post": {
                "operationId": "lead-boards-create",
                "summary": "Board anlegen",
                "description": "Legt ein neues Board an. Bei überschrittenem Limit (5 pro Team) antwortet der Endpunkt mit HTTP 422.",
                "tags": [
                    "lead-boards"
                ],
                "responses": {
                    "200": {
                        "description": "Erfolgreiche Antwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                },
                                "example": {
                                    "success": true,
                                    "created": true,
                                    "data": {
                                        "uuid": "bb22cc33-dd44-4e55-8f66-7a77bb88cc99",
                                        "name": "Partner",
                                        "is_default": false,
                                        "sort_order": 1,
                                        "created_at": "2026-07-21T13:20:00+00:00",
                                        "updated_at": "2026-07-21T13:20:00+00:00"
                                    }
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Fehlerantwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                },
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "name": {
                                        "type": "string",
                                        "description": "Name des Boards"
                                    }
                                },
                                "required": [
                                    "name"
                                ]
                            }
                        }
                    }
                }
            }
        },
        "/lead-boards/{uuid}": {
            "get": {
                "operationId": "lead-boards-show",
                "summary": "Board abrufen",
                "description": "Ruft ein team-eigenes Board ab. Mit include=columns oder columns.cards inklusive Spalten bzw. Karten. Jede Spalte liefert neben name (gespeicherter Wert, beim Umbenennen zurückzusenden) system_key (Standardspalten des Sales-Boards: cold, warming, setting, closing, won, lost; sonst null) und display_name (Spaltenname in der Sprache der Anfrage, sonst name).",
                "tags": [
                    "lead-boards"
                ],
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "format": "uuid"
                        }
                    },
                    {
                        "name": "include",
                        "in": "query",
                        "required": false,
                        "description": "columns oder columns.cards",
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Erfolgreiche Antwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object"
                                },
                                "example": {
                                    "success": true,
                                    "data": {
                                        "uuid": "aa11bb22-cc33-4d44-8e55-6f66aa77bb88",
                                        "name": "Vertrieb",
                                        "is_default": true,
                                        "sort_order": 0,
                                        "columns": [
                                            {
                                                "uuid": "cc33dd44-ee55-4f66-8a77-8b88cc99dd00",
                                                "name": "Kalt",
                                                "system_key": "cold",
                                                "display_name": "Kalt",
                                                "sort_order": 0,
                                                "created_at": "2026-07-01T08:00:00+00:00",
                                                "updated_at": "2026-07-01T08:00:00+00:00"
                                            }
                                        ],
                                        "created_at": "2026-07-01T08:00:00+00:00",
                                        "updated_at": "2026-07-01T08:00:00+00:00"
                                    }
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Fehlerantwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            },
            "patch": {
                "operationId": "lead-boards-update",
                "summary": "Board umbenennen",
                "description": "Benennt ein team-eigenes Board um.",
                "tags": [
                    "lead-boards"
                ],
                "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": "aa11bb22-cc33-4d44-8e55-6f66aa77bb88",
                                        "name": "Vertrieb DACH",
                                        "is_default": true,
                                        "sort_order": 0,
                                        "created_at": "2026-07-01T08:00:00+00:00",
                                        "updated_at": "2026-07-21T13:25:00+00:00"
                                    }
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Fehlerantwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                },
                "requestBody": {
                    "required": false,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "name": {
                                        "type": "string",
                                        "description": "Neuer Name des Boards"
                                    }
                                }
                            }
                        }
                    }
                }
            },
            "delete": {
                "operationId": "lead-boards-delete",
                "summary": "Board löschen",
                "description": "Löscht ein team-eigenes Board samt seiner Spalten und Karten. Die verknüpften Leads bleiben bestehen.",
                "tags": [
                    "lead-boards"
                ],
                "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": "Board gelöscht."
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Fehlerantwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/lead-boards/{uuid}/columns": {
            "post": {
                "operationId": "lead-board-columns-create",
                "summary": "Spalte anlegen",
                "description": "Legt eine Spalte in einem team-eigenen Board an. Ohne sort_order wird die Spalte hinten angefügt.",
                "tags": [
                    "lead-boards"
                ],
                "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,
                                    "created": true,
                                    "data": {
                                        "uuid": "dd44ee55-ff66-4a77-8b88-9c99dd00ee11",
                                        "name": "In Verhandlung",
                                        "system_key": null,
                                        "display_name": "In Verhandlung",
                                        "sort_order": 1,
                                        "created_at": "2026-07-21T13:30:00+00:00",
                                        "updated_at": "2026-07-21T13:30:00+00:00"
                                    }
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Fehlerantwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                },
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "name": {
                                        "type": "string",
                                        "description": "Name der Spalte"
                                    },
                                    "sort_order": {
                                        "type": "integer",
                                        "description": "Position der Spalte (Standard: hinten angefügt)"
                                    }
                                },
                                "required": [
                                    "name"
                                ]
                            }
                        }
                    }
                }
            }
        },
        "/lead-board-columns/{uuid}": {
            "patch": {
                "operationId": "lead-board-columns-update",
                "summary": "Spalte aktualisieren",
                "description": "Aktualisiert Name oder Position einer team-eigenen Spalte.",
                "tags": [
                    "lead-boards"
                ],
                "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": "dd44ee55-ff66-4a77-8b88-9c99dd00ee11",
                                        "name": "Verhandlung",
                                        "system_key": null,
                                        "display_name": "Verhandlung",
                                        "sort_order": 1,
                                        "created_at": "2026-07-21T13:30:00+00:00",
                                        "updated_at": "2026-07-21T13:35:00+00:00"
                                    }
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Fehlerantwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                },
                "requestBody": {
                    "required": false,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "name": {
                                        "type": "string",
                                        "description": "Neuer Name der Spalte"
                                    },
                                    "sort_order": {
                                        "type": "integer",
                                        "description": "Neue Position der Spalte"
                                    }
                                }
                            }
                        }
                    }
                }
            },
            "delete": {
                "operationId": "lead-board-columns-delete",
                "summary": "Spalte löschen",
                "description": "Löscht eine team-eigene Spalte. Die Karten der Spalte werden mitentfernt; die verknüpften Leads bleiben bestehen.",
                "tags": [
                    "lead-boards"
                ],
                "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": "Spalte gelöscht."
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Fehlerantwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/lead-board-columns/{uuid}/cards": {
            "post": {
                "operationId": "lead-board-cards-create",
                "summary": "Karte anlegen",
                "description": "Legt eine Karte in einer team-eigenen Spalte an. Genau eine der beiden Varianten angeben: entweder lead_uuid (bestehender Lead) ODER ein verschachteltes lead-Objekt (neuer Lead und Karte in einer Transaktion). Die Karten-eigenen deal_value/deal_currency sind unabhängig von den Deal-Feldern des Leads.",
                "tags": [
                    "lead-boards"
                ],
                "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,
                                    "created": true,
                                    "data": {
                                        "uuid": "ee55ff66-aa77-4b88-9c99-0d00ee11ff22",
                                        "deal_value": "5000.00",
                                        "deal_currency": "EUR",
                                        "sort_order": 0,
                                        "column_uuid": "cc33dd44-ee55-4f66-8a77-8b88cc99dd00",
                                        "lead": {
                                            "uuid": "9b1c7f3e-2a4d-4c8b-8e1a-6f0d2c9b4a11",
                                            "name": "Mustermann GmbH"
                                        },
                                        "created_at": "2026-07-21T13:40:00+00:00",
                                        "updated_at": "2026-07-21T13:40:00+00:00"
                                    }
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Fehlerantwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                },
                "requestBody": {
                    "required": false,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "lead_uuid": {
                                        "type": "string",
                                        "description": "UUID eines bestehenden team-eigenen Leads (Alternative zu lead)"
                                    },
                                    "lead": {
                                        "type": "object",
                                        "description": "Neuer Lead (type plus company_name/first_name usw., analog zum Lead-Anlegen; Alternative zu lead_uuid)"
                                    },
                                    "deal_value": {
                                        "type": "number",
                                        "description": "Auftragswert der Karte"
                                    },
                                    "deal_currency": {
                                        "type": "string",
                                        "description": "Währung der Karte (3-stelliger ISO-Code)"
                                    },
                                    "sort_order": {
                                        "type": "integer",
                                        "description": "Position der Karte in der Spalte"
                                    }
                                }
                            }
                        }
                    }
                }
            }
        },
        "/lead-board-cards/{uuid}": {
            "patch": {
                "operationId": "lead-board-cards-update",
                "summary": "Karte aktualisieren",
                "description": "Aktualisiert die Deal-Felder oder die Position einer team-eigenen Karte. Die Verknüpfung zum Lead und die Spalte werden hier nicht geändert (dafür dient der Move-Endpunkt).",
                "tags": [
                    "lead-boards"
                ],
                "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": "ee55ff66-aa77-4b88-9c99-0d00ee11ff22",
                                        "deal_value": "6500.00",
                                        "deal_currency": "EUR",
                                        "sort_order": 0,
                                        "column_uuid": "cc33dd44-ee55-4f66-8a77-8b88cc99dd00",
                                        "lead": {
                                            "uuid": "9b1c7f3e-2a4d-4c8b-8e1a-6f0d2c9b4a11",
                                            "name": "Mustermann GmbH"
                                        },
                                        "created_at": "2026-07-21T13:40:00+00:00",
                                        "updated_at": "2026-07-21T13:45:00+00:00"
                                    }
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Fehlerantwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                },
                "requestBody": {
                    "required": false,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "deal_value": {
                                        "type": "number",
                                        "description": "Auftragswert der Karte"
                                    },
                                    "deal_currency": {
                                        "type": "string",
                                        "description": "Währung der Karte (3-stelliger ISO-Code)"
                                    },
                                    "sort_order": {
                                        "type": "integer",
                                        "description": "Position der Karte in der Spalte"
                                    }
                                }
                            }
                        }
                    }
                }
            },
            "delete": {
                "operationId": "lead-board-cards-delete",
                "summary": "Karte löschen",
                "description": "Löscht eine team-eigene Karte. Der verknüpfte Lead bleibt bestehen.",
                "tags": [
                    "lead-boards"
                ],
                "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": "Karte gelöscht."
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Fehlerantwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/lead-board-cards/{uuid}/move": {
            "put": {
                "operationId": "lead-board-cards-move",
                "summary": "Karte verschieben",
                "description": "Verschiebt eine team-eigene Karte in eine team-eigene Zielspalte, mit position an einen Index (lückenlos neu nummeriert). Ist die Zielspalte status-gemappt, wird der Lead-Status wie beim Drag-and-Drop gesetzt. Die Verknüpfung der Karte bleibt unverändert. Ohne position und sort_order wird die Karte ans Ende der Spalte gehängt; sort_order und position zusammen ergeben HTTP 422.",
                "tags": [
                    "lead-boards"
                ],
                "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": "ee55ff66-aa77-4b88-9c99-0d00ee11ff22",
                                        "deal_value": "6500.00",
                                        "deal_currency": "EUR",
                                        "sort_order": 0,
                                        "column_uuid": "dd44ee55-ff66-4a77-8b88-9c99dd00ee11",
                                        "lead": {
                                            "uuid": "9b1c7f3e-2a4d-4c8b-8e1a-6f0d2c9b4a11",
                                            "name": "Mustermann GmbH"
                                        },
                                        "created_at": "2026-07-21T13:40:00+00:00",
                                        "updated_at": "2026-07-21T13:50:00+00:00"
                                    }
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Fehlerantwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                },
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "target_column_uuid": {
                                        "type": "string",
                                        "description": "UUID der team-eigenen Zielspalte"
                                    },
                                    "position": {
                                        "type": "integer",
                                        "description": "Index in der Zielspalte ab 0 (0 = oben), gezählt ohne die verschobene Karte. Ein Index hinter dem Ende hängt an. Beide Spalten werden lückenlos ab 0 neu nummeriert. Nicht zusammen mit sort_order."
                                    },
                                    "sort_order": {
                                        "type": "integer",
                                        "description": "Roher sort_order-Wert, wird ohne Neunummerierung der übrigen Karten gespeichert (bisheriges Verhalten). Nicht zusammen mit position."
                                    }
                                },
                                "required": [
                                    "target_column_uuid"
                                ]
                            }
                        }
                    }
                }
            }
        },
        "/leads/{uuid}/docs": {
            "get": {
                "operationId": "leads-docs-show",
                "summary": "Lead-Dokument abrufen",
                "description": "Ruft das FlowDoc eines team-eigenen Leads ab, inklusive latest_version_number. Existiert noch keines, wird es beim ersten Aufruf angelegt und leer zurückgegeben. documentable.type ist crm_lead.",
                "tags": [
                    "flowdoc"
                ],
                "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": "a1b2c3d4-e5f6-4a7b-8c9d-0e1f2a3b4c5d",
                                        "title": "Notizen",
                                        "content": {
                                            "type": "doc",
                                            "content": [
                                                {
                                                    "type": "paragraph",
                                                    "content": [
                                                        {
                                                            "type": "text",
                                                            "text": "Angebot bis Freitag."
                                                        }
                                                    ]
                                                }
                                            ]
                                        },
                                        "content_html": "<p>Angebot bis Freitag.</p>",
                                        "documentable": {
                                            "type": "crm_lead",
                                            "uuid": "9b1c7f3e-2a4d-4c8b-8e1a-6f0d2c9b4a11"
                                        },
                                        "created_by_uuid": "2b7c4d8e-1f3a-4e5c-0d7b-2c9a8f4e3d1a",
                                        "latest_version_number": 1,
                                        "created_at": "2026-07-21T14:00:00+00:00",
                                        "updated_at": "2026-07-21T14:00:00+00:00"
                                    }
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Fehlerantwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            },
            "put": {
                "operationId": "leads-docs-update",
                "summary": "Lead-Dokument aktualisieren",
                "description": "Ersetzt den Inhalt des FlowDocs vollständig. content muss übergeben werden; null oder ein leerer String leert das Dokument. Jeder Aufruf erzeugt eine neue Version und erhöht latest_version_number. title wird im Body mit 422 abgelehnt.",
                "tags": [
                    "flowdoc"
                ],
                "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": "a1b2c3d4-e5f6-4a7b-8c9d-0e1f2a3b4c5d",
                                        "title": "Notizen",
                                        "content": {
                                            "type": "doc",
                                            "content": [
                                                {
                                                    "type": "paragraph",
                                                    "content": [
                                                        {
                                                            "type": "text",
                                                            "text": "Angebot versendet."
                                                        }
                                                    ]
                                                }
                                            ]
                                        },
                                        "content_html": "<p>Angebot versendet.</p>",
                                        "documentable": {
                                            "type": "crm_lead",
                                            "uuid": "9b1c7f3e-2a4d-4c8b-8e1a-6f0d2c9b4a11"
                                        },
                                        "created_by_uuid": "2b7c4d8e-1f3a-4e5c-0d7b-2c9a8f4e3d1a",
                                        "latest_version_number": 2,
                                        "created_at": "2026-07-21T14:00:00+00:00",
                                        "updated_at": "2026-07-21T14:10:00+00:00"
                                    }
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Fehlerantwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                },
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "content": {
                                        "type": "string",
                                        "description": "Markdown-Inhalt, wird serverseitig in TipTap umgewandelt. null oder leerer String leert das Dokument"
                                    }
                                },
                                "required": [
                                    "content"
                                ]
                            }
                        }
                    }
                }
            }
        },
        "/clients/{uuid}/docs": {
            "get": {
                "operationId": "clients-docs-show",
                "summary": "Kunden-Dokument abrufen",
                "description": "Ruft das FlowDoc eines team-eigenen Kunden ab, inklusive latest_version_number. Existiert noch keines, wird es beim ersten Aufruf angelegt und leer zurückgegeben. documentable.type ist cmm_client.",
                "tags": [
                    "flowdoc"
                ],
                "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": "c3d4e5f6-a7b8-4c9d-0e1f-2a3b4c5d6e7f",
                                        "title": "Notizen",
                                        "content": {
                                            "type": "doc",
                                            "content": [
                                                {
                                                    "type": "paragraph",
                                                    "content": [
                                                        {
                                                            "type": "text",
                                                            "text": "Angebot bis Freitag."
                                                        }
                                                    ]
                                                }
                                            ]
                                        },
                                        "content_html": "<p>Angebot bis Freitag.</p>",
                                        "documentable": {
                                            "type": "cmm_client",
                                            "uuid": "8c1a5d2e-0f4b-4a9c-9d3e-2b7f0a6c1e44"
                                        },
                                        "created_by_uuid": "2b7c4d8e-1f3a-4e5c-0d7b-2c9a8f4e3d1a",
                                        "latest_version_number": 1,
                                        "created_at": "2026-07-21T14:00:00+00:00",
                                        "updated_at": "2026-07-21T14:00:00+00:00"
                                    }
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Fehlerantwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            },
            "put": {
                "operationId": "clients-docs-update",
                "summary": "Kunden-Dokument aktualisieren",
                "description": "Ersetzt den Inhalt des FlowDocs vollständig. content muss übergeben werden; null oder ein leerer String leert das Dokument. Jeder Aufruf erzeugt eine neue Version und erhöht latest_version_number. title wird im Body mit 422 abgelehnt.",
                "tags": [
                    "flowdoc"
                ],
                "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": "c3d4e5f6-a7b8-4c9d-0e1f-2a3b4c5d6e7f",
                                        "title": "Notizen",
                                        "content": {
                                            "type": "doc",
                                            "content": [
                                                {
                                                    "type": "paragraph",
                                                    "content": [
                                                        {
                                                            "type": "text",
                                                            "text": "Angebot versendet."
                                                        }
                                                    ]
                                                }
                                            ]
                                        },
                                        "content_html": "<p>Angebot versendet.</p>",
                                        "documentable": {
                                            "type": "cmm_client",
                                            "uuid": "8c1a5d2e-0f4b-4a9c-9d3e-2b7f0a6c1e44"
                                        },
                                        "created_by_uuid": "2b7c4d8e-1f3a-4e5c-0d7b-2c9a8f4e3d1a",
                                        "latest_version_number": 2,
                                        "created_at": "2026-07-21T14:00:00+00:00",
                                        "updated_at": "2026-07-21T14:10:00+00:00"
                                    }
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Fehlerantwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                },
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "content": {
                                        "type": "string",
                                        "description": "Markdown-Inhalt, wird serverseitig in TipTap umgewandelt. null oder leerer String leert das Dokument"
                                    }
                                },
                                "required": [
                                    "content"
                                ]
                            }
                        }
                    }
                }
            }
        },
        "/contacts/{uuid}/docs": {
            "get": {
                "operationId": "contacts-docs-show",
                "summary": "Kontakt-Dokument abrufen",
                "description": "Ruft das FlowDoc eines Kontakts (ein privater Kontakt ohne Team ist nur für seinen Eigentümer erreichbar) ab, inklusive latest_version_number. Existiert noch keines, wird es beim ersten Aufruf angelegt und leer zurückgegeben. documentable.type ist cmm_contact.",
                "tags": [
                    "flowdoc"
                ],
                "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": "e5f6a7b8-c9d0-4e1f-2a3b-4c5d6e7f8a9b",
                                        "title": "Notizen",
                                        "content": {
                                            "type": "doc",
                                            "content": [
                                                {
                                                    "type": "paragraph",
                                                    "content": [
                                                        {
                                                            "type": "text",
                                                            "text": "Angebot bis Freitag."
                                                        }
                                                    ]
                                                }
                                            ]
                                        },
                                        "content_html": "<p>Angebot bis Freitag.</p>",
                                        "documentable": {
                                            "type": "cmm_contact",
                                            "uuid": "7d2e6f3a-1b5c-4d8e-9f0a-3c4b5d6e7f8a"
                                        },
                                        "created_by_uuid": "2b7c4d8e-1f3a-4e5c-0d7b-2c9a8f4e3d1a",
                                        "latest_version_number": 1,
                                        "created_at": "2026-07-21T14:00:00+00:00",
                                        "updated_at": "2026-07-21T14:00:00+00:00"
                                    }
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Fehlerantwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            },
            "put": {
                "operationId": "contacts-docs-update",
                "summary": "Kontakt-Dokument aktualisieren",
                "description": "Ersetzt den Inhalt des FlowDocs vollständig. content muss übergeben werden; null oder ein leerer String leert das Dokument. Jeder Aufruf erzeugt eine neue Version und erhöht latest_version_number. title wird im Body mit 422 abgelehnt.",
                "tags": [
                    "flowdoc"
                ],
                "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": "e5f6a7b8-c9d0-4e1f-2a3b-4c5d6e7f8a9b",
                                        "title": "Notizen",
                                        "content": {
                                            "type": "doc",
                                            "content": [
                                                {
                                                    "type": "paragraph",
                                                    "content": [
                                                        {
                                                            "type": "text",
                                                            "text": "Angebot versendet."
                                                        }
                                                    ]
                                                }
                                            ]
                                        },
                                        "content_html": "<p>Angebot versendet.</p>",
                                        "documentable": {
                                            "type": "cmm_contact",
                                            "uuid": "7d2e6f3a-1b5c-4d8e-9f0a-3c4b5d6e7f8a"
                                        },
                                        "created_by_uuid": "2b7c4d8e-1f3a-4e5c-0d7b-2c9a8f4e3d1a",
                                        "latest_version_number": 2,
                                        "created_at": "2026-07-21T14:00:00+00:00",
                                        "updated_at": "2026-07-21T14:10:00+00:00"
                                    }
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Fehlerantwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                },
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "content": {
                                        "type": "string",
                                        "description": "Markdown-Inhalt, wird serverseitig in TipTap umgewandelt. null oder leerer String leert das Dokument"
                                    }
                                },
                                "required": [
                                    "content"
                                ]
                            }
                        }
                    }
                }
            }
        },
        "/projects/{uuid}/docs": {
            "get": {
                "operationId": "projects-docs-show",
                "summary": "Projekt-Dokument abrufen",
                "description": "Ruft das FlowDoc eines Projekts (ein Projekt hat kein eigenes Team und wird über seinen Kunden team-scoped) ab, inklusive latest_version_number. Existiert noch keines, wird es beim ersten Aufruf angelegt und leer zurückgegeben. documentable.type ist cmm_client_project.",
                "tags": [
                    "flowdoc"
                ],
                "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": "f6a7b8c9-d0e1-4f2a-3b4c-5d6e7f8a9b0c",
                                        "title": "Notizen",
                                        "content": {
                                            "type": "doc",
                                            "content": [
                                                {
                                                    "type": "paragraph",
                                                    "content": [
                                                        {
                                                            "type": "text",
                                                            "text": "Angebot bis Freitag."
                                                        }
                                                    ]
                                                }
                                            ]
                                        },
                                        "content_html": "<p>Angebot bis Freitag.</p>",
                                        "documentable": {
                                            "type": "cmm_client_project",
                                            "uuid": "6e3f7a4b-2c6d-4e9f-0a1b-4d5c6e7f8a9b"
                                        },
                                        "created_by_uuid": "2b7c4d8e-1f3a-4e5c-0d7b-2c9a8f4e3d1a",
                                        "latest_version_number": 1,
                                        "created_at": "2026-07-21T14:00:00+00:00",
                                        "updated_at": "2026-07-21T14:00:00+00:00"
                                    }
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Fehlerantwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            },
            "put": {
                "operationId": "projects-docs-update",
                "summary": "Projekt-Dokument aktualisieren",
                "description": "Ersetzt den Inhalt des FlowDocs vollständig. content muss übergeben werden; null oder ein leerer String leert das Dokument. Jeder Aufruf erzeugt eine neue Version und erhöht latest_version_number. title wird im Body mit 422 abgelehnt.",
                "tags": [
                    "flowdoc"
                ],
                "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": "f6a7b8c9-d0e1-4f2a-3b4c-5d6e7f8a9b0c",
                                        "title": "Notizen",
                                        "content": {
                                            "type": "doc",
                                            "content": [
                                                {
                                                    "type": "paragraph",
                                                    "content": [
                                                        {
                                                            "type": "text",
                                                            "text": "Angebot versendet."
                                                        }
                                                    ]
                                                }
                                            ]
                                        },
                                        "content_html": "<p>Angebot versendet.</p>",
                                        "documentable": {
                                            "type": "cmm_client_project",
                                            "uuid": "6e3f7a4b-2c6d-4e9f-0a1b-4d5c6e7f8a9b"
                                        },
                                        "created_by_uuid": "2b7c4d8e-1f3a-4e5c-0d7b-2c9a8f4e3d1a",
                                        "latest_version_number": 2,
                                        "created_at": "2026-07-21T14:00:00+00:00",
                                        "updated_at": "2026-07-21T14:10:00+00:00"
                                    }
                                }
                            }
                        }
                    },
                    "default": {
                        "description": "Fehlerantwort",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                },
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "content": {
                                        "type": "string",
                                        "description": "Markdown-Inhalt, wird serverseitig in TipTap umgewandelt. null oder leerer String leert das Dokument"
                                    }
                                },
                                "required": [
                                    "content"
                                ]
                            }
                        }
                    }
                }
            }
        }
    },
    "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"
                    }
                }
            }
        }
    }
}