{
  "components": {
    "headers": {
      "Deprecation": {
        "description": "Nach RFC 9745: Zeitpunkt (Structured Date `@<Unix-Sekunden>`), ab dem der Endpunkt veraltet ist. Kommt erst, wenn eine Version abgekündigt wird.",
        "schema": {
          "examples": [
            "@1798761600"
          ],
          "type": "string"
        }
      },
      "RateLimit": {
        "description": "Übrige Anfragen (r) und Sekunden bis zum Reset (t).",
        "schema": {
          "examples": [
            "\"default\";r=57;t=42"
          ],
          "type": "string"
        }
      },
      "RateLimit-Policy": {
        "description": "Limit je Token: 60 Anfragen (q) je 60 Sekunden (w).",
        "schema": {
          "examples": [
            "\"default\";q=60;w=60"
          ],
          "type": "string"
        }
      },
      "Retry-After": {
        "description": "Sekunden bis zur nächsten erlaubten Anfrage.",
        "schema": {
          "minimum": 0,
          "type": "integer"
        }
      },
      "Sunset": {
        "description": "Nach RFC 8594: HTTP-Datum, ab dem der Endpunkt abgeschaltet wird. Kommt erst, wenn eine Version abgekündigt wird.",
        "schema": {
          "examples": [
            "Fri, 01 Jan 2027 00:00:00 GMT"
          ],
          "type": "string"
        }
      },
      "WWW-Authenticate": {
        "description": "Bearer-Challenge nach RFC 6750 mit Fehler und benötigtem Scope.",
        "schema": {
          "examples": [
            "Bearer error=\"insufficient_scope\", scope=\"integrations:write\", resource_metadata=\"https://api.kiosa.ai/.well-known/oauth-protected-resource/v1\""
          ],
          "type": "string"
        }
      },
      "X-Request-Id": {
        "description": "ID dieser Anfrage, für Rückfragen: `req_` gefolgt von einer 26-stelligen ULID.",
        "schema": {
          "examples": [
            "req_01JDX5Q8M3V8F2K7ZB9T4N6C1A"
          ],
          "pattern": "^req_[0-7][0-9A-HJKMNP-TV-Z]{25}$",
          "type": "string"
        }
      }
    },
    "schemas": {
      "Address": {
        "description": "Postanschrift; unbekannte Teile sind null.",
        "properties": {
          "city": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Ort."
          },
          "country": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Land als ISO-3166-1-Alpha-2-Code."
          },
          "postal_code": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Postleitzahl."
          },
          "street": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Straße und Hausnummer."
          }
        },
        "required": [
          "street",
          "postal_code",
          "city",
          "country"
        ],
        "type": "object"
      },
      "BranchList": {
        "description": "Alle Filialen beim Anbieter.",
        "properties": {
          "data": {
            "items": {
              "$ref": "#/components/schemas/ProviderBranch"
            },
            "type": "array"
          }
        },
        "required": [
          "data"
        ],
        "type": "object"
      },
      "BranchMapping": {
        "anyOf": [
          {
            "additionalProperties": false,
            "properties": {
              "branch_id": {
                "description": "Filial-ID beim Anbieter.",
                "minLength": 1,
                "type": "string"
              },
              "location_id": {
                "description": "Kiosa-Standort dieses Betriebs.",
                "minLength": 1,
                "type": "string"
              }
            },
            "required": [
              "branch_id",
              "location_id"
            ],
            "type": "object"
          },
          {
            "additionalProperties": false,
            "properties": {
              "branch_id": {
                "description": "Filial-ID beim Anbieter.",
                "minLength": 1,
                "type": "string"
              },
              "ignore": {
                "const": true,
                "description": "Diese Filiale nicht importieren.",
                "type": "boolean"
              }
            },
            "required": [
              "branch_id",
              "ignore"
            ],
            "type": "object"
          }
        ],
        "description": "Ordnet eine Filiale einem Kiosa-Standort zu oder ignoriert die ganze Filiale."
      },
      "BranchMappingRequest": {
        "additionalProperties": false,
        "description": "Änderungen an der Filial-Zuordnung.",
        "properties": {
          "mappings": {
            "description": "Zu ändernde Filialen. Nicht genannte Filialen behalten ihre Zuordnung.",
            "items": {
              "$ref": "#/components/schemas/BranchMapping"
            },
            "minItems": 1,
            "type": "array"
          }
        },
        "required": [
          "mappings"
        ],
        "type": "object"
      },
      "ImportState": {
        "description": "Ein Importlauf.",
        "properties": {
          "finished_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Ende des Laufs."
          },
          "started_at": {
            "description": "Beginn des Laufs.",
            "format": "date-time",
            "type": "string"
          },
          "status": {
            "description": "Stand des Importlaufs.",
            "enum": [
              "running",
              "succeeded",
              "failed"
            ],
            "type": "string"
          }
        },
        "required": [
          "status",
          "started_at",
          "finished_at"
        ],
        "type": "object"
      },
      "Integration": {
        "description": "Vollständiger Status einer Integration.",
        "properties": {
          "api_key_last4": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Letzte vier Zeichen des gespeicherten Schlüssels. Kiosa gibt den Schlüssel selbst nie heraus."
          },
          "company_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Firmen-ID beim Anbieter."
          },
          "connected_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Wann die aktuellen Zugangsdaten gespeichert wurden."
          },
          "initial_import": {
            "anyOf": [
              {
                "properties": {
                  "since": {
                    "description": "Erster importierter Tag: 1. Januar des Vorjahres.",
                    "format": "date",
                    "type": "string"
                  },
                  "status": {
                    "description": "Stand des Erstimports.",
                    "enum": [
                      "waiting_for_mapping",
                      "running",
                      "succeeded",
                      "failed"
                    ],
                    "type": "string"
                  }
                },
                "required": [
                  "status",
                  "since"
                ],
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "description": "Erstimport der Historie. Er startet automatisch, sobald alle Filialen zugeordnet sind."
          },
          "issues": {
            "description": "Offene Punkte; leer, wenn alles passt.",
            "items": {
              "$ref": "#/components/schemas/IntegrationIssue"
            },
            "type": "array"
          },
          "key_expires_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Ablauf des Schlüssels, falls bekannt."
          },
          "last_import": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/ImportState"
              },
              {
                "type": "null"
              }
            ]
          },
          "provider": {
            "description": "Anbieter der Integration. v1 unterstützt nur `ordio`.",
            "enum": [
              "ordio"
            ],
            "type": "string"
          },
          "status": {
            "$ref": "#/components/schemas/IntegrationStatus"
          }
        },
        "required": [
          "provider",
          "status",
          "company_id",
          "api_key_last4",
          "key_expires_at",
          "connected_at",
          "initial_import",
          "last_import",
          "issues"
        ],
        "type": "object"
      },
      "IntegrationIssue": {
        "description": "Etwas, das der Betrieb oder der Partner erledigen muss.",
        "properties": {
          "code": {
            "description": "Stabiler Code des offenen Punkts. `other_staff_provider_active`: In Kiosa ist für diesen Betrieb schon ein anderes Personal-System aktiv. Melde dich bei uns, dann stellen wir auf ordio um (die API schaltet es nie ab).",
            "enum": [
              "unmapped_branches",
              "key_expires_soon",
              "key_expired",
              "provider_auth_failed",
              "missing_provider_scopes",
              "import_failed",
              "other_staff_provider_active"
            ],
            "type": "string"
          },
          "detail": {
            "description": "Erklärung in Klartext (Englisch).",
            "type": "string"
          }
        },
        "required": [
          "code",
          "detail"
        ],
        "type": "object"
      },
      "IntegrationList": {
        "description": "Alle Integrationen des Betriebs.",
        "properties": {
          "data": {
            "items": {
              "$ref": "#/components/schemas/IntegrationSummary"
            },
            "type": "array"
          }
        },
        "required": [
          "data"
        ],
        "type": "object"
      },
      "IntegrationStatus": {
        "description": "`not_connected`: keine Zugangsdaten gespeichert. `testing`: Kiosa prüft die Zugangsdaten noch. `needs_mapping`: verbunden, aber mindestens eine Filiale ist noch nicht zugeordnet. `active`: verbunden und vollständig zugeordnet, Importe laufen. `error`: der letzte Test oder Import ist fehlgeschlagen, siehe `issues`.",
        "enum": [
          "not_connected",
          "testing",
          "needs_mapping",
          "active",
          "error"
        ],
        "type": "string"
      },
      "IntegrationSummary": {
        "description": "Kurzstatus einer Integration.",
        "properties": {
          "last_import_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Ende des letzten erfolgreichen Imports."
          },
          "provider": {
            "description": "Anbieter der Integration. v1 unterstützt nur `ordio`.",
            "enum": [
              "ordio"
            ],
            "type": "string"
          },
          "status": {
            "$ref": "#/components/schemas/IntegrationStatus"
          },
          "writable": {
            "description": "`true`, wenn dieser Client die Integration über die API verwalten darf.",
            "type": "boolean"
          }
        },
        "required": [
          "provider",
          "status",
          "writable",
          "last_import_at"
        ],
        "type": "object"
      },
      "IntegrationWithBranches": {
        "description": "Status der Integration samt Filial-Zuordnung.",
        "properties": {
          "api_key_last4": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Letzte vier Zeichen des gespeicherten Schlüssels. Kiosa gibt den Schlüssel selbst nie heraus."
          },
          "branches": {
            "description": "Filialen beim Anbieter mit ihrer Zuordnung; leer, solange der Status `testing` ist.",
            "items": {
              "$ref": "#/components/schemas/ProviderBranch"
            },
            "type": "array"
          },
          "company_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Firmen-ID beim Anbieter."
          },
          "connected_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Wann die aktuellen Zugangsdaten gespeichert wurden."
          },
          "initial_import": {
            "anyOf": [
              {
                "properties": {
                  "since": {
                    "description": "Erster importierter Tag: 1. Januar des Vorjahres.",
                    "format": "date",
                    "type": "string"
                  },
                  "status": {
                    "description": "Stand des Erstimports.",
                    "enum": [
                      "waiting_for_mapping",
                      "running",
                      "succeeded",
                      "failed"
                    ],
                    "type": "string"
                  }
                },
                "required": [
                  "status",
                  "since"
                ],
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "description": "Erstimport der Historie. Er startet automatisch, sobald alle Filialen zugeordnet sind."
          },
          "issues": {
            "description": "Offene Punkte; leer, wenn alles passt.",
            "items": {
              "$ref": "#/components/schemas/IntegrationIssue"
            },
            "type": "array"
          },
          "key_expires_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Ablauf des Schlüssels, falls bekannt."
          },
          "last_import": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/ImportState"
              },
              {
                "type": "null"
              }
            ]
          },
          "provider": {
            "description": "Anbieter der Integration. v1 unterstützt nur `ordio`.",
            "enum": [
              "ordio"
            ],
            "type": "string"
          },
          "status": {
            "$ref": "#/components/schemas/IntegrationStatus"
          }
        },
        "required": [
          "provider",
          "status",
          "company_id",
          "api_key_last4",
          "key_expires_at",
          "connected_at",
          "initial_import",
          "last_import",
          "issues",
          "branches"
        ],
        "type": "object"
      },
      "Location": {
        "description": "Ein Standort (Restaurant) des Betriebs.",
        "properties": {
          "address": {
            "$ref": "#/components/schemas/Address"
          },
          "id": {
            "description": "Kiosa-Standort-ID. Verwende sie als `location_id` in Filial-Zuordnungen.",
            "type": "string"
          },
          "name": {
            "description": "Name des Standorts.",
            "type": "string"
          }
        },
        "required": [
          "id",
          "name",
          "address"
        ],
        "type": "object"
      },
      "LocationList": {
        "description": "Alle Standorte des Betriebs.",
        "properties": {
          "data": {
            "items": {
              "$ref": "#/components/schemas/Location"
            },
            "type": "array"
          }
        },
        "required": [
          "data"
        ],
        "type": "object"
      },
      "Me": {
        "description": "Die Verbindung hinter dem Access Token.",
        "properties": {
          "account": {
            "description": "Der Betrieb, der den Zugriff erteilt hat.",
            "properties": {
              "id": {
                "description": "Kiosa-ID des Betriebs.",
                "type": "string"
              },
              "name": {
                "description": "Name des Betriebs.",
                "type": "string"
              },
              "slug": {
                "description": "Kiosa-Adresse des Betriebs (`<slug>.kiosa.ai`).",
                "type": "string"
              }
            },
            "required": [
              "id",
              "name",
              "slug"
            ],
            "type": "object"
          },
          "consented_at": {
            "description": "Wann ein Admin des Betriebs diesem Client den Zugriff erteilt hat (ISO 8601 mit Zeitzone).",
            "format": "date-time",
            "type": "string"
          },
          "scopes": {
            "description": "Scopes, die diesem Token gewährt sind.",
            "items": {
              "$ref": "#/components/schemas/Scope"
            },
            "type": "array"
          }
        },
        "required": [
          "account",
          "consented_at",
          "scopes"
        ],
        "type": "object"
      },
      "OrdioCredentials": {
        "additionalProperties": false,
        "description": "Zugangsdaten der ordio-Integration.",
        "properties": {
          "api_key": {
            "description": "ordio-API-Schlüssel mit den Scopes branches:read, shifts:read, absences:read und wages:read.",
            "minLength": 1,
            "type": "string"
          },
          "company_id": {
            "description": "ordio-Firmen-ID.",
            "minLength": 1,
            "type": "string"
          },
          "key_expires_at": {
            "description": "Ablauf des Schlüssels. Kiosa erinnert den Betrieb vorher.",
            "format": "date-time",
            "type": "string"
          }
        },
        "required": [
          "api_key",
          "company_id"
        ],
        "type": "object"
      },
      "Problem": {
        "description": "Problem Details nach RFC 9457. `title` und `detail` sind immer englisch; übersetzte Texte je `code` stehen in der Doku.",
        "properties": {
          "code": {
            "description": "Stabiler, maschinenlesbarer Fehlercode. Werte diesen aus, nicht `title` oder `detail`.",
            "enum": [
              "invalid_token",
              "insufficient_scope",
              "user_inactive",
              "partner_not_approved",
              "partner_suspended",
              "partner_apps_disabled",
              "admin_required",
              "not_found",
              "validation_failed",
              "rate_limited",
              "provider_auth_failed",
              "missing_provider_scopes",
              "provider_unreachable",
              "provider_not_allowed",
              "mapping_conflict",
              "internal_error",
              "payload_too_large",
              "upstream_unavailable",
              "upstream_timeout",
              "service_unavailable"
            ],
            "type": "string"
          },
          "detail": {
            "description": "Erklärung dieses konkreten Falls.",
            "type": "string"
          },
          "invalid_params": {
            "description": "Nur bei `validation_failed`.",
            "items": {
              "properties": {
                "name": {
                  "description": "Feldpfad, zum Beispiel `mappings[0].location_id`.",
                  "type": "string"
                },
                "reason": {
                  "description": "Was an dem Feld falsch ist.",
                  "type": "string"
                }
              },
              "required": [
                "name",
                "reason"
              ],
              "type": "object"
            },
            "type": "array"
          },
          "missing_scopes": {
            "description": "Nur bei `missing_provider_scopes`: Scopes, die dem Schlüssel des Anbieters fehlen.",
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "request_id": {
            "description": "Gleicher Wert wie der Header X-Request-Id: `req_` gefolgt von einer 26-stelligen ULID.",
            "pattern": "^req_[0-7][0-9A-HJKMNP-TV-Z]{25}$",
            "type": "string"
          },
          "status": {
            "description": "HTTP-Statuscode.",
            "type": "integer"
          },
          "title": {
            "description": "Kurzfassung des Fehlercodes.",
            "type": "string"
          },
          "type": {
            "description": "Doku-URL des Fehlercodes: `https://docs.kiosa.ai/en/reference/errors/#<code>`, in jeder Sprache gleich.",
            "format": "uri",
            "type": "string"
          }
        },
        "required": [
          "type",
          "title",
          "status",
          "detail",
          "code",
          "request_id"
        ],
        "type": "object"
      },
      "ProviderBranch": {
        "description": "Eine Filiale beim Anbieter und ihr Kiosa-Standort.",
        "properties": {
          "branch_id": {
            "description": "Filial-ID beim Anbieter.",
            "type": "string"
          },
          "location_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Kiosa-Standort, dem die Filiale zugeordnet ist."
          },
          "mapping": {
            "description": "`mapped`: wird nach `location_id` importiert. `ignored`: wird nicht importiert. `unmapped`: noch offen.",
            "enum": [
              "mapped",
              "ignored",
              "unmapped"
            ],
            "type": "string"
          },
          "name": {
            "description": "Filialname beim Anbieter.",
            "type": "string"
          },
          "suggested_location_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "Vorschlag für eine offene Filiale, anhand eines gleichen Namens."
          }
        },
        "required": [
          "branch_id",
          "name",
          "mapping",
          "location_id",
          "suggested_location_id"
        ],
        "type": "object"
      },
      "Scope": {
        "description": "OAuth-Scope.",
        "enum": [
          "account:read",
          "integrations:read",
          "integrations:write"
        ],
        "type": "string"
      }
    },
    "securitySchemes": {
      "oauth2": {
        "flows": {
          "authorizationCode": {
            "authorizationUrl": "https://api.kiosa.ai/api/oauth/authorize",
            "refreshUrl": "https://api.kiosa.ai/api/oauth/token",
            "scopes": {
              "account:read": "Deinen Betrieb, seine Standorte und die eigene Verbindung lesen.",
              "integrations:read": "Den Status der Integrationen deines Betriebs lesen.",
              "integrations:write": "Zugangsdaten eines Anbieters übergeben, Filialen zuordnen und Integrationen trennen. Schließt integrations:read ein."
            },
            "tokenUrl": "https://api.kiosa.ai/api/oauth/token"
          }
        },
        "type": "oauth2"
      }
    }
  },
  "info": {
    "contact": {
      "name": "Kiosa",
      "url": "https://docs.kiosa.ai"
    },
    "description": "Mit der Kiosa API verbindest du deine Software mit dem Kiosa-Konto eines Gastronomiebetriebs. Version 1 deckt die Einrichtung von Integrationen ab: Betrieb und Standorte lesen, Zugangsdaten übergeben, Filialen zuordnen, trennen.\n\n**Partner-Vorschau:** Alle Endpunkte sind als Vertrag veröffentlicht und können sich bis zur allgemeinen Verfügbarkeit noch ändern.\n\n## Login\nOAuth 2.0 Authorization Code mit PKCE (S256). Dein Client ist eine https-URL auf deiner Domain mit einem Client-Metadaten-Dokument (CIMD), öffentlicher Client ohne Secret. Beim Login gibt der Gastronom seine Kiosa-Adresse ein; mit `login_hint=<slug>` füllst du sie vor. Nur Admins des Betriebs können zustimmen. Access Tokens gelten 1 Stunde, Refresh Tokens rotieren bei jeder Nutzung. Tokens werden mit `resource=https://api.kiosa.ai/v1` ausgestellt und gelten nur für diese API. Widerruf: `https://api.kiosa.ai/api/oauth/revoke`.\n\nDie API steht nur freigegebenen, aktiven Partnern offen: ein nicht eingetragener Client bekommt keinen Scope, auch keinen lesenden (Login endet mit `unauthorized_client`). `integrations:write` gilt nur für die Anbieter in der Freigabe. Der Betrieb kann Partner-Apps in Kiosa jederzeit abschalten.\n\n## Fehler\nFehler kommen als `application/problem+json` (RFC 9457) mit `type`, `title`, `status`, `detail`, `code` und `request_id`. `type` ist `https://docs.kiosa.ai/en/reference/errors/#<code>`. Werte `code` aus; die Liste aller Codes steht in der Doku.\n\n## Limits\nJe Token 60 Anfragen pro Minute. Jede Antwort trägt `RateLimit-Policy: \"default\";q=60;w=60` und `RateLimit: \"default\";r=<übrig>;t=<Sekunden bis Reset>`. Bei Überschreitung kommt `429` mit `Retry-After` in Sekunden.\n\n## Versionen\nDie Hauptversion steht im Pfad. Neue Felder, Endpunkte und Fehlercodes kommen ohne Versionssprung; ignoriere unbekannte Felder. Breaking Changes gibt es nur in einer neuen Hauptversion, die alte läuft mindestens 12 Monate parallel und wird mit den Headern `Deprecation` und `Sunset` angekündigt.\n\n## Request-ID\nJede Antwort trägt `X-Request-Id` im Format `req_` + 26-stellige ULID (zum Beispiel `req_01JDX5Q8M3V8F2K7ZB9T4N6C1A`); Fehler wiederholen sie als `request_id`. Nenne sie bei Rückfragen an Kiosa.",
    "title": "Kiosa API",
    "version": "1.0.0"
  },
  "jsonSchemaDialect": "https://spec.openapis.org/oas/3.1/dialect/base",
  "openapi": "3.1.0",
  "paths": {
    "/integrations": {
      "get": {
        "description": "Liefert alle Anbieter, die über die API verwaltet werden können (v1: `ordio`), mit Kurzstatus, auch wenn sie noch nicht verbunden sind (`not_connected`). `writable` zeigt, ob dein Client den Anbieter verwalten darf. Weitere Anbieter kommen ohne Versionssprung hinzu.",
        "operationId": "listIntegrations",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": {
                  "data": [
                    {
                      "last_import_at": null,
                      "provider": "ordio",
                      "status": "needs_mapping",
                      "writable": true
                    }
                  ]
                },
                "schema": {
                  "$ref": "#/components/schemas/IntegrationList"
                }
              }
            },
            "description": "Alle Integrationen des Betriebs, die über die API verwaltet werden können.",
            "headers": {
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "401": {
            "content": {
              "application/problem+json": {
                "examples": {
                  "invalid_token": {
                    "summary": "Token ungültig",
                    "value": {
                      "code": "invalid_token",
                      "detail": "The access token is missing, expired, revoked or not issued for this API. Use the refresh token to obtain a new access token; if that fails, the business has to grant access again.",
                      "request_id": "req_01JDX5Q8M3V8F2K7ZB9T4N6C1A",
                      "status": 401,
                      "title": "Invalid token",
                      "type": "https://docs.kiosa.ai/en/reference/errors/#invalid_token"
                    }
                  }
                },
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "Fehler: `invalid_token`",
            "headers": {
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "WWW-Authenticate": {
                "$ref": "#/components/headers/WWW-Authenticate"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "403": {
            "content": {
              "application/problem+json": {
                "examples": {
                  "insufficient_scope": {
                    "summary": "Scope fehlt",
                    "value": {
                      "code": "insufficient_scope",
                      "detail": "The token does not carry the scope this endpoint requires. Request the scope during authorization; the WWW-Authenticate header names it.",
                      "request_id": "req_01JDX5Q8M3V8F2K7ZB9T4N6C1A",
                      "status": 403,
                      "title": "Insufficient scope",
                      "type": "https://docs.kiosa.ai/en/reference/errors/#insufficient_scope"
                    }
                  },
                  "partner_apps_disabled": {
                    "summary": "Partner-Apps abgeschaltet",
                    "value": {
                      "code": "partner_apps_disabled",
                      "detail": "The business has turned off partner apps in Kiosa (Settings → Connected apps). Calls are rejected until it turns them back on.",
                      "request_id": "req_01JDX5Q8M3V8F2K7ZB9T4N6C1A",
                      "status": 403,
                      "title": "Partner apps disabled",
                      "type": "https://docs.kiosa.ai/en/reference/errors/#partner_apps_disabled"
                    }
                  },
                  "partner_not_approved": {
                    "summary": "Partner nicht freigegeben",
                    "value": {
                      "code": "partner_not_approved",
                      "detail": "The Kiosa API is only open to approved partners. Your client is not registered as a partner. Write to kontakt@kiosa.ai to apply for approval. Authorization already rejects such a client (`unauthorized_client`); calls get this code when the token belongs to a partner that has lost its approval since.",
                      "request_id": "req_01JDX5Q8M3V8F2K7ZB9T4N6C1A",
                      "status": 403,
                      "title": "Partner not approved",
                      "type": "https://docs.kiosa.ai/en/reference/errors/#partner_not_approved"
                    }
                  },
                  "partner_suspended": {
                    "summary": "Partner gesperrt",
                    "value": {
                      "code": "partner_suspended",
                      "detail": "Kiosa has suspended this client. All of its tokens are rejected with immediate effect.",
                      "request_id": "req_01JDX5Q8M3V8F2K7ZB9T4N6C1A",
                      "status": 403,
                      "title": "Partner suspended",
                      "type": "https://docs.kiosa.ai/en/reference/errors/#partner_suspended"
                    }
                  },
                  "user_inactive": {
                    "summary": "Nutzer nicht mehr berechtigt",
                    "value": {
                      "code": "user_inactive",
                      "detail": "The user who granted access has been deactivated, is no longer a member of the business or no longer has a sufficient role. An admin of the business has to grant access again.",
                      "request_id": "req_01JDX5Q8M3V8F2K7ZB9T4N6C1A",
                      "status": 403,
                      "title": "User inactive",
                      "type": "https://docs.kiosa.ai/en/reference/errors/#user_inactive"
                    }
                  }
                },
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "Fehler: `insufficient_scope`, `user_inactive`, `partner_not_approved`, `partner_suspended`, `partner_apps_disabled`",
            "headers": {
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "WWW-Authenticate": {
                "$ref": "#/components/headers/WWW-Authenticate"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "429": {
            "content": {
              "application/problem+json": {
                "examples": {
                  "rate_limited": {
                    "summary": "Zu viele Anfragen",
                    "value": {
                      "code": "rate_limited",
                      "detail": "Each client may send 60 requests per minute per business. Wait for the number of seconds in the Retry-After header, then retry.",
                      "request_id": "req_01JDX5Q8M3V8F2K7ZB9T4N6C1A",
                      "status": 429,
                      "title": "Rate limited",
                      "type": "https://docs.kiosa.ai/en/reference/errors/#rate_limited"
                    }
                  }
                },
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "Fehler: `rate_limited`",
            "headers": {
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "500": {
            "content": {
              "application/problem+json": {
                "examples": {
                  "internal_error": {
                    "summary": "Interner Fehler",
                    "value": {
                      "code": "internal_error",
                      "detail": "An unexpected error occurred at Kiosa. Retry later and quote the request_id when contacting support.",
                      "request_id": "req_01JDX5Q8M3V8F2K7ZB9T4N6C1A",
                      "status": 500,
                      "title": "Internal error",
                      "type": "https://docs.kiosa.ai/en/reference/errors/#internal_error"
                    }
                  }
                },
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "Fehler: `internal_error`",
            "headers": {
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "502": {
            "content": {
              "application/problem+json": {
                "examples": {
                  "upstream_unavailable": {
                    "summary": "Kiosa-Server nicht erreichbar",
                    "value": {
                      "code": "upstream_unavailable",
                      "detail": "The Kiosa server hosting the business could not be reached or sent an invalid response. Retry later; write calls are idempotent.",
                      "request_id": "req_01JDX5Q8M3V8F2K7ZB9T4N6C1A",
                      "status": 502,
                      "title": "Upstream unavailable",
                      "type": "https://docs.kiosa.ai/en/reference/errors/#upstream_unavailable"
                    }
                  }
                },
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "Fehler: `upstream_unavailable`",
            "headers": {
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "503": {
            "content": {
              "application/problem+json": {
                "examples": {
                  "service_unavailable": {
                    "summary": "Vorübergehend nicht verfügbar",
                    "value": {
                      "code": "service_unavailable",
                      "detail": "Kiosa is temporarily overloaded or unavailable. Wait for the number of seconds in the Retry-After header, if present, then retry.",
                      "request_id": "req_01JDX5Q8M3V8F2K7ZB9T4N6C1A",
                      "status": 503,
                      "title": "Service unavailable",
                      "type": "https://docs.kiosa.ai/en/reference/errors/#service_unavailable"
                    }
                  }
                },
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "Fehler: `service_unavailable`",
            "headers": {
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "504": {
            "content": {
              "application/problem+json": {
                "examples": {
                  "upstream_timeout": {
                    "summary": "Zeitüberschreitung",
                    "value": {
                      "code": "upstream_timeout",
                      "detail": "The Kiosa server hosting the business did not respond in time. The matching GET shows whether a write call already took effect; retrying is idempotent.",
                      "request_id": "req_01JDX5Q8M3V8F2K7ZB9T4N6C1A",
                      "status": 504,
                      "title": "Upstream timeout",
                      "type": "https://docs.kiosa.ai/en/reference/errors/#upstream_timeout"
                    }
                  }
                },
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "Fehler: `upstream_timeout`",
            "headers": {
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          }
        },
        "security": [
          {
            "oauth2": [
              "integrations:read"
            ]
          }
        ],
        "summary": "Integrationen auflisten",
        "tags": [
          "integrations"
        ],
        "x-kiosa-availability": "partner_preview"
      }
    },
    "/integrations/{provider}": {
      "delete": {
        "description": "Löscht die Zugangsdaten und stoppt laufende und künftige Importe, bevor die Antwort kommt. Bereits importierte Daten bleiben in Kiosa. Beim erneuten Verbinden holt Kiosa Lücken von mehr als 7 Tagen nicht nach; der nächtliche Abgleich lädt nur die letzten 7 Tage. Ist nichts verbunden, antwortet der Aufruf ebenfalls mit 204. Den OAuth-Zugriff deines Clients beendet das nicht; dafür gibt es den Widerruf.",
        "operationId": "deleteIntegration",
        "parameters": [
          {
            "description": "Anbieter der Integration. v1 unterstützt nur `ordio`.",
            "in": "path",
            "name": "provider",
            "required": true,
            "schema": {
              "enum": [
                "ordio"
              ],
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Integration getrennt.",
            "headers": {
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "401": {
            "content": {
              "application/problem+json": {
                "examples": {
                  "invalid_token": {
                    "summary": "Token ungültig",
                    "value": {
                      "code": "invalid_token",
                      "detail": "The access token is missing, expired, revoked or not issued for this API. Use the refresh token to obtain a new access token; if that fails, the business has to grant access again.",
                      "request_id": "req_01JDX5Q8M3V8F2K7ZB9T4N6C1A",
                      "status": 401,
                      "title": "Invalid token",
                      "type": "https://docs.kiosa.ai/en/reference/errors/#invalid_token"
                    }
                  }
                },
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "Fehler: `invalid_token`",
            "headers": {
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "WWW-Authenticate": {
                "$ref": "#/components/headers/WWW-Authenticate"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "403": {
            "content": {
              "application/problem+json": {
                "examples": {
                  "admin_required": {
                    "summary": "Admin-Recht nötig",
                    "value": {
                      "code": "admin_required",
                      "detail": "Write calls require the user who granted access to still be an admin of the business. An admin has to grant access again.",
                      "request_id": "req_01JDX5Q8M3V8F2K7ZB9T4N6C1A",
                      "status": 403,
                      "title": "Admin required",
                      "type": "https://docs.kiosa.ai/en/reference/errors/#admin_required"
                    }
                  },
                  "insufficient_scope": {
                    "summary": "Scope fehlt",
                    "value": {
                      "code": "insufficient_scope",
                      "detail": "The token does not carry the scope this endpoint requires. Request the scope during authorization; the WWW-Authenticate header names it.",
                      "request_id": "req_01JDX5Q8M3V8F2K7ZB9T4N6C1A",
                      "status": 403,
                      "title": "Insufficient scope",
                      "type": "https://docs.kiosa.ai/en/reference/errors/#insufficient_scope"
                    }
                  },
                  "partner_apps_disabled": {
                    "summary": "Partner-Apps abgeschaltet",
                    "value": {
                      "code": "partner_apps_disabled",
                      "detail": "The business has turned off partner apps in Kiosa (Settings → Connected apps). Calls are rejected until it turns them back on.",
                      "request_id": "req_01JDX5Q8M3V8F2K7ZB9T4N6C1A",
                      "status": 403,
                      "title": "Partner apps disabled",
                      "type": "https://docs.kiosa.ai/en/reference/errors/#partner_apps_disabled"
                    }
                  },
                  "partner_not_approved": {
                    "summary": "Partner nicht freigegeben",
                    "value": {
                      "code": "partner_not_approved",
                      "detail": "The Kiosa API is only open to approved partners. Your client is not registered as a partner. Write to kontakt@kiosa.ai to apply for approval. Authorization already rejects such a client (`unauthorized_client`); calls get this code when the token belongs to a partner that has lost its approval since.",
                      "request_id": "req_01JDX5Q8M3V8F2K7ZB9T4N6C1A",
                      "status": 403,
                      "title": "Partner not approved",
                      "type": "https://docs.kiosa.ai/en/reference/errors/#partner_not_approved"
                    }
                  },
                  "partner_suspended": {
                    "summary": "Partner gesperrt",
                    "value": {
                      "code": "partner_suspended",
                      "detail": "Kiosa has suspended this client. All of its tokens are rejected with immediate effect.",
                      "request_id": "req_01JDX5Q8M3V8F2K7ZB9T4N6C1A",
                      "status": 403,
                      "title": "Partner suspended",
                      "type": "https://docs.kiosa.ai/en/reference/errors/#partner_suspended"
                    }
                  },
                  "provider_not_allowed": {
                    "summary": "Anbieter nicht erlaubt",
                    "value": {
                      "code": "provider_not_allowed",
                      "detail": "This client may not write integrations of this provider. Each partner is approved only for the providers agreed with Kiosa.",
                      "request_id": "req_01JDX5Q8M3V8F2K7ZB9T4N6C1A",
                      "status": 403,
                      "title": "Provider not allowed",
                      "type": "https://docs.kiosa.ai/en/reference/errors/#provider_not_allowed"
                    }
                  },
                  "user_inactive": {
                    "summary": "Nutzer nicht mehr berechtigt",
                    "value": {
                      "code": "user_inactive",
                      "detail": "The user who granted access has been deactivated, is no longer a member of the business or no longer has a sufficient role. An admin of the business has to grant access again.",
                      "request_id": "req_01JDX5Q8M3V8F2K7ZB9T4N6C1A",
                      "status": 403,
                      "title": "User inactive",
                      "type": "https://docs.kiosa.ai/en/reference/errors/#user_inactive"
                    }
                  }
                },
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "Fehler: `insufficient_scope`, `user_inactive`, `partner_not_approved`, `partner_suspended`, `partner_apps_disabled`, `admin_required`, `provider_not_allowed`",
            "headers": {
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "WWW-Authenticate": {
                "$ref": "#/components/headers/WWW-Authenticate"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "404": {
            "content": {
              "application/problem+json": {
                "examples": {
                  "not_found": {
                    "summary": "Nicht gefunden",
                    "value": {
                      "code": "not_found",
                      "detail": "The resource does not exist or the provider is not supported by the API.",
                      "request_id": "req_01JDX5Q8M3V8F2K7ZB9T4N6C1A",
                      "status": 404,
                      "title": "Not found",
                      "type": "https://docs.kiosa.ai/en/reference/errors/#not_found"
                    }
                  }
                },
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "Fehler: `not_found`",
            "headers": {
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "429": {
            "content": {
              "application/problem+json": {
                "examples": {
                  "rate_limited": {
                    "summary": "Zu viele Anfragen",
                    "value": {
                      "code": "rate_limited",
                      "detail": "Each client may send 60 requests per minute per business. Wait for the number of seconds in the Retry-After header, then retry.",
                      "request_id": "req_01JDX5Q8M3V8F2K7ZB9T4N6C1A",
                      "status": 429,
                      "title": "Rate limited",
                      "type": "https://docs.kiosa.ai/en/reference/errors/#rate_limited"
                    }
                  }
                },
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "Fehler: `rate_limited`",
            "headers": {
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "500": {
            "content": {
              "application/problem+json": {
                "examples": {
                  "internal_error": {
                    "summary": "Interner Fehler",
                    "value": {
                      "code": "internal_error",
                      "detail": "An unexpected error occurred at Kiosa. Retry later and quote the request_id when contacting support.",
                      "request_id": "req_01JDX5Q8M3V8F2K7ZB9T4N6C1A",
                      "status": 500,
                      "title": "Internal error",
                      "type": "https://docs.kiosa.ai/en/reference/errors/#internal_error"
                    }
                  }
                },
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "Fehler: `internal_error`",
            "headers": {
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "502": {
            "content": {
              "application/problem+json": {
                "examples": {
                  "upstream_unavailable": {
                    "summary": "Kiosa-Server nicht erreichbar",
                    "value": {
                      "code": "upstream_unavailable",
                      "detail": "The Kiosa server hosting the business could not be reached or sent an invalid response. Retry later; write calls are idempotent.",
                      "request_id": "req_01JDX5Q8M3V8F2K7ZB9T4N6C1A",
                      "status": 502,
                      "title": "Upstream unavailable",
                      "type": "https://docs.kiosa.ai/en/reference/errors/#upstream_unavailable"
                    }
                  }
                },
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "Fehler: `upstream_unavailable`",
            "headers": {
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "503": {
            "content": {
              "application/problem+json": {
                "examples": {
                  "service_unavailable": {
                    "summary": "Vorübergehend nicht verfügbar",
                    "value": {
                      "code": "service_unavailable",
                      "detail": "Kiosa is temporarily overloaded or unavailable. Wait for the number of seconds in the Retry-After header, if present, then retry.",
                      "request_id": "req_01JDX5Q8M3V8F2K7ZB9T4N6C1A",
                      "status": 503,
                      "title": "Service unavailable",
                      "type": "https://docs.kiosa.ai/en/reference/errors/#service_unavailable"
                    }
                  }
                },
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "Fehler: `service_unavailable`",
            "headers": {
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "504": {
            "content": {
              "application/problem+json": {
                "examples": {
                  "upstream_timeout": {
                    "summary": "Zeitüberschreitung",
                    "value": {
                      "code": "upstream_timeout",
                      "detail": "The Kiosa server hosting the business did not respond in time. The matching GET shows whether a write call already took effect; retrying is idempotent.",
                      "request_id": "req_01JDX5Q8M3V8F2K7ZB9T4N6C1A",
                      "status": 504,
                      "title": "Upstream timeout",
                      "type": "https://docs.kiosa.ai/en/reference/errors/#upstream_timeout"
                    }
                  }
                },
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "Fehler: `upstream_timeout`",
            "headers": {
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          }
        },
        "security": [
          {
            "oauth2": [
              "integrations:write"
            ]
          }
        ],
        "summary": "Integration trennen",
        "tags": [
          "integrations"
        ],
        "x-kiosa-availability": "partner_preview"
      },
      "get": {
        "description": "Liefert den vollständigen Status einer Integration: Verbindung, Erstimport, letzter Import und offene Punkte. Ist nichts verbunden, ist der Status `not_connected` (kein 404). Nach einem PUT mit Antwort 202 fragst du hier ab, bis der Status nicht mehr `testing` ist.",
        "operationId": "getIntegration",
        "parameters": [
          {
            "description": "Anbieter der Integration. v1 unterstützt nur `ordio`.",
            "in": "path",
            "name": "provider",
            "required": true,
            "schema": {
              "enum": [
                "ordio"
              ],
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": {
                  "api_key_last4": "x9Qa",
                  "company_id": "1234",
                  "connected_at": "2026-11-24T10:15:02+01:00",
                  "initial_import": {
                    "since": "2025-01-01",
                    "status": "waiting_for_mapping"
                  },
                  "issues": [
                    {
                      "code": "unmapped_branches",
                      "detail": "1 ordio branch is not mapped to a Kiosa location yet."
                    }
                  ],
                  "key_expires_at": "2027-11-30T23:59:59+01:00",
                  "last_import": null,
                  "provider": "ordio",
                  "status": "needs_mapping"
                },
                "schema": {
                  "$ref": "#/components/schemas/Integration"
                }
              }
            },
            "description": "Status der Integration.",
            "headers": {
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "401": {
            "content": {
              "application/problem+json": {
                "examples": {
                  "invalid_token": {
                    "summary": "Token ungültig",
                    "value": {
                      "code": "invalid_token",
                      "detail": "The access token is missing, expired, revoked or not issued for this API. Use the refresh token to obtain a new access token; if that fails, the business has to grant access again.",
                      "request_id": "req_01JDX5Q8M3V8F2K7ZB9T4N6C1A",
                      "status": 401,
                      "title": "Invalid token",
                      "type": "https://docs.kiosa.ai/en/reference/errors/#invalid_token"
                    }
                  }
                },
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "Fehler: `invalid_token`",
            "headers": {
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "WWW-Authenticate": {
                "$ref": "#/components/headers/WWW-Authenticate"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "403": {
            "content": {
              "application/problem+json": {
                "examples": {
                  "insufficient_scope": {
                    "summary": "Scope fehlt",
                    "value": {
                      "code": "insufficient_scope",
                      "detail": "The token does not carry the scope this endpoint requires. Request the scope during authorization; the WWW-Authenticate header names it.",
                      "request_id": "req_01JDX5Q8M3V8F2K7ZB9T4N6C1A",
                      "status": 403,
                      "title": "Insufficient scope",
                      "type": "https://docs.kiosa.ai/en/reference/errors/#insufficient_scope"
                    }
                  },
                  "partner_apps_disabled": {
                    "summary": "Partner-Apps abgeschaltet",
                    "value": {
                      "code": "partner_apps_disabled",
                      "detail": "The business has turned off partner apps in Kiosa (Settings → Connected apps). Calls are rejected until it turns them back on.",
                      "request_id": "req_01JDX5Q8M3V8F2K7ZB9T4N6C1A",
                      "status": 403,
                      "title": "Partner apps disabled",
                      "type": "https://docs.kiosa.ai/en/reference/errors/#partner_apps_disabled"
                    }
                  },
                  "partner_not_approved": {
                    "summary": "Partner nicht freigegeben",
                    "value": {
                      "code": "partner_not_approved",
                      "detail": "The Kiosa API is only open to approved partners. Your client is not registered as a partner. Write to kontakt@kiosa.ai to apply for approval. Authorization already rejects such a client (`unauthorized_client`); calls get this code when the token belongs to a partner that has lost its approval since.",
                      "request_id": "req_01JDX5Q8M3V8F2K7ZB9T4N6C1A",
                      "status": 403,
                      "title": "Partner not approved",
                      "type": "https://docs.kiosa.ai/en/reference/errors/#partner_not_approved"
                    }
                  },
                  "partner_suspended": {
                    "summary": "Partner gesperrt",
                    "value": {
                      "code": "partner_suspended",
                      "detail": "Kiosa has suspended this client. All of its tokens are rejected with immediate effect.",
                      "request_id": "req_01JDX5Q8M3V8F2K7ZB9T4N6C1A",
                      "status": 403,
                      "title": "Partner suspended",
                      "type": "https://docs.kiosa.ai/en/reference/errors/#partner_suspended"
                    }
                  },
                  "user_inactive": {
                    "summary": "Nutzer nicht mehr berechtigt",
                    "value": {
                      "code": "user_inactive",
                      "detail": "The user who granted access has been deactivated, is no longer a member of the business or no longer has a sufficient role. An admin of the business has to grant access again.",
                      "request_id": "req_01JDX5Q8M3V8F2K7ZB9T4N6C1A",
                      "status": 403,
                      "title": "User inactive",
                      "type": "https://docs.kiosa.ai/en/reference/errors/#user_inactive"
                    }
                  }
                },
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "Fehler: `insufficient_scope`, `user_inactive`, `partner_not_approved`, `partner_suspended`, `partner_apps_disabled`",
            "headers": {
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "WWW-Authenticate": {
                "$ref": "#/components/headers/WWW-Authenticate"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "404": {
            "content": {
              "application/problem+json": {
                "examples": {
                  "not_found": {
                    "summary": "Nicht gefunden",
                    "value": {
                      "code": "not_found",
                      "detail": "The resource does not exist or the provider is not supported by the API.",
                      "request_id": "req_01JDX5Q8M3V8F2K7ZB9T4N6C1A",
                      "status": 404,
                      "title": "Not found",
                      "type": "https://docs.kiosa.ai/en/reference/errors/#not_found"
                    }
                  }
                },
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "Fehler: `not_found`",
            "headers": {
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "429": {
            "content": {
              "application/problem+json": {
                "examples": {
                  "rate_limited": {
                    "summary": "Zu viele Anfragen",
                    "value": {
                      "code": "rate_limited",
                      "detail": "Each client may send 60 requests per minute per business. Wait for the number of seconds in the Retry-After header, then retry.",
                      "request_id": "req_01JDX5Q8M3V8F2K7ZB9T4N6C1A",
                      "status": 429,
                      "title": "Rate limited",
                      "type": "https://docs.kiosa.ai/en/reference/errors/#rate_limited"
                    }
                  }
                },
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "Fehler: `rate_limited`",
            "headers": {
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "500": {
            "content": {
              "application/problem+json": {
                "examples": {
                  "internal_error": {
                    "summary": "Interner Fehler",
                    "value": {
                      "code": "internal_error",
                      "detail": "An unexpected error occurred at Kiosa. Retry later and quote the request_id when contacting support.",
                      "request_id": "req_01JDX5Q8M3V8F2K7ZB9T4N6C1A",
                      "status": 500,
                      "title": "Internal error",
                      "type": "https://docs.kiosa.ai/en/reference/errors/#internal_error"
                    }
                  }
                },
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "Fehler: `internal_error`",
            "headers": {
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "502": {
            "content": {
              "application/problem+json": {
                "examples": {
                  "upstream_unavailable": {
                    "summary": "Kiosa-Server nicht erreichbar",
                    "value": {
                      "code": "upstream_unavailable",
                      "detail": "The Kiosa server hosting the business could not be reached or sent an invalid response. Retry later; write calls are idempotent.",
                      "request_id": "req_01JDX5Q8M3V8F2K7ZB9T4N6C1A",
                      "status": 502,
                      "title": "Upstream unavailable",
                      "type": "https://docs.kiosa.ai/en/reference/errors/#upstream_unavailable"
                    }
                  }
                },
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "Fehler: `upstream_unavailable`",
            "headers": {
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "503": {
            "content": {
              "application/problem+json": {
                "examples": {
                  "service_unavailable": {
                    "summary": "Vorübergehend nicht verfügbar",
                    "value": {
                      "code": "service_unavailable",
                      "detail": "Kiosa is temporarily overloaded or unavailable. Wait for the number of seconds in the Retry-After header, if present, then retry.",
                      "request_id": "req_01JDX5Q8M3V8F2K7ZB9T4N6C1A",
                      "status": 503,
                      "title": "Service unavailable",
                      "type": "https://docs.kiosa.ai/en/reference/errors/#service_unavailable"
                    }
                  }
                },
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "Fehler: `service_unavailable`",
            "headers": {
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "504": {
            "content": {
              "application/problem+json": {
                "examples": {
                  "upstream_timeout": {
                    "summary": "Zeitüberschreitung",
                    "value": {
                      "code": "upstream_timeout",
                      "detail": "The Kiosa server hosting the business did not respond in time. The matching GET shows whether a write call already took effect; retrying is idempotent.",
                      "request_id": "req_01JDX5Q8M3V8F2K7ZB9T4N6C1A",
                      "status": 504,
                      "title": "Upstream timeout",
                      "type": "https://docs.kiosa.ai/en/reference/errors/#upstream_timeout"
                    }
                  }
                },
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "Fehler: `upstream_timeout`",
            "headers": {
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          }
        },
        "security": [
          {
            "oauth2": [
              "integrations:read"
            ]
          }
        ],
        "summary": "Integration abfragen",
        "tags": [
          "integrations"
        ],
        "x-kiosa-availability": "partner_preview"
      },
      "put": {
        "description": "Übergibt die Zugangsdaten des Anbieters. Kiosa prüft sie sofort beim Anbieter (Schlüssel gültig, alle nötigen Rechte vorhanden), speichert sie verschlüsselt und ordnet Filialen mit eindeutig gleichem Namen automatisch Kiosa-Standorten zu. Sind alle Filialen zugeordnet, startet der Erstimport ab 1. Januar des Vorjahres. Der Aufruf ist idempotent: derselbe Body ändert nichts und startet keinen zweiten Import; ein neuer Schlüssel ersetzt den alten. Eine neue `company_id` verwirft alle bisherigen Zuordnungen. Der Betrieb sieht in Kiosa, dass die Integration verbunden wurde.",
        "operationId": "putIntegration",
        "parameters": [
          {
            "description": "Anbieter der Integration. v1 unterstützt nur `ordio`.",
            "in": "path",
            "name": "provider",
            "required": true,
            "schema": {
              "enum": [
                "ordio"
              ],
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "example": {
                "api_key": "<your-ordio-api-key>",
                "company_id": "1234",
                "key_expires_at": "2027-11-30T23:59:59+01:00"
              },
              "schema": {
                "$ref": "#/components/schemas/OrdioCredentials"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": {
                  "api_key_last4": "x9Qa",
                  "branches": [
                    {
                      "branch_id": "4711",
                      "location_id": "cm3loc0000city0000000001",
                      "mapping": "mapped",
                      "name": "Trattoria City",
                      "suggested_location_id": null
                    },
                    {
                      "branch_id": "4712",
                      "location_id": null,
                      "mapping": "unmapped",
                      "name": "Trattoria am Hafen GmbH",
                      "suggested_location_id": "cm3loc0000hafen000000002"
                    },
                    {
                      "branch_id": "4713",
                      "location_id": null,
                      "mapping": "ignored",
                      "name": "Zentrale Verwaltung",
                      "suggested_location_id": null
                    }
                  ],
                  "company_id": "1234",
                  "connected_at": "2026-11-24T10:15:02+01:00",
                  "initial_import": {
                    "since": "2025-01-01",
                    "status": "waiting_for_mapping"
                  },
                  "issues": [
                    {
                      "code": "unmapped_branches",
                      "detail": "1 ordio branch is not mapped to a Kiosa location yet."
                    }
                  ],
                  "key_expires_at": "2027-11-30T23:59:59+01:00",
                  "last_import": null,
                  "provider": "ordio",
                  "status": "needs_mapping"
                },
                "schema": {
                  "$ref": "#/components/schemas/IntegrationWithBranches"
                }
              }
            },
            "description": "Zugangsdaten geprüft und gespeichert, mit Zuordnungsvorschlag.",
            "headers": {
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "202": {
            "content": {
              "application/json": {
                "example": {
                  "api_key_last4": "x9Qa",
                  "branches": [],
                  "company_id": "1234",
                  "connected_at": "2026-11-24T10:15:02+01:00",
                  "initial_import": null,
                  "issues": [],
                  "key_expires_at": "2027-11-30T23:59:59+01:00",
                  "last_import": null,
                  "provider": "ordio",
                  "status": "testing"
                },
                "schema": {
                  "$ref": "#/components/schemas/IntegrationWithBranches"
                }
              }
            },
            "description": "Die Prüfung dauert länger als 10 Sekunden. Status `testing`; das Ergebnis liefert `GET /integrations/{provider}`.",
            "headers": {
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "401": {
            "content": {
              "application/problem+json": {
                "examples": {
                  "invalid_token": {
                    "summary": "Token ungültig",
                    "value": {
                      "code": "invalid_token",
                      "detail": "The access token is missing, expired, revoked or not issued for this API. Use the refresh token to obtain a new access token; if that fails, the business has to grant access again.",
                      "request_id": "req_01JDX5Q8M3V8F2K7ZB9T4N6C1A",
                      "status": 401,
                      "title": "Invalid token",
                      "type": "https://docs.kiosa.ai/en/reference/errors/#invalid_token"
                    }
                  }
                },
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "Fehler: `invalid_token`",
            "headers": {
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "WWW-Authenticate": {
                "$ref": "#/components/headers/WWW-Authenticate"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "403": {
            "content": {
              "application/problem+json": {
                "examples": {
                  "admin_required": {
                    "summary": "Admin-Recht nötig",
                    "value": {
                      "code": "admin_required",
                      "detail": "Write calls require the user who granted access to still be an admin of the business. An admin has to grant access again.",
                      "request_id": "req_01JDX5Q8M3V8F2K7ZB9T4N6C1A",
                      "status": 403,
                      "title": "Admin required",
                      "type": "https://docs.kiosa.ai/en/reference/errors/#admin_required"
                    }
                  },
                  "insufficient_scope": {
                    "summary": "Scope fehlt",
                    "value": {
                      "code": "insufficient_scope",
                      "detail": "The token does not carry the scope this endpoint requires. Request the scope during authorization; the WWW-Authenticate header names it.",
                      "request_id": "req_01JDX5Q8M3V8F2K7ZB9T4N6C1A",
                      "status": 403,
                      "title": "Insufficient scope",
                      "type": "https://docs.kiosa.ai/en/reference/errors/#insufficient_scope"
                    }
                  },
                  "partner_apps_disabled": {
                    "summary": "Partner-Apps abgeschaltet",
                    "value": {
                      "code": "partner_apps_disabled",
                      "detail": "The business has turned off partner apps in Kiosa (Settings → Connected apps). Calls are rejected until it turns them back on.",
                      "request_id": "req_01JDX5Q8M3V8F2K7ZB9T4N6C1A",
                      "status": 403,
                      "title": "Partner apps disabled",
                      "type": "https://docs.kiosa.ai/en/reference/errors/#partner_apps_disabled"
                    }
                  },
                  "partner_not_approved": {
                    "summary": "Partner nicht freigegeben",
                    "value": {
                      "code": "partner_not_approved",
                      "detail": "The Kiosa API is only open to approved partners. Your client is not registered as a partner. Write to kontakt@kiosa.ai to apply for approval. Authorization already rejects such a client (`unauthorized_client`); calls get this code when the token belongs to a partner that has lost its approval since.",
                      "request_id": "req_01JDX5Q8M3V8F2K7ZB9T4N6C1A",
                      "status": 403,
                      "title": "Partner not approved",
                      "type": "https://docs.kiosa.ai/en/reference/errors/#partner_not_approved"
                    }
                  },
                  "partner_suspended": {
                    "summary": "Partner gesperrt",
                    "value": {
                      "code": "partner_suspended",
                      "detail": "Kiosa has suspended this client. All of its tokens are rejected with immediate effect.",
                      "request_id": "req_01JDX5Q8M3V8F2K7ZB9T4N6C1A",
                      "status": 403,
                      "title": "Partner suspended",
                      "type": "https://docs.kiosa.ai/en/reference/errors/#partner_suspended"
                    }
                  },
                  "provider_not_allowed": {
                    "summary": "Anbieter nicht erlaubt",
                    "value": {
                      "code": "provider_not_allowed",
                      "detail": "This client may not write integrations of this provider. Each partner is approved only for the providers agreed with Kiosa.",
                      "request_id": "req_01JDX5Q8M3V8F2K7ZB9T4N6C1A",
                      "status": 403,
                      "title": "Provider not allowed",
                      "type": "https://docs.kiosa.ai/en/reference/errors/#provider_not_allowed"
                    }
                  },
                  "user_inactive": {
                    "summary": "Nutzer nicht mehr berechtigt",
                    "value": {
                      "code": "user_inactive",
                      "detail": "The user who granted access has been deactivated, is no longer a member of the business or no longer has a sufficient role. An admin of the business has to grant access again.",
                      "request_id": "req_01JDX5Q8M3V8F2K7ZB9T4N6C1A",
                      "status": 403,
                      "title": "User inactive",
                      "type": "https://docs.kiosa.ai/en/reference/errors/#user_inactive"
                    }
                  }
                },
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "Fehler: `insufficient_scope`, `user_inactive`, `partner_not_approved`, `partner_suspended`, `partner_apps_disabled`, `admin_required`, `provider_not_allowed`",
            "headers": {
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "WWW-Authenticate": {
                "$ref": "#/components/headers/WWW-Authenticate"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "404": {
            "content": {
              "application/problem+json": {
                "examples": {
                  "not_found": {
                    "summary": "Nicht gefunden",
                    "value": {
                      "code": "not_found",
                      "detail": "The resource does not exist or the provider is not supported by the API.",
                      "request_id": "req_01JDX5Q8M3V8F2K7ZB9T4N6C1A",
                      "status": 404,
                      "title": "Not found",
                      "type": "https://docs.kiosa.ai/en/reference/errors/#not_found"
                    }
                  }
                },
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "Fehler: `not_found`",
            "headers": {
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "413": {
            "content": {
              "application/problem+json": {
                "examples": {
                  "payload_too_large": {
                    "summary": "Anfrage zu groß",
                    "value": {
                      "code": "payload_too_large",
                      "detail": "The request body exceeds 64 KB. Kiosa did not process the request.",
                      "request_id": "req_01JDX5Q8M3V8F2K7ZB9T4N6C1A",
                      "status": 413,
                      "title": "Payload too large",
                      "type": "https://docs.kiosa.ai/en/reference/errors/#payload_too_large"
                    }
                  }
                },
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "Fehler: `payload_too_large`",
            "headers": {
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "422": {
            "content": {
              "application/problem+json": {
                "examples": {
                  "missing_provider_scopes": {
                    "summary": "Schlüssel hat zu wenige Rechte",
                    "value": {
                      "code": "missing_provider_scopes",
                      "detail": "The key works but lacks permissions Kiosa needs for the import; missing_scopes lists them. Issue a key with all permissions and submit it again.",
                      "missing_scopes": [
                        "wages:read"
                      ],
                      "request_id": "req_01JDX5Q8M3V8F2K7ZB9T4N6C1A",
                      "status": 422,
                      "title": "Missing provider scopes",
                      "type": "https://docs.kiosa.ai/en/reference/errors/#missing_provider_scopes"
                    }
                  },
                  "provider_auth_failed": {
                    "summary": "Anbieter lehnt Zugang ab",
                    "value": {
                      "code": "provider_auth_failed",
                      "detail": "The provider rejected the credentials (wrong or expired key, or a key of another company). Kiosa stored nothing.",
                      "request_id": "req_01JDX5Q8M3V8F2K7ZB9T4N6C1A",
                      "status": 422,
                      "title": "Provider rejected credentials",
                      "type": "https://docs.kiosa.ai/en/reference/errors/#provider_auth_failed"
                    }
                  },
                  "validation_failed": {
                    "summary": "Anfrage ungültig",
                    "value": {
                      "code": "validation_failed",
                      "detail": "The body or a parameter does not match the schema, for example a missing or unknown field or a location ID that does not belong to this business. invalid_params lists every affected field.",
                      "invalid_params": [
                        {
                          "name": "company_id",
                          "reason": "Required"
                        }
                      ],
                      "request_id": "req_01JDX5Q8M3V8F2K7ZB9T4N6C1A",
                      "status": 422,
                      "title": "Validation failed",
                      "type": "https://docs.kiosa.ai/en/reference/errors/#validation_failed"
                    }
                  }
                },
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "Fehler: `validation_failed`, `provider_auth_failed`, `missing_provider_scopes`",
            "headers": {
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "429": {
            "content": {
              "application/problem+json": {
                "examples": {
                  "rate_limited": {
                    "summary": "Zu viele Anfragen",
                    "value": {
                      "code": "rate_limited",
                      "detail": "Each client may send 60 requests per minute per business. Wait for the number of seconds in the Retry-After header, then retry.",
                      "request_id": "req_01JDX5Q8M3V8F2K7ZB9T4N6C1A",
                      "status": 429,
                      "title": "Rate limited",
                      "type": "https://docs.kiosa.ai/en/reference/errors/#rate_limited"
                    }
                  }
                },
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "Fehler: `rate_limited`",
            "headers": {
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "500": {
            "content": {
              "application/problem+json": {
                "examples": {
                  "internal_error": {
                    "summary": "Interner Fehler",
                    "value": {
                      "code": "internal_error",
                      "detail": "An unexpected error occurred at Kiosa. Retry later and quote the request_id when contacting support.",
                      "request_id": "req_01JDX5Q8M3V8F2K7ZB9T4N6C1A",
                      "status": 500,
                      "title": "Internal error",
                      "type": "https://docs.kiosa.ai/en/reference/errors/#internal_error"
                    }
                  }
                },
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "Fehler: `internal_error`",
            "headers": {
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "502": {
            "content": {
              "application/problem+json": {
                "examples": {
                  "provider_unreachable": {
                    "summary": "Anbieter nicht erreichbar",
                    "value": {
                      "code": "provider_unreachable",
                      "detail": "Kiosa could not reach the provider or received an unexpected response. Retry later; repeating the PUT is idempotent.",
                      "request_id": "req_01JDX5Q8M3V8F2K7ZB9T4N6C1A",
                      "status": 502,
                      "title": "Provider unreachable",
                      "type": "https://docs.kiosa.ai/en/reference/errors/#provider_unreachable"
                    }
                  },
                  "upstream_unavailable": {
                    "summary": "Kiosa-Server nicht erreichbar",
                    "value": {
                      "code": "upstream_unavailable",
                      "detail": "The Kiosa server hosting the business could not be reached or sent an invalid response. Retry later; write calls are idempotent.",
                      "request_id": "req_01JDX5Q8M3V8F2K7ZB9T4N6C1A",
                      "status": 502,
                      "title": "Upstream unavailable",
                      "type": "https://docs.kiosa.ai/en/reference/errors/#upstream_unavailable"
                    }
                  }
                },
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "Fehler: `upstream_unavailable`, `provider_unreachable`",
            "headers": {
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "503": {
            "content": {
              "application/problem+json": {
                "examples": {
                  "service_unavailable": {
                    "summary": "Vorübergehend nicht verfügbar",
                    "value": {
                      "code": "service_unavailable",
                      "detail": "Kiosa is temporarily overloaded or unavailable. Wait for the number of seconds in the Retry-After header, if present, then retry.",
                      "request_id": "req_01JDX5Q8M3V8F2K7ZB9T4N6C1A",
                      "status": 503,
                      "title": "Service unavailable",
                      "type": "https://docs.kiosa.ai/en/reference/errors/#service_unavailable"
                    }
                  }
                },
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "Fehler: `service_unavailable`",
            "headers": {
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "504": {
            "content": {
              "application/problem+json": {
                "examples": {
                  "upstream_timeout": {
                    "summary": "Zeitüberschreitung",
                    "value": {
                      "code": "upstream_timeout",
                      "detail": "The Kiosa server hosting the business did not respond in time. The matching GET shows whether a write call already took effect; retrying is idempotent.",
                      "request_id": "req_01JDX5Q8M3V8F2K7ZB9T4N6C1A",
                      "status": 504,
                      "title": "Upstream timeout",
                      "type": "https://docs.kiosa.ai/en/reference/errors/#upstream_timeout"
                    }
                  }
                },
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "Fehler: `upstream_timeout`",
            "headers": {
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          }
        },
        "security": [
          {
            "oauth2": [
              "integrations:write"
            ]
          }
        ],
        "summary": "Integration verbinden",
        "tags": [
          "integrations"
        ],
        "x-kiosa-availability": "partner_preview"
      }
    },
    "/integrations/{provider}/branch-mappings": {
      "put": {
        "description": "Ordnet Filialen beim Anbieter Kiosa-Standorten zu oder ignoriert ganze Filialen. Nur die genannten Filialen ändern sich. `location_id` muss ein Standort dieses Betriebs sein (siehe `GET /locations`). Sind danach alle Filialen zugeordnet oder ignoriert, wechselt der Status auf `active` und der Erstimport startet. Zuordnungen nach Arbeitsbereichen pflegt Kiosa selbst.",
        "operationId": "putIntegrationBranchMappings",
        "parameters": [
          {
            "description": "Anbieter der Integration. v1 unterstützt nur `ordio`.",
            "in": "path",
            "name": "provider",
            "required": true,
            "schema": {
              "enum": [
                "ordio"
              ],
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "example": {
                "mappings": [
                  {
                    "branch_id": "4712",
                    "location_id": "cm3loc0000hafen000000002"
                  },
                  {
                    "branch_id": "4713",
                    "ignore": true
                  }
                ]
              },
              "schema": {
                "$ref": "#/components/schemas/BranchMappingRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": {
                  "api_key_last4": "x9Qa",
                  "branches": [
                    {
                      "branch_id": "4711",
                      "location_id": "cm3loc0000city0000000001",
                      "mapping": "mapped",
                      "name": "Trattoria City",
                      "suggested_location_id": null
                    },
                    {
                      "branch_id": "4712",
                      "location_id": "cm3loc0000hafen000000002",
                      "mapping": "mapped",
                      "name": "Trattoria am Hafen GmbH",
                      "suggested_location_id": null
                    },
                    {
                      "branch_id": "4713",
                      "location_id": null,
                      "mapping": "ignored",
                      "name": "Zentrale Verwaltung",
                      "suggested_location_id": null
                    }
                  ],
                  "company_id": "1234",
                  "connected_at": "2026-11-24T10:15:02+01:00",
                  "initial_import": {
                    "since": "2025-01-01",
                    "status": "running"
                  },
                  "issues": [],
                  "key_expires_at": "2027-11-30T23:59:59+01:00",
                  "last_import": {
                    "finished_at": null,
                    "started_at": "2026-11-24T10:16:40+01:00",
                    "status": "running"
                  },
                  "provider": "ordio",
                  "status": "active"
                },
                "schema": {
                  "$ref": "#/components/schemas/IntegrationWithBranches"
                }
              }
            },
            "description": "Zuordnung gespeichert; Status der Integration samt Filialen.",
            "headers": {
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "401": {
            "content": {
              "application/problem+json": {
                "examples": {
                  "invalid_token": {
                    "summary": "Token ungültig",
                    "value": {
                      "code": "invalid_token",
                      "detail": "The access token is missing, expired, revoked or not issued for this API. Use the refresh token to obtain a new access token; if that fails, the business has to grant access again.",
                      "request_id": "req_01JDX5Q8M3V8F2K7ZB9T4N6C1A",
                      "status": 401,
                      "title": "Invalid token",
                      "type": "https://docs.kiosa.ai/en/reference/errors/#invalid_token"
                    }
                  }
                },
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "Fehler: `invalid_token`",
            "headers": {
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "WWW-Authenticate": {
                "$ref": "#/components/headers/WWW-Authenticate"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "403": {
            "content": {
              "application/problem+json": {
                "examples": {
                  "admin_required": {
                    "summary": "Admin-Recht nötig",
                    "value": {
                      "code": "admin_required",
                      "detail": "Write calls require the user who granted access to still be an admin of the business. An admin has to grant access again.",
                      "request_id": "req_01JDX5Q8M3V8F2K7ZB9T4N6C1A",
                      "status": 403,
                      "title": "Admin required",
                      "type": "https://docs.kiosa.ai/en/reference/errors/#admin_required"
                    }
                  },
                  "insufficient_scope": {
                    "summary": "Scope fehlt",
                    "value": {
                      "code": "insufficient_scope",
                      "detail": "The token does not carry the scope this endpoint requires. Request the scope during authorization; the WWW-Authenticate header names it.",
                      "request_id": "req_01JDX5Q8M3V8F2K7ZB9T4N6C1A",
                      "status": 403,
                      "title": "Insufficient scope",
                      "type": "https://docs.kiosa.ai/en/reference/errors/#insufficient_scope"
                    }
                  },
                  "partner_apps_disabled": {
                    "summary": "Partner-Apps abgeschaltet",
                    "value": {
                      "code": "partner_apps_disabled",
                      "detail": "The business has turned off partner apps in Kiosa (Settings → Connected apps). Calls are rejected until it turns them back on.",
                      "request_id": "req_01JDX5Q8M3V8F2K7ZB9T4N6C1A",
                      "status": 403,
                      "title": "Partner apps disabled",
                      "type": "https://docs.kiosa.ai/en/reference/errors/#partner_apps_disabled"
                    }
                  },
                  "partner_not_approved": {
                    "summary": "Partner nicht freigegeben",
                    "value": {
                      "code": "partner_not_approved",
                      "detail": "The Kiosa API is only open to approved partners. Your client is not registered as a partner. Write to kontakt@kiosa.ai to apply for approval. Authorization already rejects such a client (`unauthorized_client`); calls get this code when the token belongs to a partner that has lost its approval since.",
                      "request_id": "req_01JDX5Q8M3V8F2K7ZB9T4N6C1A",
                      "status": 403,
                      "title": "Partner not approved",
                      "type": "https://docs.kiosa.ai/en/reference/errors/#partner_not_approved"
                    }
                  },
                  "partner_suspended": {
                    "summary": "Partner gesperrt",
                    "value": {
                      "code": "partner_suspended",
                      "detail": "Kiosa has suspended this client. All of its tokens are rejected with immediate effect.",
                      "request_id": "req_01JDX5Q8M3V8F2K7ZB9T4N6C1A",
                      "status": 403,
                      "title": "Partner suspended",
                      "type": "https://docs.kiosa.ai/en/reference/errors/#partner_suspended"
                    }
                  },
                  "provider_not_allowed": {
                    "summary": "Anbieter nicht erlaubt",
                    "value": {
                      "code": "provider_not_allowed",
                      "detail": "This client may not write integrations of this provider. Each partner is approved only for the providers agreed with Kiosa.",
                      "request_id": "req_01JDX5Q8M3V8F2K7ZB9T4N6C1A",
                      "status": 403,
                      "title": "Provider not allowed",
                      "type": "https://docs.kiosa.ai/en/reference/errors/#provider_not_allowed"
                    }
                  },
                  "user_inactive": {
                    "summary": "Nutzer nicht mehr berechtigt",
                    "value": {
                      "code": "user_inactive",
                      "detail": "The user who granted access has been deactivated, is no longer a member of the business or no longer has a sufficient role. An admin of the business has to grant access again.",
                      "request_id": "req_01JDX5Q8M3V8F2K7ZB9T4N6C1A",
                      "status": 403,
                      "title": "User inactive",
                      "type": "https://docs.kiosa.ai/en/reference/errors/#user_inactive"
                    }
                  }
                },
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "Fehler: `insufficient_scope`, `user_inactive`, `partner_not_approved`, `partner_suspended`, `partner_apps_disabled`, `admin_required`, `provider_not_allowed`",
            "headers": {
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "WWW-Authenticate": {
                "$ref": "#/components/headers/WWW-Authenticate"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "404": {
            "content": {
              "application/problem+json": {
                "examples": {
                  "not_found": {
                    "summary": "Nicht gefunden",
                    "value": {
                      "code": "not_found",
                      "detail": "The resource does not exist or the provider is not supported by the API.",
                      "request_id": "req_01JDX5Q8M3V8F2K7ZB9T4N6C1A",
                      "status": 404,
                      "title": "Not found",
                      "type": "https://docs.kiosa.ai/en/reference/errors/#not_found"
                    }
                  }
                },
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "Fehler: `not_found`",
            "headers": {
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "409": {
            "content": {
              "application/problem+json": {
                "examples": {
                  "mapping_conflict": {
                    "summary": "Zuordnung veraltet",
                    "value": {
                      "code": "mapping_conflict",
                      "detail": "The mapping references branches that no longer belong to the connected company, for example because the credentials changed in the meantime. Fetch the branches again and resend the mapping.",
                      "request_id": "req_01JDX5Q8M3V8F2K7ZB9T4N6C1A",
                      "status": 409,
                      "title": "Mapping conflict",
                      "type": "https://docs.kiosa.ai/en/reference/errors/#mapping_conflict"
                    }
                  }
                },
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "Fehler: `mapping_conflict`",
            "headers": {
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "413": {
            "content": {
              "application/problem+json": {
                "examples": {
                  "payload_too_large": {
                    "summary": "Anfrage zu groß",
                    "value": {
                      "code": "payload_too_large",
                      "detail": "The request body exceeds 64 KB. Kiosa did not process the request.",
                      "request_id": "req_01JDX5Q8M3V8F2K7ZB9T4N6C1A",
                      "status": 413,
                      "title": "Payload too large",
                      "type": "https://docs.kiosa.ai/en/reference/errors/#payload_too_large"
                    }
                  }
                },
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "Fehler: `payload_too_large`",
            "headers": {
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "422": {
            "content": {
              "application/problem+json": {
                "examples": {
                  "validation_failed": {
                    "summary": "Anfrage ungültig",
                    "value": {
                      "code": "validation_failed",
                      "detail": "The body or a parameter does not match the schema, for example a missing or unknown field or a location ID that does not belong to this business. invalid_params lists every affected field.",
                      "invalid_params": [
                        {
                          "name": "company_id",
                          "reason": "Required"
                        }
                      ],
                      "request_id": "req_01JDX5Q8M3V8F2K7ZB9T4N6C1A",
                      "status": 422,
                      "title": "Validation failed",
                      "type": "https://docs.kiosa.ai/en/reference/errors/#validation_failed"
                    }
                  }
                },
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "Fehler: `validation_failed`",
            "headers": {
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "429": {
            "content": {
              "application/problem+json": {
                "examples": {
                  "rate_limited": {
                    "summary": "Zu viele Anfragen",
                    "value": {
                      "code": "rate_limited",
                      "detail": "Each client may send 60 requests per minute per business. Wait for the number of seconds in the Retry-After header, then retry.",
                      "request_id": "req_01JDX5Q8M3V8F2K7ZB9T4N6C1A",
                      "status": 429,
                      "title": "Rate limited",
                      "type": "https://docs.kiosa.ai/en/reference/errors/#rate_limited"
                    }
                  }
                },
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "Fehler: `rate_limited`",
            "headers": {
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "500": {
            "content": {
              "application/problem+json": {
                "examples": {
                  "internal_error": {
                    "summary": "Interner Fehler",
                    "value": {
                      "code": "internal_error",
                      "detail": "An unexpected error occurred at Kiosa. Retry later and quote the request_id when contacting support.",
                      "request_id": "req_01JDX5Q8M3V8F2K7ZB9T4N6C1A",
                      "status": 500,
                      "title": "Internal error",
                      "type": "https://docs.kiosa.ai/en/reference/errors/#internal_error"
                    }
                  }
                },
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "Fehler: `internal_error`",
            "headers": {
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "502": {
            "content": {
              "application/problem+json": {
                "examples": {
                  "upstream_unavailable": {
                    "summary": "Kiosa-Server nicht erreichbar",
                    "value": {
                      "code": "upstream_unavailable",
                      "detail": "The Kiosa server hosting the business could not be reached or sent an invalid response. Retry later; write calls are idempotent.",
                      "request_id": "req_01JDX5Q8M3V8F2K7ZB9T4N6C1A",
                      "status": 502,
                      "title": "Upstream unavailable",
                      "type": "https://docs.kiosa.ai/en/reference/errors/#upstream_unavailable"
                    }
                  }
                },
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "Fehler: `upstream_unavailable`",
            "headers": {
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "503": {
            "content": {
              "application/problem+json": {
                "examples": {
                  "service_unavailable": {
                    "summary": "Vorübergehend nicht verfügbar",
                    "value": {
                      "code": "service_unavailable",
                      "detail": "Kiosa is temporarily overloaded or unavailable. Wait for the number of seconds in the Retry-After header, if present, then retry.",
                      "request_id": "req_01JDX5Q8M3V8F2K7ZB9T4N6C1A",
                      "status": 503,
                      "title": "Service unavailable",
                      "type": "https://docs.kiosa.ai/en/reference/errors/#service_unavailable"
                    }
                  }
                },
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "Fehler: `service_unavailable`",
            "headers": {
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "504": {
            "content": {
              "application/problem+json": {
                "examples": {
                  "upstream_timeout": {
                    "summary": "Zeitüberschreitung",
                    "value": {
                      "code": "upstream_timeout",
                      "detail": "The Kiosa server hosting the business did not respond in time. The matching GET shows whether a write call already took effect; retrying is idempotent.",
                      "request_id": "req_01JDX5Q8M3V8F2K7ZB9T4N6C1A",
                      "status": 504,
                      "title": "Upstream timeout",
                      "type": "https://docs.kiosa.ai/en/reference/errors/#upstream_timeout"
                    }
                  }
                },
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "Fehler: `upstream_timeout`",
            "headers": {
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          }
        },
        "security": [
          {
            "oauth2": [
              "integrations:write"
            ]
          }
        ],
        "summary": "Filialen zuordnen",
        "tags": [
          "integrations"
        ],
        "x-kiosa-availability": "partner_preview"
      }
    },
    "/integrations/{provider}/branches": {
      "get": {
        "description": "Liefert die Filialen beim Anbieter mit ihrem zugeordneten Kiosa-Standort oder einem Vorschlag. Ist die Integration nicht verbunden, antwortet der Aufruf mit 404 `not_found`.",
        "operationId": "listIntegrationBranches",
        "parameters": [
          {
            "description": "Anbieter der Integration. v1 unterstützt nur `ordio`.",
            "in": "path",
            "name": "provider",
            "required": true,
            "schema": {
              "enum": [
                "ordio"
              ],
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": {
                  "data": [
                    {
                      "branch_id": "4711",
                      "location_id": "cm3loc0000city0000000001",
                      "mapping": "mapped",
                      "name": "Trattoria City",
                      "suggested_location_id": null
                    },
                    {
                      "branch_id": "4712",
                      "location_id": null,
                      "mapping": "unmapped",
                      "name": "Trattoria am Hafen GmbH",
                      "suggested_location_id": "cm3loc0000hafen000000002"
                    },
                    {
                      "branch_id": "4713",
                      "location_id": null,
                      "mapping": "ignored",
                      "name": "Zentrale Verwaltung",
                      "suggested_location_id": null
                    }
                  ]
                },
                "schema": {
                  "$ref": "#/components/schemas/BranchList"
                }
              }
            },
            "description": "Filialen beim Anbieter.",
            "headers": {
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "401": {
            "content": {
              "application/problem+json": {
                "examples": {
                  "invalid_token": {
                    "summary": "Token ungültig",
                    "value": {
                      "code": "invalid_token",
                      "detail": "The access token is missing, expired, revoked or not issued for this API. Use the refresh token to obtain a new access token; if that fails, the business has to grant access again.",
                      "request_id": "req_01JDX5Q8M3V8F2K7ZB9T4N6C1A",
                      "status": 401,
                      "title": "Invalid token",
                      "type": "https://docs.kiosa.ai/en/reference/errors/#invalid_token"
                    }
                  }
                },
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "Fehler: `invalid_token`",
            "headers": {
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "WWW-Authenticate": {
                "$ref": "#/components/headers/WWW-Authenticate"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "403": {
            "content": {
              "application/problem+json": {
                "examples": {
                  "insufficient_scope": {
                    "summary": "Scope fehlt",
                    "value": {
                      "code": "insufficient_scope",
                      "detail": "The token does not carry the scope this endpoint requires. Request the scope during authorization; the WWW-Authenticate header names it.",
                      "request_id": "req_01JDX5Q8M3V8F2K7ZB9T4N6C1A",
                      "status": 403,
                      "title": "Insufficient scope",
                      "type": "https://docs.kiosa.ai/en/reference/errors/#insufficient_scope"
                    }
                  },
                  "partner_apps_disabled": {
                    "summary": "Partner-Apps abgeschaltet",
                    "value": {
                      "code": "partner_apps_disabled",
                      "detail": "The business has turned off partner apps in Kiosa (Settings → Connected apps). Calls are rejected until it turns them back on.",
                      "request_id": "req_01JDX5Q8M3V8F2K7ZB9T4N6C1A",
                      "status": 403,
                      "title": "Partner apps disabled",
                      "type": "https://docs.kiosa.ai/en/reference/errors/#partner_apps_disabled"
                    }
                  },
                  "partner_not_approved": {
                    "summary": "Partner nicht freigegeben",
                    "value": {
                      "code": "partner_not_approved",
                      "detail": "The Kiosa API is only open to approved partners. Your client is not registered as a partner. Write to kontakt@kiosa.ai to apply for approval. Authorization already rejects such a client (`unauthorized_client`); calls get this code when the token belongs to a partner that has lost its approval since.",
                      "request_id": "req_01JDX5Q8M3V8F2K7ZB9T4N6C1A",
                      "status": 403,
                      "title": "Partner not approved",
                      "type": "https://docs.kiosa.ai/en/reference/errors/#partner_not_approved"
                    }
                  },
                  "partner_suspended": {
                    "summary": "Partner gesperrt",
                    "value": {
                      "code": "partner_suspended",
                      "detail": "Kiosa has suspended this client. All of its tokens are rejected with immediate effect.",
                      "request_id": "req_01JDX5Q8M3V8F2K7ZB9T4N6C1A",
                      "status": 403,
                      "title": "Partner suspended",
                      "type": "https://docs.kiosa.ai/en/reference/errors/#partner_suspended"
                    }
                  },
                  "user_inactive": {
                    "summary": "Nutzer nicht mehr berechtigt",
                    "value": {
                      "code": "user_inactive",
                      "detail": "The user who granted access has been deactivated, is no longer a member of the business or no longer has a sufficient role. An admin of the business has to grant access again.",
                      "request_id": "req_01JDX5Q8M3V8F2K7ZB9T4N6C1A",
                      "status": 403,
                      "title": "User inactive",
                      "type": "https://docs.kiosa.ai/en/reference/errors/#user_inactive"
                    }
                  }
                },
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "Fehler: `insufficient_scope`, `user_inactive`, `partner_not_approved`, `partner_suspended`, `partner_apps_disabled`",
            "headers": {
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "WWW-Authenticate": {
                "$ref": "#/components/headers/WWW-Authenticate"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "404": {
            "content": {
              "application/problem+json": {
                "examples": {
                  "not_found": {
                    "summary": "Nicht gefunden",
                    "value": {
                      "code": "not_found",
                      "detail": "The resource does not exist or the provider is not supported by the API.",
                      "request_id": "req_01JDX5Q8M3V8F2K7ZB9T4N6C1A",
                      "status": 404,
                      "title": "Not found",
                      "type": "https://docs.kiosa.ai/en/reference/errors/#not_found"
                    }
                  }
                },
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "Fehler: `not_found`",
            "headers": {
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "429": {
            "content": {
              "application/problem+json": {
                "examples": {
                  "rate_limited": {
                    "summary": "Zu viele Anfragen",
                    "value": {
                      "code": "rate_limited",
                      "detail": "Each client may send 60 requests per minute per business. Wait for the number of seconds in the Retry-After header, then retry.",
                      "request_id": "req_01JDX5Q8M3V8F2K7ZB9T4N6C1A",
                      "status": 429,
                      "title": "Rate limited",
                      "type": "https://docs.kiosa.ai/en/reference/errors/#rate_limited"
                    }
                  }
                },
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "Fehler: `rate_limited`",
            "headers": {
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "500": {
            "content": {
              "application/problem+json": {
                "examples": {
                  "internal_error": {
                    "summary": "Interner Fehler",
                    "value": {
                      "code": "internal_error",
                      "detail": "An unexpected error occurred at Kiosa. Retry later and quote the request_id when contacting support.",
                      "request_id": "req_01JDX5Q8M3V8F2K7ZB9T4N6C1A",
                      "status": 500,
                      "title": "Internal error",
                      "type": "https://docs.kiosa.ai/en/reference/errors/#internal_error"
                    }
                  }
                },
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "Fehler: `internal_error`",
            "headers": {
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "502": {
            "content": {
              "application/problem+json": {
                "examples": {
                  "provider_unreachable": {
                    "summary": "Anbieter nicht erreichbar",
                    "value": {
                      "code": "provider_unreachable",
                      "detail": "Kiosa could not reach the provider or received an unexpected response. Retry later; repeating the PUT is idempotent.",
                      "request_id": "req_01JDX5Q8M3V8F2K7ZB9T4N6C1A",
                      "status": 502,
                      "title": "Provider unreachable",
                      "type": "https://docs.kiosa.ai/en/reference/errors/#provider_unreachable"
                    }
                  },
                  "upstream_unavailable": {
                    "summary": "Kiosa-Server nicht erreichbar",
                    "value": {
                      "code": "upstream_unavailable",
                      "detail": "The Kiosa server hosting the business could not be reached or sent an invalid response. Retry later; write calls are idempotent.",
                      "request_id": "req_01JDX5Q8M3V8F2K7ZB9T4N6C1A",
                      "status": 502,
                      "title": "Upstream unavailable",
                      "type": "https://docs.kiosa.ai/en/reference/errors/#upstream_unavailable"
                    }
                  }
                },
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "Fehler: `upstream_unavailable`, `provider_unreachable`",
            "headers": {
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "503": {
            "content": {
              "application/problem+json": {
                "examples": {
                  "service_unavailable": {
                    "summary": "Vorübergehend nicht verfügbar",
                    "value": {
                      "code": "service_unavailable",
                      "detail": "Kiosa is temporarily overloaded or unavailable. Wait for the number of seconds in the Retry-After header, if present, then retry.",
                      "request_id": "req_01JDX5Q8M3V8F2K7ZB9T4N6C1A",
                      "status": 503,
                      "title": "Service unavailable",
                      "type": "https://docs.kiosa.ai/en/reference/errors/#service_unavailable"
                    }
                  }
                },
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "Fehler: `service_unavailable`",
            "headers": {
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "504": {
            "content": {
              "application/problem+json": {
                "examples": {
                  "upstream_timeout": {
                    "summary": "Zeitüberschreitung",
                    "value": {
                      "code": "upstream_timeout",
                      "detail": "The Kiosa server hosting the business did not respond in time. The matching GET shows whether a write call already took effect; retrying is idempotent.",
                      "request_id": "req_01JDX5Q8M3V8F2K7ZB9T4N6C1A",
                      "status": 504,
                      "title": "Upstream timeout",
                      "type": "https://docs.kiosa.ai/en/reference/errors/#upstream_timeout"
                    }
                  }
                },
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "Fehler: `upstream_timeout`",
            "headers": {
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          }
        },
        "security": [
          {
            "oauth2": [
              "integrations:read"
            ]
          }
        ],
        "summary": "Filialen auflisten",
        "tags": [
          "integrations"
        ],
        "x-kiosa-availability": "partner_preview"
      }
    },
    "/locations": {
      "get": {
        "description": "Liefert alle Standorte des Betriebs mit ID, Name und Adresse. Die IDs brauchst du, um Filialen eines Anbieters per `PUT /integrations/{provider}/branch-mappings` zuzuordnen.",
        "operationId": "listLocations",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": {
                  "data": [
                    {
                      "address": {
                        "city": "Hamburg",
                        "country": "DE",
                        "postal_code": "20095",
                        "street": "Musterstraße 1"
                      },
                      "id": "cm3loc0000city0000000001",
                      "name": "Trattoria City"
                    },
                    {
                      "address": {
                        "city": "Hamburg",
                        "country": "DE",
                        "postal_code": "20457",
                        "street": "Hafenweg 7"
                      },
                      "id": "cm3loc0000hafen000000002",
                      "name": "Trattoria am Hafen"
                    }
                  ]
                },
                "schema": {
                  "$ref": "#/components/schemas/LocationList"
                }
              }
            },
            "description": "Alle Standorte des Betriebs.",
            "headers": {
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "401": {
            "content": {
              "application/problem+json": {
                "examples": {
                  "invalid_token": {
                    "summary": "Token ungültig",
                    "value": {
                      "code": "invalid_token",
                      "detail": "The access token is missing, expired, revoked or not issued for this API. Use the refresh token to obtain a new access token; if that fails, the business has to grant access again.",
                      "request_id": "req_01JDX5Q8M3V8F2K7ZB9T4N6C1A",
                      "status": 401,
                      "title": "Invalid token",
                      "type": "https://docs.kiosa.ai/en/reference/errors/#invalid_token"
                    }
                  }
                },
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "Fehler: `invalid_token`",
            "headers": {
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "WWW-Authenticate": {
                "$ref": "#/components/headers/WWW-Authenticate"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "403": {
            "content": {
              "application/problem+json": {
                "examples": {
                  "insufficient_scope": {
                    "summary": "Scope fehlt",
                    "value": {
                      "code": "insufficient_scope",
                      "detail": "The token does not carry the scope this endpoint requires. Request the scope during authorization; the WWW-Authenticate header names it.",
                      "request_id": "req_01JDX5Q8M3V8F2K7ZB9T4N6C1A",
                      "status": 403,
                      "title": "Insufficient scope",
                      "type": "https://docs.kiosa.ai/en/reference/errors/#insufficient_scope"
                    }
                  },
                  "partner_apps_disabled": {
                    "summary": "Partner-Apps abgeschaltet",
                    "value": {
                      "code": "partner_apps_disabled",
                      "detail": "The business has turned off partner apps in Kiosa (Settings → Connected apps). Calls are rejected until it turns them back on.",
                      "request_id": "req_01JDX5Q8M3V8F2K7ZB9T4N6C1A",
                      "status": 403,
                      "title": "Partner apps disabled",
                      "type": "https://docs.kiosa.ai/en/reference/errors/#partner_apps_disabled"
                    }
                  },
                  "partner_not_approved": {
                    "summary": "Partner nicht freigegeben",
                    "value": {
                      "code": "partner_not_approved",
                      "detail": "The Kiosa API is only open to approved partners. Your client is not registered as a partner. Write to kontakt@kiosa.ai to apply for approval. Authorization already rejects such a client (`unauthorized_client`); calls get this code when the token belongs to a partner that has lost its approval since.",
                      "request_id": "req_01JDX5Q8M3V8F2K7ZB9T4N6C1A",
                      "status": 403,
                      "title": "Partner not approved",
                      "type": "https://docs.kiosa.ai/en/reference/errors/#partner_not_approved"
                    }
                  },
                  "partner_suspended": {
                    "summary": "Partner gesperrt",
                    "value": {
                      "code": "partner_suspended",
                      "detail": "Kiosa has suspended this client. All of its tokens are rejected with immediate effect.",
                      "request_id": "req_01JDX5Q8M3V8F2K7ZB9T4N6C1A",
                      "status": 403,
                      "title": "Partner suspended",
                      "type": "https://docs.kiosa.ai/en/reference/errors/#partner_suspended"
                    }
                  },
                  "user_inactive": {
                    "summary": "Nutzer nicht mehr berechtigt",
                    "value": {
                      "code": "user_inactive",
                      "detail": "The user who granted access has been deactivated, is no longer a member of the business or no longer has a sufficient role. An admin of the business has to grant access again.",
                      "request_id": "req_01JDX5Q8M3V8F2K7ZB9T4N6C1A",
                      "status": 403,
                      "title": "User inactive",
                      "type": "https://docs.kiosa.ai/en/reference/errors/#user_inactive"
                    }
                  }
                },
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "Fehler: `insufficient_scope`, `user_inactive`, `partner_not_approved`, `partner_suspended`, `partner_apps_disabled`",
            "headers": {
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "WWW-Authenticate": {
                "$ref": "#/components/headers/WWW-Authenticate"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "429": {
            "content": {
              "application/problem+json": {
                "examples": {
                  "rate_limited": {
                    "summary": "Zu viele Anfragen",
                    "value": {
                      "code": "rate_limited",
                      "detail": "Each client may send 60 requests per minute per business. Wait for the number of seconds in the Retry-After header, then retry.",
                      "request_id": "req_01JDX5Q8M3V8F2K7ZB9T4N6C1A",
                      "status": 429,
                      "title": "Rate limited",
                      "type": "https://docs.kiosa.ai/en/reference/errors/#rate_limited"
                    }
                  }
                },
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "Fehler: `rate_limited`",
            "headers": {
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "500": {
            "content": {
              "application/problem+json": {
                "examples": {
                  "internal_error": {
                    "summary": "Interner Fehler",
                    "value": {
                      "code": "internal_error",
                      "detail": "An unexpected error occurred at Kiosa. Retry later and quote the request_id when contacting support.",
                      "request_id": "req_01JDX5Q8M3V8F2K7ZB9T4N6C1A",
                      "status": 500,
                      "title": "Internal error",
                      "type": "https://docs.kiosa.ai/en/reference/errors/#internal_error"
                    }
                  }
                },
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "Fehler: `internal_error`",
            "headers": {
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "502": {
            "content": {
              "application/problem+json": {
                "examples": {
                  "upstream_unavailable": {
                    "summary": "Kiosa-Server nicht erreichbar",
                    "value": {
                      "code": "upstream_unavailable",
                      "detail": "The Kiosa server hosting the business could not be reached or sent an invalid response. Retry later; write calls are idempotent.",
                      "request_id": "req_01JDX5Q8M3V8F2K7ZB9T4N6C1A",
                      "status": 502,
                      "title": "Upstream unavailable",
                      "type": "https://docs.kiosa.ai/en/reference/errors/#upstream_unavailable"
                    }
                  }
                },
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "Fehler: `upstream_unavailable`",
            "headers": {
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "503": {
            "content": {
              "application/problem+json": {
                "examples": {
                  "service_unavailable": {
                    "summary": "Vorübergehend nicht verfügbar",
                    "value": {
                      "code": "service_unavailable",
                      "detail": "Kiosa is temporarily overloaded or unavailable. Wait for the number of seconds in the Retry-After header, if present, then retry.",
                      "request_id": "req_01JDX5Q8M3V8F2K7ZB9T4N6C1A",
                      "status": 503,
                      "title": "Service unavailable",
                      "type": "https://docs.kiosa.ai/en/reference/errors/#service_unavailable"
                    }
                  }
                },
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "Fehler: `service_unavailable`",
            "headers": {
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "504": {
            "content": {
              "application/problem+json": {
                "examples": {
                  "upstream_timeout": {
                    "summary": "Zeitüberschreitung",
                    "value": {
                      "code": "upstream_timeout",
                      "detail": "The Kiosa server hosting the business did not respond in time. The matching GET shows whether a write call already took effect; retrying is idempotent.",
                      "request_id": "req_01JDX5Q8M3V8F2K7ZB9T4N6C1A",
                      "status": 504,
                      "title": "Upstream timeout",
                      "type": "https://docs.kiosa.ai/en/reference/errors/#upstream_timeout"
                    }
                  }
                },
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "Fehler: `upstream_timeout`",
            "headers": {
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          }
        },
        "security": [
          {
            "oauth2": [
              "account:read"
            ]
          }
        ],
        "summary": "Standorte auflisten",
        "tags": [
          "account"
        ],
        "x-kiosa-availability": "partner_preview"
      }
    },
    "/me": {
      "get": {
        "description": "Liefert den Betrieb, der den Zugriff erteilt hat, den Zeitpunkt der Zustimmung und die gewährten Scopes. Gut als erster Aufruf nach dem Login, um den Betrieb in deinem System zuzuordnen.",
        "operationId": "getMe",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": {
                  "account": {
                    "id": "cm3acc0000trattoria00001",
                    "name": "Trattoria Beispiel GmbH",
                    "slug": "trattoria-beispiel"
                  },
                  "consented_at": "2026-11-24T09:30:00+01:00",
                  "scopes": [
                    "account:read",
                    "integrations:write"
                  ]
                },
                "schema": {
                  "$ref": "#/components/schemas/Me"
                }
              }
            },
            "description": "Die Verbindung des Tokens.",
            "headers": {
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "401": {
            "content": {
              "application/problem+json": {
                "examples": {
                  "invalid_token": {
                    "summary": "Token ungültig",
                    "value": {
                      "code": "invalid_token",
                      "detail": "The access token is missing, expired, revoked or not issued for this API. Use the refresh token to obtain a new access token; if that fails, the business has to grant access again.",
                      "request_id": "req_01JDX5Q8M3V8F2K7ZB9T4N6C1A",
                      "status": 401,
                      "title": "Invalid token",
                      "type": "https://docs.kiosa.ai/en/reference/errors/#invalid_token"
                    }
                  }
                },
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "Fehler: `invalid_token`",
            "headers": {
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "WWW-Authenticate": {
                "$ref": "#/components/headers/WWW-Authenticate"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "403": {
            "content": {
              "application/problem+json": {
                "examples": {
                  "insufficient_scope": {
                    "summary": "Scope fehlt",
                    "value": {
                      "code": "insufficient_scope",
                      "detail": "The token does not carry the scope this endpoint requires. Request the scope during authorization; the WWW-Authenticate header names it.",
                      "request_id": "req_01JDX5Q8M3V8F2K7ZB9T4N6C1A",
                      "status": 403,
                      "title": "Insufficient scope",
                      "type": "https://docs.kiosa.ai/en/reference/errors/#insufficient_scope"
                    }
                  },
                  "partner_apps_disabled": {
                    "summary": "Partner-Apps abgeschaltet",
                    "value": {
                      "code": "partner_apps_disabled",
                      "detail": "The business has turned off partner apps in Kiosa (Settings → Connected apps). Calls are rejected until it turns them back on.",
                      "request_id": "req_01JDX5Q8M3V8F2K7ZB9T4N6C1A",
                      "status": 403,
                      "title": "Partner apps disabled",
                      "type": "https://docs.kiosa.ai/en/reference/errors/#partner_apps_disabled"
                    }
                  },
                  "partner_not_approved": {
                    "summary": "Partner nicht freigegeben",
                    "value": {
                      "code": "partner_not_approved",
                      "detail": "The Kiosa API is only open to approved partners. Your client is not registered as a partner. Write to kontakt@kiosa.ai to apply for approval. Authorization already rejects such a client (`unauthorized_client`); calls get this code when the token belongs to a partner that has lost its approval since.",
                      "request_id": "req_01JDX5Q8M3V8F2K7ZB9T4N6C1A",
                      "status": 403,
                      "title": "Partner not approved",
                      "type": "https://docs.kiosa.ai/en/reference/errors/#partner_not_approved"
                    }
                  },
                  "partner_suspended": {
                    "summary": "Partner gesperrt",
                    "value": {
                      "code": "partner_suspended",
                      "detail": "Kiosa has suspended this client. All of its tokens are rejected with immediate effect.",
                      "request_id": "req_01JDX5Q8M3V8F2K7ZB9T4N6C1A",
                      "status": 403,
                      "title": "Partner suspended",
                      "type": "https://docs.kiosa.ai/en/reference/errors/#partner_suspended"
                    }
                  },
                  "user_inactive": {
                    "summary": "Nutzer nicht mehr berechtigt",
                    "value": {
                      "code": "user_inactive",
                      "detail": "The user who granted access has been deactivated, is no longer a member of the business or no longer has a sufficient role. An admin of the business has to grant access again.",
                      "request_id": "req_01JDX5Q8M3V8F2K7ZB9T4N6C1A",
                      "status": 403,
                      "title": "User inactive",
                      "type": "https://docs.kiosa.ai/en/reference/errors/#user_inactive"
                    }
                  }
                },
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "Fehler: `insufficient_scope`, `user_inactive`, `partner_not_approved`, `partner_suspended`, `partner_apps_disabled`",
            "headers": {
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "WWW-Authenticate": {
                "$ref": "#/components/headers/WWW-Authenticate"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "429": {
            "content": {
              "application/problem+json": {
                "examples": {
                  "rate_limited": {
                    "summary": "Zu viele Anfragen",
                    "value": {
                      "code": "rate_limited",
                      "detail": "Each client may send 60 requests per minute per business. Wait for the number of seconds in the Retry-After header, then retry.",
                      "request_id": "req_01JDX5Q8M3V8F2K7ZB9T4N6C1A",
                      "status": 429,
                      "title": "Rate limited",
                      "type": "https://docs.kiosa.ai/en/reference/errors/#rate_limited"
                    }
                  }
                },
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "Fehler: `rate_limited`",
            "headers": {
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "500": {
            "content": {
              "application/problem+json": {
                "examples": {
                  "internal_error": {
                    "summary": "Interner Fehler",
                    "value": {
                      "code": "internal_error",
                      "detail": "An unexpected error occurred at Kiosa. Retry later and quote the request_id when contacting support.",
                      "request_id": "req_01JDX5Q8M3V8F2K7ZB9T4N6C1A",
                      "status": 500,
                      "title": "Internal error",
                      "type": "https://docs.kiosa.ai/en/reference/errors/#internal_error"
                    }
                  }
                },
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "Fehler: `internal_error`",
            "headers": {
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "502": {
            "content": {
              "application/problem+json": {
                "examples": {
                  "upstream_unavailable": {
                    "summary": "Kiosa-Server nicht erreichbar",
                    "value": {
                      "code": "upstream_unavailable",
                      "detail": "The Kiosa server hosting the business could not be reached or sent an invalid response. Retry later; write calls are idempotent.",
                      "request_id": "req_01JDX5Q8M3V8F2K7ZB9T4N6C1A",
                      "status": 502,
                      "title": "Upstream unavailable",
                      "type": "https://docs.kiosa.ai/en/reference/errors/#upstream_unavailable"
                    }
                  }
                },
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "Fehler: `upstream_unavailable`",
            "headers": {
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "503": {
            "content": {
              "application/problem+json": {
                "examples": {
                  "service_unavailable": {
                    "summary": "Vorübergehend nicht verfügbar",
                    "value": {
                      "code": "service_unavailable",
                      "detail": "Kiosa is temporarily overloaded or unavailable. Wait for the number of seconds in the Retry-After header, if present, then retry.",
                      "request_id": "req_01JDX5Q8M3V8F2K7ZB9T4N6C1A",
                      "status": 503,
                      "title": "Service unavailable",
                      "type": "https://docs.kiosa.ai/en/reference/errors/#service_unavailable"
                    }
                  }
                },
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "Fehler: `service_unavailable`",
            "headers": {
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "504": {
            "content": {
              "application/problem+json": {
                "examples": {
                  "upstream_timeout": {
                    "summary": "Zeitüberschreitung",
                    "value": {
                      "code": "upstream_timeout",
                      "detail": "The Kiosa server hosting the business did not respond in time. The matching GET shows whether a write call already took effect; retrying is idempotent.",
                      "request_id": "req_01JDX5Q8M3V8F2K7ZB9T4N6C1A",
                      "status": 504,
                      "title": "Upstream timeout",
                      "type": "https://docs.kiosa.ai/en/reference/errors/#upstream_timeout"
                    }
                  }
                },
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            },
            "description": "Fehler: `upstream_timeout`",
            "headers": {
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          }
        },
        "security": [
          {
            "oauth2": [
              "account:read"
            ]
          }
        ],
        "summary": "Verbindung abfragen",
        "tags": [
          "account"
        ],
        "x-kiosa-availability": "partner_preview"
      }
    }
  },
  "security": [
    {
      "oauth2": []
    }
  ],
  "servers": [
    {
      "url": "https://api.kiosa.ai/v1"
    }
  ],
  "tags": [
    {
      "description": "Betrieb und Standorte, für die dein Client freigegeben ist.",
      "name": "account"
    },
    {
      "description": "Integrationen des Betriebs verbinden, zuordnen und trennen.",
      "name": "integrations"
    }
  ],
  "x-kiosa-errors": {
    "admin_required": {
      "description": "Schreibende Aufrufe verlangen, dass der Nutzer, der die Verbindung erteilt hat, weiterhin Admin des Betriebs ist. Ein Admin muss die Verbindung neu erteilen.",
      "status": 403,
      "title": "Admin-Recht nötig",
      "type": "https://docs.kiosa.ai/en/reference/errors/#admin_required"
    },
    "insufficient_scope": {
      "description": "Das Token trägt den Scope nicht, den dieser Endpunkt verlangt. Fordere den Scope beim Login an; der Header WWW-Authenticate nennt ihn.",
      "status": 403,
      "title": "Scope fehlt",
      "type": "https://docs.kiosa.ai/en/reference/errors/#insufficient_scope"
    },
    "internal_error": {
      "description": "Bei Kiosa ist ein unerwarteter Fehler passiert. Wiederhole die Anfrage später und nenne bei Rückfragen die request_id.",
      "status": 500,
      "title": "Interner Fehler",
      "type": "https://docs.kiosa.ai/en/reference/errors/#internal_error"
    },
    "invalid_token": {
      "description": "Das Access Token fehlt, ist abgelaufen, widerrufen oder gilt nicht für diese API. Hol dir mit dem Refresh Token ein neues Access Token; schlägt das fehl, muss der Betrieb die Verbindung neu erteilen.",
      "status": 401,
      "title": "Token ungültig",
      "type": "https://docs.kiosa.ai/en/reference/errors/#invalid_token"
    },
    "mapping_conflict": {
      "description": "Die Zuordnung nennt Filialen, die nicht mehr zur verbundenen Firma gehören, etwa weil die Zugangsdaten inzwischen gewechselt wurden. Lies die Filialen neu und sende die Zuordnung erneut.",
      "status": 409,
      "title": "Zuordnung veraltet",
      "type": "https://docs.kiosa.ai/en/reference/errors/#mapping_conflict"
    },
    "missing_provider_scopes": {
      "description": "Der Schlüssel funktioniert, ihm fehlen aber Rechte, die Kiosa für den Import braucht. missing_scopes nennt sie. Stell einen Schlüssel mit allen Rechten aus und übergib ihn erneut.",
      "status": 422,
      "title": "Schlüssel hat zu wenige Rechte",
      "type": "https://docs.kiosa.ai/en/reference/errors/#missing_provider_scopes"
    },
    "not_found": {
      "description": "Die Ressource gibt es nicht, oder der Anbieter wird von der API nicht unterstützt.",
      "status": 404,
      "title": "Nicht gefunden",
      "type": "https://docs.kiosa.ai/en/reference/errors/#not_found"
    },
    "partner_apps_disabled": {
      "description": "Der Betrieb hat Partner-Apps in Kiosa unter Einstellungen → Verbundene Apps abgeschaltet. Erst wenn er sie wieder einschaltet, nimmt die API Aufrufe an.",
      "status": 403,
      "title": "Partner-Apps abgeschaltet",
      "type": "https://docs.kiosa.ai/en/reference/errors/#partner_apps_disabled"
    },
    "partner_not_approved": {
      "description": "Die Kiosa API steht nur freigegebenen Partnern offen. Dein Client ist nicht als Partner eingetragen. Melde dich unter kontakt@kiosa.ai, um die Freigabe zu beantragen. Beim Login lehnt Kiosa einen solchen Client schon ab (`unauthorized_client`); diesen Code bekommt ein Aufruf mit einem Token, dessen Partner die Freigabe inzwischen verloren hat.",
      "status": 403,
      "title": "Partner nicht freigegeben",
      "type": "https://docs.kiosa.ai/en/reference/errors/#partner_not_approved"
    },
    "partner_suspended": {
      "description": "Kiosa hat die Freigabe deines Clients gesperrt. Alle Tokens des Clients sind ab sofort ungültig.",
      "status": 403,
      "title": "Partner gesperrt",
      "type": "https://docs.kiosa.ai/en/reference/errors/#partner_suspended"
    },
    "payload_too_large": {
      "description": "Der Body ist größer als 64 KB. Kiosa hat die Anfrage nicht verarbeitet.",
      "status": 413,
      "title": "Anfrage zu groß",
      "type": "https://docs.kiosa.ai/en/reference/errors/#payload_too_large"
    },
    "provider_auth_failed": {
      "description": "Der Anbieter hat die Zugangsdaten abgelehnt (Schlüssel falsch, abgelaufen oder gehört zu einer anderen Firma). Kiosa hat nichts gespeichert.",
      "status": 422,
      "title": "Anbieter lehnt Zugang ab",
      "type": "https://docs.kiosa.ai/en/reference/errors/#provider_auth_failed"
    },
    "provider_not_allowed": {
      "description": "Dein Client darf für diesen Anbieter nicht schreiben. Jeder Partner ist nur für die Anbieter freigegeben, die mit Kiosa vereinbart sind.",
      "status": 403,
      "title": "Anbieter nicht erlaubt",
      "type": "https://docs.kiosa.ai/en/reference/errors/#provider_not_allowed"
    },
    "provider_unreachable": {
      "description": "Kiosa konnte den Anbieter nicht erreichen oder hat eine unerwartete Antwort bekommen. Wiederhole die Anfrage später; ein erneuter PUT ist idempotent.",
      "status": 502,
      "title": "Anbieter nicht erreichbar",
      "type": "https://docs.kiosa.ai/en/reference/errors/#provider_unreachable"
    },
    "rate_limited": {
      "description": "Je Client und Betrieb sind 60 Anfragen pro Minute erlaubt. Warte die Sekunden aus dem Header Retry-After ab und wiederhole die Anfrage dann.",
      "status": 429,
      "title": "Zu viele Anfragen",
      "type": "https://docs.kiosa.ai/en/reference/errors/#rate_limited"
    },
    "service_unavailable": {
      "description": "Kiosa ist gerade ausgelastet oder kurz nicht verfügbar. Warte die Sekunden aus dem Header Retry-After ab, falls vorhanden, und wiederhole die Anfrage dann.",
      "status": 503,
      "title": "Vorübergehend nicht verfügbar",
      "type": "https://docs.kiosa.ai/en/reference/errors/#service_unavailable"
    },
    "upstream_timeout": {
      "description": "Der Kiosa-Server, auf dem der Betrieb liegt, hat nicht rechtzeitig geantwortet. Ob ein schreibender Aufruf schon gewirkt hat, zeigt der passende GET; ein Wiederholen ist idempotent.",
      "status": 504,
      "title": "Zeitüberschreitung",
      "type": "https://docs.kiosa.ai/en/reference/errors/#upstream_timeout"
    },
    "upstream_unavailable": {
      "description": "Der Kiosa-Server, auf dem der Betrieb liegt, war nicht erreichbar oder hat ungültig geantwortet. Wiederhole die Anfrage später; schreibende Aufrufe sind idempotent.",
      "status": 502,
      "title": "Kiosa-Server nicht erreichbar",
      "type": "https://docs.kiosa.ai/en/reference/errors/#upstream_unavailable"
    },
    "user_inactive": {
      "description": "Der Nutzer, der die Verbindung erteilt hat, ist deaktiviert, gehört nicht mehr zum Betrieb oder hat keine ausreichende Rolle mehr. Ein Admin des Betriebs muss die Verbindung neu erteilen.",
      "status": 403,
      "title": "Nutzer nicht mehr berechtigt",
      "type": "https://docs.kiosa.ai/en/reference/errors/#user_inactive"
    },
    "validation_failed": {
      "description": "Der Body oder ein Parameter entspricht nicht dem Schema, zum Beispiel ein fehlendes oder unbekanntes Feld oder eine Standort-ID, die nicht zu diesem Betrieb gehört. invalid_params nennt jedes betroffene Feld.",
      "status": 422,
      "title": "Anfrage ungültig",
      "type": "https://docs.kiosa.ai/en/reference/errors/#validation_failed"
    }
  }
}
