{
  "openapi": "3.0.0",
  "info": {
    "title": "business.watch API",
    "version": "2.1.0",
    "description": "Directly accessing business.watch data and functions."
  },
  "tags": [
    {
      "name": "Search",
      "description": "Endpoints for searching organizations and persons.",
      "x-description-en": "Endpoints for searching organizations and persons.",
      "x-description-de": "Endpunkte zur Suche nach Organisationen und Personen."
    },
    {
      "name": "Organization",
      "description": "Endpoints for accessing organization data.",
      "x-description-en": "Endpoints for accessing organization data.",
      "x-description-de": "Endpunkte zum Abruf von Organisationsdaten."
    },
    {
      "name": "Person",
      "description": "Endpoints for accessing person data.",
      "x-description-en": "Endpoints for accessing person data.",
      "x-description-de": "Endpunkte zum Abruf von Personendaten."
    },
    {
      "name": "Agent",
      "description": "",
      "x-description-en": "AI assistant for natural language queries.",
      "x-description-de": "KI-Assistent für natürlichsprachliche Abfragen."
    },
    {
      "name": "Network",
      "description": "",
      "x-description-en": "Graph-based path finding between entities.",
      "x-description-de": "Graphbasierte Pfadsuche zwischen Entitäten."
    },
    {
      "name": "News",
      "description": "",
      "x-description-en": "Chronological newsfeed for entities.",
      "x-description-de": "Chronologischer Newsfeed für Entitäten."
    },
    {
      "name": "Selektion",
      "description": "",
      "x-description-en": "Structured organization search with filters.",
      "x-description-de": "Strukturierte Unternehmenssuche mit Filtern."
    }
  ],
  "servers": [
    {
      "url": "https://api.business.watch/"
    },
    {
      "url": "http://localhost:3000/"
    }
  ],
  "paths": {
    "/search": {
      "get": {
        "tags": [
          "Search"
        ],
        "summary": "Search for candidate organizations or persons (dedicated search namespace).",
        "description": "Returns a ranked candidate list. This is the explicit search entry point; the resource endpoints (/organization/{query}, /person/{query}) instead resolve a single best match internally. Without `type`, organizations and persons are searched together.\n",
        "parameters": [
          {
            "in": "query",
            "name": "q",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The search string (name, register number, business.watch ID, …).",
            "example": "WashTec"
          },
          {
            "in": "query",
            "name": "type",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "organization",
                "person"
              ]
            },
            "description": "Restrict to organizations or persons. Omit to search both."
          },
          {
            "in": "query",
            "name": "prominent",
            "required": false,
            "schema": {
              "type": "boolean"
            },
            "description": "type=person only: search prominent persons (Wikipedia) incl. a prominence rating A–D."
          },
          {
            "in": "query",
            "name": "birthday",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Optional birthday (YYYY-MM-DD or DD.MM.YYYY) to boost prominent-person matches."
          },
          {
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 50,
              "default": 10
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Candidate list.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "query": {
                      "type": "string"
                    },
                    "type": {
                      "type": "string"
                    },
                    "count": {
                      "type": "integer"
                    },
                    "results": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string",
                            "description": "business.watch ID"
                          },
                          "name": {
                            "type": "string"
                          },
                          "type": {
                            "type": "string",
                            "enum": [
                              "o",
                              "p"
                            ]
                          },
                          "score": {
                            "type": "integer",
                            "nullable": true
                          },
                          "city": {
                            "type": "string",
                            "nullable": true
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "query": "WashTec",
                  "type": "organization",
                  "count": 1,
                  "results": [
                    {
                      "id": "fXKFJB4v",
                      "name": "WashTec AG",
                      "type": "o",
                      "score": 1840,
                      "city": "Augsburg",
                      "organization_type": "AG",
                      "register_number": "HRB 81",
                      "birthday": null
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/400ResponseSearch"
          },
          "500": {
            "$ref": "#/components/responses/500ResponseSearch"
          }
        },
        "x-summary-en": "Search for candidate organizations or persons.",
        "x-summary-de": "Nach Organisationen oder Personen suchen (Kandidatenliste).",
        "x-description-en": "Dedicated search namespace; returns a ranked candidate list. The resource endpoints (/organization/{query}, /person/{query}) instead resolve a single best match internally. Use `type=organization|person` to restrict, or `prominent=true` (with `type=person`) for Wikipedia-based prominent persons incl. a prominence rating.",
        "x-description-de": "Dediziertes Such-Namespace; liefert eine bewertete Kandidatenliste. Die Resource-Endpunkte (/organization/{query}, /person/{query}) lösen stattdessen intern den besten Treffer auf. Mit `type=organization|person` eingrenzen oder `prominent=true` (mit `type=person`) für prominente Personen (Wikipedia) inkl. Prominenz-Rating."
      }
    },
    "/organization/{query}": {
      "get": {
        "tags": [
          "Organization"
        ],
        "summary": "Organisations-Dossier — gebündelt (Stammdaten + Finanzen + Beziehungen) in einem Aufruf.",
        "parameters": [
          {
            "$ref": "#/components/parameters/OrgQuery"
          },
          {
            "$ref": "#/components/parameters/OrgTypeHint"
          }
        ],
        "responses": {
          "200": {
            "description": "Gebündeltes Dossier — Felder flach, Beziehungen unter relations{…}, resolved am Ende.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "description": "Stammdaten + Finanzen flach, plus relations{management, prokura, supervisory_board, owner, auditor, holdings}, counts/truncated und resolved.",
                  "additionalProperties": true,
                  "properties": {
                    "resolved": {
                      "$ref": "#/components/schemas/Resolved"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Organisation nicht gefunden."
          },
          "500": {
            "description": "Interner Serverfehler."
          }
        },
        "x-group": "Dossier",
        "x-summary-en": "Organization dossier — bundled (master data + financials + relations) in one call.",
        "x-summary-de": "Organisations-Dossier — gebündelt (Stammdaten + Finanzen + Beziehungen) in einem Aufruf.",
        "x-description-en": "Returns the full, BUNDLED dossier in one call: master data (name, address, register, LEI, ISIN, inception, line of business), financial figures, the company description AND the relationships grouped by category — `relations: { management, prokura, supervisory_board, owner, auditor, holdings }` — incl. counts/truncated, master data flat at the top level. `management`…`auditor` are incoming relations; `holdings` are the company's own outgoing shareholdings/subsidiaries. `{query}` may be a business.watch ID, LEI, ISIN, register number OR a name; the best match is resolved internally and appended as `resolved:{id,name,score}` (last field). Optional `?type=lei|isin|id|register|name` hints how to interpret {query}.",
        "x-description-de": "Liefert das vollständige, GEBÜNDELTE Dossier in einem Aufruf: Stammdaten (Name, Adresse, Register, LEI, ISIN, Gründung, Branche), Finanzkennzahlen, Unternehmensbeschreibung UND die nach Kategorien gruppierten Beziehungen — `relations: { management, prokura, supervisory_board, owner, auditor, holdings }` — inkl. counts/truncated, Stammdaten flach auf oberster Ebene. `management`…`auditor` sind eingehende Relationen; `holdings` sind die eigenen ausgehenden Beteiligungen/Tochtergesellschaften. `{query}` kann eine business.watch ID, LEI, ISIN, Registernummer ODER ein Name sein; der beste Treffer wird intern aufgelöst und als `resolved:{id,name,score}` ans Ende angehängt (letztes Feld). Optional `?type=lei|isin|id|register|name` als Interpretationshinweis."
      }
    },
    "/organization/{query}/management": {
      "get": {
        "tags": [
          "Organization"
        ],
        "summary": "Beziehungen — Geschäftsführung / Vorstand (management).",
        "parameters": [
          {
            "$ref": "#/components/parameters/OrgQuery"
          },
          {
            "$ref": "#/components/parameters/OrgTypeHint"
          }
        ],
        "responses": {
          "200": {
            "description": "{ management, count, truncated, resolved }"
          },
          "404": {
            "description": "Organisation nicht gefunden."
          }
        },
        "x-group": "Beziehungen",
        "x-summary-en": "Relations — management (executive board / managing directors).",
        "x-summary-de": "Beziehungen — Geschäftsführung / Vorstand (management).",
        "x-description-en": "Returns only the management relations (managing directors / executive board) of the organization — capped, with count/truncated. Procuration, supervisory board, owners, auditors and shareholdings each have their own category (see the bundled dossier `GET /organization/{query}`).",
        "x-description-de": "Liefert nur die Geschäftsführungs-/Vorstandsbeziehungen der Organisation — gekappt, mit count/truncated. Prokura, Aufsichtsrat, Eigentümer, Wirtschaftsprüfer und Beteiligungen haben jeweils eine eigene Kategorie (siehe gebündeltes Dossier `GET /organization/{query}`)."
      }
    },
    "/organization/{query}/prokura": {
      "get": {
        "tags": [
          "Organization"
        ],
        "summary": "Beziehungen — Prokuristen (prokura).",
        "parameters": [
          {
            "$ref": "#/components/parameters/OrgQuery"
          },
          {
            "$ref": "#/components/parameters/OrgTypeHint"
          }
        ],
        "responses": {
          "200": {
            "description": "{ prokura, count, truncated, resolved }"
          },
          "404": {
            "description": "Organisation nicht gefunden."
          }
        },
        "x-group": "Beziehungen",
        "x-summary-en": "Relations — authorised signatories (Prokura).",
        "x-summary-de": "Beziehungen — Prokuristen (Prokura).",
        "x-description-en": "Returns the procuration holders (Prokuristen) of the organization — capped, with count/truncated.",
        "x-description-de": "Liefert die Prokuristen der Organisation — gekappt, mit count/truncated."
      }
    },
    "/organization/{query}/supervisory_board": {
      "get": {
        "tags": [
          "Organization"
        ],
        "summary": "Beziehungen — Aufsichtsrat (supervisory_board).",
        "parameters": [
          {
            "$ref": "#/components/parameters/OrgQuery"
          },
          {
            "$ref": "#/components/parameters/OrgTypeHint"
          }
        ],
        "responses": {
          "200": {
            "description": "{ supervisory_board, count, truncated, resolved }"
          },
          "404": {
            "description": "Organisation nicht gefunden."
          }
        },
        "x-group": "Beziehungen",
        "x-summary-en": "Relations — supervisory board.",
        "x-summary-de": "Beziehungen — Aufsichtsrat.",
        "x-description-en": "Returns the supervisory board members of the organization — capped, with count/truncated. Where the legal form does not reliably file changes to the supervisory board (GmbH and similar — unlike AG/SE/KGaA), an active membership carries `last_confirmed: { date, publication_id }` — the date this line-up is last attested for, and the document attesting it. Such a membership is confirmed as of that date, NOT necessarily as of today; if the date equals the start of the relation, the line-up has never been re-attested since it began.",
        "x-description-de": "Liefert die Aufsichtsratsmitglieder der Organisation — gekappt, mit count/truncated. Bei Rechtsformen, die Änderungen im Aufsichtsrat nicht verlässlich einreichen (GmbH und ähnliche — anders als AG/SE/KGaA), trägt eine aktive Mitgliedschaft `last_confirmed: { date, publication_id }` — das Datum, zu dem diese Besetzung letztmals belegt ist, plus den Beleg. Sie ist damit zu diesem Datum bestätigt, NICHT zwingend bis heute; stimmt das Datum mit dem Beginn der Beziehung überein, wurde die Besetzung seit dem Beginn nie erneut belegt."
      }
    },
    "/organization/{query}/owner": {
      "get": {
        "tags": [
          "Organization"
        ],
        "summary": "Beziehungen — Eigentümer / Gesellschafter (owner), inkl. Kontrollverträge.",
        "parameters": [
          {
            "$ref": "#/components/parameters/OrgQuery"
          },
          {
            "$ref": "#/components/parameters/OrgTypeHint"
          }
        ],
        "responses": {
          "200": {
            "description": "{ owner, count, truncated, resolved }"
          },
          "404": {
            "description": "Organisation nicht gefunden."
          }
        },
        "x-group": "Beziehungen",
        "x-summary-en": "Relations — owners / shareholders (incl. control agreements).",
        "x-summary-de": "Beziehungen — Eigentümer / Gesellschafter (inkl. Kontrollverträge).",
        "x-description-en": "Returns the incoming owners/shareholders of the organization — including controlling agreements (profit-transfer / domination) — capped, with count/truncated. For the multi-level UBO chain use `GET /organization/{query}/ownership`.",
        "x-description-de": "Liefert die eingehenden Eigentümer/Gesellschafter der Organisation — inklusive Kontrollverträge (Gewinnabführungs-/Beherrschungsvertrag) — gekappt, mit count/truncated. Für die mehrstufige UBO-Kette siehe `GET /organization/{query}/ownership`."
      }
    },
    "/organization/{query}/auditor": {
      "get": {
        "tags": [
          "Organization"
        ],
        "summary": "Beziehungen — Wirtschaftsprüfer (auditor).",
        "parameters": [
          {
            "$ref": "#/components/parameters/OrgQuery"
          },
          {
            "$ref": "#/components/parameters/OrgTypeHint"
          }
        ],
        "responses": {
          "200": {
            "description": "{ auditor, count, truncated, resolved }"
          },
          "404": {
            "description": "Organisation nicht gefunden."
          }
        },
        "x-group": "Beziehungen",
        "x-summary-en": "Relations — auditors.",
        "x-summary-de": "Beziehungen — Wirtschaftsprüfer.",
        "x-description-en": "Returns the auditors of the organization — capped, with count/truncated.",
        "x-description-de": "Liefert die Wirtschaftsprüfer der Organisation — gekappt, mit count/truncated."
      }
    },
    "/organization/{query}/holdings": {
      "get": {
        "tags": [
          "Organization"
        ],
        "summary": "Beziehungen — Beteiligungen / Tochtergesellschaften (holdings, ausgehend).",
        "parameters": [
          {
            "$ref": "#/components/parameters/OrgQuery"
          },
          {
            "$ref": "#/components/parameters/OrgTypeHint"
          }
        ],
        "responses": {
          "200": {
            "description": "{ holdings, count, truncated, resolved }"
          },
          "404": {
            "description": "Organisation nicht gefunden."
          }
        },
        "x-group": "Beziehungen",
        "x-summary-en": "Relations — shareholdings / subsidiaries (outgoing).",
        "x-summary-de": "Beziehungen — Beteiligungen / Tochtergesellschaften (ausgehend).",
        "x-description-en": "Returns the organization's OWN outgoing shareholdings / subsidiaries (companies it holds a stake in) — capped, with count/truncated.",
        "x-description-de": "Liefert die EIGENEN ausgehenden Beteiligungen / Tochtergesellschaften der Organisation (Firmen, an denen sie beteiligt ist) — gekappt, mit count/truncated."
      }
    },
    "/organization/{query}/ownership": {
      "get": {
        "tags": [
          "Organization"
        ],
        "summary": "Mehrstufige Eigentümer-/UBO-Kette (kontrollierende Kette, >25% bzw. beherrschende Rolle).",
        "parameters": [
          {
            "$ref": "#/components/parameters/OrgQuery"
          },
          {
            "$ref": "#/components/parameters/OrgTypeHint"
          }
        ],
        "responses": {
          "200": {
            "description": "{ levels, owners, max_depth_reached, truncated, resolved }"
          },
          "404": {
            "description": "Organisation nicht gefunden."
          }
        },
        "x-group": "Beziehungen",
        "x-summary-en": "Multi-level ownership / UBO chain.",
        "x-summary-de": "Mehrstufige Eigentümer-/UBO-Kette.",
        "x-description-en": "Follows the controlling ownership chain upstream (>25% stake or a clearly controlling role). A single call returns all levels.",
        "x-description-de": "Verfolgt die kontrollierende Eigentümer-Kette upstream (>25% Anteil oder eindeutig beherrschende Rolle). Ein Aufruf liefert alle Ebenen."
      }
    },
    "/organization/{query}/history": {
      "get": {
        "tags": [
          "Organization"
        ],
        "summary": "Beziehungs-Historie (eingehende/ausgehende Rollen über die Zeit).",
        "parameters": [
          {
            "$ref": "#/components/parameters/OrgQuery"
          },
          {
            "$ref": "#/components/parameters/OrgTypeHint"
          }
        ],
        "responses": {
          "200": {
            "description": "{ history, resolved }"
          },
          "404": {
            "description": "Organisation nicht gefunden."
          }
        },
        "x-group": "Beziehungen",
        "x-summary-en": "Relationship / role history of the organization.",
        "x-summary-de": "Beziehungs-/Rollenhistorie der Organisation."
      }
    },
    "/organization/{query}/financials": {
      "get": {
        "tags": [
          "Organization"
        ],
        "summary": "Finanzkennzahlen-Zeitreihen (Bilanzsumme, Umsatz, Gewinn, Mitarbeiter).",
        "parameters": [
          {
            "$ref": "#/components/parameters/OrgQuery"
          },
          {
            "$ref": "#/components/parameters/OrgTypeHint"
          }
        ],
        "responses": {
          "200": {
            "description": "{ total_assets, revenue, profit, employees, resolved }"
          },
          "404": {
            "description": "Organisation nicht gefunden."
          }
        },
        "x-group": "Finanzen",
        "x-summary-en": "Financial figure time series (balance, revenue, profit, employees).",
        "x-summary-de": "Finanzkennzahlen-Zeitreihen (Bilanzsumme, Umsatz, Gewinn, Mitarbeiter)."
      }
    },
    "/organization/{query}/insolvency": {
      "get": {
        "tags": [
          "Organization"
        ],
        "summary": "Insolvenzstatus und anzeigbare Verfahren einer Organisation.",
        "parameters": [
          {
            "$ref": "#/components/parameters/OrgQuery"
          },
          {
            "$ref": "#/components/parameters/OrgTypeHint"
          }
        ],
        "responses": {
          "200": {
            "description": "Kein Verfahren ist ein regulaerer Treffer mit insolvent=false, status=null und leerem verfahren-Array.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InsolvencyResource"
                }
              }
            }
          },
          "404": {
            "description": "Organisation nicht gefunden."
          }
        },
        "x-group": "Insolvenz",
        "x-summary-en": "Insolvency status and visible proceedings of an organization.",
        "x-summary-de": "Insolvenzstatus und anzeigbare Verfahren einer Organisation."
      }
    },
    "/organization/{query}/documents": {
      "get": {
        "tags": [
          "Organization"
        ],
        "summary": "Offizielle Dokumente (Jahresabschluss, Gesellschaftsvertrag, Gesellschafter-/Aufsichtsratliste, chron. Abdruck).",
        "parameters": [
          {
            "$ref": "#/components/parameters/OrgQuery"
          },
          {
            "$ref": "#/components/parameters/OrgTypeHint"
          },
          {
            "in": "query",
            "name": "category",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Optional auf eine Dokumentkategorie filtern."
          },
          {
            "in": "query",
            "name": "latest",
            "required": false,
            "schema": {
              "type": "boolean"
            },
            "description": "Nur das neueste passende Dokument zurückgeben."
          }
        ],
        "responses": {
          "200": {
            "description": "Liste der Dokument-Metadaten. Jedes Dokument trägt eine publication_id — der Inhalt (CD-Tabelle bzw. Datei) wird über GET /document/{publicationId} geladen.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "count": {
                      "type": "integer"
                    },
                    "documents": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "publication_id": {
                            "type": "string",
                            "description": "ID für GET /document/{publicationId}"
                          },
                          "name": {
                            "type": "string"
                          },
                          "date": {
                            "type": "string",
                            "description": "YYYY-MM-DD"
                          },
                          "publication_type": {
                            "type": "string",
                            "description": "CD | GEL | LAM | DOC | HTML"
                          },
                          "is_group": {
                            "type": "boolean",
                            "description": "Nur bei Jahresabschlüssen: Konzernabschluss?"
                          }
                        }
                      }
                    },
                    "resolved": {
                      "$ref": "#/components/schemas/Resolved"
                    }
                  },
                  "example": {
                    "count": 2,
                    "documents": [
                      {
                        "publication_id": "MV3zf-7i",
                        "name": "Aktueller Abdruck",
                        "date": "2026-05-22",
                        "publication_type": "CD"
                      },
                      {
                        "publication_id": "4ZTIjP7j",
                        "name": "Gesellschafterliste",
                        "date": "2025-01-09",
                        "publication_type": "GEL"
                      }
                    ],
                    "resolved": {
                      "id": "X0bwAFT6",
                      "name": "Query GmbH",
                      "score": 30151728
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Organisation nicht gefunden."
          }
        },
        "x-group": "Dokumente",
        "x-summary-en": "Official documents (annual reports, articles of association, shareholder/board lists, chronological print).",
        "x-summary-de": "Offizielle Dokumente (Jahresabschluss, Gesellschaftsvertrag, Gesellschafter-/Aufsichtsratliste, chronologischer Abdruck).",
        "x-description-en": "Returns document metadata. Each document carries a `publication_id`, a `name`, a `date` and a `publication_type` (CD | GEL | LAM | DOC | HTML). Fetch the actual content (chronological print as a table, otherwise the file) via `GET /document/{publicationId}`. Optional `?category=…` filter and `?latest=true` for the newest matching document.",
        "x-description-de": "Liefert Dokument-Metadaten. Jedes Dokument trägt eine `publication_id`, einen `name`, ein `date` und einen `publication_type` (CD | GEL | LAM | DOC | HTML). Den eigentlichen Inhalt (chronologischer Abdruck als Tabelle, sonst die Datei) liefert `GET /document/{publicationId}`. Optional `?category=…`-Filter und `?latest=true` für das neueste passende Dokument."
      }
    },
    "/document/{publicationId}": {
      "get": {
        "tags": [
          "Organization"
        ],
        "summary": "Dokumentinhalt — chronologischer Abdruck als Tabelle, sonst die Datei.",
        "parameters": [
          {
            "in": "path",
            "name": "publicationId",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "publication_id eines Dokuments (aus GET /organization/{query}/documents).",
            "example": "MV3zf-7i"
          },
          {
            "in": "query",
            "name": "token",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Optionaler signierter Download-Token (kurzlebig). Mit gültigem Token wird IMMER die Datei gestreamt (kein Login nötig); jede Aktivierung kostet 50 Credits zulasten des im Token gebundenen Pools."
          }
        ],
        "responses": {
          "200": {
            "description": "Bei chronologischem Abdruck (CD) JSON mit dem Tabelleninhalt ({ publication_id, publication_type, headers, rows, meta }); bei allen anderen Dokumenten die (zu PDF konvertierte) Datei als Download-Stream.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "publication_id": {
                      "type": "string"
                    },
                    "publication_type": {
                      "type": "string",
                      "example": "CD"
                    },
                    "headers": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "rows": {
                      "type": "array",
                      "items": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    },
                    "meta": {
                      "type": "object"
                    }
                  }
                }
              },
              "application/pdf": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "404": {
            "description": "Dokument nicht gefunden."
          },
          "500": {
            "description": "Interner Serverfehler."
          }
        },
        "x-group": "Dokumente",
        "x-summary-en": "Document content — chronological print as a table, otherwise the file.",
        "x-summary-de": "Dokumentinhalt — chronologischer Abdruck als Tabelle, sonst die Datei.",
        "x-description-en": "Returns the content of a single document by its `publication_id` (from `GET /organization/{query}/documents`). For a chronological print (CD) the parsed register table is returned as JSON (`{ publication_id, publication_type, headers, rows, meta }`); for every other document the (PDF-converted) file is streamed back as a download.",
        "x-description-de": "Liefert den Inhalt eines einzelnen Dokuments anhand seiner `publication_id` (aus `GET /organization/{query}/documents`). Bei einem chronologischen Abdruck (CD) wird die geparste Register-Tabelle als JSON zurückgegeben (`{ publication_id, publication_type, headers, rows, meta }`); bei jedem anderen Dokument wird die (zu PDF konvertierte) Datei als Download zurückgestreamt."
      }
    },
    "/person/{query}": {
      "get": {
        "tags": [
          "Person"
        ],
        "summary": "Personen-Dossier — gebündelt (Stammdaten + Beziehungen + Timeline) in einem Aufruf.",
        "parameters": [
          {
            "$ref": "#/components/parameters/PersonQuery"
          },
          {
            "$ref": "#/components/parameters/PersonTypeHint"
          }
        ],
        "responses": {
          "200": {
            "description": "Dossier — Felder flach, Beziehungen unter relations{…}, timeline separat, resolved am Ende.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "description": "Stammdaten flach, plus relations{management, prokura, supervisory_board, auditor, holdings}, timeline, counts/truncated und resolved.",
                  "additionalProperties": true,
                  "properties": {
                    "resolved": {
                      "$ref": "#/components/schemas/Resolved"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Person nicht gefunden."
          },
          "500": {
            "description": "Interner Serverfehler."
          }
        },
        "x-group": "Dossier",
        "x-summary-en": "Person dossier — bundled (master data + relations + timeline) in one call.",
        "x-summary-de": "Personen-Dossier — gebündelt (Stammdaten + Beziehungen + Timeline) in einem Aufruf.",
        "x-description-en": "`{query}` may be a business.watch ID OR a name — the best match is resolved internally. Returns the master data flat, the relationships grouped by category — `relations: { management, prokura, supervisory_board, auditor, holdings }` (persons have no owner category; their stakes are `holdings`) — plus a chronological timeline, with the resolved match appended as `resolved:{id,name,score}` (last field).",
        "x-description-de": "`{query}` kann eine business.watch ID ODER ein Name sein — der beste Treffer wird intern aufgelöst. Liefert die Stammdaten flach, die nach Kategorien gruppierten Beziehungen — `relations: { management, prokura, supervisory_board, auditor, holdings }` (Personen haben keine owner-Kategorie; ihre Beteiligungen stehen unter `holdings`) — plus eine chronologische Timeline; der aufgelöste Treffer wird als `resolved:{id,name,score}` ans Ende angehängt (letztes Feld)."
      }
    },
    "/person/{query}/management": {
      "get": {
        "tags": [
          "Person"
        ],
        "summary": "Beziehungen — Geschäftsführungs-/Vorstandsrollen (management).",
        "parameters": [
          {
            "$ref": "#/components/parameters/PersonQuery"
          },
          {
            "$ref": "#/components/parameters/PersonTypeHint"
          }
        ],
        "responses": {
          "200": {
            "description": "{ management, count, truncated, resolved }"
          },
          "404": {
            "description": "Person nicht gefunden."
          }
        },
        "x-group": "Beziehungen",
        "x-summary-en": "Relations — executive / management roles.",
        "x-summary-de": "Beziehungen — Geschäftsführungs-/Vorstandsrollen (management)."
      }
    },
    "/person/{query}/prokura": {
      "get": {
        "tags": [
          "Person"
        ],
        "summary": "Beziehungen — Prokura-Rollen (prokura).",
        "parameters": [
          {
            "$ref": "#/components/parameters/PersonQuery"
          },
          {
            "$ref": "#/components/parameters/PersonTypeHint"
          }
        ],
        "responses": {
          "200": {
            "description": "{ prokura, count, truncated, resolved }"
          },
          "404": {
            "description": "Person nicht gefunden."
          }
        },
        "x-group": "Beziehungen",
        "x-summary-en": "Relations — procuration roles (Prokura).",
        "x-summary-de": "Beziehungen — Prokura-Rollen (prokura)."
      }
    },
    "/person/{query}/supervisory_board": {
      "get": {
        "tags": [
          "Person"
        ],
        "summary": "Beziehungen — Aufsichtsratsmandate (supervisory_board).",
        "parameters": [
          {
            "$ref": "#/components/parameters/PersonQuery"
          },
          {
            "$ref": "#/components/parameters/PersonTypeHint"
          }
        ],
        "responses": {
          "200": {
            "description": "{ supervisory_board, count, truncated, resolved }"
          },
          "404": {
            "description": "Person nicht gefunden."
          }
        },
        "x-group": "Beziehungen",
        "x-summary-en": "Relations — supervisory board mandates.",
        "x-summary-de": "Beziehungen — Aufsichtsratsmandate (supervisory_board).",
        "x-description-en": "Returns the person's supervisory board mandates. Where the company's legal form does not reliably file changes to the supervisory board (GmbH and similar — unlike AG/SE/KGaA), an active mandate carries `last_confirmed: { date, publication_id }` — the date this line-up is last attested for, and the document attesting it. Such a mandate is confirmed as of that date, NOT necessarily as of today.",
        "x-description-de": "Liefert die Aufsichtsratsmandate der Person. Bei Rechtsformen, die Änderungen im Aufsichtsrat nicht verlässlich einreichen (GmbH und ähnliche — anders als AG/SE/KGaA), trägt ein aktives Mandat `last_confirmed: { date, publication_id }` — das Datum, zu dem diese Besetzung letztmals belegt ist, plus den Beleg. Es ist damit zu diesem Datum bestätigt, NICHT zwingend bis heute."
      }
    },
    "/person/{query}/auditor": {
      "get": {
        "tags": [
          "Person"
        ],
        "summary": "Beziehungen — Wirtschaftsprüfer-Mandate (auditor).",
        "parameters": [
          {
            "$ref": "#/components/parameters/PersonQuery"
          },
          {
            "$ref": "#/components/parameters/PersonTypeHint"
          }
        ],
        "responses": {
          "200": {
            "description": "{ auditor, count, truncated, resolved }"
          },
          "404": {
            "description": "Person nicht gefunden."
          }
        },
        "x-group": "Beziehungen",
        "x-summary-en": "Relations — auditor mandates.",
        "x-summary-de": "Beziehungen — Wirtschaftsprüfer-Mandate (auditor)."
      }
    },
    "/person/{query}/holdings": {
      "get": {
        "tags": [
          "Person"
        ],
        "summary": "Beziehungen — gehaltene Beteiligungen (holdings, ausgehend).",
        "parameters": [
          {
            "$ref": "#/components/parameters/PersonQuery"
          },
          {
            "$ref": "#/components/parameters/PersonTypeHint"
          }
        ],
        "responses": {
          "200": {
            "description": "{ holdings, count, truncated, resolved }"
          },
          "404": {
            "description": "Person nicht gefunden."
          }
        },
        "x-group": "Beziehungen",
        "x-summary-en": "Relations — shareholdings held (outgoing).",
        "x-summary-de": "Beziehungen — gehaltene Beteiligungen (holdings)."
      }
    },
    "/person/{query}/insolvency": {
      "get": {
        "tags": [
          "Person"
        ],
        "summary": "Insolvenzstatus und anzeigbare Verfahren einer Person.",
        "parameters": [
          {
            "$ref": "#/components/parameters/PersonQuery"
          },
          {
            "$ref": "#/components/parameters/PersonTypeHint"
          }
        ],
        "responses": {
          "200": {
            "description": "Kein Verfahren ist ein regulaerer Treffer mit insolvent=false, status=null und leerem verfahren-Array.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InsolvencyResource"
                }
              }
            }
          },
          "404": {
            "description": "Person nicht gefunden."
          }
        },
        "x-group": "Insolvenz",
        "x-summary-en": "Insolvency status and visible proceedings of a person.",
        "x-summary-de": "Insolvenzstatus und anzeigbare Verfahren einer Person."
      }
    },
    "/agent": {
      "post": {
        "tags": [
          "Agent"
        ],
        "summary": "Stellt eine Frage an den business.watch KI-Agenten.",
        "description": "Erlaubt es, natürlichsprachliche Fragen zu Unternehmensstrukturen, Personen oder wirtschaftlichen Zusammenhängen zu stellen. Durch das Mitgeben einer `conversationHistory` kann Kontext für Folgefragen aufgebaut werden. Es werden keine Sessions serverseitig gespeichert.\n",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "userPrompt"
                ],
                "properties": {
                  "userPrompt": {
                    "type": "string",
                    "description": "Die aktuelle Frage oder Anweisung des Nutzers.",
                    "example": "Zeige mir bitte die aktuellen Führungskräfte dieser Firma."
                  },
                  "conversationHistory": {
                    "type": "array",
                    "description": "Der bisherige Chatverlauf, um Kontext für Folgefragen zu liefern. Optional.",
                    "items": {
                      "$ref": "#/components/schemas/ChatMessage"
                    },
                    "example": [
                      {
                        "role": "user",
                        "content": "Wer sind die größten Automobilzulieferer in Bayern?"
                      },
                      {
                        "role": "assistant",
                        "content": "Zu den größten Automobilzulieferern in Bayern zählen unter anderem die Schaeffler AG, die Brose Fahrzeugteile SE & Co. KG sowie die Webasto SE."
                      }
                    ]
                  }
                },
                "example": {
                  "userPrompt": "Schreibe mir einen Dossier über Julius Maneth."
                }
              },
              "examples": {
                "ohneConversationHistory": {
                  "summary": "Anfrage ohne vorherigen Kontext",
                  "value": {
                    "userPrompt": "Schreibe mir einen Dossier über Julius Maneth.",
                    "conversationHistory": []
                  }
                },
                "mitConversationHistory": {
                  "summary": "Anfrage mit bestehendem Gesprächskontext",
                  "value": {
                    "userPrompt": "Schreibe mir einen Dossier über Julius Maneth.",
                    "conversationHistory": [
                      {
                        "role": "user",
                        "content": "Wer ist Julius Maneth?"
                      },
                      {
                        "role": "assistant",
                        "content": "Julius Maneth ist eine Person, zu der wir nun weitere Hintergrundinformationen zusammentragen können."
                      }
                    ]
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Die Antwort der KI, generierte Filterkonfigurationen und eventuell verknüpfte Publikationen.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "answer": {
                      "type": "string",
                      "description": "Die formatierte Textantwort der KI (oft in Markdown)."
                    },
                    "publications": {
                      "type": "array",
                      "description": "Eine Liste von Publikationen, falls die KI Dokumente als Quellen herangezogen hat.",
                      "items": {
                        "type": "object"
                      }
                    },
                    "screeningConfig": {
                      "type": "array",
                      "description": "Ein maschinenlesbares Array von Filter-Kriterien (z.B. für weiterführende Suchabfragen), falls zutreffend.",
                      "items": {
                        "type": "object"
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Fehlerhafte Anfrage (z.B. fehlender `userPrompt`)."
          },
          "500": {
            "description": "Interner Server- oder KI-Fehler."
          }
        },
        "x-summary-en": "Ask a question to the business.watch AI agent.",
        "x-summary-de": "Stellt eine Frage an den business.watch KI-Agenten.",
        "x-description-en": "Allows you to ask natural language questions about company structures, persons, or economic relationships. By including a `conversationHistory`, you can build context for follow-up questions. No sessions are stored server-side.",
        "x-description-de": "Erlaubt es, natürlichsprachliche Fragen zu Unternehmensstrukturen, Personen oder wirtschaftlichen Zusammenhängen zu stellen. Durch das Mitgeben einer `conversationHistory` kann Kontext für Folgefragen aufgebaut werden. Es werden keine Sessions serverseitig gespeichert."
      }
    },
    "/connection": {
      "post": {
        "tags": [
          "Network"
        ],
        "summary": "Findet den kürzesten Weg zwischen zwei oder mehr Knoten (Unternehmen / Personen).",
        "description": "Dieser Endpoint nutzt Graphen-Technologie, um indirekte und direkte Verbindungen über bis zu 60 Ebenen zwischen Ziel-Knoten (Personen oder Organisationen) zu finden.\n`targets` dürfen business.watch IDs ODER Namen sein — beides wird intern aufgelöst (siehe `resolvedTargets` in der Antwort).\nDie Antwort enthält vorberechnete, gerichtete Pfade (`connectionPaths`, `pathsAreGrouped`) OHNE KI. Optional liefert `ai_summary: true` zusätzlich eine in natürlicher Sprache verfasste KI-Erklärung.\n",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "targets"
                ],
                "properties": {
                  "targets": {
                    "type": "array",
                    "description": "Array von mindestens zwei business.watch IDs ODER Namen (Person oder Organisation).",
                    "items": {
                      "type": "string"
                    }
                  },
                  "ai_summary": {
                    "type": "boolean",
                    "description": "Setze auf `true`, um zusätzlich eine durch KI generierte Text-Erklärung des Pfades zu erhalten.",
                    "default": false
                  }
                }
              },
              "examples": {
                "defaultSearch": {
                  "summary": "Standard Pfad-Suche mit KI-Zusammenfassung",
                  "description": "Sucht nach Verbindungen zwischen zwei beispielhaften Knoten und fordert gleichzeitig die Erklärungs-KI an.",
                  "value": {
                    "targets": [
                      "hWV0hwvc",
                      "JKDJiXse"
                    ],
                    "ai_summary": true
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Ein Graph-Objekt (Knoten und Relationen) sowie optional die KI-Erklärung. Sind die Arrays leer, existiert keine Verbindung.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "nodes": {
                      "type": "array",
                      "description": "Die Liste aller beteiligten Entitäten auf dem Pfad.",
                      "items": {
                        "type": "object"
                      }
                    },
                    "relations": {
                      "type": "array",
                      "description": "Die Relationen (Kanten), die die Knoten verbinden.",
                      "items": {
                        "type": "object"
                      }
                    },
                    "summary": {
                      "type": "string",
                      "nullable": true,
                      "description": "Die KI-generierte Erklärung des Pfades in Textform. Nur vorhanden, wenn `ai_summary: true` gesetzt wurde."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Ungültige Parameter (z.B. weniger als 2 Targets übergeben).",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Interner Server-Fehler bei der Pfadsuche."
          }
        },
        "x-summary-en": "Find the shortest path between two or more nodes (organizations / persons).",
        "x-summary-de": "Findet den kürzesten Weg zwischen zwei oder mehr Knoten (Unternehmen / Personen).",
        "x-description-en": "This endpoint uses graph technology to find indirect and direct connections across up to 60 levels between target IDs (persons or organizations).\nAdditionally, a flag can be set to request a detailed, natural language summary generated by AI that explains the discovered route in an understandable way.",
        "x-description-de": "Dieser Endpoint nutzt Graphen-Technologie, um indirekte und direkte Verbindungen über bis zu 60 Ebenen zwischen Ziel-IDs (Personen oder Organisationen) zu finden.\nZusätzlich kann über ein Flag eine detaillierte, in natürlicher Sprache verfasste Zusammenfassung der KI angefordert werden, welche die gefundene Route verständlich erklärt."
      }
    },
    "/at-address": {
      "get": {
        "tags": [
          "Network"
        ],
        "summary": "Reverse-Lookup — wer (Organisationen + Personen) ist an einer Adresse.",
        "description": "Liefert eine flache, gemischte Liste von Organisationen und Personen an der angegebenen Adresse. Jeder Treffer trägt `type` ('o' = Organisation, 'p' = Person). Mindestens eines von street/city/zip ist erforderlich. Personen werden nur bei gesetztem zip/city einbezogen (sie tragen keine Straße).\n",
        "parameters": [
          {
            "in": "query",
            "name": "street",
            "schema": {
              "type": "string"
            },
            "description": "Straße (unscharf gematcht)."
          },
          {
            "in": "query",
            "name": "city",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "zip",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Treffer-Liste.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "query": {
                      "type": "object"
                    },
                    "count": {
                      "type": "integer"
                    },
                    "results": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string",
                            "description": "business.watch ID"
                          },
                          "type": {
                            "type": "string",
                            "enum": [
                              "o",
                              "p"
                            ]
                          },
                          "name": {
                            "type": "string"
                          },
                          "street": {
                            "type": "string",
                            "nullable": true
                          },
                          "zip": {
                            "type": "string",
                            "nullable": true
                          },
                          "city": {
                            "type": "string",
                            "nullable": true
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Kein Adresskriterium angegeben."
          },
          "500": {
            "description": "Interner Serverfehler."
          }
        },
        "x-summary-en": "Reverse lookup: who (organizations + persons) is at an address.",
        "x-summary-de": "Reverse-Lookup: wer (Organisationen + Personen) ist an einer Adresse.",
        "x-description-en": "Returns a flat, mixed list of organizations and persons at the address (each with `type` o|p). At least one of street/city/zip is required; persons are only included when city/zip is given.",
        "x-description-de": "Liefert eine flache, gemischte Liste von Organisationen und Personen an der Adresse (jeder Treffer mit `type` o|p). Mindestens eines von street/city/zip ist erforderlich; Personen nur bei city/zip."
      }
    },
    "/news": {
      "post": {
        "tags": [
          "News"
        ],
        "summary": "Ruft Neuigkeiten für eine spezifische Person oder Organisation ab.",
        "description": "Dieser Endpoint liefert einen chronologischen Newsfeed für eine spezifische Unternehmens- oder Personen-ID (`node_id`).\nDie Daten werden on-the-fly generiert und beinhalten Registeränderungen, neue Publikationen inkl. extrahierter Finanzkennzahlen sowie Geburtstage.\n\n---\n\n### Unterstützte Event-Typen (`eventTypes`)\nDu kannst die Ergebnisse filtern, indem du ein Array der gewünschten Typen übergibst. Lässt du das Feld weg, werden alle Typen zurückgegeben.\n- **`new_role`**: Neue Registereintragungen (z.B. neuer Geschäftsführer, neue Gesellschafterliste).\n- **`role_ended`**: Austragungen aus dem Handelsregister.\n- **`share_transfer`**: Veräußerung von Unternehmensanteilen. Enthält im `event_data` u.a. Verkäufer, verlorene Prozentanteile, Empfänger (`recipients[]`) und bei vollständigem Exit `combines_role_ended = true`.\n- **`new_publication`**: Neue Publikationen (Jahresabschlüsse, Bilanzen). Enthält im `event_data.figures` Array oftmals direkt extrahierte Umsätze, Gewinne oder Mitarbeiterzahlen. Bei passenden Finanzberichten können zusätzlich `event_data.dividend_distribution` und `event_data.statement_groups` für Gewinnausschüttungen und weitere Kennzahlen aus Bilanz/GUV/Cashflow enthalten sein.\n- **`dividend_distribution`**: Spezieller Feed-Filter für Publikations-Events mit vorhandener Gewinnausschüttung. Dies ist kein eigener DB-`event_type`, sondern filtert `new_publication`-Einträge mit Dividendendaten.\n- **`birthday`**: Geburtstage (nur relevant, wenn die `node_id` eine Person ist).\n",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "node_id"
                ],
                "properties": {
                  "node_id": {
                    "type": "string",
                    "description": "Die eindeutige business.watch ID der Organisation oder Person."
                  },
                  "limit": {
                    "type": "integer",
                    "description": "Maximale Anzahl der zurückgegebenen Events (Standard 50).",
                    "default": 50
                  },
                  "offset": {
                    "type": "integer",
                    "description": "Offset für Paginierung (Standard 0).",
                    "default": 0
                  },
                  "eventTypes": {
                    "type": "array",
                    "description": "Optionaler Filter für bestimmte Event-Typen.",
                    "items": {
                      "type": "string",
                      "enum": [
                        "new_role",
                        "role_ended",
                        "share_transfer",
                        "new_publication",
                        "birthday",
                        "dividend_distribution"
                      ]
                    }
                  }
                }
              },
              "examples": {
                "organizationFeed": {
                  "summary": "Beispiel für eine Unternehmens-Historie",
                  "value": {
                    "node_id": "hWV0hwvc",
                    "limit": 20,
                    "eventTypes": [
                      "new_role",
                      "new_publication"
                    ]
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Eine chronologisch absteigende Liste an Newsfeed-Events.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "meta": {
                      "type": "object",
                      "properties": {
                        "node_id": {
                          "type": "string"
                        },
                        "returned_count": {
                          "type": "integer"
                        }
                      }
                    },
                    "results": {
                      "type": "array",
                      "description": "Die chronologischen Events.",
                      "items": {
                        "type": "object",
                        "properties": {
                          "event_type": {
                            "type": "string"
                          },
                          "event_date": {
                            "type": "string",
                            "format": "date"
                          },
                          "event_data": {
                            "type": "object",
                            "description": "Enthält die detaillierten Informationen zum Event (Namen, Rollen, Finanzkennzahlen sowie optional Gewinnausschüttungs- und Statement-Daten bei Publikationen)."
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "x-summary-en": "Retrieve news for a specific person or organization.",
        "x-summary-de": "Ruft Neuigkeiten für eine spezifische Person oder Organisation ab.",
        "x-description-en": "This endpoint delivers a chronological newsfeed for a specific organization or person ID (`node_id`).\nThe data is generated on-the-fly and includes register changes, new publications including extracted financial figures, and birthdays.\n\n---\n\n### Supported Event Types (`eventTypes`)\nYou can filter results by passing an array of desired types. If omitted, all types are returned.\n- **`new_role`**: New register entries (e.g. new managing director, new shareholder list).\n- **`role_ended`**: Deregistrations from the commercial register.\n- **`new_publication`**: New publications (annual reports, balance sheets). Often contains directly extracted revenues, profits, or employee counts in `event_data.figures`.\n- **`birthday`**: Birthdays (only relevant when `node_id` is a person).",
        "x-description-de": "Dieser Endpoint liefert einen chronologischen Newsfeed für eine spezifische Unternehmens- oder Personen-ID (`node_id`).\nDie Daten werden on-the-fly generiert und beinhalten Registeränderungen, neue Publikationen inkl. extrahierter Finanzkennzahlen sowie Geburtstage.\n\n---\n\n### Unterstützte Event-Typen (`eventTypes`)\nDu kannst die Ergebnisse filtern, indem du ein Array der gewünschten Typen übergibst. Lässt du das Feld weg, werden alle Typen zurückgegeben.\n- **`new_role`**: Neue Registereintragungen (z.B. neuer Geschäftsführer, neue Gesellschafterliste).\n- **`role_ended`**: Austragungen aus dem Handelsregister.\n- **`new_publication`**: Neue Publikationen (Jahresabschlüsse, Bilanzen). Enthält im `event_data.figures` Array oftmals direkt extrahierte Umsätze, Gewinne oder Mitarbeiterzahlen.\n- **`birthday`**: Geburtstage (nur relevant, wenn die `node_id` eine Person ist)."
      }
    },
    "/selection": {
      "post": {
        "tags": [
          "Selektion"
        ],
        "summary": "Führt eine strukturierte Unternehmenssuche (Selektion) durch.",
        "description": "Dieser Endpoint ermöglicht granulare Unternehmenssuchen (Selektionen) durch die Kombination verschiedener Filter-Klauseln (Logisches UND). Die Ergebnisse sind auf maximal 1.000 Datensätze limitiert und werden absteigend nach Bilanzsumme (`balance`) sortiert.\n\n**Tipp:** Du kannst das Array `screeningConfig`, das vom `/chat` Endpoint generiert wird, 1:1 in diesen Endpoint als `clauses` Body einspeisen!\n\n---\n\n### Detaillierte Referenz aller Filter-Klauseln (`type`)\nJedes Objekt im `clauses` Array benötigt zwingend `type`, `operator` und `value`.\n\n#### 1. Stichwörter & Textsuche (`keyword`, `exclude_keyword`)\nSucht nach Begriffen in Namen, Unternehmensgegenständen oder Jahresabschlüssen.\n- **operator**: `eq`\n- **value**: Array von Strings (z.B. `[\"Künstliche Intelligenz\", \"Software\"]`).\n- **subType**: Array der zu durchsuchenden Bereiche: `[\"name\", \"business\", \"publication\"]`.\n- **matchMode** (optional): `exact` (Ganzes Wort) oder `contains` (Teilwort).\n\n#### 2. Branche / Semantische Suche (`industry`)\nNutzt eine KI-gestützte Vektorsuche, um Unternehmen basierend auf einer Freitext-Branchenbeschreibung zu finden.\n- **operator**: `eq`\n- **value**: Ein einzelner String (z.B. `\"SaaS Anbieter für den B2B Bereich\"`).\n- **strictness** (optional): `narrow` (hohe Übereinstimmung), `default` (Standard), `broad` (breite Übereinstimmung).\n\n#### 3. Geographie (`location`, `location_radius`, `state`)\n- **type: `location`**: Filtert nach exakten Orten oder PLZ.\n  - **operator**: `eq`\n  - **value**: Array von Geo-Objekten. (z.B. `[{\"city\": \"München\", \"zip\": \"80331\"}]`).\n- **type: `location_radius`**: Umkreissuche.\n  - **operator**: `eq`\n  - **value**: Array mit Geo-Objekten inkl. Koordinaten (z.B. `[{\"city\": \"Berlin\", \"lat\": 52.52, \"lng\": 13.40}]`).\n  - **radius**: Integer in Metern auf Top-Ebene der Klausel (z.B. `50000` für 50km).\n- **type: `state`**: Bundesland.\n  - **operator**: `in` oder `not_in`.\n  - **value**: Array von Strings (z.B. `[\"Bayern\", \"Hessen\"]`).\n\n#### 4. Finanzen & Kennzahlen\nVerfügbare Typen: `revenue` (Umsatz), `profit` (Gewinn), `employee_nr` (Mitarbeiterzahl), `balance` (Bilanzsumme), `retained_profit` (Gewinnvortrag), `inception_age` (Unternehmensalter).\n- **operator**: `gt` (größer als), `lt` (kleiner als), `eq` (genau).\n- **value**: String oder Number (z.B. `\"5000000\"`).\n\n#### 5. Personen & Organe (`people`)\nFiltert Unternehmen anhand spezifischer Kriterien ihrer Führungskräfte oder Eigentümer.\n- **operator**: `none` (nur Existenz prüfen), `age_gt`, `age_lt`, `active_gt`, `active_lt` oder `location`.\n- **subType**: Array der Rollen: `[\"manager\"]`, `[\"owner\"]` oder `[\"board\"]`.\n- **value**: String/Number für Alter/Jahre (z.B. `\"5\"` für aktiv seit > 5 Jahren). Bei operator `location` ein Geo-Objekt-Array. Bei `none` ein leerer String `\"\"`.\n- **Zusatzfelder (nur für `subType: [\"owner\"]`)**:\n  - `ownerFilter`: `any`, `majority`, `largest`, `equity_gt`, `equity_lt`.\n  - `equityValue`: Prozentwert als String (z.B. `\"50\"`).\n\n#### 6. Unternehmensstatus & Typ (`is_active`, `organization_type`, `managing_partner`)\n- **type: `is_active`**:\n  - **operator**: `eq`\n  - **value**: `\"active\"`, `\"inactive\"` oder `\"all\"`.\n- **type: `organization_type`**: Rechtsform.\n  - **operator**: `in` oder `not_in`.\n  - **value**: Array von Strings (z.B. `[\"GmbH\", \"AG\"]`).\n- **type: `managing_partner`**: Inhabergeführt.\n  - **operator**: `eq`\n  - **value**: `\"true\"` oder `\"false\"`.\n",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "clauses"
                ],
                "properties": {
                  "clauses": {
                    "type": "array",
                    "description": "Array von Konfigurationsobjekten (Logisches UND zwischen den Objekten).",
                    "items": {
                      "type": "object"
                    }
                  }
                }
              },
              "examples": {
                "simpleScreening": {
                  "summary": "Default-Beispiel (aktive Heizungsbauer um Westendorf)",
                  "description": "Standardbeispiel für aktive Unternehmen um Westendorf mit einer stimmigen Branchensuche nach Heizungsbauern.",
                  "value": {
                    "clauses": [
                      {
                        "type": "is_active",
                        "operator": "eq",
                        "value": "active"
                      },
                      {
                        "type": "location_radius",
                        "operator": "eq",
                        "radius": 5000,
                        "value": [
                          {
                            "city": "Westendorf",
                            "zip": "86707",
                            "lat": 48.566,
                            "lng": 10.833
                          }
                        ]
                      },
                      {
                        "type": "industry",
                        "operator": "eq",
                        "value": "Heizungsbauer",
                        "strictness": "default"
                      }
                    ]
                  }
                },
                "complexScreening": {
                  "summary": "Komplexes Beispiel (Branche, Finanzen, Umkreis & Geschäftsführer-Alter)",
                  "description": "Sucht nach aktiven Software-Unternehmen im Umkreis von 50km um München, mit mehr als 2 Mio. Euro Umsatz, die keine \"Consulting\" Dienstleistungen anbieten, und deren Geschäftsführer älter als 40 Jahre ist.",
                  "value": {
                    "clauses": [
                      {
                        "type": "is_active",
                        "operator": "eq",
                        "value": "active"
                      },
                      {
                        "type": "industry",
                        "operator": "eq",
                        "value": "Softwareentwicklung und IT-Dienstleistungen",
                        "strictness": "default"
                      },
                      {
                        "type": "exclude_keyword",
                        "operator": "eq",
                        "value": [
                          "Consulting",
                          "Personalvermittlung"
                        ],
                        "subType": [
                          "name",
                          "business"
                        ],
                        "matchMode": "contains"
                      },
                      {
                        "type": "location_radius",
                        "operator": "eq",
                        "radius": 50000,
                        "value": [
                          {
                            "city": "München",
                            "zip": "80331",
                            "lat": 48.1351,
                            "lng": 11.582
                          }
                        ]
                      },
                      {
                        "type": "revenue",
                        "operator": "gt",
                        "value": "2000000"
                      },
                      {
                        "type": "people",
                        "operator": "age_gt",
                        "subType": [
                          "manager"
                        ],
                        "value": "40"
                      }
                    ]
                  }
                },
                "neugruendungen": {
                  "summary": "Neugründungen (junge Unternehmen bis 1 Jahr alt)",
                  "description": "Findet kürzlich gegründete Unternehmen (max. 1 Jahr alt) im Umkreis von 20km um Augsburg.",
                  "value": {
                    "clauses": [
                      {
                        "type": "is_active",
                        "operator": "eq",
                        "value": "active"
                      },
                      {
                        "type": "inception_age",
                        "operator": "lt",
                        "value": "1"
                      },
                      {
                        "type": "location_radius",
                        "operator": "eq",
                        "radius": 20000,
                        "value": [
                          {
                            "city": "Augsburg",
                            "zip": "86150",
                            "lat": 48.3705,
                            "lng": 10.8978
                          }
                        ]
                      }
                    ]
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Eine Liste der gefundenen Unternehmen (max 1.000) sortiert nach Bilanzsumme.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "meta": {
                      "type": "object",
                      "nullable": true,
                      "description": "Gibt an, ob Ergebnisse bei 1.000 abgeschnitten wurden und wie viele insgesamt geschätzt/gefunden wurden."
                    },
                    "results": {
                      "type": "array",
                      "description": "Die Unternehmensdaten.",
                      "items": {
                        "type": "object"
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "x-summary-en": "Execute a structured organization search (selection).",
        "x-summary-de": "Führt eine strukturierte Unternehmenssuche (Selektion) durch.",
        "x-description-en": "This endpoint enables granular organization searches (selections) by combining various filter clauses (logical AND). Results are limited to 1,000 records and sorted descending by balance sheet total (`balance`).\n\n**Tip:** You can feed the `screeningConfig` array generated by the `/agent` endpoint directly into this endpoint as the `clauses` body!\n\n---\n\n### Detailed Reference of All Filter Clauses (`type`)\nEach object in the `clauses` array requires `type`, `operator`, and `value`.\n\n#### 1. Keywords & Text Search (`keyword`, `exclude_keyword`)\nSearches for terms in names, line of business, or annual reports.\n- **operator**: `eq`\n- **value**: Array of strings (e.g. `[\"Artificial Intelligence\", \"Software\"]`).\n- **subType**: Array of areas to search: `[\"name\", \"business\", \"publication\"]`.\n- **matchMode** (optional): `exact` (whole word) or `contains` (partial match).\n\n#### 2. Industry / Semantic Search (`industry`)\nUses AI-powered vector search to find organizations based on a free-text industry description.\n- **operator**: `eq`\n- **value**: A single string (e.g. `\"SaaS provider for the B2B sector\"`).\n- **strictness** (optional): `narrow` (high match), `default` (standard), `broad` (wide match).\n\n#### 3. Geography (`location`, `location_radius`, `state`)\n- **type: `location`**: Filters by exact places or ZIP codes.\n  - **operator**: `eq`\n  - **value**: Array of geo objects (e.g. `[{\"city\": \"Munich\", \"zip\": \"80331\"}]`).\n- **type: `location_radius`**: Radius search.\n  - **operator**: `eq`\n  - **value**: Array of geo objects with coordinates (e.g. `[{\"city\": \"Berlin\", \"lat\": 52.52, \"lng\": 13.40}]`).\n  - **radius**: Integer in meters at clause top-level (e.g. `50000` for 50km).\n- **type: `state`**: Federal state.\n  - **operator**: `in` or `not_in`.\n  - **value**: Array of strings (e.g. `[\"Bayern\", \"Hessen\"]`).\n\n#### 4. Financials & Metrics\nAvailable types: `revenue`, `profit`, `employee_nr`, `balance`, `retained_profit`, `inception_age`.\n- **operator**: `gt` (greater than), `lt` (less than), `eq` (exact).\n- **value**: String or number (e.g. `\"5000000\"`).\n\n#### 5. People & Officers (`people`)\nFilters organizations by criteria of their executives or owners.\n- **operator**: `none` (check existence only), `age_gt`, `age_lt`, `active_gt`, `active_lt`, or `location`.\n- **subType**: Array of roles: `[\"manager\"]`, `[\"owner\"]`, or `[\"board\"]`.\n- **value**: String/number for age/years. For operator `location` an array of geo objects. For `none` an empty string `\"\"`.\n- **Additional fields (only for `subType: [\"owner\"]`)**:\n  - `ownerFilter`: `any`, `majority`, `largest`, `equity_gt`, `equity_lt`.\n  - `equityValue`: Percentage as string (e.g. `\"50\"`).\n\n#### 6. Status & Type (`is_active`, `organization_type`, `managing_partner`)\n- **type: `is_active`**:\n  - **operator**: `eq`\n  - **value**: `\"active\"`, `\"inactive\"`, or `\"all\"`.\n- **type: `organization_type`**: Legal form.\n  - **operator**: `in` or `not_in`.\n  - **value**: Array of strings (e.g. `[\"GmbH\", \"AG\"]`).\n- **type: `managing_partner`**: Owner-managed.\n  - **operator**: `eq`\n  - **value**: `\"true\"` or `\"false\"`.",
        "x-description-de": "Dieser Endpoint ermöglicht granulare Unternehmenssuchen (Selektionen) durch die Kombination verschiedener Filter-Klauseln (Logisches UND). Die Ergebnisse sind auf maximal 1.000 Datensätze limitiert und werden absteigend nach Bilanzsumme (`balance`) sortiert.\n\n**Tipp:** Du kannst das Array `screeningConfig`, das vom `/agent` Endpoint generiert wird, 1:1 in diesen Endpoint als `clauses` Body einspeisen!\n\n---\n\n### Detaillierte Referenz aller Filter-Klauseln (`type`)\nJedes Objekt im `clauses` Array benötigt zwingend `type`, `operator` und `value`.\n\n#### 1. Stichwörter & Textsuche (`keyword`, `exclude_keyword`)\nSucht nach Begriffen in Namen, Unternehmensgegenständen oder Jahresabschlüssen.\n- **operator**: `eq`\n- **value**: Array von Strings (z.B. `[\"Künstliche Intelligenz\", \"Software\"]`).\n- **subType**: Array der zu durchsuchenden Bereiche: `[\"name\", \"business\", \"publication\"]`.\n- **matchMode** (optional): `exact` (Ganzes Wort) oder `contains` (Teilwort).\n\n#### 2. Branche / Semantische Suche (`industry`)\nNutzt eine KI-gestützte Vektorsuche, um Unternehmen basierend auf einer Freitext-Branchenbeschreibung zu finden.\n- **operator**: `eq`\n- **value**: Ein einzelner String (z.B. `\"SaaS Anbieter für den B2B Bereich\"`).\n- **strictness** (optional): `narrow` (hohe Übereinstimmung), `default` (Standard), `broad` (breite Übereinstimmung).\n\n#### 3. Geographie (`location`, `location_radius`, `state`)\n- **type: `location`**: Filtert nach exakten Orten oder PLZ.\n  - **operator**: `eq`\n  - **value**: Array von Geo-Objekten. (z.B. `[{\"city\": \"München\", \"zip\": \"80331\"}]`).\n- **type: `location_radius`**: Umkreissuche.\n  - **operator**: `eq`\n  - **value**: Array mit Geo-Objekten inkl. Koordinaten (z.B. `[{\"city\": \"Berlin\", \"lat\": 52.52, \"lng\": 13.40}]`).\n  - **radius**: Integer in Metern auf Top-Ebene der Klausel (z.B. `50000` für 50km).\n- **type: `state`**: Bundesland.\n  - **operator**: `in` oder `not_in`.\n  - **value**: Array von Strings (z.B. `[\"Bayern\", \"Hessen\"]`).\n\n#### 4. Finanzen & Kennzahlen\nVerfügbare Typen: `revenue` (Umsatz), `profit` (Gewinn), `employee_nr` (Mitarbeiterzahl), `balance` (Bilanzsumme), `retained_profit` (Gewinnvortrag), `inception_age` (Unternehmensalter).\n- **operator**: `gt` (größer als), `lt` (kleiner als), `eq` (genau).\n- **value**: String oder Number (z.B. `\"5000000\"`).\n\n#### 5. Personen & Organe (`people`)\nFiltert Unternehmen anhand spezifischer Kriterien ihrer Führungskräfte oder Eigentümer.\n- **operator**: `none` (nur Existenz prüfen), `age_gt`, `age_lt`, `active_gt`, `active_lt` oder `location`.\n- **subType**: Array der Rollen: `[\"manager\"]`, `[\"owner\"]` oder `[\"board\"]`.\n- **value**: String/Number für Alter/Jahre (z.B. `\"5\"` für aktiv seit > 5 Jahren). Bei operator `location` ein Geo-Objekt-Array. Bei `none` ein leerer String `\"\"`.\n- **Zusatzfelder (nur für `subType: [\"owner\"]`)**:\n  - `ownerFilter`: `any`, `majority`, `largest`, `equity_gt`, `equity_lt`.\n  - `equityValue`: Prozentwert als String (z.B. `\"50\"`).\n\n#### 6. Unternehmensstatus & Typ (`is_active`, `organization_type`, `managing_partner`)\n- **type: `is_active`**:\n  - **operator**: `eq`\n  - **value**: `\"active\"`, `\"inactive\"` oder `\"all\"`.\n- **type: `organization_type`**: Rechtsform.\n  - **operator**: `in` oder `not_in`.\n  - **value**: Array von Strings (z.B. `[\"GmbH\", \"AG\"]`).\n- **type: `managing_partner`**: Inhabergeführt.\n  - **operator**: `eq`\n  - **value**: `\"true\"` oder `\"false\"`."
      }
    }
  },
  "components": {
    "responses": {
      "200Response": {
        "description": "Successful response",
        "content": {
          "application/json": {
            "schema": {
              "type": "object"
            }
          }
        }
      },
      "400ResponseSearch": {
        "description": "Invalid request parameters provided.",
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "properties": {
                "error": {
                  "type": "string",
                  "description": "Detailed error message describing the invalid request parameters.",
                  "example": "Invalid request parameters provided."
                }
              }
            }
          }
        }
      },
      "404ResponseSearch": {
        "description": "Nothing found.",
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "properties": {
                "error": {
                  "type": "string",
                  "description": "Error message indicating that nothing could be found.",
                  "example": "Nothing found."
                }
              }
            }
          }
        }
      },
      "500ResponseSearch": {
        "description": "Internal server error.",
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "properties": {
                "error": {
                  "type": "string",
                  "description": "Error message providing details about the server error.",
                  "example": "Internal server error."
                }
              }
            }
          }
        }
      }
    },
    "parameters": {
      "PersonQuery": {
        "in": "path",
        "name": "query",
        "required": true,
        "schema": {
          "type": "string"
        },
        "description": "business.watch ID ODER Name. Intern wird der beste Treffer aufgelöst.",
        "example": "Markus Söder"
      },
      "PersonTypeHint": {
        "in": "query",
        "name": "type",
        "required": false,
        "schema": {
          "type": "string",
          "enum": [
            "id",
            "name"
          ]
        },
        "description": "Optionaler Hinweis, wie {query} zu interpretieren ist."
      },
      "OrgQuery": {
        "in": "path",
        "name": "query",
        "required": true,
        "schema": {
          "type": "string"
        },
        "description": "business.watch ID, LEI, ISIN, Registernummer ODER Name. Intern wird der beste Treffer aufgelöst.",
        "example": "WashTec AG"
      },
      "OrgTypeHint": {
        "in": "query",
        "name": "type",
        "required": false,
        "schema": {
          "type": "string",
          "enum": [
            "lei",
            "isin",
            "id",
            "register",
            "name"
          ]
        },
        "description": "Optionaler Hinweis, wie {query} zu interpretieren ist."
      }
    },
    "schemas": {
      "Resolved": {
        "type": "object",
        "description": "Safeguard — der intern aufgelöste Treffer. Bei Fehlauflösung mit konkreter business.watch ID nachfassen.",
        "properties": {
          "id": {
            "type": "string",
            "description": "business.watch ID"
          },
          "name": {
            "type": "string",
            "nullable": true
          },
          "score": {
            "type": "integer",
            "nullable": true
          }
        }
      },
      "InsolvencyStatus": {
        "type": "object",
        "required": [
          "code",
          "label",
          "severity"
        ],
        "properties": {
          "code": {
            "type": "string",
            "nullable": true
          },
          "label": {
            "type": "string"
          },
          "severity": {
            "type": "string",
            "enum": [
              "active",
              "terminated"
            ]
          }
        }
      },
      "InsolvencyProceeding": {
        "type": "object",
        "required": [
          "stationen"
        ],
        "properties": {
          "gericht": {
            "type": "string",
            "nullable": true
          },
          "aktenzeichen": {
            "type": "string",
            "nullable": true
          },
          "status": {
            "allOf": [
              {
                "$ref": "#/components/schemas/InsolvencyStatus"
              }
            ],
            "nullable": true
          },
          "verwalter": {
            "type": "string",
            "nullable": true
          },
          "verwalter_rolle": {
            "type": "string",
            "nullable": true
          },
          "erste_pub": {
            "type": "string",
            "format": "date",
            "nullable": true
          },
          "letzte_pub": {
            "type": "string",
            "format": "date",
            "nullable": true
          },
          "stationen": {
            "type": "array",
            "items": {
              "type": "object",
              "required": [
                "label",
                "date"
              ],
              "properties": {
                "label": {
                  "type": "string"
                },
                "date": {
                  "type": "string",
                  "format": "date",
                  "nullable": true
                },
                "quelle": {
                  "type": "string",
                  "nullable": true
                }
              }
            }
          }
        }
      },
      "InsolvencyResource": {
        "type": "object",
        "required": [
          "id",
          "type",
          "insolvent",
          "status",
          "n_verfahren",
          "verfahren",
          "resolved"
        ],
        "properties": {
          "id": {
            "type": "string",
            "description": "business.watch ID"
          },
          "type": {
            "type": "string",
            "enum": [
              "o",
              "p"
            ]
          },
          "insolvent": {
            "type": "boolean"
          },
          "status": {
            "allOf": [
              {
                "$ref": "#/components/schemas/InsolvencyStatus"
              }
            ],
            "nullable": true
          },
          "n_verfahren": {
            "type": "integer",
            "minimum": 0
          },
          "verfahren": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/InsolvencyProceeding"
            }
          },
          "message": {
            "type": "string"
          },
          "resolved": {
            "$ref": "#/components/schemas/Resolved"
          }
        }
      },
      "ChatMessage": {
        "type": "object",
        "required": [
          "role",
          "content"
        ],
        "properties": {
          "role": {
            "type": "string",
            "enum": [
              "user",
              "assistant"
            ],
            "description": "Die Rolle des Senders (Entweder Nutzer oder KI-Assistent)."
          },
          "content": {
            "type": "string",
            "description": "Der Textinhalt der Nachricht.",
            "example": "In welchen Städten gibt es Entwicklungszentren von BMW?"
          }
        }
      }
    }
  }
}