{
  "openapi": "3.1.0",
  "info": {
    "title": "DomainWarn API",
    "version": "1.0.0",
    "description": "Öffentliche API von DomainWarn: Domains, Monitore, Meldungen, Ereignisse und Kunden einer Organisation aus Skripten, CI-Pipelines und eigenen Integrationen lesen und schreiben.\n\nAuthentifizierung mit einem API-Token als Bearer-Token; Tokens werden im Dashboard unter Einstellungen → Integrationen → API-Tokens erzeugt und gelten für genau eine Organisation mit dem Recht `read` oder `write`. 300 Anfragen je Minute und Token. Alle Zeitpunkte sind ISO 8601 in UTC.",
    "contact": {
      "name": "DomainWarn",
      "url": "https://domainwarn.com/de/docs/api",
      "email": "info@domainwarn.com"
    },
    "termsOfService": "https://domainwarn.com/de/legal/terms"
  },
  "externalDocs": {
    "description": "Dokumentation der API",
    "url": "https://domainwarn.com/de/docs/api"
  },
  "servers": [
    {
      "url": "https://api.domainwarn.com/api/v1"
    }
  ],
  "security": [
    {
      "bearerAuth": []
    }
  ],
  "tags": [
    {
      "name": "Organisation",
      "description": "Die Organisation, für die das Token gilt"
    },
    {
      "name": "Übersicht",
      "description": "Zusammenfassung wie auf der Startseite des Dashboards"
    },
    {
      "name": "Domains",
      "description": "Überwachte Domains anlegen, ändern, pausieren und prüfen"
    },
    {
      "name": "Monitore",
      "description": "Einzelne Prüfungen je Domain, ihre Ergebnisse und Verfügbarkeit"
    },
    {
      "name": "DNS",
      "description": "DNS-Schnappschüsse und Änderungen"
    },
    {
      "name": "Meldungen",
      "description": "Störungen mit Ursache, Status und Quittierung"
    },
    {
      "name": "Ereignisse",
      "description": "Erkannte Änderungen und Verlauf"
    },
    {
      "name": "Kunden",
      "description": "Kunden, denen Domains zugeordnet sind"
    }
  ],
  "paths": {
    "/organizations": {
      "get": {
        "operationId": "listOrganizations",
        "tags": [
          "Organisation"
        ],
        "summary": "Organisation des Tokens",
        "description": "Liefert genau die Organisation, für die das Token gilt, mit Slug, Tarif und der Rolle des Tokens. Praktisch, um den Slug für alle weiteren Aufrufe zu ermitteln.\n\nLese-Token genügt (`read`).",
        "x-scope": "read",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Erfolg",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Organization"
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        }
      }
    },
    "/orgs/{organization}/dashboard": {
      "get": {
        "operationId": "getDashboard",
        "tags": [
          "Übersicht"
        ],
        "summary": "Übersicht",
        "description": "Zähler je Zustand, offene Meldungen, Änderungen der letzten 24 Stunden, Auslastung des Tarifs und Verlauf der letzten 14 Tage. Die Antwort trägt einen ETag; mit `If-None-Match` antwortet der Server bei unverändertem Stand mit 304.\n\nLese-Token genügt (`read`).",
        "x-scope": "read",
        "parameters": [
          {
            "name": "organization",
            "in": "path",
            "required": true,
            "description": "Slug der Organisation, steht in der Adresse des Dashboards und unter Einstellungen → Integrationen → API-Tokens. Ein Token erreicht nur seine eigene Organisation, andere antworten mit 404.",
            "schema": {
              "type": "string",
              "example": "meine-agentur"
            }
          },
          {
            "name": "If-None-Match",
            "in": "header",
            "required": false,
            "description": "ETag der letzten Antwort; bei unverändertem Stand antwortet der Server mit 304 ohne Body",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Erfolg",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Dashboard"
                    }
                  }
                }
              }
            },
            "headers": {
              "ETag": {
                "schema": {
                  "type": "string"
                },
                "description": "Kennung des Standes für `If-None-Match`"
              },
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "example": "private, max-age=30"
                },
                "description": "Kurze Haltbarkeit, die Antwort ist je Organisation"
              }
            }
          },
          "304": {
            "description": "Unverändert seit dem ETag aus `If-None-Match`, kein Body",
            "headers": {
              "ETag": {
                "schema": {
                  "type": "string"
                },
                "description": "Kennung des Standes für `If-None-Match`"
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        }
      }
    },
    "/orgs/{organization}/usage": {
      "get": {
        "operationId": "getUsage",
        "tags": [
          "Übersicht"
        ],
        "summary": "Auslastung des Tarifs",
        "description": "Grenzen des wirksamen Tarifs und die aktuelle Nutzung: Domains, Monitore, Mitglieder, Kanäle und Prüfungen der letzten 24 Stunden.\n\nLese-Token genügt (`read`).",
        "x-scope": "read",
        "parameters": [
          {
            "name": "organization",
            "in": "path",
            "required": true,
            "description": "Slug der Organisation, steht in der Adresse des Dashboards und unter Einstellungen → Integrationen → API-Tokens. Ein Token erreicht nur seine eigene Organisation, andere antworten mit 404.",
            "schema": {
              "type": "string",
              "example": "meine-agentur"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Erfolg",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Usage"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        }
      }
    },
    "/orgs/{organization}/domains": {
      "get": {
        "operationId": "listDomains",
        "tags": [
          "Domains"
        ],
        "summary": "Domains auflisten",
        "description": "Alle Domains der Organisation mit Zustand, Kunde und Anzahl offener Meldungen, seitenweise. Monitore sind hier nicht enthalten, dafür den Einzelabruf nutzen.\n\nLese-Token genügt (`read`).",
        "x-scope": "read",
        "parameters": [
          {
            "name": "organization",
            "in": "path",
            "required": true,
            "description": "Slug der Organisation, steht in der Adresse des Dashboards und unter Einstellungen → Integrationen → API-Tokens. Ein Token erreicht nur seine eigene Organisation, andere antworten mit 404.",
            "schema": {
              "type": "string",
              "example": "meine-agentur"
            }
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "description": "Zustände, kommagetrennt: healthy, warning, critical, unknown",
            "schema": {
              "type": "string",
              "example": "critical,warning"
            }
          },
          {
            "name": "customer",
            "in": "query",
            "required": false,
            "description": "Nur Domains dieses Kunden",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "cms",
            "in": "query",
            "required": false,
            "description": "CMS-Schlüssel, kommagetrennt; `none` für erreichbar ohne bekanntes System, `unknown` für noch nicht erkannt",
            "schema": {
              "type": "string",
              "example": "wordpress"
            }
          },
          {
            "name": "search",
            "in": "query",
            "required": false,
            "description": "Teil des Domainnamens",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "sort",
            "in": "query",
            "required": false,
            "description": "Sortierung, Minus für absteigend",
            "schema": {
              "type": "string",
              "enum": [
                "name",
                "-name",
                "health_status",
                "-health_status",
                "created_at",
                "-created_at",
                "last_checked_at",
                "-last_checked_at"
              ],
              "default": "name"
            }
          },
          {
            "name": "page",
            "in": "query",
            "required": false,
            "description": "Seitennummer",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "default": 1
            }
          },
          {
            "name": "per_page",
            "in": "query",
            "required": false,
            "description": "Einträge je Seite (1 bis 200)",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 200,
              "default": 50
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Erfolg",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Domain"
                      }
                    },
                    "links": {
                      "$ref": "#/components/schemas/Links"
                    },
                    "meta": {
                      "$ref": "#/components/schemas/PageMeta"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        }
      },
      "post": {
        "operationId": "createDomain",
        "tags": [
          "Domains"
        ],
        "summary": "Domain anlegen",
        "description": "Legt die Domain mit den Standard-Monitoren an und startet die erste Prüfung. Das Domainlimit des Tarifs gilt; darüber antwortet der Server mit 422.\n\nBraucht ein Token mit Schreibrecht (`write`).",
        "x-scope": "write",
        "parameters": [
          {
            "name": "organization",
            "in": "path",
            "required": true,
            "description": "Slug der Organisation, steht in der Adresse des Dashboards und unter Einstellungen → Integrationen → API-Tokens. Ein Token erreicht nur seine eigene Organisation, andere antworten mit 404.",
            "schema": {
              "type": "string",
              "example": "meine-agentur"
            }
          }
        ],
        "responses": {
          "201": {
            "description": "Angelegt",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Domain"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "name"
                ],
                "properties": {
                  "name": {
                    "type": "string",
                    "maxLength": 255,
                    "description": "Domain, Unicode oder Punycode; Subdomains und Schemata werden entfernt"
                  },
                  "customer_id": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "format": "uuid",
                    "description": "Kunde, dem die Domain zugeordnet wird"
                  },
                  "run_checks": {
                    "type": "boolean",
                    "default": true,
                    "description": "Erste Prüfung sofort starten"
                  }
                }
              },
              "example": {
                "name": "kunde.de",
                "customer_id": null
              }
            }
          }
        }
      }
    },
    "/orgs/{organization}/domains/export.csv": {
      "get": {
        "operationId": "exportDomainsCsv",
        "tags": [
          "Domains"
        ],
        "summary": "Domains als CSV",
        "description": "Dieselbe Liste wie beim Auflisten als CSV-Datei mit allen Zeilen statt Seiten (UTF-8 mit BOM, `Content-Disposition: attachment`). Spalten: domain, customer, health, cms, cms_version, registrar, domain_expires_at, certificate_target, certificate_valid_to, certificate_days_left, open_incidents, last_checked_at, paused, dashboard_url. Das Zertifikat ist das der Apex-Domain auf Port 443, sonst das des ersten aktiven Zertifikatsmonitors (`certificate_target` nennt es).\n\nLese-Token genügt (`read`).\n\nEigenes Limit: 30 Aufrufe je Stunde und Organisation.",
        "x-scope": "read",
        "parameters": [
          {
            "name": "organization",
            "in": "path",
            "required": true,
            "description": "Slug der Organisation, steht in der Adresse des Dashboards und unter Einstellungen → Integrationen → API-Tokens. Ein Token erreicht nur seine eigene Organisation, andere antworten mit 404.",
            "schema": {
              "type": "string",
              "example": "meine-agentur"
            }
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "description": "Zustände, kommagetrennt: healthy, warning, critical, unknown",
            "schema": {
              "type": "string",
              "example": "critical,warning"
            }
          },
          {
            "name": "customer",
            "in": "query",
            "required": false,
            "description": "Nur Domains dieses Kunden",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "cms",
            "in": "query",
            "required": false,
            "description": "CMS-Schlüssel, kommagetrennt; `none` für erreichbar ohne bekanntes System, `unknown` für noch nicht erkannt",
            "schema": {
              "type": "string",
              "example": "wordpress"
            }
          },
          {
            "name": "search",
            "in": "query",
            "required": false,
            "description": "Teil des Domainnamens",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "sort",
            "in": "query",
            "required": false,
            "description": "Sortierung, Minus für absteigend",
            "schema": {
              "type": "string",
              "enum": [
                "name",
                "-name",
                "health_status",
                "-health_status",
                "created_at",
                "-created_at",
                "last_checked_at",
                "-last_checked_at"
              ],
              "default": "name"
            }
          },
          {
            "name": "delimiter",
            "in": "query",
            "required": false,
            "description": "Trennzeichen; ohne Angabe Semikolon bei Sprache de (Excel), sonst Komma",
            "schema": {
              "type": "string",
              "enum": [
                "comma",
                "semicolon"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "CSV-Datei",
            "content": {
              "text/csv": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        }
      }
    },
    "/orgs/{organization}/expirations": {
      "get": {
        "operationId": "listExpirations",
        "tags": [
          "Domains"
        ],
        "summary": "Abläufe auflisten",
        "description": "Was in den nächsten Tagen abläuft, nach Datum: Domainregistrierung (RDAP), Zertifikat (TLS-Check), Vertragsende und letzter Kündigungstermin (Vertragsende minus Kündigungsfrist) aus den Vertragsdaten, je Zeile mit Kunde, Zuständigem und Kosten. Überfälliges bleibt mit negativen Resttagen sichtbar. `meta.totals` summiert die Kosten je Jahr je Kunde und Währung über die Domains der Liste. Ein Kundenzugang sieht nur Domain- und Zertifikatsabläufe seiner Domains.\n\nLese-Token genügt (`read`).",
        "x-scope": "read",
        "parameters": [
          {
            "name": "organization",
            "in": "path",
            "required": true,
            "description": "Slug der Organisation, steht in der Adresse des Dashboards und unter Einstellungen → Integrationen → API-Tokens. Ein Token erreicht nur seine eigene Organisation, andere antworten mit 404.",
            "schema": {
              "type": "string",
              "example": "meine-agentur"
            }
          },
          {
            "name": "days",
            "in": "query",
            "required": false,
            "description": "Horizont in Kalendertagen ab heute",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 730,
              "default": 90
            }
          },
          {
            "name": "customer",
            "in": "query",
            "required": false,
            "description": "Nur Domains dieses Kunden",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "kind",
            "in": "query",
            "required": false,
            "description": "Arten, kommagetrennt: domain, certificate, contract_end, notice_deadline",
            "schema": {
              "type": "string",
              "example": "contract_end,notice_deadline"
            }
          },
          {
            "name": "action_required",
            "in": "query",
            "required": false,
            "description": "Nur Zeilen mit Handlungsbedarf",
            "schema": {
              "type": "boolean"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Erfolg",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Expiration"
                      }
                    },
                    "meta": {
                      "type": "object",
                      "properties": {
                        "days": {
                          "type": "integer",
                          "description": "Angewandter Horizont"
                        },
                        "totals": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "customer": {
                                "type": [
                                  "object",
                                  "null"
                                ],
                                "properties": {
                                  "id": {
                                    "type": "string",
                                    "format": "uuid",
                                    "description": "ID des Kunden"
                                  },
                                  "name": {
                                    "type": "string",
                                    "description": "Name"
                                  }
                                }
                              },
                              "currency": {
                                "type": "string",
                                "description": "Währung"
                              },
                              "annual_cost": {
                                "type": "number",
                                "description": "Summe der Kosten je Jahr"
                              },
                              "domains": {
                                "type": "integer",
                                "description": "Domains mit Kosten in der Summe"
                              }
                            }
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        }
      }
    },
    "/orgs/{organization}/expirations/export.csv": {
      "get": {
        "operationId": "exportExpirationsCsv",
        "tags": [
          "Domains"
        ],
        "summary": "Abläufe als CSV",
        "description": "Dieselbe Liste wie beim Auflisten als CSV-Datei (UTF-8 mit BOM, `Content-Disposition: attachment`). Spalten: date, days_left, kind, domain, customer, target, provider, auto_renews, responsible, annual_cost, currency, cost_reference, action_required, dashboard_url.\n\nLese-Token genügt (`read`).\n\nEigenes Limit: 30 Aufrufe je Stunde und Organisation.",
        "x-scope": "read",
        "parameters": [
          {
            "name": "organization",
            "in": "path",
            "required": true,
            "description": "Slug der Organisation, steht in der Adresse des Dashboards und unter Einstellungen → Integrationen → API-Tokens. Ein Token erreicht nur seine eigene Organisation, andere antworten mit 404.",
            "schema": {
              "type": "string",
              "example": "meine-agentur"
            }
          },
          {
            "name": "days",
            "in": "query",
            "required": false,
            "description": "Horizont in Kalendertagen ab heute",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 730,
              "default": 90
            }
          },
          {
            "name": "customer",
            "in": "query",
            "required": false,
            "description": "Nur Domains dieses Kunden",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "kind",
            "in": "query",
            "required": false,
            "description": "Arten, kommagetrennt: domain, certificate, contract_end, notice_deadline",
            "schema": {
              "type": "string",
              "example": "contract_end,notice_deadline"
            }
          },
          {
            "name": "action_required",
            "in": "query",
            "required": false,
            "description": "Nur Zeilen mit Handlungsbedarf",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "delimiter",
            "in": "query",
            "required": false,
            "description": "Trennzeichen; ohne Angabe Semikolon bei Sprache de (Excel), sonst Komma",
            "schema": {
              "type": "string",
              "enum": [
                "comma",
                "semicolon"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "CSV-Datei",
            "content": {
              "text/csv": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        }
      }
    },
    "/orgs/{organization}/ip-addresses": {
      "post": {
        "operationId": "createIpAddress",
        "tags": [
          "Domains"
        ],
        "summary": "IP-Adresse überwachen",
        "description": "Legt einen Eintrag in der Domainliste an, dessen Name die IP-Adresse ist, mit genau einem Blacklist-Monitor (IP-Listen und Reverse DNS), und startet die erste Prüfung. Der Eintrag belegt einen Platz im Domainlimit des Tarifs; Kunde, Pause, Löschen und Verschieben laufen über die Routen der Domains. Private, reservierte und interne Adressen sowie eine schon überwachte Adresse sind 422.\n\nBraucht ein Token mit Schreibrecht (`write`).",
        "x-scope": "write",
        "parameters": [
          {
            "name": "organization",
            "in": "path",
            "required": true,
            "description": "Slug der Organisation, steht in der Adresse des Dashboards und unter Einstellungen → Integrationen → API-Tokens. Ein Token erreicht nur seine eigene Organisation, andere antworten mit 404.",
            "schema": {
              "type": "string",
              "example": "meine-agentur"
            }
          }
        ],
        "responses": {
          "201": {
            "description": "Angelegt",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Domain"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "address"
                ],
                "properties": {
                  "address": {
                    "type": "string",
                    "maxLength": 64,
                    "description": "Öffentliche IPv4- oder IPv6-Adresse (IPv6 auch in eckigen Klammern)"
                  },
                  "customer_id": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "format": "uuid",
                    "description": "Kunde, dem die IP-Adresse zugeordnet wird"
                  },
                  "run_checks": {
                    "type": "boolean",
                    "default": true,
                    "description": "Erste Prüfung sofort starten"
                  }
                }
              },
              "example": {
                "address": "8.8.4.4",
                "customer_id": null
              }
            }
          }
        }
      }
    },
    "/orgs/{organization}/domains/cms": {
      "get": {
        "operationId": "listDomainCms",
        "tags": [
          "Domains"
        ],
        "summary": "Erkannte Systeme",
        "description": "Welche CMS und Shopsysteme auf den Domains erkannt wurden, mit Anzahl; `meta.none` zählt erreichbare Domains ohne bekanntes System, `meta.unknown` noch nicht erkannte. Werte für den Filter `cms` der Domainliste.\n\nLese-Token genügt (`read`).",
        "x-scope": "read",
        "parameters": [
          {
            "name": "organization",
            "in": "path",
            "required": true,
            "description": "Slug der Organisation, steht in der Adresse des Dashboards und unter Einstellungen → Integrationen → API-Tokens. Ein Token erreicht nur seine eigene Organisation, andere antworten mit 404.",
            "schema": {
              "type": "string",
              "example": "meine-agentur"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Erfolg",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "key": {
                            "type": "string",
                            "description": "CMS-Schlüssel"
                          },
                          "name": {
                            "type": "string",
                            "description": "Name"
                          },
                          "count": {
                            "type": "integer",
                            "description": "Domains"
                          }
                        }
                      }
                    },
                    "meta": {
                      "type": "object",
                      "properties": {
                        "none": {
                          "type": "integer",
                          "description": "Erreichbar ohne bekanntes System"
                        },
                        "unknown": {
                          "type": "integer",
                          "description": "Noch nicht erkannt"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        }
      }
    },
    "/orgs/{organization}/domains/bulk": {
      "post": {
        "operationId": "bulkCreateDomains",
        "tags": [
          "Domains"
        ],
        "summary": "Domains gesammelt anlegen",
        "description": "Bis zu 200 Domains je Aufruf, als Liste oder als Text mit einer Domain je Zeile (Trennzeichen auch Komma, Semikolon, Leerzeichen; Zeilen mit # werden übersprungen). Ungültige oder doppelte Domains landen in `meta.errors`, die übrigen werden angelegt.\n\nBraucht ein Token mit Schreibrecht (`write`).\n\nEigenes Limit: 3 Aufrufe je Stunde und Organisation.",
        "x-scope": "write",
        "parameters": [
          {
            "name": "organization",
            "in": "path",
            "required": true,
            "description": "Slug der Organisation, steht in der Adresse des Dashboards und unter Einstellungen → Integrationen → API-Tokens. Ein Token erreicht nur seine eigene Organisation, andere antworten mit 404.",
            "schema": {
              "type": "string",
              "example": "meine-agentur"
            }
          }
        ],
        "responses": {
          "201": {
            "description": "Angelegte Domains und Fehler je Eingabe",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Domain"
                      }
                    },
                    "meta": {
                      "type": "object",
                      "properties": {
                        "created": {
                          "type": "integer"
                        },
                        "failed": {
                          "type": "integer"
                        },
                        "errors": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "additionalProperties": true
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [],
                "properties": {
                  "domains": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "maxItems": 200,
                    "description": "Liste von Domains (alternativ zu `text`)"
                  },
                  "text": {
                    "type": "string",
                    "maxLength": 20000,
                    "description": "Domains als Text (alternativ zu `domains`)"
                  },
                  "customer_id": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "format": "uuid",
                    "description": "Kunde für alle angelegten Domains"
                  }
                }
              },
              "example": {
                "text": "kunde-a.de\nkunde-b.de\nshop.kunde-c.com",
                "customer_id": null
              }
            }
          }
        }
      }
    },
    "/orgs/{organization}/domains/bulk-actions": {
      "post": {
        "operationId": "bulkDomainAction",
        "tags": [
          "Domains"
        ],
        "summary": "Massenaktion auf Domains",
        "description": "Eine Aktion auf bis zu 500 Domains der Organisation: `pause` (optional `until`), `resume`, `assign_customer` (`customer_id` oder null), `set_areas` (`groups` wie bei `PATCH /domains/{domain}/monitoring`), `set_interval` (`type` und `interval_seconds`, nicht unter der Untergrenze des Tarifs), `check_now` (höchstens 50 Domains, zählt in dieselben Limits wie „Jetzt prüfen“; Domains ohne freies Kontingent werden übersprungen) und `delete` (nur mit `confirm: true`, gibt Tarifplätze frei). Bis 100 Domains antwortet der Server mit 200 und dem Ergebnis je Domain, darüber mit 202 und der Massenaktion im Status queued; den Fortschritt liefert `GET /domains/bulk-actions/{operation}`. IDs fremder Organisationen oder unbekannte IDs stehen als übersprungen (`not_found`) ohne Namen im Ergebnis. Das Sicherheitsprotokoll erhält einen zusammenfassenden Eintrag.\n\nBraucht ein Token mit Schreibrecht (`write`).\n\nEigenes Limit: 10 Aufrufe je Minute und Organisation.",
        "x-scope": "write",
        "parameters": [
          {
            "name": "organization",
            "in": "path",
            "required": true,
            "description": "Slug der Organisation, steht in der Adresse des Dashboards und unter Einstellungen → Integrationen → API-Tokens. Ein Token erreicht nur seine eigene Organisation, andere antworten mit 404.",
            "schema": {
              "type": "string",
              "example": "meine-agentur"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Ergebnis je Domain (status done); bei mehr als 100 Domains 202 mit status queued",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/DomainBulkOperation"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "action",
                  "ids"
                ],
                "properties": {
                  "action": {
                    "type": "string",
                    "enum": [
                      "pause",
                      "resume",
                      "assign_customer",
                      "set_areas",
                      "set_interval",
                      "check_now",
                      "delete"
                    ],
                    "description": "Aktion"
                  },
                  "ids": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "minItems": 1,
                    "maxItems": 500,
                    "uniqueItems": true,
                    "description": "Domain-IDs (bei `check_now` höchstens 50)"
                  },
                  "until": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "format": "date-time",
                    "description": "pause: bis zu diesem Zeitpunkt, ohne Angabe unbefristet"
                  },
                  "customer_id": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "format": "uuid",
                    "description": "assign_customer: Kunde der Organisation oder null (Zuordnung entfernen); Pflicht bei dieser Aktion"
                  },
                  "groups": {
                    "type": "object",
                    "properties": {
                      "web": {
                        "type": "boolean"
                      },
                      "mail": {
                        "type": "boolean"
                      },
                      "dns": {
                        "type": "boolean"
                      },
                      "security": {
                        "type": "boolean"
                      }
                    },
                    "additionalProperties": false,
                    "minProperties": 1,
                    "description": "set_areas: Bereiche ein oder aus"
                  },
                  "type": {
                    "type": "string",
                    "description": "set_interval: Check-Typ (alle außer heartbeat)"
                  },
                  "interval_seconds": {
                    "type": "integer",
                    "minimum": 60,
                    "maximum": 604800,
                    "description": "set_interval: Intervall in Sekunden"
                  },
                  "confirm": {
                    "type": "boolean",
                    "description": "delete: muss true sein"
                  }
                }
              },
              "example": {
                "action": "set_areas",
                "ids": [
                  "9a1c6d2e-4b7f-4e1a-9c3d-2f5e8a7b6c10",
                  "9a1c6d2e-4b7f-4e1a-9c3d-2f5e8a7b6c11"
                ],
                "groups": {
                  "mail": false
                }
              }
            }
          }
        }
      }
    },
    "/orgs/{organization}/domains/bulk-actions/{operation}": {
      "get": {
        "operationId": "getBulkDomainAction",
        "tags": [
          "Domains"
        ],
        "summary": "Fortschritt einer Massenaktion",
        "description": "Stand einer Massenaktion im Hintergrund: Zähler und das bisherige Ergebnis je Domain. Alle paar Sekunden abfragen, bis `status` done oder failed ist. Innenansicht der Agentur: Kundenzugänge sehen Massenaktionen nicht.\n\nLese-Token genügt (`read`).",
        "x-scope": "read",
        "parameters": [
          {
            "name": "organization",
            "in": "path",
            "required": true,
            "description": "Slug der Organisation, steht in der Adresse des Dashboards und unter Einstellungen → Integrationen → API-Tokens. Ein Token erreicht nur seine eigene Organisation, andere antworten mit 404.",
            "schema": {
              "type": "string",
              "example": "meine-agentur"
            }
          },
          {
            "name": "operation",
            "in": "path",
            "required": true,
            "description": "ID der Massenaktion aus der Antwort auf das Anstoßen",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Erfolg",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/DomainBulkOperation"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        }
      }
    },
    "/orgs/{organization}/domains/import/zone-file": {
      "post": {
        "operationId": "previewZoneFileImport",
        "tags": [
          "Domains"
        ],
        "summary": "Zonendatei auswerten",
        "description": "Liest eine BIND-Zonendatei und liefert die Website-Hostnamen (A, AAAA, CNAME) als Vorschau, je Eintrag mit dem Hinweis, ob er schon überwacht wird. Höchstens 200 je Aufruf, weitere Seiten über `offset` = `next_offset`. Legt nichts an: die bestätigte Auswahl geht an den Import.\n\nBraucht ein Token mit Schreibrecht (`write`).\n\nEigenes Limit: 60 Aufrufe je Minute und Organisation.",
        "x-scope": "write",
        "parameters": [
          {
            "name": "organization",
            "in": "path",
            "required": true,
            "description": "Slug der Organisation, steht in der Adresse des Dashboards und unter Einstellungen → Integrationen → API-Tokens. Ein Token erreicht nur seine eigene Organisation, andere antworten mit 404.",
            "schema": {
              "type": "string",
              "example": "meine-agentur"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Erfolg",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "origin": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "description": "Erkannte Zone"
                        },
                        "records": {
                          "type": "integer",
                          "description": "Gelesene Records"
                        },
                        "hostnames": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "hostname": {
                                "type": "string"
                              },
                              "is_apex": {
                                "type": "boolean",
                                "description": "Die Zone selbst"
                              },
                              "already_monitored": {
                                "type": "boolean",
                                "description": "Ein Website-Monitor auf diesen Hostnamen besteht schon"
                              }
                            }
                          }
                        },
                        "total": {
                          "type": "integer",
                          "description": "Hostnamen insgesamt"
                        },
                        "offset": {
                          "type": "integer",
                          "description": "Erster Eintrag dieser Seite"
                        },
                        "next_offset": {
                          "type": [
                            "integer",
                            "null"
                          ],
                          "description": "Offset der nächsten Seite, null am Ende"
                        },
                        "truncated": {
                          "type": "boolean",
                          "description": "Mehr Hostnamen als eine Seite"
                        },
                        "limit": {
                          "type": "integer",
                          "description": "Hostnamen je Seite"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "text"
                ],
                "properties": {
                  "text": {
                    "type": "string",
                    "maxLength": 500000,
                    "description": "Inhalt der Zonendatei"
                  },
                  "origin": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "maxLength": 255,
                    "description": "Zone für Dateien ohne `$ORIGIN` (z. B. kunde.de); fehlt sie bei relativen Namen, antwortet der Server mit 422"
                  },
                  "offset": {
                    "type": [
                      "integer",
                      "null"
                    ],
                    "minimum": 0,
                    "description": "Erster Eintrag der Seite (aus `next_offset`)"
                  }
                }
              },
              "example": {
                "text": "$ORIGIN kunde.de.\n@ IN A 203.0.113.10\nwww IN CNAME kunde.de.\nshop IN A 203.0.113.11"
              }
            }
          }
        }
      }
    },
    "/orgs/{organization}/domains/import/commit": {
      "post": {
        "operationId": "commitDomainImport",
        "tags": [
          "Domains"
        ],
        "summary": "Import bestätigen",
        "description": "Legt die bestätigte Liste aus einer Zonendatei im Hintergrund an, bis zu 5000 Domains je Import. Die Antwort (202) ist der Import mit seiner ID; den Fortschritt liefert `GET /domains/import/{import}`, bis `status` done oder failed ist. Anders als beim gesammelten Anlegen starten die Monitore zu ihrem regulären Zeitpunkt statt sofort. Ist das Domainlimit des Tarifs erreicht, gelten die restlichen Namen mit demselben Grund als abgelehnt.\n\nBraucht ein Token mit Schreibrecht (`write`).\n\nEigenes Limit: 10 Imports je Stunde und Organisation.",
        "x-scope": "write",
        "parameters": [
          {
            "name": "organization",
            "in": "path",
            "required": true,
            "description": "Slug der Organisation, steht in der Adresse des Dashboards und unter Einstellungen → Integrationen → API-Tokens. Ein Token erreicht nur seine eigene Organisation, andere antworten mit 404.",
            "schema": {
              "type": "string",
              "example": "meine-agentur"
            }
          }
        ],
        "responses": {
          "202": {
            "description": "Der angelegte Import (status queued)",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/DomainImport"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "domains"
                ],
                "properties": {
                  "domains": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "maxLength": 255
                    },
                    "minItems": 1,
                    "maxItems": 5000,
                    "description": "Bestätigte Domains oder Hostnamen"
                  },
                  "customer_id": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "format": "uuid",
                    "description": "Kunde für alle angelegten Domains"
                  }
                }
              },
              "example": {
                "domains": [
                  "kunde.de",
                  "shop.kunde.de"
                ],
                "customer_id": null
              }
            }
          }
        }
      }
    },
    "/orgs/{organization}/domains/import/{import}": {
      "get": {
        "operationId": "getDomainImport",
        "tags": [
          "Domains"
        ],
        "summary": "Import-Fortschritt abrufen",
        "description": "Stand eines Imports: Zähler je Block, nach dem Ende die Liste der abgelehnten oder übersprungenen Namen mit Grund. Alle paar Sekunden abfragen, bis `status` done oder failed ist. Innenansicht der Agentur: Kundenzugänge sehen Imports nicht.\n\nLese-Token genügt (`read`).",
        "x-scope": "read",
        "parameters": [
          {
            "name": "organization",
            "in": "path",
            "required": true,
            "description": "Slug der Organisation, steht in der Adresse des Dashboards und unter Einstellungen → Integrationen → API-Tokens. Ein Token erreicht nur seine eigene Organisation, andere antworten mit 404.",
            "schema": {
              "type": "string",
              "example": "meine-agentur"
            }
          },
          {
            "name": "import",
            "in": "path",
            "required": true,
            "description": "ID des Imports aus der Antwort auf das Bestätigen",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Erfolg",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/DomainImport"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        }
      }
    },
    "/orgs/{organization}/domains/{domain}": {
      "get": {
        "operationId": "getDomain",
        "tags": [
          "Domains"
        ],
        "summary": "Domain abrufen",
        "description": "Eine Domain mit allen Monitoren, deren letzten Befunden und der Anzahl offener Meldungen.\n\nLese-Token genügt (`read`).",
        "x-scope": "read",
        "parameters": [
          {
            "name": "organization",
            "in": "path",
            "required": true,
            "description": "Slug der Organisation, steht in der Adresse des Dashboards und unter Einstellungen → Integrationen → API-Tokens. Ein Token erreicht nur seine eigene Organisation, andere antworten mit 404.",
            "schema": {
              "type": "string",
              "example": "meine-agentur"
            }
          },
          {
            "name": "domain",
            "in": "path",
            "required": true,
            "description": "ID der Domain",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Erfolg",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Domain"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        }
      },
      "patch": {
        "operationId": "updateDomain",
        "tags": [
          "Domains"
        ],
        "summary": "Domain ändern",
        "description": "Kunde zuordnen, Überwachung ein- oder ausschalten oder Benachrichtigungsregeln nur für diese Domain setzen. Nur mitgesendete Felder ändern sich.\n\nBraucht ein Token mit Schreibrecht (`write`).",
        "x-scope": "write",
        "parameters": [
          {
            "name": "organization",
            "in": "path",
            "required": true,
            "description": "Slug der Organisation, steht in der Adresse des Dashboards und unter Einstellungen → Integrationen → API-Tokens. Ein Token erreicht nur seine eigene Organisation, andere antworten mit 404.",
            "schema": {
              "type": "string",
              "example": "meine-agentur"
            }
          },
          {
            "name": "domain",
            "in": "path",
            "required": true,
            "description": "ID der Domain",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Erfolg",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Domain"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [],
                "properties": {
                  "customer_id": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "format": "uuid",
                    "description": "Kunde oder null zum Lösen"
                  },
                  "is_active": {
                    "type": "boolean",
                    "description": "false pausiert die Überwachung dauerhaft, true nimmt sie wieder auf"
                  },
                  "notification_overrides": {
                    "type": [
                      "object",
                      "null"
                    ],
                    "description": "Abweichende Benachrichtigungsregeln",
                    "properties": {
                      "failure_minutes": {
                        "type": "integer",
                        "description": "Minuten bis zur Meldung eines Ausfalls (1 bis 1440)",
                        "minimum": 1,
                        "maximum": 1440
                      },
                      "recovery_minutes": {
                        "type": "integer",
                        "description": "Minuten bis zur Entwarnung (1 bis 1440)",
                        "minimum": 1,
                        "maximum": 1440
                      },
                      "min_severity": {
                        "type": "string",
                        "enum": [
                          "info",
                          "warning",
                          "critical"
                        ],
                        "description": "Kleinster gemeldeter Schweregrad"
                      },
                      "ignore_quiet_hours": {
                        "type": "boolean",
                        "description": "Auch in den Ruhezeiten melden"
                      },
                      "notify_on_change": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        },
                        "description": "Änderungsarten, die gemeldet werden"
                      }
                    }
                  }
                }
              },
              "example": {
                "customer_id": "3f9c1a52-6a2e-4c0e-9d4b-1c9a1a0e5b77",
                "notification_overrides": {
                  "min_severity": "critical"
                }
              }
            }
          }
        }
      },
      "delete": {
        "operationId": "deleteDomain",
        "tags": [
          "Domains"
        ],
        "summary": "Domain löschen",
        "description": "Entfernt die Domain mit Monitoren, Ergebnissen, Meldungen und Ereignissen endgültig.\n\nBraucht ein Token mit Schreibrecht (`write`).",
        "x-scope": "write",
        "parameters": [
          {
            "name": "organization",
            "in": "path",
            "required": true,
            "description": "Slug der Organisation, steht in der Adresse des Dashboards und unter Einstellungen → Integrationen → API-Tokens. Ein Token erreicht nur seine eigene Organisation, andere antworten mit 404.",
            "schema": {
              "type": "string",
              "example": "meine-agentur"
            }
          },
          {
            "name": "domain",
            "in": "path",
            "required": true,
            "description": "ID der Domain",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Gelöscht, keine Antwort"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        }
      }
    },
    "/orgs/{organization}/domains/{domain}/contract": {
      "get": {
        "operationId": "getDomainContract",
        "tags": [
          "Domains"
        ],
        "summary": "Vertrag und Kosten abrufen",
        "description": "Vertrags- und Kostendaten der Domain: Registrar, Hosting-Anbieter, Vertragsende, Kündigungsfrist, automatische Verlängerung, Kosten je Jahr, Kostenstelle, zuständiges Mitglied, Notiz. Ohne gespeicherten Vertrag kommen leere Felder mit `exists: false` und dem vom Domain-Check erkannten Registrar als Vorschlag. Innenansicht der Agentur: Kundenzugänge erreichen die Route nicht.\n\nLese-Token genügt (`read`).",
        "x-scope": "read",
        "parameters": [
          {
            "name": "organization",
            "in": "path",
            "required": true,
            "description": "Slug der Organisation, steht in der Adresse des Dashboards und unter Einstellungen → Integrationen → API-Tokens. Ein Token erreicht nur seine eigene Organisation, andere antworten mit 404.",
            "schema": {
              "type": "string",
              "example": "meine-agentur"
            }
          },
          {
            "name": "domain",
            "in": "path",
            "required": true,
            "description": "ID der Domain",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Erfolg",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/DomainContract"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        }
      },
      "put": {
        "operationId": "updateDomainContract",
        "tags": [
          "Domains"
        ],
        "summary": "Vertrag und Kosten setzen",
        "description": "Ersetzt den ganzen Vertrag: weggelassene Felder werden leer, ein Aufruf ohne Felder löscht den Vertrag. Der letzte Kündigungstermin ist Vertragsende minus Frist; 30 und 7 Tage davor (und ohne automatische Verlängerung vor dem Vertragsende) erinnert DomainWarn über die Benachrichtigungsregeln der Organisation, beide Termine stehen im Kalender-Abo.\n\nBraucht ein Token mit Schreibrecht (`write`).",
        "x-scope": "write",
        "parameters": [
          {
            "name": "organization",
            "in": "path",
            "required": true,
            "description": "Slug der Organisation, steht in der Adresse des Dashboards und unter Einstellungen → Integrationen → API-Tokens. Ein Token erreicht nur seine eigene Organisation, andere antworten mit 404.",
            "schema": {
              "type": "string",
              "example": "meine-agentur"
            }
          },
          {
            "name": "domain",
            "in": "path",
            "required": true,
            "description": "ID der Domain",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Erfolg",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/DomainContract"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [],
                "properties": {
                  "registrar": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "maxLength": 160,
                    "description": "Registrar (Freitext)"
                  },
                  "hosting_provider": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "maxLength": 160,
                    "description": "Hosting-Anbieter"
                  },
                  "ends_at": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "format": "date",
                    "description": "Vertragsende als YYYY-MM-DD"
                  },
                  "notice_period_days": {
                    "type": [
                      "integer",
                      "null"
                    ],
                    "minimum": 0,
                    "maximum": 3650,
                    "description": "Kündigungsfrist in Tagen"
                  },
                  "auto_renews": {
                    "type": "boolean",
                    "default": false,
                    "description": "Verlängert sich automatisch"
                  },
                  "annual_cost": {
                    "type": [
                      "number",
                      "null"
                    ],
                    "minimum": 0,
                    "description": "Kosten je Jahr"
                  },
                  "currency": {
                    "type": "string",
                    "minLength": 3,
                    "maxLength": 3,
                    "default": "EUR",
                    "description": "Währung (ISO 4217)"
                  },
                  "cost_reference": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "maxLength": 120,
                    "description": "Kostenstelle oder Referenz"
                  },
                  "responsible_user_id": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "format": "uuid",
                    "description": "Mitglied der Organisation (kein Kundenzugang)"
                  },
                  "notes": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "maxLength": 5000,
                    "description": "Notiz"
                  }
                }
              },
              "example": {
                "registrar": "IONOS SE",
                "hosting_provider": "Hetzner",
                "ends_at": "2026-12-31",
                "notice_period_days": 90,
                "auto_renews": false,
                "annual_cost": 119.5,
                "currency": "EUR",
                "cost_reference": "KST-4711",
                "responsible_user_id": "3f9c1a52-6a2e-4c0e-9d4b-1c9a1a0e5b77"
              }
            }
          }
        }
      }
    },
    "/orgs/{organization}/domains/{domain}/pause": {
      "post": {
        "operationId": "pauseDomain",
        "tags": [
          "Domains"
        ],
        "summary": "Domain pausieren",
        "description": "Setzt die Überwachung bis zu einem Zeitpunkt aus, etwa während eines Umzugs. Ohne `until` wird die Pause aufgehoben. Offene Meldungen bleiben bestehen.\n\nBraucht ein Token mit Schreibrecht (`write`).",
        "x-scope": "write",
        "parameters": [
          {
            "name": "organization",
            "in": "path",
            "required": true,
            "description": "Slug der Organisation, steht in der Adresse des Dashboards und unter Einstellungen → Integrationen → API-Tokens. Ein Token erreicht nur seine eigene Organisation, andere antworten mit 404.",
            "schema": {
              "type": "string",
              "example": "meine-agentur"
            }
          },
          {
            "name": "domain",
            "in": "path",
            "required": true,
            "description": "ID der Domain",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Erfolg",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Domain"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [],
                "properties": {
                  "until": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "format": "date-time",
                    "description": "Ende der Pause, in der Zukunft; null hebt die Pause auf"
                  }
                }
              },
              "example": {
                "until": "2026-10-01T06:00:00Z"
              }
            }
          }
        }
      }
    },
    "/orgs/{organization}/domains/{domain}/move": {
      "post": {
        "operationId": "moveDomain",
        "tags": [
          "Domains"
        ],
        "summary": "Domain in andere Organisation verschieben",
        "description": "Hängt die Domain mit Monitoren, Ergebnissen, Verlauf, Meldungen und Zertifikaten in eine andere Organisation um, in der der Aufrufer Schreibrecht hat. Kundenzuordnung, domainbezogene Regeln und Wartungsfenster bleiben zurück; danach gelten Tarif und Intervalle des Ziels (über dem Limit wird die Domain dort pausiert). 409 `domain-exists`, wenn das Ziel die Domain bereits überwacht.\n\nBraucht ein Token mit Schreibrecht (`write`).",
        "x-scope": "write",
        "parameters": [
          {
            "name": "organization",
            "in": "path",
            "required": true,
            "description": "Slug der Organisation, steht in der Adresse des Dashboards und unter Einstellungen → Integrationen → API-Tokens. Ein Token erreicht nur seine eigene Organisation, andere antworten mit 404.",
            "schema": {
              "type": "string",
              "example": "meine-agentur"
            }
          },
          {
            "name": "domain",
            "in": "path",
            "required": true,
            "description": "ID der Domain",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Erfolg",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "name": {
                          "type": "string"
                        },
                        "unicode_name": {
                          "type": "string"
                        },
                        "organization": {
                          "type": "object",
                          "properties": {
                            "slug": {
                              "type": "string"
                            },
                            "name": {
                              "type": "string"
                            }
                          }
                        },
                        "plan_paused": {
                          "type": "boolean"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "organization"
                ],
                "properties": {
                  "organization": {
                    "type": "string",
                    "description": "Slug der Zielorganisation"
                  }
                }
              },
              "example": {
                "organization": "zweite-agentur"
              }
            }
          }
        }
      }
    },
    "/orgs/{organization}/domains/{domain}/monitoring": {
      "patch": {
        "operationId": "setMonitoringGroups",
        "tags": [
          "Domains"
        ],
        "summary": "Überwachungsbereiche schalten",
        "description": "Schaltet die Bereiche Website (`web`: http, tls, ct_log, redirects, ipv6), Mail (`mail`: mx, spf, dkim, dmarc, mta_sts, tls_rpt, bimi, reverse_dns, smtp, dane, autodiscover) und DNS (`dns`: dns, dnssec, domain, blacklist, caa, nameservers) ein oder aus. Ausgeschaltete Bereiche schließen ihre offenen Meldungen.\n\nBraucht ein Token mit Schreibrecht (`write`).",
        "x-scope": "write",
        "parameters": [
          {
            "name": "organization",
            "in": "path",
            "required": true,
            "description": "Slug der Organisation, steht in der Adresse des Dashboards und unter Einstellungen → Integrationen → API-Tokens. Ein Token erreicht nur seine eigene Organisation, andere antworten mit 404.",
            "schema": {
              "type": "string",
              "example": "meine-agentur"
            }
          },
          {
            "name": "domain",
            "in": "path",
            "required": true,
            "description": "ID der Domain",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Erfolg",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Domain"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "groups"
                ],
                "properties": {
                  "groups": {
                    "type": "object",
                    "properties": {
                      "web": {
                        "type": "boolean"
                      },
                      "mail": {
                        "type": "boolean"
                      },
                      "dns": {
                        "type": "boolean"
                      }
                    },
                    "description": "Bereiche mit gewünschtem Zustand; nicht genannte bleiben unverändert"
                  }
                }
              },
              "example": {
                "groups": {
                  "mail": false
                }
              }
            }
          }
        }
      }
    },
    "/orgs/{organization}/domains/{domain}/detect-cms": {
      "post": {
        "operationId": "detectDomainCms",
        "tags": [
          "Domains"
        ],
        "summary": "System neu erkennen",
        "description": "Reiht die Erkennung von CMS und Shopsystem für die Domain ein; das Ergebnis erscheint in `cms` der Domain.\n\nBraucht ein Token mit Schreibrecht (`write`).",
        "x-scope": "write",
        "parameters": [
          {
            "name": "organization",
            "in": "path",
            "required": true,
            "description": "Slug der Organisation, steht in der Adresse des Dashboards und unter Einstellungen → Integrationen → API-Tokens. Ein Token erreicht nur seine eigene Organisation, andere antworten mit 404.",
            "schema": {
              "type": "string",
              "example": "meine-agentur"
            }
          },
          {
            "name": "domain",
            "in": "path",
            "required": true,
            "description": "ID der Domain",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "202": {
            "description": "Erkennung eingereiht",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "queued": {
                          "type": "boolean",
                          "description": "Eingereiht"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        }
      }
    },
    "/orgs/{organization}/domains/{domain}/check-now": {
      "post": {
        "operationId": "checkDomainNow",
        "tags": [
          "Domains"
        ],
        "summary": "Jetzt prüfen",
        "description": "Stellt alle aktiven Monitore der Domain sofort in die Warteschlange, z. B. nach einem Deploy oder einer DNS-Änderung. Ergebnisse erscheinen wenige Sekunden später in den Monitoren.\n\nBraucht ein Token mit Schreibrecht (`write`).\n\nEigenes Limit: 5 je Domain und Stunde, 60 je Organisation und Stunde.",
        "x-scope": "write",
        "parameters": [
          {
            "name": "organization",
            "in": "path",
            "required": true,
            "description": "Slug der Organisation, steht in der Adresse des Dashboards und unter Einstellungen → Integrationen → API-Tokens. Ein Token erreicht nur seine eigene Organisation, andere antworten mit 404.",
            "schema": {
              "type": "string",
              "example": "meine-agentur"
            }
          },
          {
            "name": "domain",
            "in": "path",
            "required": true,
            "description": "ID der Domain",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "202": {
            "description": "Prüfungen eingereiht",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "dispatched": {
                          "type": "integer",
                          "description": "Anzahl eingereihter Prüfungen"
                        },
                        "requested_at": {
                          "type": "string",
                          "format": "date-time"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        }
      }
    },
    "/orgs/{organization}/domains/{domain}/fixes": {
      "get": {
        "operationId": "listFixes",
        "tags": [
          "DNS"
        ],
        "summary": "Vorschläge zu Befunden",
        "description": "Vorschläge aus den aktuellen Befunden der Domain – fehlende DNS-Records (DMARC, SPF, TLS-RPT, CAA), ~all statt eines freizügigen SPF-Endes, die ausstellende CA für einen aussperrenden CAA-Satz –, mit den verbundenen Integrationen und dem DNS-Anbieter, bei dem die Zone laut Nameservern liegt (dns_provider); nur eine Integration dieses Anbieters kann Records anlegen.\n\nLese-Token genügt (`read`).",
        "x-scope": "read",
        "parameters": [
          {
            "name": "organization",
            "in": "path",
            "required": true,
            "description": "Slug der Organisation, steht in der Adresse des Dashboards und unter Einstellungen → Integrationen → API-Tokens. Ein Token erreicht nur seine eigene Organisation, andere antworten mit 404.",
            "schema": {
              "type": "string",
              "example": "meine-agentur"
            }
          },
          {
            "name": "domain",
            "in": "path",
            "required": true,
            "description": "ID der Domain",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Erfolg",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Fix"
                      }
                    },
                    "meta": {
                      "type": "object",
                      "properties": {
                        "integrations": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string",
                                "format": "uuid"
                              },
                              "provider": {
                                "type": "string",
                                "description": "Schlüssel des Anbieters, z. B. cloudflare"
                              },
                              "provider_name": {
                                "type": "string",
                                "description": "Anzeigename des Anbieters"
                              },
                              "name": {
                                "type": "string"
                              }
                            }
                          }
                        },
                        "dns_provider": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "description": "Anbieter, auf den alle Nameserver der Domain zeigen (nur über dessen Integration ist Anlegen möglich); null bei fremder oder gemischter Delegation"
                        },
                        "dns_hosted_at_cloudflare": {
                          "type": "boolean",
                          "description": "Veraltet: dns_provider ist cloudflare"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        }
      }
    },
    "/orgs/{organization}/domains/{domain}/fixes/{fix}/apply": {
      "post": {
        "operationId": "applyFix",
        "tags": [
          "DNS"
        ],
        "summary": "Vorschlag beim DNS-Anbieter umsetzen",
        "description": "Legt den vorgeschlagenen Record über die angegebene Integration an (action create). Einen bestehenden Record ändert der Server nur bei action update, mit `replace: true` und dem gezeigten Wert in `current`; steht der Record beim Anbieter inzwischen anders da, antwortet er mit 422. Gelöscht wird nie etwas; ist bereits ein passender Record vorhanden oder liegt die Zone nicht (mehr) beim Anbieter der Integration, ebenfalls 422. Jede Anwendung steht im Audit-Log, der Monitor wird anschließend neu geprüft.\n\nBraucht ein Token mit Schreibrecht (`write`).\n\nEigenes Limit: 20 je Minute.",
        "x-scope": "write",
        "parameters": [
          {
            "name": "organization",
            "in": "path",
            "required": true,
            "description": "Slug der Organisation, steht in der Adresse des Dashboards und unter Einstellungen → Integrationen → API-Tokens. Ein Token erreicht nur seine eigene Organisation, andere antworten mit 404.",
            "schema": {
              "type": "string",
              "example": "meine-agentur"
            }
          },
          {
            "name": "domain",
            "in": "path",
            "required": true,
            "description": "ID der Domain",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "fix",
            "in": "path",
            "required": true,
            "description": "Schlüssel des Vorschlags aus der Liste der fehlenden Records",
            "schema": {
              "type": "string",
              "pattern": "^[a-z_]+$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Record angelegt",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "fix": {
                          "$ref": "#/components/schemas/Fix"
                        },
                        "record_id": {
                          "type": "string",
                          "description": "ID des angelegten Records beim Anbieter"
                        },
                        "zone": {
                          "type": "string",
                          "description": "Name der Zone beim Anbieter"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "integration_id"
                ],
                "properties": {
                  "integration_id": {
                    "type": "string",
                    "format": "uuid",
                    "description": "Integration der Organisation (Einstellungen → Integrationen → DNS-Anbieter)"
                  },
                  "rua": {
                    "type": "string",
                    "description": "Berichtsadresse für dmarc_missing und tls_rpt_missing (Pflicht bei diesen Vorschlägen)"
                  },
                  "senders": {
                    "type": "string",
                    "description": "Weitere SPF-Mechanismen für spf_missing und spf_all, durch Komma getrennt (include:…, ip4:…, ip6:…, a, mx); leer bestätigt, dass keine weiteren Dienste senden"
                  },
                  "replace": {
                    "type": "boolean",
                    "description": "Ausdrückliche Bestätigung, einen bestehenden Record zu ändern (Pflicht bei action update)"
                  },
                  "current": {
                    "type": "string",
                    "description": "Der bestehende Wert, wie der Vorschlag ihn nennt (Pflicht bei action update); weicht der Record ab, ändert DomainWarn nichts"
                  }
                }
              },
              "example": {
                "integration_id": "3f9c1a52-6a2e-4c0e-9d4b-1c9a1a0e5b77",
                "rua": "dmarc-reports@agentur.de"
              }
            }
          }
        }
      }
    },
    "/orgs/{organization}/domains/{domain}/hosting-dns/{feature}": {
      "get": {
        "operationId": "showHostingDns",
        "tags": [
          "DNS"
        ],
        "summary": "Records einer gehosteten Funktion beim DNS-Anbieter",
        "description": "Vergleicht die Records, die MTA-STS, BIMI, das SPF-Flattening (`spf`) oder die security.txt-Weiterleitung brauchen, mit dem Stand beim Anbieter der Integration, ohne etwas zu ändern. Je Record `state`: `missing` (wird angelegt), `current`, `outdated` (von DomainWarn, alter Stand oder doppelt – wird aktualisiert bzw. aufgeräumt), `conflict` (fremder Inhalt, etwa A-Records neben dem CNAME oder mehrere Policy-Records – nur mit `replace`), `blocked` (den Zugangsdaten fehlt eine Berechtigung) oder `manual` (Anbieter ohne Weiterleitungsregeln). `deletes` nennt je Record, was ein Klick löschen würde. Fragt den Anbieter mit den Zugangsdaten der Integration; Kundenzugänge sehen das nicht.\n\nLese-Token genügt (`read`).\n\nEigenes Limit: 30 je Minute.",
        "x-scope": "read",
        "parameters": [
          {
            "name": "organization",
            "in": "path",
            "required": true,
            "description": "Slug der Organisation, steht in der Adresse des Dashboards und unter Einstellungen → Integrationen → API-Tokens. Ein Token erreicht nur seine eigene Organisation, andere antworten mit 404.",
            "schema": {
              "type": "string",
              "example": "meine-agentur"
            }
          },
          {
            "name": "domain",
            "in": "path",
            "required": true,
            "description": "ID der Domain",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "feature",
            "in": "path",
            "required": true,
            "description": "Gehostete Funktion: mta_sts (CNAME und TXT), bimi (TXT) oder security_txt (Weiterleitung, nur bei Anbietern mit Weiterleitungsregeln wie Cloudflare)",
            "schema": {
              "type": "string",
              "enum": [
                "mta_sts",
                "bimi",
                "security_txt"
              ]
            }
          },
          {
            "name": "integration_id",
            "in": "query",
            "required": true,
            "description": "Integration der Organisation, bei deren Anbieter die Zone laut Nameservern liegt",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Erfolg",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "feature": {
                          "type": "string",
                          "description": "Funktion"
                        },
                        "provider": {
                          "type": "string",
                          "description": "Schlüssel des Anbieters"
                        },
                        "zone": {
                          "type": "string",
                          "description": "Zone beim Anbieter"
                        },
                        "status": {
                          "type": "string",
                          "description": "Was ein Klick täte",
                          "enum": [
                            "up_to_date",
                            "actionable",
                            "needs_replace",
                            "blocked",
                            "manual"
                          ]
                        },
                        "records": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "type": {
                                "type": "string",
                                "description": "TXT, CNAME oder REDIRECT"
                              },
                              "name": {
                                "type": "string"
                              },
                              "content": {
                                "type": "string",
                                "description": "Soll-Inhalt"
                              },
                              "proxied": {
                                "type": [
                                  "boolean",
                                  "null"
                                ],
                                "description": "Bei Anbietern mit Proxy: false = „DNS only“"
                              },
                              "state": {
                                "type": "string",
                                "enum": [
                                  "missing",
                                  "current",
                                  "outdated",
                                  "conflict",
                                  "blocked",
                                  "manual"
                                ]
                              },
                              "reason": {
                                "type": [
                                  "string",
                                  "null"
                                ]
                              },
                              "existing": {
                                "type": "array",
                                "items": {
                                  "type": "object",
                                  "properties": {
                                    "type": {
                                      "type": "string"
                                    },
                                    "content": {
                                      "type": "string"
                                    }
                                  }
                                }
                              },
                              "deletes": {
                                "type": "array",
                                "description": "Vorhandene Records, die ein Klick löschen würde",
                                "items": {
                                  "type": "object",
                                  "properties": {
                                    "type": {
                                      "type": "string"
                                    },
                                    "content": {
                                      "type": "string"
                                    }
                                  }
                                }
                              }
                            }
                          }
                        },
                        "sync": {
                          "type": [
                            "object",
                            "null"
                          ],
                          "description": "Automatisches Nachziehen (nur mta_sts, bimi und spf)"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        }
      }
    },
    "/orgs/{organization}/domains/{domain}/hosting-dns/{feature}/apply": {
      "post": {
        "operationId": "applyHostingDns",
        "tags": [
          "DNS"
        ],
        "summary": "Records einer gehosteten Funktion anlegen oder aktualisieren",
        "description": "Legt fehlende Records an und aktualisiert veraltete, die von DomainWarn stammen (neue MTA-STS-Kennung, neue Logo-Adresse). Doppelte eigene Records räumt DomainWarn dabei auf (`deletes` der Vorschau nennt sie); Records mit fremdem Inhalt – auch A/AAAA neben dem CNAME oder mehrere Policy-Records – ersetzt oder löscht es nur mit `replace: true`. Gelöschte Records stehen in `changes` mit `action: deleted`; andere Records unter demselben Namen bleiben unberührt. Bei Cloudflare liegt der MTA-STS-CNAME ohne Proxy („DNS only“), die security.txt-Weiterleitung ist eine eigene Regel mit der Kennung `domainwarn_security_txt` (Berechtigung „Zone → Single Redirect → Edit“). 422, wenn den Zugangsdaten Rechte fehlen, ohne Bestätigung eines Konflikts oder wenn die Zone nicht (mehr) beim Anbieter liegt.\n\nBraucht ein Token mit Schreibrecht (`write`).\n\nEigenes Limit: 20 je Minute.",
        "x-scope": "write",
        "parameters": [
          {
            "name": "organization",
            "in": "path",
            "required": true,
            "description": "Slug der Organisation, steht in der Adresse des Dashboards und unter Einstellungen → Integrationen → API-Tokens. Ein Token erreicht nur seine eigene Organisation, andere antworten mit 404.",
            "schema": {
              "type": "string",
              "example": "meine-agentur"
            }
          },
          {
            "name": "domain",
            "in": "path",
            "required": true,
            "description": "ID der Domain",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "feature",
            "in": "path",
            "required": true,
            "description": "Gehostete Funktion: mta_sts (CNAME und TXT), bimi (TXT) oder security_txt (Weiterleitung, nur bei Anbietern mit Weiterleitungsregeln wie Cloudflare)",
            "schema": {
              "type": "string",
              "enum": [
                "mta_sts",
                "bimi",
                "security_txt"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Records geschrieben",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "feature": {
                          "type": "string"
                        },
                        "zone": {
                          "type": "string"
                        },
                        "changes": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "type": {
                                "type": "string"
                              },
                              "name": {
                                "type": "string"
                              },
                              "content": {
                                "type": "string"
                              },
                              "action": {
                                "type": "string",
                                "enum": [
                                  "created",
                                  "updated",
                                  "replaced",
                                  "deleted"
                                ]
                              }
                            }
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "integration_id"
                ],
                "properties": {
                  "integration_id": {
                    "type": "string",
                    "format": "uuid",
                    "description": "Integration der Organisation"
                  },
                  "replace": {
                    "type": "boolean",
                    "default": false,
                    "description": "Records mit fremdem Inhalt (state conflict) ersetzen"
                  }
                }
              },
              "example": {
                "integration_id": "3f9c1a52-6a2e-4c0e-9d4b-1c9a1a0e5b77"
              }
            }
          }
        }
      }
    },
    "/orgs/{organization}/domains/{domain}/hosting-dns/{feature}/sync": {
      "patch": {
        "operationId": "updateHostingDnsSync",
        "tags": [
          "DNS"
        ],
        "summary": "TXT-Record automatisch nachziehen",
        "description": "Nur `mta_sts`, `bimi` und `spf`: Mit einer Integration zieht DomainWarn den TXT-Record bei jeder Änderung der Policy, des Logos bzw. der aufgelösten Netze selbst nach (beim SPF-Flattening nur die Teile unter `_spf.<domain>`, nie den SPF-Record der Domain) (im Hintergrund, mit Wiederholungen; scheitert es, entsteht ein Änderungs-Event). Voraussetzung ist ein Record, der schon von DomainWarn stammt; fehlt er oder ist er fremd, erst per `apply` einrichten. `null` schaltet ab.\n\nBraucht ein Token mit Schreibrecht (`write`).\n\nEigenes Limit: 20 je Minute.",
        "x-scope": "write",
        "parameters": [
          {
            "name": "organization",
            "in": "path",
            "required": true,
            "description": "Slug der Organisation, steht in der Adresse des Dashboards und unter Einstellungen → Integrationen → API-Tokens. Ein Token erreicht nur seine eigene Organisation, andere antworten mit 404.",
            "schema": {
              "type": "string",
              "example": "meine-agentur"
            }
          },
          {
            "name": "domain",
            "in": "path",
            "required": true,
            "description": "ID der Domain",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "feature",
            "in": "path",
            "required": true,
            "description": "Gehostete Funktion: mta_sts (CNAME und TXT), bimi (TXT) oder security_txt (Weiterleitung, nur bei Anbietern mit Weiterleitungsregeln wie Cloudflare)",
            "schema": {
              "type": "string",
              "enum": [
                "mta_sts",
                "bimi",
                "security_txt"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Erfolg",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": [
                        "object",
                        "null"
                      ],
                      "properties": {
                        "integration_id": {
                          "type": "string",
                          "format": "uuid"
                        },
                        "last_synced_at": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "format": "date-time",
                          "description": "Letzter Lauf ohne Fehler"
                        },
                        "last_error": {
                          "type": [
                            "string",
                            "null"
                          ]
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "integration_id"
                ],
                "properties": {
                  "integration_id": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "format": "uuid",
                    "description": "Integration, über die geschrieben wird; null schaltet ab"
                  }
                }
              },
              "example": {
                "integration_id": "3f9c1a52-6a2e-4c0e-9d4b-1c9a1a0e5b77"
              }
            }
          }
        }
      }
    },
    "/orgs/{organization}/domains/{domain}/suggestions": {
      "get": {
        "operationId": "listHostnameSuggestions",
        "tags": [
          "Monitore"
        ],
        "summary": "Hostnamen-Vorschläge",
        "description": "Hostnamen unter der Domain, die in Certificate-Transparency-Logs auftauchen, aber noch nicht überwacht werden. Standardmäßig nur offene; mit `all=1` auch angenommene und verworfene, seitenweise zu 200.\n\nLese-Token genügt (`read`).",
        "x-scope": "read",
        "parameters": [
          {
            "name": "organization",
            "in": "path",
            "required": true,
            "description": "Slug der Organisation, steht in der Adresse des Dashboards und unter Einstellungen → Integrationen → API-Tokens. Ein Token erreicht nur seine eigene Organisation, andere antworten mit 404.",
            "schema": {
              "type": "string",
              "example": "meine-agentur"
            }
          },
          {
            "name": "domain",
            "in": "path",
            "required": true,
            "description": "ID der Domain",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "all",
            "in": "query",
            "required": false,
            "description": "Auch entschiedene Vorschläge",
            "schema": {
              "type": "boolean",
              "default": false
            }
          },
          {
            "name": "page",
            "in": "query",
            "required": false,
            "description": "Seitennummer",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 10000,
              "default": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Erfolg",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/HostnameSuggestion"
                      }
                    },
                    "meta": {
                      "type": "object",
                      "properties": {
                        "page": {
                          "type": "integer"
                        },
                        "per_page": {
                          "type": "integer"
                        },
                        "has_more": {
                          "type": "boolean",
                          "description": "Weitere Seite vorhanden"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        }
      }
    },
    "/orgs/{organization}/suggestions/{suggestion}/accept": {
      "post": {
        "operationId": "acceptHostnameSuggestion",
        "tags": [
          "Monitore"
        ],
        "summary": "Vorschlag annehmen",
        "description": "Legt einen Website-Monitor auf den Hostnamen an und markiert den Vorschlag als angenommen. 422, wenn der Hostname nicht zur Domain gehört oder das Limit an Hostnamen je Domain erreicht ist.\n\nBraucht ein Token mit Schreibrecht (`write`).",
        "x-scope": "write",
        "parameters": [
          {
            "name": "organization",
            "in": "path",
            "required": true,
            "description": "Slug der Organisation, steht in der Adresse des Dashboards und unter Einstellungen → Integrationen → API-Tokens. Ein Token erreicht nur seine eigene Organisation, andere antworten mit 404.",
            "schema": {
              "type": "string",
              "example": "meine-agentur"
            }
          },
          {
            "name": "suggestion",
            "in": "path",
            "required": true,
            "description": "ID des Hostnamen-Vorschlags",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Angenommen",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/HostnameSuggestion"
                    },
                    "monitor": {
                      "oneOf": [
                        {
                          "$ref": "#/components/schemas/Monitor"
                        },
                        {
                          "type": "null"
                        }
                      ],
                      "description": "Angelegter Monitor; null, wenn es ihn schon gab"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "description": "Der Vorschlag wurde bereits entschieden",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        }
      }
    },
    "/orgs/{organization}/suggestions/{suggestion}/dismiss": {
      "post": {
        "operationId": "dismissHostnameSuggestion",
        "tags": [
          "Monitore"
        ],
        "summary": "Vorschlag verwerfen",
        "description": "Markiert den Vorschlag als verworfen; der Hostname wird nicht erneut vorgeschlagen.\n\nBraucht ein Token mit Schreibrecht (`write`).",
        "x-scope": "write",
        "parameters": [
          {
            "name": "organization",
            "in": "path",
            "required": true,
            "description": "Slug der Organisation, steht in der Adresse des Dashboards und unter Einstellungen → Integrationen → API-Tokens. Ein Token erreicht nur seine eigene Organisation, andere antworten mit 404.",
            "schema": {
              "type": "string",
              "example": "meine-agentur"
            }
          },
          {
            "name": "suggestion",
            "in": "path",
            "required": true,
            "description": "ID des Hostnamen-Vorschlags",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Verworfen",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/HostnameSuggestion"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "description": "Der Vorschlag wurde bereits entschieden",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        }
      }
    },
    "/orgs/{organization}/domains/{domain}/site-insights": {
      "get": {
        "operationId": "siteInsight",
        "tags": [
          "Domains"
        ],
        "summary": "Innensicht der Website",
        "description": "Was eine Erweiterung im System selbst meldet (Shopware, WordPress): genaue Version, PHP, installierte Erweiterungen mit verfügbarem Update, Mailversand, Wartungsmodus – dazu die Bewertung. Von außen ist davon nichts sichtbar. `null`, solange nichts gemeldet wurde.\n\nLese-Token genügt (`read`).",
        "x-scope": "read",
        "parameters": [
          {
            "name": "organization",
            "in": "path",
            "required": true,
            "description": "Slug der Organisation, steht in der Adresse des Dashboards und unter Einstellungen → Integrationen → API-Tokens. Ein Token erreicht nur seine eigene Organisation, andere antworten mit 404.",
            "schema": {
              "type": "string",
              "example": "meine-agentur"
            }
          },
          {
            "name": "domain",
            "in": "path",
            "required": true,
            "description": "ID der Domain",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Erfolg",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": [
                        "object",
                        "null"
                      ],
                      "additionalProperties": true
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        }
      },
      "post": {
        "operationId": "reportSiteInsight",
        "tags": [
          "Domains"
        ],
        "summary": "Innensicht melden",
        "description": "Die Erweiterung im System meldet nur Tatsachen; bewertet wird in DomainWarn, damit sich das Urteil ändern kann, ohne dass jemand an der Website etwas aktualisiert. Je Domain wird die letzte Meldung behalten.\n\nBraucht ein Token mit Schreibrecht (`write`).",
        "x-scope": "write",
        "parameters": [
          {
            "name": "organization",
            "in": "path",
            "required": true,
            "description": "Slug der Organisation, steht in der Adresse des Dashboards und unter Einstellungen → Integrationen → API-Tokens. Ein Token erreicht nur seine eigene Organisation, andere antworten mit 404.",
            "schema": {
              "type": "string",
              "example": "meine-agentur"
            }
          },
          {
            "name": "domain",
            "in": "path",
            "required": true,
            "description": "ID der Domain",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Erfolg",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "additionalProperties": true
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "platform"
                ],
                "properties": {
                  "platform": {
                    "type": "string",
                    "enum": [
                      "shopware",
                      "wordpress"
                    ],
                    "description": "System"
                  },
                  "platform_version": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "maxLength": 32,
                    "description": "Version des Systems"
                  },
                  "php_version": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "maxLength": 32,
                    "description": "PHP-Version"
                  },
                  "maintenance": {
                    "type": "boolean",
                    "description": "Wartungsmodus aktiv"
                  },
                  "extensions": {
                    "type": "array",
                    "maxItems": 300,
                    "items": {
                      "type": "object",
                      "properties": {
                        "name": {
                          "type": "string"
                        },
                        "label": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "version": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "latest_version": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "active": {
                          "type": "boolean"
                        }
                      }
                    },
                    "description": "Installierte Erweiterungen; latest_version ist die Version, die das System als Update kennt"
                  },
                  "mailer": {
                    "type": "object",
                    "properties": {
                      "transport": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "host": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "sender": {
                        "type": [
                          "string",
                          "null"
                        ]
                      }
                    },
                    "description": "Mailversand der Website"
                  },
                  "channels": {
                    "type": "array",
                    "maxItems": 100,
                    "items": {
                      "type": "object",
                      "properties": {
                        "name": {
                          "type": "string"
                        },
                        "domains": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        }
                      }
                    },
                    "description": "Verkaufskanäle (Shopware) bzw. Seiten eines Netzwerks (WordPress)"
                  },
                  "agent": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "maxLength": 32,
                    "description": "Meldende Erweiterung"
                  },
                  "agent_version": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "maxLength": 32,
                    "description": "Version der Erweiterung"
                  }
                }
              },
              "example": {
                "platform": "shopware",
                "platform_version": "6.7.3.1",
                "php_version": "8.3.26",
                "maintenance": false,
                "extensions": [
                  {
                    "name": "SwagPayPal",
                    "version": "9.0.0",
                    "latest_version": "9.1.0",
                    "active": true
                  }
                ],
                "mailer": {
                  "transport": "smtp",
                  "host": "smtp.hoster.de",
                  "sender": "shop@kunde.de"
                },
                "agent": "shopware",
                "agent_version": "1.2.0"
              }
            }
          }
        }
      }
    },
    "/orgs/{organization}/plugin-installations": {
      "get": {
        "operationId": "listPluginInstallations",
        "tags": [
          "Domains"
        ],
        "summary": "Erweiterungen und ihr Meldestand",
        "description": "Alle Installationen des WordPress-Plugins und der Shopware-Erweiterung über die Domains der Organisation: Plattform und Version, Version der Erweiterung, letzte Meldung und deren Stand (`current` bis zwei Stunden, `late` bis ein Tag, `stale` älter) sowie der Heartbeat, den die Erweiterung für ihren geplanten Lauf angelegt hat. Meldet eine Installation an zwei Domains, steht sie zweimal da.\n\nLese-Token genügt (`read`).",
        "x-scope": "read",
        "parameters": [
          {
            "name": "organization",
            "in": "path",
            "required": true,
            "description": "Slug der Organisation, steht in der Adresse des Dashboards und unter Einstellungen → Integrationen → API-Tokens. Ein Token erreicht nur seine eigene Organisation, andere antworten mit 404.",
            "schema": {
              "type": "string",
              "example": "meine-agentur"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Erfolg",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "domain": {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string",
                                "format": "uuid",
                                "description": "ID der Domain"
                              },
                              "name": {
                                "type": "string",
                                "description": "Domain"
                              },
                              "unicode_name": {
                                "type": "string",
                                "description": "Domain in Unicode"
                              }
                            }
                          },
                          "source": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "Erster Hostname der Installation; `null` bei älteren Erweiterungen"
                          },
                          "platform": {
                            "type": "string",
                            "description": "System",
                            "enum": [
                              "shopware",
                              "wordpress"
                            ]
                          },
                          "platform_version": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "Version des Systems"
                          },
                          "agent": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "Meldende Erweiterung"
                          },
                          "agent_version": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "description": "Version der Erweiterung"
                          },
                          "reported_at": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "format": "date-time",
                            "description": "Letzte Meldung"
                          },
                          "state": {
                            "type": "string",
                            "description": "Meldestand",
                            "enum": [
                              "current",
                              "late",
                              "stale"
                            ]
                          },
                          "heartbeat": {
                            "type": [
                              "object",
                              "null"
                            ],
                            "properties": {
                              "monitor_id": {
                                "type": "string",
                                "format": "uuid",
                                "description": "ID des Monitors"
                              },
                              "is_enabled": {
                                "type": "boolean",
                                "description": "Monitor eingeschaltet"
                              },
                              "status": {
                                "type": "string",
                                "description": "Zustand des Monitors",
                                "enum": [
                                  "ok",
                                  "warning",
                                  "critical",
                                  "unknown"
                                ]
                              },
                              "last_ping_at": {
                                "type": [
                                  "string",
                                  "null"
                                ],
                                "format": "date-time",
                                "description": "Letzter Ping"
                              }
                            }
                          }
                        }
                      }
                    },
                    "meta": {
                      "type": "object",
                      "properties": {
                        "total": {
                          "type": "integer",
                          "description": "Installationen"
                        },
                        "current": {
                          "type": "integer",
                          "description": "Davon laufend"
                        },
                        "late": {
                          "type": "integer",
                          "description": "Davon verspätet"
                        },
                        "stale": {
                          "type": "integer",
                          "description": "Davon verstummt"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        }
      }
    },
    "/orgs/{organization}/domains/{domain}/mta-sts": {
      "get": {
        "operationId": "showMtaSts",
        "tags": [
          "Domains"
        ],
        "summary": "MTA-STS-Policy der Domain",
        "description": "Einstellung und die beiden Records, die der Kunde setzen muss (CNAME auf die Website, TXT mit der Kennung). Liefert DomainWarn die Policy aus, steht sie als Text dabei.\n\nLese-Token genügt (`read`).",
        "x-scope": "read",
        "parameters": [
          {
            "name": "organization",
            "in": "path",
            "required": true,
            "description": "Slug der Organisation, steht in der Adresse des Dashboards und unter Einstellungen → Integrationen → API-Tokens. Ein Token erreicht nur seine eigene Organisation, andere antworten mit 404.",
            "schema": {
              "type": "string",
              "example": "meine-agentur"
            }
          },
          {
            "name": "domain",
            "in": "path",
            "required": true,
            "description": "ID der Domain",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Erfolg",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "additionalProperties": true
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        }
      },
      "patch": {
        "operationId": "updateMtaSts",
        "tags": [
          "Domains"
        ],
        "summary": "MTA-STS bei DomainWarn hosten",
        "description": "Die Policy-Datei muss unter `https://mta-sts.<domain>/.well-known/mta-sts.txt` mit gültigem Zertifikat liegen; DomainWarn liefert sie aus. Jede Änderung vergibt eine neue Kennung – der TXT-Record muss nachgezogen werden (über eine Integration per Klick oder automatisch, siehe `hosting-dns`). Ohne bekannte MX-Hosts wird bewusst nichts ausgeliefert.\n\nBraucht ein Token mit Schreibrecht (`write`).",
        "x-scope": "write",
        "parameters": [
          {
            "name": "organization",
            "in": "path",
            "required": true,
            "description": "Slug der Organisation, steht in der Adresse des Dashboards und unter Einstellungen → Integrationen → API-Tokens. Ein Token erreicht nur seine eigene Organisation, andere antworten mit 404.",
            "schema": {
              "type": "string",
              "example": "meine-agentur"
            }
          },
          {
            "name": "domain",
            "in": "path",
            "required": true,
            "description": "ID der Domain",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Erfolg",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "additionalProperties": true
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "hosted"
                ],
                "properties": {
                  "hosted": {
                    "type": "boolean",
                    "description": "Policy von DomainWarn ausliefern lassen"
                  },
                  "mode": {
                    "type": "string",
                    "enum": [
                      "testing",
                      "enforce"
                    ],
                    "description": "testing meldet Fehler nur, enforce lässt sendende Server abbrechen"
                  },
                  "max_age": {
                    "type": "integer",
                    "minimum": 86400,
                    "maximum": 31557600,
                    "description": "Laufzeit in Sekunden"
                  },
                  "mx": {
                    "type": "array",
                    "maxItems": 20,
                    "items": {
                      "type": "string"
                    },
                    "description": "MX-Hosts der Policy; leer = die aufgelösten MX-Records der Domain"
                  }
                }
              },
              "example": {
                "hosted": true,
                "mode": "enforce",
                "max_age": 604800
              }
            }
          }
        }
      }
    },
    "/orgs/{organization}/domains/{domain}/bimi": {
      "get": {
        "operationId": "showBimi",
        "tags": [
          "Domains"
        ],
        "summary": "BIMI-Logo der Domain",
        "description": "Ob DomainWarn ein BIMI-Logo für die Domain ausliefert, unter welcher Adresse, und der TXT-Record `default._bimi.<domain>`, den der Kunde setzen muss.\n\nLese-Token genügt (`read`).",
        "x-scope": "read",
        "parameters": [
          {
            "name": "organization",
            "in": "path",
            "required": true,
            "description": "Slug der Organisation, steht in der Adresse des Dashboards und unter Einstellungen → Integrationen → API-Tokens. Ein Token erreicht nur seine eigene Organisation, andere antworten mit 404.",
            "schema": {
              "type": "string",
              "example": "meine-agentur"
            }
          },
          {
            "name": "domain",
            "in": "path",
            "required": true,
            "description": "ID der Domain",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Erfolg",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "additionalProperties": true
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        }
      },
      "post": {
        "operationId": "updateBimi",
        "tags": [
          "Domains"
        ],
        "summary": "BIMI-Logo bei DomainWarn hosten",
        "description": "Lädt das Logo hoch oder tauscht es aus. DomainWarn wandelt es in SVG Tiny PS um (wie `previewBimi`) und speichert das Ergebnis; `changes` in der Antwort nennt, was geändert wurde. Ein Logo, das schon Tiny PS ist, bleibt unverändert. Was sich nicht umwandeln lässt (Rasterbilder, Entities, kein SVG, über 512 KB oder umgewandelt über 32 KB), lehnt die API mit 422 und allen Gründen ab. Die Adresse behält beim Austausch ihr Token, nur die Version im Dateinamen ändert sich.\n\nBraucht ein Token mit Schreibrecht (`write`).",
        "x-scope": "write",
        "parameters": [
          {
            "name": "organization",
            "in": "path",
            "required": true,
            "description": "Slug der Organisation, steht in der Adresse des Dashboards und unter Einstellungen → Integrationen → API-Tokens. Ein Token erreicht nur seine eigene Organisation, andere antworten mit 404.",
            "schema": {
              "type": "string",
              "example": "meine-agentur"
            }
          },
          {
            "name": "domain",
            "in": "path",
            "required": true,
            "description": "ID der Domain",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Erfolg",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "additionalProperties": true
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "svg"
                ],
                "properties": {
                  "svg": {
                    "type": "string",
                    "description": "Das Logo als SVG-Text, bis 512 KB"
                  }
                }
              },
              "example": {
                "svg": "<svg xmlns=\"http://www.w3.org/2000/svg\" version=\"1.2\" baseProfile=\"tiny-ps\" viewBox=\"0 0 100 100\"><title>Kunde GmbH</title><circle cx=\"50\" cy=\"50\" r=\"40\" fill=\"#0a7\"/></svg>"
              }
            }
          }
        }
      },
      "delete": {
        "operationId": "deleteBimi",
        "tags": [
          "Domains"
        ],
        "summary": "BIMI-Logo entfernen",
        "description": "Die Adresse des Logos antwortet ab sofort mit 404. Ein späterer Upload bekommt eine neue Adresse.\n\nBraucht ein Token mit Schreibrecht (`write`).",
        "x-scope": "write",
        "parameters": [
          {
            "name": "organization",
            "in": "path",
            "required": true,
            "description": "Slug der Organisation, steht in der Adresse des Dashboards und unter Einstellungen → Integrationen → API-Tokens. Ein Token erreicht nur seine eigene Organisation, andere antworten mit 404.",
            "schema": {
              "type": "string",
              "example": "meine-agentur"
            }
          },
          {
            "name": "domain",
            "in": "path",
            "required": true,
            "description": "ID der Domain",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Erfolg",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "additionalProperties": true
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        }
      }
    },
    "/orgs/{organization}/domains/{domain}/bimi/preview": {
      "post": {
        "operationId": "previewBimi",
        "tags": [
          "Domains"
        ],
        "summary": "BIMI-Logo umwandeln (Vorschau)",
        "description": "Wandelt ein SVG in SVG Tiny PS um, ohne etwas zu speichern: Profil, title-Element (Name des Kunden, sonst die Domain), quadratische viewBox, CSS als Attribute, ohne Skripte, Animationen, Editor-Daten und externe Verweise. Die Antwort enthält das Ergebnis (`svg`, `preview` als data-URL, `size`) und `changes`: je Änderung `code`, `params`, `message` in der Sprache der Anfrage und `severity` (`warning`, wenn sich das Aussehen ändern kann). Dasselbe SVG an `updateBimi` gespeichert ergibt genau dieses Ergebnis. Rasterbilder lassen sich nicht umwandeln: 422. Höchstens 30 Umwandlungen je Minute und Organisation, Vorschau und Hochladen zusammen (429).\n\nBraucht ein Token mit Schreibrecht (`write`).",
        "x-scope": "write",
        "parameters": [
          {
            "name": "organization",
            "in": "path",
            "required": true,
            "description": "Slug der Organisation, steht in der Adresse des Dashboards und unter Einstellungen → Integrationen → API-Tokens. Ein Token erreicht nur seine eigene Organisation, andere antworten mit 404.",
            "schema": {
              "type": "string",
              "example": "meine-agentur"
            }
          },
          {
            "name": "domain",
            "in": "path",
            "required": true,
            "description": "ID der Domain",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Erfolg",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "additionalProperties": true
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "svg"
                ],
                "properties": {
                  "svg": {
                    "type": "string",
                    "description": "Das Logo als SVG-Text, bis 512 KB"
                  }
                }
              },
              "example": {
                "svg": "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"200\" height=\"100\"><circle cx=\"100\" cy=\"50\" r=\"40\" fill=\"#0a7\"/></svg>"
              }
            }
          }
        }
      }
    },
    "/orgs/{organization}/domains/{domain}/compliance": {
      "get": {
        "operationId": "getDomainCompliance",
        "tags": [
          "Domains"
        ],
        "summary": "Compliance-Bericht der Domain",
        "description": "Ordnet die letzten Prüfergebnisse den Anforderungen aus BSI TR-03108 (sicherer E-Mail-Transport), BSI TR-03182 (E-Mail-Authentifizierung) und NIS2 Art. 21 Abs. 2 zu: je Anforderung `met`, `partial`, `failed` oder `unknown` mit Beleg und Empfehlung. Technische Indikation von außen, keine Zertifizierung. Ab Agency (Tariffeature `reports`, sonst 402).\n\nLese-Token genügt (`read`).",
        "x-scope": "read",
        "parameters": [
          {
            "name": "organization",
            "in": "path",
            "required": true,
            "description": "Slug der Organisation, steht in der Adresse des Dashboards und unter Einstellungen → Integrationen → API-Tokens. Ein Token erreicht nur seine eigene Organisation, andere antworten mit 404.",
            "schema": {
              "type": "string",
              "example": "meine-agentur"
            }
          },
          {
            "name": "domain",
            "in": "path",
            "required": true,
            "description": "ID der Domain",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "locale",
            "in": "query",
            "required": false,
            "description": "Sprache des Berichts (Texte, Datumsformate); ohne Angabe die Berichtssprache des Kunden, sonst die der Organisation. Accept-Language gilt hier nicht.",
            "schema": {
              "type": "string",
              "enum": [
                "de",
                "en"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Erfolg",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "additionalProperties": true,
                      "description": "Organisation, Kunde, Abschnitte (frameworks), Summen und je Domain die Prüfpunkte"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        }
      }
    },
    "/orgs/{organization}/domains/{domain}/compliance/pdf": {
      "get": {
        "operationId": "getDomainCompliancePdf",
        "tags": [
          "Domains"
        ],
        "summary": "Compliance-Bericht der Domain als PDF",
        "description": "Derselbe Bericht als PDF im Stil des Monatsberichts, mit White-Label; `download=1` liefert ihn als Anhang.\n\nLese-Token genügt (`read`).",
        "x-scope": "read",
        "parameters": [
          {
            "name": "organization",
            "in": "path",
            "required": true,
            "description": "Slug der Organisation, steht in der Adresse des Dashboards und unter Einstellungen → Integrationen → API-Tokens. Ein Token erreicht nur seine eigene Organisation, andere antworten mit 404.",
            "schema": {
              "type": "string",
              "example": "meine-agentur"
            }
          },
          {
            "name": "domain",
            "in": "path",
            "required": true,
            "description": "ID der Domain",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "locale",
            "in": "query",
            "required": false,
            "description": "Sprache des Berichts (Texte, Datumsformate); ohne Angabe die Berichtssprache des Kunden, sonst die der Organisation. Accept-Language gilt hier nicht.",
            "schema": {
              "type": "string",
              "enum": [
                "de",
                "en"
              ]
            }
          },
          {
            "name": "download",
            "in": "query",
            "required": false,
            "description": "Als Download (Content-Disposition attachment)",
            "schema": {
              "type": "boolean",
              "default": false
            }
          }
        ],
        "responses": {
          "200": {
            "description": "PDF-Datei",
            "content": {
              "application/pdf": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        }
      }
    },
    "/orgs/{organization}/domains/{domain}/email-audits": {
      "get": {
        "operationId": "listEmailAudits",
        "tags": [
          "Domains"
        ],
        "summary": "Prüfberichte E-Mail-Sicherheit der Domain",
        "description": "Die letzten 30 Prüfberichte der Domain, neueste zuerst: Prüfnummer, Prüfdatum, `met` von `total` gezählten Kriterien, `passed`, Quelle (`manual` auf Anforderung, `daily` für das Siegel), die 15 Kriterien aus BSI TR-03108 und TR-03182 mit Anforderung und Ergebnis sowie die Adresse der öffentlichen Verifizierung (`verify_url`). Berichte sind unveränderlich. `meta.available` sagt, ob die Organisation neue erstellen darf. Automatisierte Prüfung von außen, keine Zertifizierung.\n\nLese-Token genügt (`read`).",
        "x-scope": "read",
        "parameters": [
          {
            "name": "organization",
            "in": "path",
            "required": true,
            "description": "Slug der Organisation, steht in der Adresse des Dashboards und unter Einstellungen → Integrationen → API-Tokens. Ein Token erreicht nur seine eigene Organisation, andere antworten mit 404.",
            "schema": {
              "type": "string",
              "example": "meine-agentur"
            }
          },
          {
            "name": "domain",
            "in": "path",
            "required": true,
            "description": "ID der Domain",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Erfolg",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "additionalProperties": true
                      }
                    },
                    "meta": {
                      "type": "object",
                      "additionalProperties": true
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        }
      },
      "post": {
        "operationId": "createEmailAudit",
        "tags": [
          "Domains"
        ],
        "summary": "Prüfbericht E-Mail-Sicherheit erstellen",
        "description": "Schreibt den aktuellen Stand der E-Mail-Prüfpunkte als neuen Prüfbericht mit eigener Prüfnummer fest. Gezählt werden alle MUSS-Kriterien, die für die Domain gelten; „teilweise“ und „nicht prüfbar“ gelten als nicht erfüllt. Alle bezahlten Tarife (Tariffeature `seal`, sonst 402).\n\nBraucht ein Token mit Schreibrecht (`write`).\n\nEigenes Limit: 20 je Organisation und Stunde.",
        "x-scope": "write",
        "parameters": [
          {
            "name": "organization",
            "in": "path",
            "required": true,
            "description": "Slug der Organisation, steht in der Adresse des Dashboards und unter Einstellungen → Integrationen → API-Tokens. Ein Token erreicht nur seine eigene Organisation, andere antworten mit 404.",
            "schema": {
              "type": "string",
              "example": "meine-agentur"
            }
          },
          {
            "name": "domain",
            "in": "path",
            "required": true,
            "description": "ID der Domain",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "201": {
            "description": "Angelegt",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "additionalProperties": true
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        }
      }
    },
    "/orgs/{organization}/domains/{domain}/email-audits/{number}/pdf": {
      "get": {
        "operationId": "getEmailAuditPdf",
        "tags": [
          "Domains"
        ],
        "summary": "Prüfbericht E-Mail-Sicherheit als PDF",
        "description": "Der Prüfbericht mit Ergebniszeile, Kriterien und QR-Code zur Verifizierungsseite; `download=1` liefert ihn als Anhang.\n\nLese-Token genügt (`read`).\n\nEigenes Limit: 10 je Minute und Organisation.",
        "x-scope": "read",
        "parameters": [
          {
            "name": "organization",
            "in": "path",
            "required": true,
            "description": "Slug der Organisation, steht in der Adresse des Dashboards und unter Einstellungen → Integrationen → API-Tokens. Ein Token erreicht nur seine eigene Organisation, andere antworten mit 404.",
            "schema": {
              "type": "string",
              "example": "meine-agentur"
            }
          },
          {
            "name": "domain",
            "in": "path",
            "required": true,
            "description": "ID der Domain",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "number",
            "in": "path",
            "required": true,
            "description": "Prüfnummer des Prüfberichts (Groß- oder Kleinschreibung)",
            "schema": {
              "type": "string",
              "example": "DW-20261109-7K3Q-X9MP-4R2T"
            }
          },
          {
            "name": "locale",
            "in": "query",
            "required": false,
            "description": "Sprache des Berichts (Texte, Datumsformate); ohne Angabe die Berichtssprache des Kunden, sonst die der Organisation. Accept-Language gilt hier nicht.",
            "schema": {
              "type": "string",
              "enum": [
                "de",
                "en"
              ]
            }
          },
          {
            "name": "download",
            "in": "query",
            "required": false,
            "description": "Als Download (Content-Disposition attachment)",
            "schema": {
              "type": "boolean",
              "default": false
            }
          }
        ],
        "responses": {
          "200": {
            "description": "PDF-Datei",
            "content": {
              "application/pdf": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        }
      }
    },
    "/orgs/{organization}/domains/{domain}/email-seal": {
      "get": {
        "operationId": "showDomainEmailSeal",
        "tags": [
          "Domains"
        ],
        "summary": "Siegel „E-Mail-Sicherheit geprüft“ der Domain",
        "description": "Eigenes Siegel der Domain zum Einbinden auf der Website des Endkunden: an/aus, ob es gerade gilt (`valid`: neuester Prüfbericht höchstens 48 Stunden alt und alle gezählten Kriterien erfüllt), Inhabername (Vorgabe: Kunde der Domain), Inhalte, Token und Adressen je Sprache (`urls`) sowie der neueste Prüfbericht. Auch für Kundenzugänge ihrer eigenen Domains.\n\nLese-Token genügt (`read`).",
        "x-scope": "read",
        "parameters": [
          {
            "name": "organization",
            "in": "path",
            "required": true,
            "description": "Slug der Organisation, steht in der Adresse des Dashboards und unter Einstellungen → Integrationen → API-Tokens. Ein Token erreicht nur seine eigene Organisation, andere antworten mit 404.",
            "schema": {
              "type": "string",
              "example": "meine-agentur"
            }
          },
          {
            "name": "domain",
            "in": "path",
            "required": true,
            "description": "ID der Domain",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Erfolg",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "additionalProperties": true
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        }
      },
      "put": {
        "operationId": "updateDomainEmailSeal",
        "tags": [
          "Domains"
        ],
        "summary": "Siegel der Domain einstellen",
        "description": "Schaltet das Siegel ein oder aus und setzt Inhabername (`name`, leer = Kunde der Domain), `show_name`, `show_date` und `show_result`. Einschalten verlangt das Tariffeature `seal` (sonst 402); ohne frischen Prüfbericht entsteht sofort einer.\n\nBraucht ein Token mit Schreibrecht (`write`).",
        "x-scope": "write",
        "parameters": [
          {
            "name": "organization",
            "in": "path",
            "required": true,
            "description": "Slug der Organisation, steht in der Adresse des Dashboards und unter Einstellungen → Integrationen → API-Tokens. Ein Token erreicht nur seine eigene Organisation, andere antworten mit 404.",
            "schema": {
              "type": "string",
              "example": "meine-agentur"
            }
          },
          {
            "name": "domain",
            "in": "path",
            "required": true,
            "description": "ID der Domain",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Erfolg",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "additionalProperties": true
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "enabled"
                ],
                "properties": {
                  "enabled": {
                    "type": "boolean",
                    "description": "Siegel an oder aus"
                  },
                  "name": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "maxLength": 80,
                    "description": "Eigener Inhabername; leer = Kunde der Domain"
                  },
                  "show_name": {
                    "type": "boolean",
                    "description": "Inhabername im Bild zeigen"
                  },
                  "show_date": {
                    "type": "boolean",
                    "description": "Prüfdatum zeigen"
                  },
                  "show_result": {
                    "type": "boolean",
                    "description": "Kriterien-Ergebnis zeigen"
                  }
                }
              },
              "example": {
                "enabled": true,
                "name": null,
                "show_result": true
              }
            }
          }
        }
      }
    },
    "/orgs/{organization}/domains/{domain}/email-seal/token": {
      "post": {
        "operationId": "rotateDomainEmailSeal",
        "tags": [
          "Domains"
        ],
        "summary": "Neue Adresse für das Siegel der Domain",
        "description": "Erzeugt ein neues Token; Bild und Bestätigungsseite unter der alten Adresse zeigen ab sofort „nicht mehr gültig“.\n\nBraucht ein Token mit Schreibrecht (`write`).",
        "x-scope": "write",
        "parameters": [
          {
            "name": "organization",
            "in": "path",
            "required": true,
            "description": "Slug der Organisation, steht in der Adresse des Dashboards und unter Einstellungen → Integrationen → API-Tokens. Ein Token erreicht nur seine eigene Organisation, andere antworten mit 404.",
            "schema": {
              "type": "string",
              "example": "meine-agentur"
            }
          },
          {
            "name": "domain",
            "in": "path",
            "required": true,
            "description": "ID der Domain",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Erfolg",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "additionalProperties": true
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        }
      }
    },
    "/orgs/{organization}/domains/{domain}/email-seal/preview": {
      "get": {
        "operationId": "previewDomainEmailSeal",
        "tags": [
          "Domains"
        ],
        "summary": "Vorschau des Siegels der Domain",
        "description": "Das Bild mit den gespeicherten Angaben und dem neuesten Prüfbericht als SVG im JSON (`svg`, `width`, `height`), auch solange das Siegel aus ist.\n\nLese-Token genügt (`read`).",
        "x-scope": "read",
        "parameters": [
          {
            "name": "organization",
            "in": "path",
            "required": true,
            "description": "Slug der Organisation, steht in der Adresse des Dashboards und unter Einstellungen → Integrationen → API-Tokens. Ein Token erreicht nur seine eigene Organisation, andere antworten mit 404.",
            "schema": {
              "type": "string",
              "example": "meine-agentur"
            }
          },
          {
            "name": "domain",
            "in": "path",
            "required": true,
            "description": "ID der Domain",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "size",
            "in": "query",
            "required": false,
            "description": "Größe (Vorgabe banner)",
            "schema": {
              "type": "string",
              "enum": [
                "small",
                "banner",
                "leaderboard",
                "square"
              ]
            }
          },
          {
            "name": "theme",
            "in": "query",
            "required": false,
            "description": "Farbschema (Vorgabe light)",
            "schema": {
              "type": "string",
              "enum": [
                "light",
                "dark"
              ]
            }
          },
          {
            "name": "lang",
            "in": "query",
            "required": false,
            "description": "Sprache (Vorgabe: Sprache der Organisation)",
            "schema": {
              "type": "string",
              "enum": [
                "de",
                "en"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Erfolg",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "additionalProperties": true
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        }
      }
    },
    "/orgs/{organization}/domains/{domain}/pagespeed": {
      "get": {
        "operationId": "showPageSpeedHistory",
        "tags": [
          "Domains"
        ],
        "summary": "PageSpeed-Verlauf",
        "description": "Punktzahl (0–100) und Kernmetriken je wöchentlicher Messung für mobil und desktop (`points`, beide Strategien eines Laufs tragen denselben Zeitpunkt `t`), dazu je Strategie die letzte und die vorletzte Messung (`latest`, `previous`) für den Trend. Metriken: `lcp_ms`, `fcp_ms`, `tbt_ms`, `cls`, `speed_index_ms` aus dem Labor, `field` mit `overall`, `lcp_ms`, `inp_ms` und `cls` echter Nutzer (Chrome UX Report) oder null. Bewertet wird die Strategie `monitor.rated_strategy` (Vorgabe mobil). Ohne PageSpeed-Monitor ist `monitor` null und der Verlauf leer.\n\nLese-Token genügt (`read`).",
        "x-scope": "read",
        "parameters": [
          {
            "name": "organization",
            "in": "path",
            "required": true,
            "description": "Slug der Organisation, steht in der Adresse des Dashboards und unter Einstellungen → Integrationen → API-Tokens. Ein Token erreicht nur seine eigene Organisation, andere antworten mit 404.",
            "schema": {
              "type": "string",
              "example": "meine-agentur"
            }
          },
          {
            "name": "domain",
            "in": "path",
            "required": true,
            "description": "ID der Domain",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "months",
            "in": "query",
            "required": false,
            "description": "Zeitraum in Monaten (Vorgabe 12; der Verlauf bleibt 13 Monate gespeichert)",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 13
            }
          },
          {
            "name": "monitor",
            "in": "query",
            "required": false,
            "description": "Bestimmter PageSpeed-Monitor der Domain (Vorgabe: der erste eingeschaltete)",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Erfolg",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "additionalProperties": true
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        }
      }
    },
    "/orgs/{organization}/domains/{domain}/heartbeats/reliability": {
      "get": {
        "operationId": "showHeartbeatReliability",
        "tags": [
          "Domains"
        ],
        "summary": "Zuverlässigkeit der Heartbeats",
        "description": "Je Heartbeat der Domain der Anteil pünktlicher Läufe (`percent`, null ohne Läufe im Zeitraum), die Summen `on_time`, `late`, `failed`, `missed` und `total` sowie dieselben Zähler je Tag (`days`, UTC, vom ältesten zum heutigen). Verpasste Läufe zählen an dem Tag, an dem sie fällig waren; steht der nächste Ping noch aus, sind die bis jetzt verpassten schon enthalten.\n\nLese-Token genügt (`read`).",
        "x-scope": "read",
        "parameters": [
          {
            "name": "organization",
            "in": "path",
            "required": true,
            "description": "Slug der Organisation, steht in der Adresse des Dashboards und unter Einstellungen → Integrationen → API-Tokens. Ein Token erreicht nur seine eigene Organisation, andere antworten mit 404.",
            "schema": {
              "type": "string",
              "example": "meine-agentur"
            }
          },
          {
            "name": "domain",
            "in": "path",
            "required": true,
            "description": "ID der Domain",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "days",
            "in": "query",
            "required": false,
            "description": "Zeitraum in Tagen (Vorgabe 30; die Zähler bleiben 90 Tage gespeichert)",
            "schema": {
              "type": "integer",
              "minimum": 7,
              "maximum": 90
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Erfolg",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "additionalProperties": true
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        }
      }
    },
    "/orgs/{organization}/domains/{domain}/security-txt": {
      "get": {
        "operationId": "showSecurityTxt",
        "tags": [
          "Domains"
        ],
        "summary": "security.txt der Domain",
        "description": "Ob DomainWarn eine security.txt (RFC 9116) für die Domain ausliefert, die gepflegten Angaben, die erzeugte Datei (`content`) und die Adresse (`url`), auf die der Kunde `/.well-known/security.txt` weiterleitet.\n\nLese-Token genügt (`read`).",
        "x-scope": "read",
        "parameters": [
          {
            "name": "organization",
            "in": "path",
            "required": true,
            "description": "Slug der Organisation, steht in der Adresse des Dashboards und unter Einstellungen → Integrationen → API-Tokens. Ein Token erreicht nur seine eigene Organisation, andere antworten mit 404.",
            "schema": {
              "type": "string",
              "example": "meine-agentur"
            }
          },
          {
            "name": "domain",
            "in": "path",
            "required": true,
            "description": "ID der Domain",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Erfolg",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "additionalProperties": true
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        }
      },
      "patch": {
        "operationId": "updateSecurityTxt",
        "tags": [
          "Domains"
        ],
        "summary": "security.txt bei DomainWarn hosten",
        "description": "Speichert die Angaben und schaltet die Auslieferung. Nur mitgeschickte Felder ändern sich, `null` leert ein optionales Feld. Canonical (die Adresse beim Kunden) und Expires (Tagesbeginn plus 180 Tage, bei jedem Abruf neu) erzeugt DomainWarn. Werte mit Zeilenumbrüchen oder Steuerzeichen lehnt die API mit 422 ab. Die Adresse behält ihr Token über alle Änderungen, auch beim Aus- und Einschalten.\n\nBraucht ein Token mit Schreibrecht (`write`).",
        "x-scope": "write",
        "parameters": [
          {
            "name": "organization",
            "in": "path",
            "required": true,
            "description": "Slug der Organisation, steht in der Adresse des Dashboards und unter Einstellungen → Integrationen → API-Tokens. Ein Token erreicht nur seine eigene Organisation, andere antworten mit 404.",
            "schema": {
              "type": "string",
              "example": "meine-agentur"
            }
          },
          {
            "name": "domain",
            "in": "path",
            "required": true,
            "description": "ID der Domain",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Erfolg",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "additionalProperties": true
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "enabled"
                ],
                "properties": {
                  "enabled": {
                    "type": "boolean",
                    "description": "Datei ausliefern"
                  },
                  "contacts": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "1 bis 10 Kontakte: `mailto:`, `tel:` (ohne Leerzeichen) oder `https://`; beim ersten Speichern Pflicht"
                  },
                  "encryption": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "description": "HTTPS-Adresse des OpenPGP-Schlüssels"
                  },
                  "policy": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "description": "HTTPS-Adresse der Melderichtlinie"
                  },
                  "acknowledgments": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "description": "HTTPS-Adresse der Danksagungen"
                  },
                  "hiring": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "description": "HTTPS-Adresse der Stellenangebote"
                  },
                  "preferred_languages": {
                    "type": [
                      "array",
                      "null"
                    ],
                    "items": {
                      "type": "string"
                    },
                    "description": "Sprachkürzel nach RFC 5646, höchstens 10"
                  }
                }
              },
              "example": {
                "enabled": true,
                "contacts": [
                  "mailto:security@kunde.de",
                  "https://kunde.de/sicherheit"
                ],
                "policy": "https://kunde.de/disclosure",
                "preferred_languages": [
                  "de",
                  "en"
                ]
              }
            }
          }
        }
      }
    },
    "/orgs/{organization}/domains/{domain}/hosted-spf": {
      "get": {
        "operationId": "showHostedSpf",
        "tags": [
          "Domains"
        ],
        "summary": "SPF-Flattening der Domain",
        "description": "Stand des gehosteten SPF-Flattenings: die Quelle (`source_record`), die aufgelösten Netze (`networks`), die TXT-Records unter `_spf.<domain>` (bei langen Ergebnissen geteilt in `_spf1`, `_spf2` …, `records`), der SPF-Record, den der Kunde an der Domain setzt (`pointer`), DNS-Lookups vorher und nachher, Hinweise, Fehler der letzten Auflösung und der Verlauf der Änderungen. `published` und `pointer_active` kommen frisch aus dem DNS. Ausgeschaltet (`enabled: false`) eine Vorschau aus dem SPF-Record der Domain, `error` sagt dann, warum sie sich nicht abflachen lässt (Makros, `exists`, `ptr`, Schleifen, Grenzen). Nicht für Kundenzugänge.\n\nLese-Token genügt (`read`).",
        "x-scope": "read",
        "parameters": [
          {
            "name": "organization",
            "in": "path",
            "required": true,
            "description": "Slug der Organisation, steht in der Adresse des Dashboards und unter Einstellungen → Integrationen → API-Tokens. Ein Token erreicht nur seine eigene Organisation, andere antworten mit 404.",
            "schema": {
              "type": "string",
              "example": "meine-agentur"
            }
          },
          {
            "name": "domain",
            "in": "path",
            "required": true,
            "description": "ID der Domain",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Erfolg",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "additionalProperties": true
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        }
      },
      "put": {
        "operationId": "updateHostedSpf",
        "tags": [
          "Domains"
        ],
        "summary": "SPF-Flattening einschalten",
        "description": "Schaltet das Flattening ein oder ändert die Quelle. Ohne `source` nimmt DomainWarn den SPF-Record der Domain (steht dort schon der Verweis auf `_spf.<domain>`, die bisherige Quelle). Lässt er sich nicht abflachen, 422 mit der Erklärung. Die Records beim DNS-Anbieter legt `applyHostingDns` mit der Funktion `spf` an: erst die Teile, zuletzt den Verweis an der Domain – den SPF-Record des Kunden ersetzt DomainWarn nur mit `replace: true`. Ab Freelancer (Tariffeature `hosted_spf`, sonst 402).\n\nBraucht ein Token mit Schreibrecht (`write`).\n\nEigenes Limit: 20 je Minute.",
        "x-scope": "write",
        "parameters": [
          {
            "name": "organization",
            "in": "path",
            "required": true,
            "description": "Slug der Organisation, steht in der Adresse des Dashboards und unter Einstellungen → Integrationen → API-Tokens. Ein Token erreicht nur seine eigene Organisation, andere antworten mit 404.",
            "schema": {
              "type": "string",
              "example": "meine-agentur"
            }
          },
          {
            "name": "domain",
            "in": "path",
            "required": true,
            "description": "ID der Domain",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Erfolg",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "additionalProperties": true
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [],
                "properties": {
                  "source": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "maxLength": 2048,
                    "description": "SPF-Record, den DomainWarn abflacht (beginnt mit v=spf1); ohne Angabe der Record der Domain"
                  }
                }
              },
              "example": {
                "source": "v=spf1 include:_spf.google.com include:spf.protection.outlook.com include:servers.mcsv.net -all"
              }
            }
          }
        }
      },
      "delete": {
        "operationId": "deleteHostedSpf",
        "tags": [
          "Domains"
        ],
        "summary": "SPF-Flattening ausschalten",
        "description": "DomainWarn zieht die Records danach nicht mehr nach. Solange der SPF-Record der Domain noch `_spf.<domain>` einbindet, 422 – erst den ursprünglichen Record wieder eintragen, sonst blieben die Netze eingefroren. Die Records unter `_spf.<domain>` bleiben stehen.\n\nBraucht ein Token mit Schreibrecht (`write`).",
        "x-scope": "write",
        "parameters": [
          {
            "name": "organization",
            "in": "path",
            "required": true,
            "description": "Slug der Organisation, steht in der Adresse des Dashboards und unter Einstellungen → Integrationen → API-Tokens. Ein Token erreicht nur seine eigene Organisation, andere antworten mit 404.",
            "schema": {
              "type": "string",
              "example": "meine-agentur"
            }
          },
          {
            "name": "domain",
            "in": "path",
            "required": true,
            "description": "ID der Domain",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Ausgeschaltet"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        }
      }
    },
    "/orgs/{organization}/domains/{domain}/hosted-spf/sync": {
      "post": {
        "operationId": "syncHostedSpf",
        "tags": [
          "Domains"
        ],
        "summary": "SPF-Flattening sofort neu auflösen",
        "description": "Löst sofort neu auf (sonst täglich und nach jeder SPF-Prüfung). `meta.result`: `changed` (neue Netze – mit eingeschaltetem Nachziehen stellt DomainWarn die Records um, sonst gibt es die Warnung „Abgeflachter SPF-Record veraltet“), `unchanged` oder `failed` (Grund in `data.error`, die veröffentlichten Netze bleiben). 422, wenn das Flattening aus ist.\n\nBraucht ein Token mit Schreibrecht (`write`).\n\nEigenes Limit: 6 je 10 Minuten und Domain.",
        "x-scope": "write",
        "parameters": [
          {
            "name": "organization",
            "in": "path",
            "required": true,
            "description": "Slug der Organisation, steht in der Adresse des Dashboards und unter Einstellungen → Integrationen → API-Tokens. Ein Token erreicht nur seine eigene Organisation, andere antworten mit 404.",
            "schema": {
              "type": "string",
              "example": "meine-agentur"
            }
          },
          {
            "name": "domain",
            "in": "path",
            "required": true,
            "description": "ID der Domain",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Erfolg",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "additionalProperties": true
                    },
                    "meta": {
                      "type": "object",
                      "properties": {
                        "result": {
                          "type": "string",
                          "enum": [
                            "changed",
                            "unchanged",
                            "failed"
                          ]
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        }
      }
    },
    "/orgs/{organization}/domains/{domain}/hosting": {
      "get": {
        "operationId": "showHostingOverview",
        "tags": [
          "Domains"
        ],
        "summary": "Gehostete Funktionen auf einen Blick",
        "description": "Stand von security.txt, MTA-STS und BIMI in einer Antwort, gedacht für Erweiterungen auf der Website (WordPress, Shopware): je Funktion `enabled`, `state` (wie im Dashboard: `off`, `pending`, `active`, `missing`, `outdated`, `elsewhere`, `unreachable`, `noMx`), die Seite im Dashboard (`dashboard_url`), bei security.txt das Ziel der Weiterleitung (`url`, nur solange ausgeliefert wird) und die Hostnamen, die weiterleiten sollen (`hosts`), bei MTA-STS und BIMI die Records zum Abschreiben (`records`). Nicht für Kundenzugänge.\n\nLese-Token genügt (`read`).",
        "x-scope": "read",
        "parameters": [
          {
            "name": "organization",
            "in": "path",
            "required": true,
            "description": "Slug der Organisation, steht in der Adresse des Dashboards und unter Einstellungen → Integrationen → API-Tokens. Ein Token erreicht nur seine eigene Organisation, andere antworten mit 404.",
            "schema": {
              "type": "string",
              "example": "meine-agentur"
            }
          },
          {
            "name": "domain",
            "in": "path",
            "required": true,
            "description": "ID der Domain",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Erfolg",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "additionalProperties": true
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        }
      }
    },
    "/orgs/{organization}/domains/{domain}/mail-reports": {
      "get": {
        "operationId": "listMailReports",
        "tags": [
          "Domains"
        ],
        "summary": "DMARC- und TLS-RPT-Berichte",
        "description": "Kennzahlen der eingegangenen Berichte: Nachrichten, ausgerichtet, Quellen je IP mit DKIM- und SPF-Ergebnis, TLS-Sitzungen und Fehlschläge. Die Berichtsadresse der Domain steht in der Antwort.\n\nLese-Token genügt (`read`).",
        "x-scope": "read",
        "parameters": [
          {
            "name": "organization",
            "in": "path",
            "required": true,
            "description": "Slug der Organisation, steht in der Adresse des Dashboards und unter Einstellungen → Integrationen → API-Tokens. Ein Token erreicht nur seine eigene Organisation, andere antworten mit 404.",
            "schema": {
              "type": "string",
              "example": "meine-agentur"
            }
          },
          {
            "name": "domain",
            "in": "path",
            "required": true,
            "description": "ID der Domain",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "days",
            "in": "query",
            "required": false,
            "description": "Zeitraum in Tagen (1 bis 90, Vorgabe 30)",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 90,
              "default": 30
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Erfolg",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "additionalProperties": true
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        }
      },
      "post": {
        "operationId": "uploadMailReport",
        "tags": [
          "Domains"
        ],
        "summary": "Bericht hochladen",
        "description": "Für Domains ohne Postfach: ein DMARC-Aggregatbericht (XML, gzip, ZIP oder die ganze Mail) oder ein TLS-RPT-Bericht (JSON). Doppelte Berichte werden erkannt.\n\nBraucht ein Token mit Schreibrecht (`write`).",
        "x-scope": "write",
        "parameters": [
          {
            "name": "organization",
            "in": "path",
            "required": true,
            "description": "Slug der Organisation, steht in der Adresse des Dashboards und unter Einstellungen → Integrationen → API-Tokens. Ein Token erreicht nur seine eigene Organisation, andere antworten mit 404.",
            "schema": {
              "type": "string",
              "example": "meine-agentur"
            }
          },
          {
            "name": "domain",
            "in": "path",
            "required": true,
            "description": "ID der Domain",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Erfolg",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "additionalProperties": true
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [],
                "properties": {
                  "content": {
                    "type": "string",
                    "description": "Bericht als Text (XML, JSON oder Mail)"
                  },
                  "content_base64": {
                    "type": "string",
                    "description": "Bericht als Base64 (gzip, ZIP)"
                  },
                  "filename": {
                    "type": "string",
                    "maxLength": 190,
                    "description": "Dateiname, hilft bei der Zuordnung"
                  }
                }
              },
              "example": {
                "content": "<?xml version=\"1.0\"?><feedback>…</feedback>",
                "filename": "google.com!kunde.de!1!2.xml"
              }
            }
          }
        }
      }
    },
    "/orgs/{organization}/domains/{domain}/mail-tests": {
      "get": {
        "operationId": "listMailTests",
        "tags": [
          "Domains"
        ],
        "summary": "Mail-Tests der Domain",
        "description": "Die letzten 20 Mail-Tests der Domain (30 Tage aufbewahrt), neueste zuerst: Einmal-Adresse, Stand (`waiting`, `received`, `expired`, `failed`), Punktzahl 0–100 und die Auswertung in `result` (SPF, DKIM je Signatur, DMARC mit Alignment, TLS, Reverse DNS, Blacklist, übersetzte Befunde). `meta.available` sagt, ob der Test auf dieser Instanz eingerichtet ist.\n\nLese-Token genügt (`read`).",
        "x-scope": "read",
        "parameters": [
          {
            "name": "organization",
            "in": "path",
            "required": true,
            "description": "Slug der Organisation, steht in der Adresse des Dashboards und unter Einstellungen → Integrationen → API-Tokens. Ein Token erreicht nur seine eigene Organisation, andere antworten mit 404.",
            "schema": {
              "type": "string",
              "example": "meine-agentur"
            }
          },
          {
            "name": "domain",
            "in": "path",
            "required": true,
            "description": "ID der Domain",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Erfolg",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "additionalProperties": true
                      }
                    },
                    "meta": {
                      "type": "object",
                      "additionalProperties": true
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        }
      },
      "post": {
        "operationId": "startMailTest",
        "tags": [
          "Domains"
        ],
        "summary": "Mail-Test starten",
        "description": "Legt eine Einmal-Adresse an, eine Stunde gültig. Eine Mail an diese Adresse wird ausgewertet, sobald sie ankommt; den Stand liefert der Abruf des Tests. Antwortet mit 503, wenn auf dieser Instanz kein Berichtspostfach eingerichtet ist.\n\nBraucht ein Token mit Schreibrecht (`write`).\n\nEigenes Limit: 30 je Organisation und Stunde.",
        "x-scope": "write",
        "parameters": [
          {
            "name": "organization",
            "in": "path",
            "required": true,
            "description": "Slug der Organisation, steht in der Adresse des Dashboards und unter Einstellungen → Integrationen → API-Tokens. Ein Token erreicht nur seine eigene Organisation, andere antworten mit 404.",
            "schema": {
              "type": "string",
              "example": "meine-agentur"
            }
          },
          {
            "name": "domain",
            "in": "path",
            "required": true,
            "description": "ID der Domain",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "201": {
            "description": "Angelegt",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "additionalProperties": true
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        }
      }
    },
    "/orgs/{organization}/domains/{domain}/mail-tests/{mailTest}": {
      "get": {
        "operationId": "showMailTest",
        "tags": [
          "Domains"
        ],
        "summary": "Mail-Test abrufen",
        "description": "Stand und Auswertung eines Tests. Solange er wartet, sieht der Abruf gezielt im Postfach nach (höchstens alle fünf Sekunden je Test).\n\nLese-Token genügt (`read`).\n\nEigenes Limit: 30 je Minute.",
        "x-scope": "read",
        "parameters": [
          {
            "name": "organization",
            "in": "path",
            "required": true,
            "description": "Slug der Organisation, steht in der Adresse des Dashboards und unter Einstellungen → Integrationen → API-Tokens. Ein Token erreicht nur seine eigene Organisation, andere antworten mit 404.",
            "schema": {
              "type": "string",
              "example": "meine-agentur"
            }
          },
          {
            "name": "domain",
            "in": "path",
            "required": true,
            "description": "ID der Domain",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Erfolg",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "additionalProperties": true
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        }
      }
    },
    "/orgs/{organization}/domains/{domain}/dmarc-assistant": {
      "get": {
        "operationId": "showDmarcAssistant",
        "tags": [
          "Domains"
        ],
        "summary": "DMARC-Assistent",
        "description": "Wertet die DMARC-Berichte im Zeitfenster aus (Nachrichten, Quote legitimer Nachrichten, Quellen je IP mit Einordnung `aligned`, `partial`, `unaligned` oder `unauthenticated`, Tage mit Daten) und empfiehlt den nächsten Schritt von `p=none` über `quarantine` zu `reject` (mit pct-Rampe 25/50/100, wenn der Record pct nutzt; ein schwächeres `sp` wandert mit). `recommendation.status`: `not_checked`, `no_record`, `invalid_record`, `no_reports`, `collecting`, `blocked`, `ready` oder `done`; `checks` nennt jede Voraussetzung (Tage mit Berichten seit der aktuellen Policy, Mindestzahl an Nachrichten, 98 % bestanden, kein nennenswerter legitim wirkender Absender, der durchfällt). `proposed` ist der Record nach dem Schritt, alle anderen Tags bleiben. `meta` mit Integrationen nur für das Team der Agentur.\n\nLese-Token genügt (`read`).",
        "x-scope": "read",
        "parameters": [
          {
            "name": "organization",
            "in": "path",
            "required": true,
            "description": "Slug der Organisation, steht in der Adresse des Dashboards und unter Einstellungen → Integrationen → API-Tokens. Ein Token erreicht nur seine eigene Organisation, andere antworten mit 404.",
            "schema": {
              "type": "string",
              "example": "meine-agentur"
            }
          },
          {
            "name": "domain",
            "in": "path",
            "required": true,
            "description": "ID der Domain",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "days",
            "in": "query",
            "required": false,
            "description": "Zeitfenster in Tagen (Vorgabe 30)",
            "schema": {
              "type": "integer",
              "minimum": 14,
              "maximum": 90
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Erfolg",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "report_address": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "description": "Berichtsadresse der Domain bei DomainWarn"
                        },
                        "rua_has_address": {
                          "type": "boolean",
                          "description": "Die Berichtsadresse steht schon in rua"
                        },
                        "analysis": {
                          "type": "object",
                          "additionalProperties": true
                        },
                        "recommendation": {
                          "type": "object",
                          "properties": {
                            "status": {
                              "type": "string",
                              "description": "Stand der Empfehlung",
                              "enum": [
                                "not_checked",
                                "no_record",
                                "invalid_record",
                                "no_reports",
                                "collecting",
                                "blocked",
                                "ready",
                                "done"
                              ]
                            },
                            "step": {
                              "type": [
                                "string",
                                "null"
                              ],
                              "enum": [
                                "enforce",
                                "pct",
                                "reject",
                                "subdomains",
                                null
                              ]
                            },
                            "proposed": {
                              "type": [
                                "string",
                                "null"
                              ],
                              "description": "Record nach dem Schritt"
                            },
                            "checks": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "key": {
                                    "type": "string"
                                  },
                                  "ok": {
                                    "type": "boolean"
                                  },
                                  "value": {
                                    "type": [
                                      "number",
                                      "null"
                                    ]
                                  },
                                  "required": {
                                    "type": "number"
                                  }
                                }
                              }
                            }
                          }
                        },
                        "rua_proposal": {
                          "type": [
                            "object",
                            "null"
                          ],
                          "description": "Record mit der Berichtsadresse als weiterem rua-Ziel"
                        }
                      }
                    },
                    "meta": {
                      "type": [
                        "object",
                        "null"
                      ]
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        }
      }
    },
    "/orgs/{organization}/domains/{domain}/dmarc-assistant/preview": {
      "get": {
        "operationId": "previewDmarcAssistant",
        "tags": [
          "DNS"
        ],
        "summary": "DMARC-Schritt beim DNS-Anbieter prüfen",
        "description": "Liest den DMARC-Record beim Anbieter der Integration und zeigt, was ein Klick daraus machen würde (`current`, `proposed`, `changes`), ohne etwas zu ändern. `status` `ready` oder `blocked` mit `reason`: `missing`, `multiple`, `changed` (weicht von der letzten Prüfung ab), `not_ready`, `unauthorized`, `no_address` oder `up_to_date`. Kundenzugänge sehen das nicht.\n\nLese-Token genügt (`read`).\n\nEigenes Limit: 30 je Minute.",
        "x-scope": "read",
        "parameters": [
          {
            "name": "organization",
            "in": "path",
            "required": true,
            "description": "Slug der Organisation, steht in der Adresse des Dashboards und unter Einstellungen → Integrationen → API-Tokens. Ein Token erreicht nur seine eigene Organisation, andere antworten mit 404.",
            "schema": {
              "type": "string",
              "example": "meine-agentur"
            }
          },
          {
            "name": "domain",
            "in": "path",
            "required": true,
            "description": "ID der Domain",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "integration_id",
            "in": "query",
            "required": true,
            "description": "Integration der Organisation, bei deren Anbieter die Zone liegt",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "action",
            "in": "query",
            "required": true,
            "description": "advance: nächster Policy-Schritt; add_rua: Berichtsadresse als weiteres rua-Ziel",
            "schema": {
              "type": "string",
              "enum": [
                "advance",
                "add_rua"
              ]
            }
          },
          {
            "name": "days",
            "in": "query",
            "required": false,
            "description": "Zeitfenster der Empfehlung (Vorgabe 30)",
            "schema": {
              "type": "integer",
              "minimum": 14,
              "maximum": 90
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Erfolg",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "status": {
                          "type": "string",
                          "description": "Was ein Klick täte",
                          "enum": [
                            "ready",
                            "blocked"
                          ]
                        },
                        "reason": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "name": {
                          "type": "string",
                          "description": "Name des Records"
                        },
                        "current": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "proposed": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "changes": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "tag": {
                                "type": "string"
                              },
                              "from": {
                                "type": [
                                  "string",
                                  "null"
                                ]
                              },
                              "to": {
                                "type": [
                                  "string",
                                  "null"
                                ]
                              }
                            }
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        }
      }
    },
    "/orgs/{organization}/domains/{domain}/dmarc-assistant/apply": {
      "post": {
        "operationId": "applyDmarcAssistant",
        "tags": [
          "DNS"
        ],
        "summary": "DMARC-Schritt beim DNS-Anbieter umsetzen",
        "description": "Ändert genau den einen vorhandenen DMARC-Record so, wie die Vorschau es zeigt. Verlangt `confirm: true` und `expected` (den Inhalt aus `current` der Vorschau): Steht beim Anbieter inzwischen etwas anderes, gibt es keinen oder mehrere DMARC-Records oder ist der Schritt nicht empfohlen, antwortet der Server mit 422. Nur `p`, `pct` und `sp` (bzw. `rua`) ändern sich; DomainWarn legt keine Records an und löscht keine.\n\nBraucht ein Token mit Schreibrecht (`write`).\n\nEigenes Limit: 20 je Minute.",
        "x-scope": "write",
        "parameters": [
          {
            "name": "organization",
            "in": "path",
            "required": true,
            "description": "Slug der Organisation, steht in der Adresse des Dashboards und unter Einstellungen → Integrationen → API-Tokens. Ein Token erreicht nur seine eigene Organisation, andere antworten mit 404.",
            "schema": {
              "type": "string",
              "example": "meine-agentur"
            }
          },
          {
            "name": "domain",
            "in": "path",
            "required": true,
            "description": "ID der Domain",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Record geändert",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "action": {
                          "type": "string"
                        },
                        "zone": {
                          "type": "string"
                        },
                        "name": {
                          "type": "string"
                        },
                        "previous": {
                          "type": "string",
                          "description": "Record vorher"
                        },
                        "content": {
                          "type": "string",
                          "description": "Record jetzt"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "integration_id",
                  "action",
                  "expected",
                  "confirm"
                ],
                "properties": {
                  "integration_id": {
                    "type": "string",
                    "format": "uuid",
                    "description": "Integration der Organisation"
                  },
                  "action": {
                    "type": "string",
                    "enum": [
                      "advance",
                      "add_rua"
                    ],
                    "description": "Wie bei der Vorschau"
                  },
                  "expected": {
                    "type": "string",
                    "description": "Der DMARC-Record, wie die Vorschau ihn gelesen hat"
                  },
                  "confirm": {
                    "type": "boolean",
                    "description": "Ausdrückliche Bestätigung"
                  },
                  "days": {
                    "type": "integer",
                    "minimum": 14,
                    "maximum": 90,
                    "description": "Zeitfenster der Empfehlung (Vorgabe 30)"
                  }
                }
              },
              "example": {
                "integration_id": "3f9c1a52-6a2e-4c0e-9d4b-1c9a1a0e5b77",
                "action": "advance",
                "expected": "v=DMARC1; p=none; rua=mailto:dmarc@kunde.de",
                "confirm": true
              }
            }
          }
        }
      }
    },
    "/orgs/{organization}/domains/{domain}/mail-reports/connect/preview": {
      "get": {
        "operationId": "previewMailReportsConnect",
        "tags": [
          "DNS"
        ],
        "summary": "Berichtsadresse beim DNS-Anbieter prüfen",
        "description": "Liest DMARC-Record (`_dmarc`) und TLS-RPT-Record (`_smtp._tls`) beim Anbieter der Integration und zeigt je Record, was ein Klick daraus machen würde (`current`, `proposed`, `changes`, `operation` `update` oder `create`), ohne etwas zu ändern. `mode` `add` trägt die Berichtsadresse zusätzlich ein, `replace` als einziges rua-Ziel. `status` `ready` oder `blocked` mit `reason`: `missing` (kein DMARC-Record), `multiple`, `invalid`, `unauthorized` (Berichtsdomain nimmt keine fremden Berichte an), `no_address` oder `up_to_date`. Kundenzugänge sehen das nicht.\n\nLese-Token genügt (`read`).\n\nEigenes Limit: 30 je Minute.",
        "x-scope": "read",
        "parameters": [
          {
            "name": "organization",
            "in": "path",
            "required": true,
            "description": "Slug der Organisation, steht in der Adresse des Dashboards und unter Einstellungen → Integrationen → API-Tokens. Ein Token erreicht nur seine eigene Organisation, andere antworten mit 404.",
            "schema": {
              "type": "string",
              "example": "meine-agentur"
            }
          },
          {
            "name": "domain",
            "in": "path",
            "required": true,
            "description": "ID der Domain",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "integration_id",
            "in": "query",
            "required": true,
            "description": "Integration der Organisation, bei deren Anbieter die Zone liegt",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "mode",
            "in": "query",
            "required": true,
            "description": "add: zusätzlich zu vorhandenen Zielen; replace: einziges rua-Ziel",
            "schema": {
              "type": "string",
              "enum": [
                "add",
                "replace"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Erfolg",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "mode": {
                          "type": "string"
                        },
                        "address": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "records": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string",
                                "description": "dmarc oder tls_rpt",
                                "enum": [
                                  "dmarc",
                                  "tls_rpt"
                                ]
                              },
                              "name": {
                                "type": "string",
                                "description": "Name des Records"
                              },
                              "status": {
                                "type": "string",
                                "description": "Was ein Klick täte",
                                "enum": [
                                  "ready",
                                  "blocked"
                                ]
                              },
                              "reason": {
                                "type": [
                                  "string",
                                  "null"
                                ]
                              },
                              "operation": {
                                "type": [
                                  "string",
                                  "null"
                                ],
                                "enum": [
                                  "update",
                                  "create",
                                  null
                                ]
                              },
                              "current": {
                                "type": [
                                  "string",
                                  "null"
                                ]
                              },
                              "proposed": {
                                "type": [
                                  "string",
                                  "null"
                                ]
                              }
                            }
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        }
      }
    },
    "/orgs/{organization}/domains/{domain}/mail-reports/connect": {
      "post": {
        "operationId": "applyMailReportsConnect",
        "tags": [
          "DNS"
        ],
        "summary": "Berichtsadresse beim DNS-Anbieter eintragen",
        "description": "Schreibt alle Records, die die Vorschau als `ready` zeigt: den vorhandenen DMARC-Record (nur `rua` ändert sich) und den TLS-RPT-Record (wird angelegt, wenn er fehlt). Verlangt `confirm: true` und `expected` mit dem Inhalt aus `current` der Vorschau je Record (`null`, wenn dort keiner stand): Steht beim Anbieter inzwischen etwas anderes oder ist nichts zu tun, antwortet der Server mit 422. DomainWarn löscht keine Records.\n\nBraucht ein Token mit Schreibrecht (`write`).\n\nEigenes Limit: 20 je Minute.",
        "x-scope": "write",
        "parameters": [
          {
            "name": "organization",
            "in": "path",
            "required": true,
            "description": "Slug der Organisation, steht in der Adresse des Dashboards und unter Einstellungen → Integrationen → API-Tokens. Ein Token erreicht nur seine eigene Organisation, andere antworten mit 404.",
            "schema": {
              "type": "string",
              "example": "meine-agentur"
            }
          },
          {
            "name": "domain",
            "in": "path",
            "required": true,
            "description": "ID der Domain",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Records geschrieben",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "zone": {
                          "type": "string"
                        },
                        "mode": {
                          "type": "string"
                        },
                        "records": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "name": {
                                "type": "string"
                              },
                              "operation": {
                                "type": "string"
                              },
                              "previous": {
                                "type": [
                                  "string",
                                  "null"
                                ]
                              },
                              "content": {
                                "type": "string",
                                "description": "Record jetzt"
                              }
                            }
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "integration_id",
                  "mode",
                  "expected",
                  "confirm"
                ],
                "properties": {
                  "integration_id": {
                    "type": "string",
                    "format": "uuid",
                    "description": "Integration der Organisation"
                  },
                  "mode": {
                    "type": "string",
                    "enum": [
                      "add",
                      "replace"
                    ],
                    "description": "Wie bei der Vorschau"
                  },
                  "expected": {
                    "type": "object",
                    "properties": {
                      "dmarc": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "tls_rpt": {
                        "type": [
                          "string",
                          "null"
                        ]
                      }
                    },
                    "description": "Die Records, wie die Vorschau sie gelesen hat"
                  },
                  "confirm": {
                    "type": "boolean",
                    "description": "Ausdrückliche Bestätigung"
                  }
                }
              },
              "example": {
                "integration_id": "3f9c1a52-6a2e-4c0e-9d4b-1c9a1a0e5b77",
                "mode": "add",
                "expected": {
                  "dmarc": "v=DMARC1; p=quarantine; rua=mailto:dmarc@kunde.de",
                  "tls_rpt": null
                },
                "confirm": true
              }
            }
          }
        }
      }
    },
    "/orgs/{organization}/domains/{domain}/monitors": {
      "get": {
        "operationId": "listMonitors",
        "tags": [
          "Monitore"
        ],
        "summary": "Monitore einer Domain",
        "description": "Alle Monitore der Domain mit Zustand, letzten Befunden und Rohdaten, sortiert nach Prüfart und Ziel.\n\nLese-Token genügt (`read`).",
        "x-scope": "read",
        "parameters": [
          {
            "name": "organization",
            "in": "path",
            "required": true,
            "description": "Slug der Organisation, steht in der Adresse des Dashboards und unter Einstellungen → Integrationen → API-Tokens. Ein Token erreicht nur seine eigene Organisation, andere antworten mit 404.",
            "schema": {
              "type": "string",
              "example": "meine-agentur"
            }
          },
          {
            "name": "domain",
            "in": "path",
            "required": true,
            "description": "ID der Domain",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Erfolg",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Monitor"
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        }
      },
      "post": {
        "operationId": "createMonitor",
        "tags": [
          "Monitore"
        ],
        "summary": "Monitor anlegen",
        "description": "Zusätzlicher Monitor, etwa eine weitere URL oder ein Mailserver-Zertifikat. Ziele müssen zur Domain gehören; nur bei `tls` ist jeder öffentliche Hostname erlaubt. Das Intervall wird auf das Minimum des Tarifs begrenzt.\n\nBraucht ein Token mit Schreibrecht (`write`).",
        "x-scope": "write",
        "parameters": [
          {
            "name": "organization",
            "in": "path",
            "required": true,
            "description": "Slug der Organisation, steht in der Adresse des Dashboards und unter Einstellungen → Integrationen → API-Tokens. Ein Token erreicht nur seine eigene Organisation, andere antworten mit 404.",
            "schema": {
              "type": "string",
              "example": "meine-agentur"
            }
          },
          {
            "name": "domain",
            "in": "path",
            "required": true,
            "description": "ID der Domain",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "201": {
            "description": "Angelegt",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Monitor"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "type",
                  "target"
                ],
                "properties": {
                  "type": {
                    "type": "string",
                    "enum": [
                      "http",
                      "tls",
                      "dns",
                      "mx",
                      "spf",
                      "dmarc",
                      "domain",
                      "dkim",
                      "dnssec",
                      "mta_sts",
                      "blacklist",
                      "tls_rpt",
                      "bimi",
                      "smtp",
                      "reverse_dns",
                      "ct_log",
                      "redirects",
                      "caa",
                      "nameservers",
                      "ipv6",
                      "dane",
                      "cms",
                      "privacy",
                      "pagespeed",
                      "heartbeat",
                      "security_txt",
                      "ports",
                      "lookalike",
                      "crawl",
                      "journey"
                    ],
                    "description": "Prüfart"
                  },
                  "target": {
                    "type": "string",
                    "maxLength": 255,
                    "description": "URL (http) oder Hostname; ohne Schema wird https:// ergänzt"
                  },
                  "interval_seconds": {
                    "type": "integer",
                    "minimum": 60,
                    "maximum": 604800,
                    "description": "Prüfintervall in Sekunden"
                  },
                  "config": {
                    "type": "object",
                    "properties": {
                      "port": {
                        "type": "integer",
                        "enum": [
                          443,
                          8443,
                          465,
                          587,
                          25,
                          993,
                          143,
                          995,
                          110
                        ]
                      },
                      "starttls": {
                        "type": [
                          "string",
                          "null"
                        ],
                        "enum": [
                          "smtp",
                          "imap",
                          "pop3",
                          null
                        ]
                      }
                    },
                    "description": "Nur bei tls: Port und STARTTLS-Protokoll"
                  }
                }
              },
              "example": {
                "type": "tls",
                "target": "mail.kunde.de",
                "config": {
                  "port": 587,
                  "starttls": "smtp"
                }
              }
            }
          }
        }
      }
    },
    "/orgs/{organization}/monitors/{monitor}": {
      "patch": {
        "operationId": "updateMonitor",
        "tags": [
          "Monitore"
        ],
        "summary": "Monitor ändern",
        "description": "Intervall, Aktivierung und Konfiguration je Prüfart: `expected_status` und `slow_ms` (http), `selectors` (dkim). Ein deaktivierter Monitor schließt seine offenen Meldungen.\n\nBraucht ein Token mit Schreibrecht (`write`).",
        "x-scope": "write",
        "parameters": [
          {
            "name": "organization",
            "in": "path",
            "required": true,
            "description": "Slug der Organisation, steht in der Adresse des Dashboards und unter Einstellungen → Integrationen → API-Tokens. Ein Token erreicht nur seine eigene Organisation, andere antworten mit 404.",
            "schema": {
              "type": "string",
              "example": "meine-agentur"
            }
          },
          {
            "name": "monitor",
            "in": "path",
            "required": true,
            "description": "ID des Monitors",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Erfolg",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Monitor"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [],
                "properties": {
                  "interval_seconds": {
                    "type": "integer",
                    "minimum": 60,
                    "maximum": 604800,
                    "description": "Prüfintervall in Sekunden"
                  },
                  "is_enabled": {
                    "type": "boolean",
                    "description": "Aktiv"
                  },
                  "config": {
                    "type": "object",
                    "properties": {
                      "expected_status": {
                        "type": "array",
                        "items": {
                          "type": "integer",
                          "minimum": 100,
                          "maximum": 599
                        }
                      },
                      "slow_ms": {
                        "type": "integer",
                        "minimum": 100,
                        "maximum": 60000
                      },
                      "selectors": {
                        "type": "array",
                        "items": {
                          "type": "string",
                          "maxLength": 63
                        },
                        "maxItems": 20
                      }
                    },
                    "description": "Erwartete HTTP-Status, Schwelle für „langsam“ in ms (http) oder DKIM-Selektoren (dkim)"
                  }
                }
              },
              "example": {
                "config": {
                  "expected_status": [
                    200,
                    301
                  ],
                  "slow_ms": 2000
                }
              }
            }
          }
        }
      },
      "delete": {
        "operationId": "deleteMonitor",
        "tags": [
          "Monitore"
        ],
        "summary": "Monitor löschen",
        "description": "Entfernt den Monitor und schließt seine offenen Meldungen.\n\nBraucht ein Token mit Schreibrecht (`write`).",
        "x-scope": "write",
        "parameters": [
          {
            "name": "organization",
            "in": "path",
            "required": true,
            "description": "Slug der Organisation, steht in der Adresse des Dashboards und unter Einstellungen → Integrationen → API-Tokens. Ein Token erreicht nur seine eigene Organisation, andere antworten mit 404.",
            "schema": {
              "type": "string",
              "example": "meine-agentur"
            }
          },
          {
            "name": "monitor",
            "in": "path",
            "required": true,
            "description": "ID des Monitors",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Gelöscht, keine Antwort"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        }
      }
    },
    "/orgs/{organization}/domains/{domain}/journeys": {
      "get": {
        "operationId": "listJourneys",
        "tags": [
          "Monitore"
        ],
        "summary": "Klickwege einer Domain",
        "description": "Klickwege (Transaktionsprüfungen) der Domain: ein echter Browser lädt die Startadresse und arbeitet die Schritte ab (Produkt in den Warenkorb, zur Kasse, Login). Alle 15 Minuten; ein Fehlschlag wird durch einen zweiten Lauf bestätigt, erst dann entsteht die Meldung `journey_failed`. Ab Tarif Agency (einer je Domain, Agency Pro drei).\n\nLese-Token genügt (`read`).",
        "x-scope": "read",
        "parameters": [
          {
            "name": "organization",
            "in": "path",
            "required": true,
            "description": "Slug der Organisation, steht in der Adresse des Dashboards und unter Einstellungen → Integrationen → API-Tokens. Ein Token erreicht nur seine eigene Organisation, andere antworten mit 404.",
            "schema": {
              "type": "string",
              "example": "meine-agentur"
            }
          },
          {
            "name": "domain",
            "in": "path",
            "required": true,
            "description": "ID der Domain",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Erfolg",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Journey"
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        }
      },
      "post": {
        "operationId": "createJourney",
        "tags": [
          "Monitore"
        ],
        "summary": "Klickweg anlegen",
        "description": "Name, Startadresse (muss zur Domain gehören) und Schritte. Werte von fill-Schritten werden verschlüsselt gespeichert und nie zurückgegeben. Ohne das Tariffeature `journeys` antwortet die API mit 402, über dem Limit je Domain mit 422.\n\nBraucht ein Token mit Schreibrecht (`write`).",
        "x-scope": "write",
        "parameters": [
          {
            "name": "organization",
            "in": "path",
            "required": true,
            "description": "Slug der Organisation, steht in der Adresse des Dashboards und unter Einstellungen → Integrationen → API-Tokens. Ein Token erreicht nur seine eigene Organisation, andere antworten mit 404.",
            "schema": {
              "type": "string",
              "example": "meine-agentur"
            }
          },
          {
            "name": "domain",
            "in": "path",
            "required": true,
            "description": "ID der Domain",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "201": {
            "description": "Angelegt",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Journey"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "name",
                  "start_url",
                  "steps"
                ],
                "properties": {
                  "name": {
                    "type": "string",
                    "maxLength": 80,
                    "description": "Name, je Domain eindeutig"
                  },
                  "start_url": {
                    "type": "string",
                    "maxLength": 2000,
                    "description": "Startadresse; ohne Schema wird https:// ergänzt"
                  },
                  "steps": {
                    "type": "array",
                    "items": {
                      "$ref": "#/components/schemas/JourneyStep"
                    },
                    "minItems": 1,
                    "maxItems": 30,
                    "description": "Schritte in Reihenfolge (1 bis 30)"
                  },
                  "slow_ms": {
                    "type": "integer",
                    "minimum": 1000,
                    "maximum": 90000,
                    "description": "Schwelle für „langsam“ in ms (Vorgabe 20000)"
                  },
                  "interval_seconds": {
                    "type": "integer",
                    "minimum": 60,
                    "maximum": 604800,
                    "description": "Prüfintervall in Sekunden (vom Tarif begrenzt)"
                  }
                }
              },
              "example": {
                "name": "Warenkorb bis Kasse",
                "start_url": "https://shop.kunde.de/",
                "steps": [
                  {
                    "type": "click",
                    "selector": ".product-box a.product-name"
                  },
                  {
                    "type": "click",
                    "selector": ".btn-buy"
                  },
                  {
                    "type": "expect_text",
                    "text": "Warenkorb"
                  },
                  {
                    "type": "goto",
                    "url": "/checkout/cart"
                  },
                  {
                    "type": "expect_url",
                    "contains": "/checkout"
                  }
                ]
              }
            }
          }
        }
      }
    },
    "/orgs/{organization}/domains/{domain}/journeys/test": {
      "post": {
        "operationId": "testJourney",
        "tags": [
          "Monitore"
        ],
        "summary": "Klickweg testen",
        "description": "Führt Startadresse und Schritte sofort im Browser aus, ohne etwas zu speichern (Budget 60 s), und liefert den Ausgang je Schritt; mit `journey` übernimmt ein fill-Schritt mit `keep_value` den gespeicherten Wert dieses Klickwegs. Höchstens 20 Testläufe je Domain und 60 je Organisation pro Stunde (429).\n\nBraucht ein Token mit Schreibrecht (`write`).",
        "x-scope": "write",
        "parameters": [
          {
            "name": "organization",
            "in": "path",
            "required": true,
            "description": "Slug der Organisation, steht in der Adresse des Dashboards und unter Einstellungen → Integrationen → API-Tokens. Ein Token erreicht nur seine eigene Organisation, andere antworten mit 404.",
            "schema": {
              "type": "string",
              "example": "meine-agentur"
            }
          },
          {
            "name": "domain",
            "in": "path",
            "required": true,
            "description": "ID der Domain",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Erfolg",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "additionalProperties": true,
                      "description": "ok, blocked, unavailable, reason, duration_ms, final_url, steps, failed_step"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "start_url",
                  "steps"
                ],
                "properties": {
                  "start_url": {
                    "type": "string",
                    "maxLength": 2000,
                    "description": "Startadresse"
                  },
                  "steps": {
                    "type": "array",
                    "items": {
                      "$ref": "#/components/schemas/JourneyStep"
                    },
                    "minItems": 1,
                    "maxItems": 30,
                    "description": "Schritte"
                  },
                  "journey": {
                    "type": "string",
                    "format": "uuid",
                    "description": "Gespeicherter Klickweg, dessen fill-Werte für keep_value gelten"
                  },
                  "slow_ms": {
                    "type": "integer",
                    "minimum": 1000,
                    "maximum": 90000,
                    "description": "Schwelle für „langsam“ in ms"
                  }
                }
              },
              "example": {
                "start_url": "https://shop.kunde.de/",
                "steps": [
                  {
                    "type": "click",
                    "text": "In den Warenkorb"
                  },
                  {
                    "type": "expect_text",
                    "text": "Warenkorb"
                  }
                ]
              }
            }
          }
        }
      }
    },
    "/orgs/{organization}/journeys/{journey}": {
      "get": {
        "operationId": "showJourney",
        "tags": [
          "Monitore"
        ],
        "summary": "Klickweg abrufen",
        "description": "Ein Klickweg mit Schritten (ohne fill-Werte), letztem Ergebnis je Schritt und den letzten Läufen.\n\nLese-Token genügt (`read`).",
        "x-scope": "read",
        "parameters": [
          {
            "name": "organization",
            "in": "path",
            "required": true,
            "description": "Slug der Organisation, steht in der Adresse des Dashboards und unter Einstellungen → Integrationen → API-Tokens. Ein Token erreicht nur seine eigene Organisation, andere antworten mit 404.",
            "schema": {
              "type": "string",
              "example": "meine-agentur"
            }
          },
          {
            "name": "journey",
            "in": "path",
            "required": true,
            "description": "ID des Klickwegs (zugleich die ID seines Monitors vom Typ journey)",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Erfolg",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Journey"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        }
      },
      "patch": {
        "operationId": "updateJourney",
        "tags": [
          "Monitore"
        ],
        "summary": "Klickweg ändern",
        "description": "Name, Startadresse, Schritte, Schwelle, Intervall und Aktivierung. Neue Schritte setzen die Fehlerserie zurück; ein fill-Schritt mit `keep_value` behält den gespeicherten Wert (gleicher Index und Selektor). Ein deaktivierter Klickweg schließt seine offenen Meldungen.\n\nBraucht ein Token mit Schreibrecht (`write`).",
        "x-scope": "write",
        "parameters": [
          {
            "name": "organization",
            "in": "path",
            "required": true,
            "description": "Slug der Organisation, steht in der Adresse des Dashboards und unter Einstellungen → Integrationen → API-Tokens. Ein Token erreicht nur seine eigene Organisation, andere antworten mit 404.",
            "schema": {
              "type": "string",
              "example": "meine-agentur"
            }
          },
          {
            "name": "journey",
            "in": "path",
            "required": true,
            "description": "ID des Klickwegs (zugleich die ID seines Monitors vom Typ journey)",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Erfolg",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Journey"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [],
                "properties": {
                  "name": {
                    "type": "string",
                    "maxLength": 80,
                    "description": "Name"
                  },
                  "start_url": {
                    "type": "string",
                    "maxLength": 2000,
                    "description": "Startadresse"
                  },
                  "steps": {
                    "type": "array",
                    "items": {
                      "$ref": "#/components/schemas/JourneyStep"
                    },
                    "minItems": 1,
                    "maxItems": 30,
                    "description": "Schritte"
                  },
                  "slow_ms": {
                    "type": "integer",
                    "minimum": 1000,
                    "maximum": 90000,
                    "description": "Schwelle für „langsam“ in ms"
                  },
                  "interval_seconds": {
                    "type": "integer",
                    "minimum": 60,
                    "maximum": 604800,
                    "description": "Prüfintervall in Sekunden"
                  },
                  "is_enabled": {
                    "type": "boolean",
                    "description": "Aktiv"
                  }
                }
              },
              "example": {
                "is_enabled": false
              }
            }
          }
        }
      },
      "delete": {
        "operationId": "deleteJourney",
        "tags": [
          "Monitore"
        ],
        "summary": "Klickweg löschen",
        "description": "Entfernt den Klickweg und schließt seine offenen Meldungen.\n\nBraucht ein Token mit Schreibrecht (`write`).",
        "x-scope": "write",
        "parameters": [
          {
            "name": "organization",
            "in": "path",
            "required": true,
            "description": "Slug der Organisation, steht in der Adresse des Dashboards und unter Einstellungen → Integrationen → API-Tokens. Ein Token erreicht nur seine eigene Organisation, andere antworten mit 404.",
            "schema": {
              "type": "string",
              "example": "meine-agentur"
            }
          },
          {
            "name": "journey",
            "in": "path",
            "required": true,
            "description": "ID des Klickwegs (zugleich die ID seines Monitors vom Typ journey)",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Gelöscht, keine Antwort"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        }
      }
    },
    "/orgs/{organization}/domains/{domain}/visual-monitors": {
      "get": {
        "operationId": "listVisualMonitors",
        "tags": [
          "Monitore"
        ],
        "summary": "Seitenbilder einer Domain",
        "description": "Visuelle Überwachung (Defacement-Schutz): ein echter Browser nimmt die Seite stündlich auf und vergleicht sie pixelgenau mit dem Referenzbild. Abweichungen über der Schwelle (`visual_changed`), typische Defacement-Formeln (`visual_defaced`) und ausgetauschter Inhalt (`visual_content_replaced`) werden durch einen zweiten Lauf bestätigt, dann entsteht die Meldung. Ab Tarif Agency (drei je Domain, Agency Pro zehn).\n\nLese-Token genügt (`read`).",
        "x-scope": "read",
        "parameters": [
          {
            "name": "organization",
            "in": "path",
            "required": true,
            "description": "Slug der Organisation, steht in der Adresse des Dashboards und unter Einstellungen → Integrationen → API-Tokens. Ein Token erreicht nur seine eigene Organisation, andere antworten mit 404.",
            "schema": {
              "type": "string",
              "example": "meine-agentur"
            }
          },
          {
            "name": "domain",
            "in": "path",
            "required": true,
            "description": "ID der Domain",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Erfolg",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/VisualMonitor"
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        }
      },
      "post": {
        "operationId": "createVisualMonitor",
        "tags": [
          "Monitore"
        ],
        "summary": "Seitenbild anlegen",
        "description": "Adresse (muss zur Domain gehören), Ansichten, Schwelle und Ausschlussbereiche. Der erste Lauf startet sofort und legt die Referenzbilder an. Ohne das Tariffeature `visual` antwortet die API mit 402, über dem Limit je Domain mit 422.\n\nBraucht ein Token mit Schreibrecht (`write`).",
        "x-scope": "write",
        "parameters": [
          {
            "name": "organization",
            "in": "path",
            "required": true,
            "description": "Slug der Organisation, steht in der Adresse des Dashboards und unter Einstellungen → Integrationen → API-Tokens. Ein Token erreicht nur seine eigene Organisation, andere antworten mit 404.",
            "schema": {
              "type": "string",
              "example": "meine-agentur"
            }
          },
          {
            "name": "domain",
            "in": "path",
            "required": true,
            "description": "ID der Domain",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "201": {
            "description": "Angelegt",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/VisualMonitor"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "url"
                ],
                "properties": {
                  "url": {
                    "type": "string",
                    "maxLength": 2000,
                    "description": "Adresse der Seite; ohne Schema wird https:// ergänzt"
                  },
                  "viewports": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "enum": [
                        "desktop",
                        "mobile"
                      ]
                    },
                    "minItems": 1,
                    "maxItems": 2,
                    "description": "Ansichten (Vorgabe desktop)"
                  },
                  "threshold_percent": {
                    "type": "number",
                    "minimum": 0.1,
                    "maximum": 50,
                    "description": "Schwelle in Prozent der Fläche (Vorgabe 2)"
                  },
                  "ignore_selectors": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "maxLength": 200
                    },
                    "maxItems": 20,
                    "description": "CSS-Selektoren wechselnder Bereiche (Slider, Datum, Werbung)"
                  },
                  "hide_cookie_banners": {
                    "type": "boolean",
                    "description": "Cookie-Banner vor der Aufnahme bestätigen und übrige übermalen (Vorgabe an)"
                  },
                  "interval_seconds": {
                    "type": "integer",
                    "minimum": 3600,
                    "maximum": 604800,
                    "description": "Prüfintervall in Sekunden"
                  }
                }
              },
              "example": {
                "url": "https://kunde.de/",
                "viewports": [
                  "desktop",
                  "mobile"
                ],
                "threshold_percent": 2,
                "ignore_selectors": [
                  ".hero-slider",
                  "#datum"
                ]
              }
            }
          }
        }
      }
    },
    "/orgs/{organization}/visual-monitors/{visualMonitor}": {
      "get": {
        "operationId": "showVisualMonitor",
        "tags": [
          "Monitore"
        ],
        "summary": "Seitenbild abrufen",
        "description": "Ein Seitenbild mit Referenz je Ansicht und den letzten Abweichungen; Bilder als signierte Adressen, die zwei Stunden gelten.\n\nLese-Token genügt (`read`).",
        "x-scope": "read",
        "parameters": [
          {
            "name": "organization",
            "in": "path",
            "required": true,
            "description": "Slug der Organisation, steht in der Adresse des Dashboards und unter Einstellungen → Integrationen → API-Tokens. Ein Token erreicht nur seine eigene Organisation, andere antworten mit 404.",
            "schema": {
              "type": "string",
              "example": "meine-agentur"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Erfolg",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/VisualMonitor"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        }
      },
      "patch": {
        "operationId": "updateVisualMonitor",
        "tags": [
          "Monitore"
        ],
        "summary": "Seitenbild ändern",
        "description": "Adresse, Ansichten, Schwelle, Ausschlussbereiche, Intervall und Aktivierung. Neue Adresse, Ausschlussbereiche oder Cookie-Banner-Einstellung verwerfen die bisherigen Bilder; der nächste Lauf legt neue Referenzen an.\n\nBraucht ein Token mit Schreibrecht (`write`).",
        "x-scope": "write",
        "parameters": [
          {
            "name": "organization",
            "in": "path",
            "required": true,
            "description": "Slug der Organisation, steht in der Adresse des Dashboards und unter Einstellungen → Integrationen → API-Tokens. Ein Token erreicht nur seine eigene Organisation, andere antworten mit 404.",
            "schema": {
              "type": "string",
              "example": "meine-agentur"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Erfolg",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/VisualMonitor"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [],
                "properties": {
                  "url": {
                    "type": "string",
                    "maxLength": 2000,
                    "description": "Adresse"
                  },
                  "viewports": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "enum": [
                        "desktop",
                        "mobile"
                      ]
                    },
                    "minItems": 1,
                    "maxItems": 2,
                    "description": "Ansichten"
                  },
                  "threshold_percent": {
                    "type": "number",
                    "minimum": 0.1,
                    "maximum": 50,
                    "description": "Schwelle in Prozent"
                  },
                  "ignore_selectors": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "maxLength": 200
                    },
                    "maxItems": 20,
                    "description": "Ausschlussbereiche"
                  },
                  "hide_cookie_banners": {
                    "type": "boolean",
                    "description": "Cookie-Banner bestätigen und übrige übermalen"
                  },
                  "interval_seconds": {
                    "type": "integer",
                    "minimum": 3600,
                    "maximum": 604800,
                    "description": "Prüfintervall in Sekunden"
                  },
                  "is_enabled": {
                    "type": "boolean",
                    "description": "Aktiv"
                  }
                }
              },
              "example": {
                "threshold_percent": 5
              }
            }
          }
        }
      },
      "delete": {
        "operationId": "deleteVisualMonitor",
        "tags": [
          "Monitore"
        ],
        "summary": "Seitenbild löschen",
        "description": "Entfernt das Seitenbild samt aller Bilder und schließt seine offenen Meldungen.\n\nBraucht ein Token mit Schreibrecht (`write`).",
        "x-scope": "write",
        "parameters": [
          {
            "name": "organization",
            "in": "path",
            "required": true,
            "description": "Slug der Organisation, steht in der Adresse des Dashboards und unter Einstellungen → Integrationen → API-Tokens. Ein Token erreicht nur seine eigene Organisation, andere antworten mit 404.",
            "schema": {
              "type": "string",
              "example": "meine-agentur"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Gelöscht, keine Antwort"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        }
      }
    },
    "/orgs/{organization}/visual-monitors/{visualMonitor}/accept": {
      "post": {
        "operationId": "acceptVisualMonitor",
        "tags": [
          "Monitore"
        ],
        "summary": "Abweichung als Referenz übernehmen",
        "description": "Macht die jüngste offene Abweichung je Ansicht (oder die mit `snapshot_id`) zum neuen Referenzbild und prüft sofort erneut; gleicht die Seite der neuen Referenz, schließt sich die Meldung. Ohne offene Abweichung 422.\n\nBraucht ein Token mit Schreibrecht (`write`).",
        "x-scope": "write",
        "parameters": [
          {
            "name": "organization",
            "in": "path",
            "required": true,
            "description": "Slug der Organisation, steht in der Adresse des Dashboards und unter Einstellungen → Integrationen → API-Tokens. Ein Token erreicht nur seine eigene Organisation, andere antworten mit 404.",
            "schema": {
              "type": "string",
              "example": "meine-agentur"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Erfolg",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/VisualMonitor"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [],
                "properties": {
                  "snapshot_id": {
                    "type": "string",
                    "format": "uuid",
                    "description": "Bestimmte Abweichung (id aus changes)"
                  }
                }
              },
              "example": {}
            }
          }
        }
      }
    },
    "/orgs/{organization}/maintenance-windows": {
      "get": {
        "operationId": "listMaintenanceWindows",
        "tags": [
          "Monitore"
        ],
        "summary": "Wartungsfenster auflisten",
        "description": "Alle Wartungsfenster der Organisation, aktive zuerst; mit `domain` nur die, die diese Domain betreffen (eigene, die ihres Kunden und die der ganzen Organisation).\n\nLese-Token genügt (`read`).",
        "x-scope": "read",
        "parameters": [
          {
            "name": "organization",
            "in": "path",
            "required": true,
            "description": "Slug der Organisation, steht in der Adresse des Dashboards und unter Einstellungen → Integrationen → API-Tokens. Ein Token erreicht nur seine eigene Organisation, andere antworten mit 404.",
            "schema": {
              "type": "string",
              "example": "meine-agentur"
            }
          },
          {
            "name": "domain",
            "in": "query",
            "required": false,
            "description": "Nur Fenster, die diese Domain betreffen",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Erfolg",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/MaintenanceWindow"
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        }
      },
      "post": {
        "operationId": "createMaintenanceWindow",
        "tags": [
          "Monitore"
        ],
        "summary": "Wartungsfenster anlegen",
        "description": "Einmalig (`starts_at`, `ends_at`) oder wöchentlich (`weekdays`, `time_from`, `time_to` in `timezone`). Mit `domain_id` gilt es für eine Domain, mit `customer_id` für alle Domains des Kunden, ohne beides für die ganze Organisation. Während des Fensters entstehen keine Meldungen und Benachrichtigungen.\n\nBraucht ein Token mit Schreibrecht (`write`).",
        "x-scope": "write",
        "parameters": [
          {
            "name": "organization",
            "in": "path",
            "required": true,
            "description": "Slug der Organisation, steht in der Adresse des Dashboards und unter Einstellungen → Integrationen → API-Tokens. Ein Token erreicht nur seine eigene Organisation, andere antworten mit 404.",
            "schema": {
              "type": "string",
              "example": "meine-agentur"
            }
          }
        ],
        "responses": {
          "201": {
            "description": "Angelegt",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/MaintenanceWindow"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "name",
                  "kind"
                ],
                "properties": {
                  "name": {
                    "type": "string",
                    "maxLength": 120,
                    "description": "Bezeichnung"
                  },
                  "kind": {
                    "type": "string",
                    "enum": [
                      "once",
                      "weekly"
                    ],
                    "description": "Einmalig oder wöchentlich"
                  },
                  "customer_id": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "format": "uuid",
                    "description": "Kunde, dessen Domains betroffen sind"
                  },
                  "domain_id": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "format": "uuid",
                    "description": "Einzelne Domain (setzt `customer_id` zurück)"
                  },
                  "starts_at": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "format": "date-time",
                    "description": "Beginn, einmalig (Pflicht bei `once`)"
                  },
                  "ends_at": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "format": "date-time",
                    "description": "Ende, einmalig, nach dem Beginn (Pflicht bei `once`)"
                  },
                  "weekdays": {
                    "type": [
                      "array",
                      "null"
                    ],
                    "items": {
                      "type": "integer",
                      "minimum": 1,
                      "maximum": 7
                    },
                    "maxItems": 7,
                    "description": "Wochentage 1 (Montag) bis 7 (Sonntag) (Pflicht bei `weekly`)"
                  },
                  "time_from": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "pattern": "^\\d{2}:\\d{2}$",
                    "description": "Beginn HH:MM (Pflicht bei `weekly`)"
                  },
                  "time_to": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "pattern": "^\\d{2}:\\d{2}$",
                    "description": "Ende HH:MM, ungleich Beginn; vor dem Beginn reicht das Fenster über Mitternacht (Pflicht bei `weekly`)"
                  },
                  "timezone": {
                    "type": "string",
                    "default": "Europe/Berlin",
                    "description": "Zeitzone für Wochentage und Uhrzeiten"
                  },
                  "is_enabled": {
                    "type": "boolean",
                    "default": true,
                    "description": "Aktiv"
                  }
                }
              },
              "example": {
                "name": "Nächtliches Deploy",
                "kind": "weekly",
                "customer_id": "3f9c1a52-6a2e-4c0e-9d4b-1c9a1a0e5b77",
                "weekdays": [
                  2,
                  4
                ],
                "time_from": "02:00",
                "time_to": "03:00",
                "timezone": "Europe/Berlin"
              }
            }
          }
        }
      }
    },
    "/orgs/{organization}/maintenance-windows/{window}": {
      "patch": {
        "operationId": "updateMaintenanceWindow",
        "tags": [
          "Monitore"
        ],
        "summary": "Wartungsfenster ändern",
        "description": "Dieselben Felder wie beim Anlegen, alle optional; nur mitgesendete Felder ändern sich. Die Regeln je Art gelten für den Stand nach der Änderung.\n\nBraucht ein Token mit Schreibrecht (`write`).",
        "x-scope": "write",
        "parameters": [
          {
            "name": "organization",
            "in": "path",
            "required": true,
            "description": "Slug der Organisation, steht in der Adresse des Dashboards und unter Einstellungen → Integrationen → API-Tokens. Ein Token erreicht nur seine eigene Organisation, andere antworten mit 404.",
            "schema": {
              "type": "string",
              "example": "meine-agentur"
            }
          },
          {
            "name": "window",
            "in": "path",
            "required": true,
            "description": "ID des Wartungsfensters",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Erfolg",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/MaintenanceWindow"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [],
                "properties": {
                  "name": {
                    "type": "string",
                    "maxLength": 120,
                    "description": "Bezeichnung"
                  },
                  "kind": {
                    "type": "string",
                    "enum": [
                      "once",
                      "weekly"
                    ],
                    "description": "Einmalig oder wöchentlich"
                  },
                  "customer_id": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "format": "uuid",
                    "description": "Kunde oder null"
                  },
                  "domain_id": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "format": "uuid",
                    "description": "Domain oder null"
                  },
                  "starts_at": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "format": "date-time",
                    "description": "Beginn, einmalig"
                  },
                  "ends_at": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "format": "date-time",
                    "description": "Ende, einmalig"
                  },
                  "weekdays": {
                    "type": [
                      "array",
                      "null"
                    ],
                    "items": {
                      "type": "integer",
                      "minimum": 1,
                      "maximum": 7
                    },
                    "maxItems": 7,
                    "description": "Wochentage 1 bis 7"
                  },
                  "time_from": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "pattern": "^\\d{2}:\\d{2}$",
                    "description": "Beginn HH:MM"
                  },
                  "time_to": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "pattern": "^\\d{2}:\\d{2}$",
                    "description": "Ende HH:MM"
                  },
                  "timezone": {
                    "type": "string",
                    "description": "Zeitzone"
                  },
                  "is_enabled": {
                    "type": "boolean",
                    "description": "Aktiv"
                  }
                }
              },
              "example": {
                "is_enabled": false
              }
            }
          }
        }
      },
      "delete": {
        "operationId": "deleteMaintenanceWindow",
        "tags": [
          "Monitore"
        ],
        "summary": "Wartungsfenster löschen",
        "description": "Braucht ein Token mit Schreibrecht (`write`).",
        "x-scope": "write",
        "parameters": [
          {
            "name": "organization",
            "in": "path",
            "required": true,
            "description": "Slug der Organisation, steht in der Adresse des Dashboards und unter Einstellungen → Integrationen → API-Tokens. Ein Token erreicht nur seine eigene Organisation, andere antworten mit 404.",
            "schema": {
              "type": "string",
              "example": "meine-agentur"
            }
          },
          {
            "name": "window",
            "in": "path",
            "required": true,
            "description": "ID des Wartungsfensters",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Gelöscht, keine Antwort"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        }
      }
    },
    "/orgs/{organization}/monitors/{monitor}/results": {
      "get": {
        "operationId": "listCheckResults",
        "tags": [
          "Monitore"
        ],
        "summary": "Prüfergebnisse",
        "description": "Einzelne Prüfungen eines Monitors, neueste zuerst, cursor-paginiert. Der Cursor der nächsten Seite steht in `links.next`.\n\nLese-Token genügt (`read`).",
        "x-scope": "read",
        "parameters": [
          {
            "name": "organization",
            "in": "path",
            "required": true,
            "description": "Slug der Organisation, steht in der Adresse des Dashboards und unter Einstellungen → Integrationen → API-Tokens. Ein Token erreicht nur seine eigene Organisation, andere antworten mit 404.",
            "schema": {
              "type": "string",
              "example": "meine-agentur"
            }
          },
          {
            "name": "monitor",
            "in": "path",
            "required": true,
            "description": "ID des Monitors",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "from",
            "in": "query",
            "required": false,
            "description": "Nur Prüfungen ab diesem Zeitpunkt",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "to",
            "in": "query",
            "required": false,
            "description": "Nur Prüfungen bis zu diesem Zeitpunkt; nicht vor `from` und höchstens 366 Tage danach",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "per_page",
            "in": "query",
            "required": false,
            "description": "Einträge je Seite (1 bis 500)",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 500,
              "default": 100
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "description": "Cursor der nächsten Seite aus `meta.next_cursor` der vorigen Antwort",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Erfolg",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/CheckResult"
                      }
                    },
                    "links": {
                      "type": "object",
                      "properties": {
                        "next": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "description": "Cursor der nächsten Seite"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        }
      }
    },
    "/orgs/{organization}/monitors/{monitor}/uptime": {
      "get": {
        "operationId": "getUptime",
        "tags": [
          "Monitore"
        ],
        "summary": "Verfügbarkeit und Antwortzeit",
        "description": "Verfügbarkeit, Antwortzeiten (Median, 95. Perzentil) und Ausfallzeit je Zeitraum, dazu Messpunkte für Diagramme.\n\nLese-Token genügt (`read`).",
        "x-scope": "read",
        "parameters": [
          {
            "name": "organization",
            "in": "path",
            "required": true,
            "description": "Slug der Organisation, steht in der Adresse des Dashboards und unter Einstellungen → Integrationen → API-Tokens. Ein Token erreicht nur seine eigene Organisation, andere antworten mit 404.",
            "schema": {
              "type": "string",
              "example": "meine-agentur"
            }
          },
          {
            "name": "monitor",
            "in": "path",
            "required": true,
            "description": "ID des Monitors",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "range",
            "in": "query",
            "required": false,
            "description": "Zeitraum",
            "schema": {
              "type": "string",
              "enum": [
                "24h",
                "7d",
                "30d",
                "90d"
              ],
              "default": "24h"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Erfolg",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Uptime"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        }
      }
    },
    "/orgs/{organization}/metrics": {
      "get": {
        "operationId": "getMetrics",
        "tags": [
          "Monitore"
        ],
        "summary": "Prometheus-Metriken",
        "description": "Zustand, Verfügbarkeit (24 h), Antwortzeit, Zertifikat- und Domainablauf sowie offene Meldungen aller Domains im Prometheus-Textformat (Version 0.0.4) für Grafana, Zabbix, Checkmk, PRTG & Co. Labels `domain`, `customer`, bei Monitoren `type` und `target`. 30 Abfragen je Minute.\n\nLese-Token genügt (`read`).",
        "x-scope": "read",
        "parameters": [
          {
            "name": "organization",
            "in": "path",
            "required": true,
            "description": "Slug der Organisation, steht in der Adresse des Dashboards und unter Einstellungen → Integrationen → API-Tokens. Ein Token erreicht nur seine eigene Organisation, andere antworten mit 404.",
            "schema": {
              "type": "string",
              "example": "meine-agentur"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Prometheus-Textformat",
            "content": {
              "text/plain; version=0.0.4": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        }
      }
    },
    "/orgs/{organization}/domains/{domain}/dns": {
      "get": {
        "operationId": "getDns",
        "tags": [
          "DNS"
        ],
        "summary": "Aktuelle DNS-Records",
        "description": "Der jüngste DNS-Schnappschuss der Domain mit allen Records je Typ; null, solange noch keiner vorliegt.\n\nLese-Token genügt (`read`).",
        "x-scope": "read",
        "parameters": [
          {
            "name": "organization",
            "in": "path",
            "required": true,
            "description": "Slug der Organisation, steht in der Adresse des Dashboards und unter Einstellungen → Integrationen → API-Tokens. Ein Token erreicht nur seine eigene Organisation, andere antworten mit 404.",
            "schema": {
              "type": "string",
              "example": "meine-agentur"
            }
          },
          {
            "name": "domain",
            "in": "path",
            "required": true,
            "description": "ID der Domain",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Erfolg",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "oneOf": [
                        {
                          "$ref": "#/components/schemas/DnsSnapshot"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        }
      }
    },
    "/orgs/{organization}/domains/{domain}/dns/snapshots": {
      "get": {
        "operationId": "listDnsSnapshots",
        "tags": [
          "DNS"
        ],
        "summary": "DNS-Verlauf",
        "description": "Alle Schnappschüsse der Domain, neueste zuerst, ohne Records (dafür den Vergleich nutzen). Jeder Schnappschuss steht für einen Zeitraum mit unveränderter Konfiguration.\n\nLese-Token genügt (`read`).",
        "x-scope": "read",
        "parameters": [
          {
            "name": "organization",
            "in": "path",
            "required": true,
            "description": "Slug der Organisation, steht in der Adresse des Dashboards und unter Einstellungen → Integrationen → API-Tokens. Ein Token erreicht nur seine eigene Organisation, andere antworten mit 404.",
            "schema": {
              "type": "string",
              "example": "meine-agentur"
            }
          },
          {
            "name": "domain",
            "in": "path",
            "required": true,
            "description": "ID der Domain",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Höchstzahl",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 200,
              "default": 50
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Erfolg",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/DnsSnapshot"
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        }
      }
    },
    "/orgs/{organization}/domains/{domain}/dns/diff": {
      "get": {
        "operationId": "diffDnsSnapshots",
        "tags": [
          "DNS"
        ],
        "summary": "Zwei DNS-Stände vergleichen",
        "description": "Beide Schnappschüsse mit Records und die Unterschiede dazwischen (hinzugefügte, entfernte und geänderte Records je Typ).\n\nLese-Token genügt (`read`).",
        "x-scope": "read",
        "parameters": [
          {
            "name": "organization",
            "in": "path",
            "required": true,
            "description": "Slug der Organisation, steht in der Adresse des Dashboards und unter Einstellungen → Integrationen → API-Tokens. Ein Token erreicht nur seine eigene Organisation, andere antworten mit 404.",
            "schema": {
              "type": "string",
              "example": "meine-agentur"
            }
          },
          {
            "name": "domain",
            "in": "path",
            "required": true,
            "description": "ID der Domain",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "from",
            "in": "query",
            "required": true,
            "description": "ID des älteren Schnappschusses",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "to",
            "in": "query",
            "required": true,
            "description": "ID des neueren Schnappschusses",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Erfolg",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "from": {
                          "$ref": "#/components/schemas/DnsSnapshot"
                        },
                        "to": {
                          "$ref": "#/components/schemas/DnsSnapshot"
                        },
                        "diff": {
                          "type": "object",
                          "additionalProperties": true,
                          "description": "Unterschiede je Record-Typ"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        }
      }
    },
    "/orgs/{organization}/domains/{domain}/zone-backups": {
      "get": {
        "operationId": "listZoneBackups",
        "tags": [
          "DNS"
        ],
        "summary": "Zonen-Backup: Stände",
        "description": "Vollständige Stände der Zone, gelesen über die Integration des DNS-Anbieters (auch Records, die von außen niemand sieht), neueste zuerst, mit der Zusammenfassung des Unterschieds zum Vorgänger. Ein neuer Stand entsteht nur, wenn sich die Zone ändert; sonst rückt `last_seen_at` nach. `meta.state` sagt, ob ein Backup möglich ist: `available`, `not_delegated` (Zone bei keinem angebundenen Anbieter), `no_integration` (keine geprüfte Integration für den Anbieter) oder `unsupported`; `meta.last_error` nennt den Fehler des letzten Laufs. Auch für Kundenzugänge.\n\nLese-Token genügt (`read`).",
        "x-scope": "read",
        "parameters": [
          {
            "name": "organization",
            "in": "path",
            "required": true,
            "description": "Slug der Organisation, steht in der Adresse des Dashboards und unter Einstellungen → Integrationen → API-Tokens. Ein Token erreicht nur seine eigene Organisation, andere antworten mit 404.",
            "schema": {
              "type": "string",
              "example": "meine-agentur"
            }
          },
          {
            "name": "domain",
            "in": "path",
            "required": true,
            "description": "ID der Domain",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Höchstzahl",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 200,
              "default": 50
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Erfolg",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/ZoneBackup"
                      }
                    },
                    "meta": {
                      "type": "object",
                      "properties": {
                        "state": {
                          "type": "string",
                          "description": "Ob ein Backup möglich ist",
                          "enum": [
                            "available",
                            "not_delegated",
                            "no_integration",
                            "unsupported"
                          ]
                        },
                        "provider": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "provider_name": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "message": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "description": "Erklärung, wenn nicht available"
                        },
                        "last_error": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "last_backup_at": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "format": "date-time",
                          "description": "Zuletzt bestätigter Stand"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        }
      }
    },
    "/orgs/{organization}/domains/{domain}/zone-backups/{backup}": {
      "get": {
        "operationId": "getZoneBackup",
        "tags": [
          "DNS"
        ],
        "summary": "Zonen-Backup: ein Stand",
        "description": "Ein Stand mit allen Records (`key` = „name|TYP“, wie ihn das Wiederherstellen erwartet) und dem Unterschied zum vorigen Stand je Name und Typ: `added`, `removed` oder `changed` mit den Werten vorher und nachher.\n\nLese-Token genügt (`read`).",
        "x-scope": "read",
        "parameters": [
          {
            "name": "organization",
            "in": "path",
            "required": true,
            "description": "Slug der Organisation, steht in der Adresse des Dashboards und unter Einstellungen → Integrationen → API-Tokens. Ein Token erreicht nur seine eigene Organisation, andere antworten mit 404.",
            "schema": {
              "type": "string",
              "example": "meine-agentur"
            }
          },
          {
            "name": "domain",
            "in": "path",
            "required": true,
            "description": "ID der Domain",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "backup",
            "in": "path",
            "required": true,
            "description": "ID des Stands im Zonen-Backup",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Erfolg",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/ZoneBackup"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        }
      }
    },
    "/orgs/{organization}/domains/{domain}/zone-backups/{backup}/export.zone": {
      "get": {
        "operationId": "exportZoneBackup",
        "tags": [
          "DNS"
        ],
        "summary": "Zonen-Backup als BIND-Zonendatei",
        "description": "Der Stand als Zonendatei nach RFC 1035 (`$ORIGIN`, `$TTL`, Namen relativ zur Zone, `@` für die Domain, TXT in Anführungszeichen in Teilstrings zu 255 Bytes), als Download (`Content-Disposition: attachment`). Lässt sich bei jedem Anbieter mit Zonenimport wieder einlesen; Records hinter dem Cloudflare-Proxy tragen den Kommentar `; proxied`.\n\nLese-Token genügt (`read`).\n\nEigenes Limit: 30 Exporte je Stunde und Organisation.",
        "x-scope": "read",
        "parameters": [
          {
            "name": "organization",
            "in": "path",
            "required": true,
            "description": "Slug der Organisation, steht in der Adresse des Dashboards und unter Einstellungen → Integrationen → API-Tokens. Ein Token erreicht nur seine eigene Organisation, andere antworten mit 404.",
            "schema": {
              "type": "string",
              "example": "meine-agentur"
            }
          },
          {
            "name": "domain",
            "in": "path",
            "required": true,
            "description": "ID der Domain",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "backup",
            "in": "path",
            "required": true,
            "description": "ID des Stands im Zonen-Backup",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Zonendatei (text/plain)",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        }
      }
    },
    "/orgs/{organization}/domains/{domain}/zone-backups/{backup}/export.json": {
      "get": {
        "operationId": "exportZoneBackupJson",
        "tags": [
          "DNS"
        ],
        "summary": "Zonen-Backup als JSON",
        "description": "Der Stand als JSON-Datei zum Herunterladen: Zone, Anbieter, Zeitpunkte, Hash und die kanonische Record-Liste.\n\nLese-Token genügt (`read`).\n\nEigenes Limit: 30 Exporte je Stunde und Organisation.",
        "x-scope": "read",
        "parameters": [
          {
            "name": "organization",
            "in": "path",
            "required": true,
            "description": "Slug der Organisation, steht in der Adresse des Dashboards und unter Einstellungen → Integrationen → API-Tokens. Ein Token erreicht nur seine eigene Organisation, andere antworten mit 404.",
            "schema": {
              "type": "string",
              "example": "meine-agentur"
            }
          },
          {
            "name": "domain",
            "in": "path",
            "required": true,
            "description": "ID der Domain",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "backup",
            "in": "path",
            "required": true,
            "description": "ID des Stands im Zonen-Backup",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Erfolg",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "zone": {
                          "type": "string"
                        },
                        "provider": {
                          "type": "string"
                        },
                        "provider_name": {
                          "type": "string"
                        },
                        "first_seen_at": {
                          "type": "string",
                          "format": "date-time"
                        },
                        "last_seen_at": {
                          "type": "string",
                          "format": "date-time"
                        },
                        "hash": {
                          "type": "string"
                        },
                        "records": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "name": {
                                "type": "string"
                              },
                              "type": {
                                "type": "string"
                              },
                              "ttl": {
                                "type": [
                                  "integer",
                                  "null"
                                ]
                              },
                              "content": {
                                "type": "string"
                              }
                            }
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        }
      }
    },
    "/orgs/{organization}/domains/{domain}/zone-backups/run": {
      "post": {
        "operationId": "runZoneBackup",
        "tags": [
          "DNS"
        ],
        "summary": "Zonen-Backup jetzt festhalten",
        "description": "Liest die Zone sofort beim Anbieter (sonst geschieht das täglich): `status` ist `created` bei geänderter Zone (dann mit Zeitleisten-Event `zone.changed`) oder `unchanged`. 422, wenn die Zone bei keinem angebundenen Anbieter liegt oder sich nicht lesen lässt.\n\nBraucht ein Token mit Schreibrecht (`write`).\n\nEigenes Limit: 10 je Stunde und Domain, 60 je Stunde und Organisation.",
        "x-scope": "write",
        "parameters": [
          {
            "name": "organization",
            "in": "path",
            "required": true,
            "description": "Slug der Organisation, steht in der Adresse des Dashboards und unter Einstellungen → Integrationen → API-Tokens. Ein Token erreicht nur seine eigene Organisation, andere antworten mit 404.",
            "schema": {
              "type": "string",
              "example": "meine-agentur"
            }
          },
          {
            "name": "domain",
            "in": "path",
            "required": true,
            "description": "ID der Domain",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Erfolg",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "status": {
                          "type": "string",
                          "enum": [
                            "created",
                            "unchanged"
                          ]
                        },
                        "backup": {
                          "$ref": "#/components/schemas/ZoneBackup"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        }
      }
    },
    "/orgs/{organization}/domains/{domain}/zone-backups/{backup}/restore": {
      "post": {
        "operationId": "restoreZoneBackup",
        "tags": [
          "DNS"
        ],
        "summary": "Records aus dem Zonen-Backup wiederherstellen",
        "description": "Schreibt Records dieses Stands über die Integration zurück in die Zone: je Schlüssel („name|TYP“) bekommt die Zone genau die Werte des Stands – fehlende werden angelegt (mit der TTL des Stands), überzählige gelöscht, bei gleicher Anzahl geändert. `all: true` nimmt alle Unterschiede zwischen Stand und Zone in einem Lauf, höchstens 200 Änderungen. Vorher werden die Nameserver frisch aufgelöst; Records hinter dem Cloudflare-Proxy fasst DomainWarn nicht an (`skipped`). Steht im Audit-Log und in der Zeitleiste (`zone.restored`). Kundenzugänge dürfen das nicht.\n\nBraucht ein Token mit Schreibrecht (`write`).\n\nEigenes Limit: 20 je Minute.",
        "x-scope": "write",
        "parameters": [
          {
            "name": "organization",
            "in": "path",
            "required": true,
            "description": "Slug der Organisation, steht in der Adresse des Dashboards und unter Einstellungen → Integrationen → API-Tokens. Ein Token erreicht nur seine eigene Organisation, andere antworten mit 404.",
            "schema": {
              "type": "string",
              "example": "meine-agentur"
            }
          },
          {
            "name": "domain",
            "in": "path",
            "required": true,
            "description": "ID der Domain",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "backup",
            "in": "path",
            "required": true,
            "description": "ID des Stands im Zonen-Backup",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Erfolg",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "zone": {
                          "type": "string"
                        },
                        "changes": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "type": {
                                "type": "string"
                              },
                              "name": {
                                "type": "string"
                              },
                              "content": {
                                "type": "string"
                              },
                              "action": {
                                "type": "string",
                                "enum": [
                                  "created",
                                  "updated",
                                  "deleted"
                                ]
                              }
                            }
                          }
                        },
                        "skipped": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "key": {
                                "type": "string"
                              },
                              "reason": {
                                "type": "string"
                              }
                            }
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [],
                "properties": {
                  "keys": {
                    "type": "array",
                    "maxItems": 200,
                    "items": {
                      "type": "string",
                      "example": "www.kunde.de|A"
                    },
                    "description": "Schlüssel der Records (Name|Typ); Pflicht ohne all"
                  },
                  "all": {
                    "type": "boolean",
                    "description": "Alle Unterschiede zwischen Stand und Zone wiederherstellen"
                  }
                }
              },
              "example": {
                "keys": [
                  "kunde.de|MX",
                  "_dmarc.kunde.de|TXT"
                ]
              }
            }
          }
        }
      }
    },
    "/orgs/{organization}/incidents": {
      "get": {
        "operationId": "listIncidents",
        "tags": [
          "Meldungen"
        ],
        "summary": "Meldungen auflisten",
        "description": "Standardmäßig nur offene und quittierte Meldungen, offene und kritische zuerst; cursor-paginiert.\n\nLese-Token genügt (`read`).",
        "x-scope": "read",
        "parameters": [
          {
            "name": "organization",
            "in": "path",
            "required": true,
            "description": "Slug der Organisation, steht in der Adresse des Dashboards und unter Einstellungen → Integrationen → API-Tokens. Ein Token erreicht nur seine eigene Organisation, andere antworten mit 404.",
            "schema": {
              "type": "string",
              "example": "meine-agentur"
            }
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "description": "`open` (offen und quittiert), `all` oder Status kommagetrennt: open, acknowledged, resolved",
            "schema": {
              "type": "string",
              "default": "open",
              "example": "open"
            }
          },
          {
            "name": "severity",
            "in": "query",
            "required": false,
            "description": "Schweregrade, kommagetrennt: info, warning, critical",
            "schema": {
              "type": "string",
              "example": "critical,warning"
            }
          },
          {
            "name": "domain",
            "in": "query",
            "required": false,
            "description": "Nur Meldungen dieser Domain",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "customer",
            "in": "query",
            "required": false,
            "description": "Nur Domains dieses Kunden",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "per_page",
            "in": "query",
            "required": false,
            "description": "Einträge je Seite (1 bis 200)",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 200,
              "default": 50
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "description": "Cursor der nächsten Seite aus `meta.next_cursor` der vorigen Antwort",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Erfolg",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Incident"
                      }
                    },
                    "links": {
                      "$ref": "#/components/schemas/Links"
                    },
                    "meta": {
                      "$ref": "#/components/schemas/CursorMeta"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        }
      }
    },
    "/orgs/{organization}/incidents/{incident}": {
      "get": {
        "operationId": "getIncident",
        "tags": [
          "Meldungen"
        ],
        "summary": "Meldung abrufen",
        "description": "Eine Meldung mit Domain, Monitor, Ursache und dem Namen des Quittierenden.\n\nLese-Token genügt (`read`).",
        "x-scope": "read",
        "parameters": [
          {
            "name": "organization",
            "in": "path",
            "required": true,
            "description": "Slug der Organisation, steht in der Adresse des Dashboards und unter Einstellungen → Integrationen → API-Tokens. Ein Token erreicht nur seine eigene Organisation, andere antworten mit 404.",
            "schema": {
              "type": "string",
              "example": "meine-agentur"
            }
          },
          {
            "name": "incident",
            "in": "path",
            "required": true,
            "description": "ID der Meldung",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Erfolg",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Incident"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        }
      }
    },
    "/orgs/{organization}/incidents/{incident}/acknowledge": {
      "post": {
        "operationId": "acknowledgeIncident",
        "tags": [
          "Meldungen"
        ],
        "summary": "Meldung quittieren",
        "description": "Markiert die Meldung als gesehen; Erinnerungen hören auf, die Entwarnung kommt weiterhin.\n\nBraucht ein Token mit Schreibrecht (`write`).",
        "x-scope": "write",
        "parameters": [
          {
            "name": "organization",
            "in": "path",
            "required": true,
            "description": "Slug der Organisation, steht in der Adresse des Dashboards und unter Einstellungen → Integrationen → API-Tokens. Ein Token erreicht nur seine eigene Organisation, andere antworten mit 404.",
            "schema": {
              "type": "string",
              "example": "meine-agentur"
            }
          },
          {
            "name": "incident",
            "in": "path",
            "required": true,
            "description": "ID der Meldung",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Erfolg",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Incident"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        }
      }
    },
    "/orgs/{organization}/incidents/{incident}/report": {
      "put": {
        "operationId": "updateIncidentReport",
        "tags": [
          "Meldungen"
        ],
        "summary": "Meldung im Kundenbericht",
        "description": "Freitext „Ursache und Maßnahmen“ für den Kunden (leer oder null entfernt ihn) und ob die Meldung im Monatsbericht ausgeblendet wird. Mindestens eins von beiden. Was der Kunde davon sieht, regeln die Berichtseinstellungen des Kunden. Der Stand steht in der Meldung unter `report`.\n\nBraucht ein Token mit Schreibrecht (`write`).",
        "x-scope": "write",
        "parameters": [
          {
            "name": "organization",
            "in": "path",
            "required": true,
            "description": "Slug der Organisation, steht in der Adresse des Dashboards und unter Einstellungen → Integrationen → API-Tokens. Ein Token erreicht nur seine eigene Organisation, andere antworten mit 404.",
            "schema": {
              "type": "string",
              "example": "meine-agentur"
            }
          },
          {
            "name": "incident",
            "in": "path",
            "required": true,
            "description": "ID der Meldung",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Erfolg",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "note": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "hidden": {
                          "type": "boolean"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [],
                "properties": {
                  "note": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "maxLength": 5000,
                    "description": "Ursache und Maßnahmen"
                  },
                  "hidden": {
                    "type": "boolean",
                    "description": "Im Kundenbericht ausblenden"
                  }
                }
              },
              "example": {
                "note": "Der Hoster hat das Rechenzentrum gewechselt; die Website war 95 Minuten nicht erreichbar."
              }
            }
          }
        }
      }
    },
    "/orgs/{organization}/webhook-subscriptions": {
      "post": {
        "operationId": "createWebhookSubscription",
        "tags": [
          "Organisation"
        ],
        "summary": "Webhook-Abo anlegen",
        "description": "Für Automatisierungen wie den n8n-Trigger: legt einen signierten Webhook-Kanal an, der dem anfragenden Token gehört. DomainWarn schickt ihm wie jedem Webhook-Kanal Meldungen, Entwarnungen und Änderungen ab der Mindestschwere (`X-DomainWarn-Signature: sha256=HMAC(secret, timestamp + \".\" + body)`, `X-DomainWarn-Timestamp`, `X-DomainWarn-Event`). Das `secret` steht nur in dieser Antwort. Das Abo erscheint im Dashboard unter den Kanälen, zählt zum Kanallimit des Tarifs (höchstens 20 je Token) und verschwindet mit dem Token; läuft das Token ab oder gehört sein Ersteller nicht mehr zur Organisation, bekommt es nichts mehr. Nur mit API-Token, mit einer Sitzung 403.\n\nBraucht ein Token mit Schreibrecht (`write`).",
        "x-scope": "write",
        "parameters": [
          {
            "name": "organization",
            "in": "path",
            "required": true,
            "description": "Slug der Organisation, steht in der Adresse des Dashboards und unter Einstellungen → Integrationen → API-Tokens. Ein Token erreicht nur seine eigene Organisation, andere antworten mit 404.",
            "schema": {
              "type": "string",
              "example": "meine-agentur"
            }
          }
        ],
        "responses": {
          "201": {
            "description": "Angelegt",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string",
                          "format": "uuid"
                        },
                        "name": {
                          "type": "string"
                        },
                        "url": {
                          "type": "string",
                          "format": "uri"
                        },
                        "min_severity": {
                          "type": "string",
                          "enum": [
                            "info",
                            "warning",
                            "critical"
                          ]
                        },
                        "is_enabled": {
                          "type": "boolean"
                        },
                        "broken_at": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "format": "date-time"
                        },
                        "created_at": {
                          "type": "string",
                          "format": "date-time"
                        },
                        "secret": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "url"
                ],
                "properties": {
                  "url": {
                    "type": "string",
                    "format": "uri",
                    "maxLength": 500,
                    "description": "Ziel, nur https und öffentliche Hosts"
                  },
                  "name": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "maxLength": 80,
                    "description": "Name in der Kanalliste; Standard „Webhook (Tokenname)“"
                  },
                  "min_severity": {
                    "type": "string",
                    "enum": [
                      "info",
                      "warning",
                      "critical"
                    ],
                    "default": "warning",
                    "description": "Mindestschwere"
                  }
                }
              },
              "example": {
                "url": "https://n8n.example.org/webhook/3f1c…/webhook",
                "name": "n8n: Tickets aus Meldungen",
                "min_severity": "warning"
              }
            }
          }
        }
      }
    },
    "/orgs/{organization}/webhook-subscriptions/{channel}": {
      "get": {
        "operationId": "getWebhookSubscription",
        "tags": [
          "Organisation"
        ],
        "summary": "Webhook-Abo abrufen",
        "description": "Ein Abo des anfragenden Tokens, ohne `secret`. Abos anderer Tokens und Kanäle aus dem Dashboard antworten mit 404 (Lese-Tokens können keine Abos anlegen).\n\nLese-Token genügt (`read`).",
        "x-scope": "read",
        "parameters": [
          {
            "name": "organization",
            "in": "path",
            "required": true,
            "description": "Slug der Organisation, steht in der Adresse des Dashboards und unter Einstellungen → Integrationen → API-Tokens. Ein Token erreicht nur seine eigene Organisation, andere antworten mit 404.",
            "schema": {
              "type": "string",
              "example": "meine-agentur"
            }
          },
          {
            "name": "channel",
            "in": "path",
            "required": true,
            "description": "ID des Webhook-Abos aus der Antwort auf das Anlegen",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Erfolg",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string",
                          "format": "uuid"
                        },
                        "name": {
                          "type": "string"
                        },
                        "url": {
                          "type": "string",
                          "format": "uri"
                        },
                        "min_severity": {
                          "type": "string",
                          "enum": [
                            "info",
                            "warning",
                            "critical"
                          ]
                        },
                        "is_enabled": {
                          "type": "boolean"
                        },
                        "broken_at": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "format": "date-time"
                        },
                        "created_at": {
                          "type": "string",
                          "format": "date-time"
                        },
                        "secret": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        }
      },
      "delete": {
        "operationId": "deleteWebhookSubscription",
        "tags": [
          "Organisation"
        ],
        "summary": "Webhook-Abo löschen",
        "description": "Löscht ein Abo des anfragenden Tokens, etwa beim Deaktivieren des n8n-Workflows.\n\nBraucht ein Token mit Schreibrecht (`write`).",
        "x-scope": "write",
        "parameters": [
          {
            "name": "organization",
            "in": "path",
            "required": true,
            "description": "Slug der Organisation, steht in der Adresse des Dashboards und unter Einstellungen → Integrationen → API-Tokens. Ein Token erreicht nur seine eigene Organisation, andere antworten mit 404.",
            "schema": {
              "type": "string",
              "example": "meine-agentur"
            }
          },
          {
            "name": "channel",
            "in": "path",
            "required": true,
            "description": "ID des Webhook-Abos aus der Antwort auf das Anlegen",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Gelöscht, keine Antwort"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        }
      }
    },
    "/orgs/{organization}/mail-deliveries": {
      "get": {
        "operationId": "listMailDeliveries",
        "tags": [
          "Organisation"
        ],
        "summary": "E-Mail-Zustellungen je Empfänger",
        "description": "Jede E-Mail der Organisation (Alarme, Berichte, Einladungen, Status-Seiten-Mails) je Empfänger, neueste zuerst, cursor-paginiert, 90 Tage lang. `meta.unreachable` nennt Adressen, die nach drei Bounces in 30 Tagen oder einer Beschwerde keine Mails mehr bekommen; `meta.stats` zählt die Status im Zeitraum und nennt die Zustellquote (`rate`). Nicht für Kundenzugänge.\n\nLese-Token genügt (`read`).",
        "x-scope": "read",
        "parameters": [
          {
            "name": "organization",
            "in": "path",
            "required": true,
            "description": "Slug der Organisation, steht in der Adresse des Dashboards und unter Einstellungen → Integrationen → API-Tokens. Ein Token erreicht nur seine eigene Organisation, andere antworten mit 404.",
            "schema": {
              "type": "string",
              "example": "meine-agentur"
            }
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "description": "Nur Einträge mit diesem Status",
            "schema": {
              "type": "string",
              "enum": [
                "sent",
                "failed",
                "bounced",
                "complained",
                "suppressed"
              ]
            }
          },
          {
            "name": "days",
            "in": "query",
            "required": false,
            "description": "Zeitraum in Tagen",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 90,
              "default": 30
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "description": "Cursor der nächsten Seite aus `meta.next_cursor` der vorigen Antwort",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Erfolg",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/MailDelivery"
                      }
                    },
                    "links": {
                      "$ref": "#/components/schemas/Links"
                    },
                    "meta": {
                      "$ref": "#/components/schemas/CursorMeta"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        }
      }
    },
    "/orgs/{organization}/mail-deliveries/reactivate": {
      "post": {
        "operationId": "reactivateMailRecipient",
        "tags": [
          "Organisation"
        ],
        "summary": "Unerreichbare Adresse wieder freigeben",
        "description": "Hebt die Sperre einer als unerreichbar markierten Adresse auf; Bounces davor zählen nicht mehr. Steht im Sicherheitsprotokoll. 404, wenn die Adresse nicht gesperrt ist. Braucht das Recht, Einstellungen zu verwalten.\n\nBraucht ein Token mit Schreibrecht (`write`).",
        "x-scope": "write",
        "parameters": [
          {
            "name": "organization",
            "in": "path",
            "required": true,
            "description": "Slug der Organisation, steht in der Adresse des Dashboards und unter Einstellungen → Integrationen → API-Tokens. Ein Token erreicht nur seine eigene Organisation, andere antworten mit 404.",
            "schema": {
              "type": "string",
              "example": "meine-agentur"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Erfolg",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "recipient": {
                          "type": "string",
                          "description": "Adresse, maskiert"
                        },
                        "recipient_hash": {
                          "type": "string",
                          "description": "Kennung der Adresse"
                        },
                        "reactivated_at": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "format": "date-time",
                          "description": "Zeitpunkt der Freigabe"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [],
                "properties": {
                  "email": {
                    "type": "string",
                    "format": "email",
                    "description": "Die Adresse (oder `recipient_hash`)"
                  },
                  "recipient_hash": {
                    "type": "string",
                    "pattern": "^[a-f0-9]{64}$",
                    "description": "Kennung aus dem Zustellprotokoll (oder `email`)"
                  }
                }
              },
              "example": {
                "email": "bereitschaft@agentur.de"
              }
            }
          }
        }
      }
    },
    "/orgs/{organization}/events": {
      "get": {
        "operationId": "listEvents",
        "tags": [
          "Ereignisse"
        ],
        "summary": "Ereignisse auflisten",
        "description": "Erkannte Änderungen und Übergänge der Meldungen aller Domains, neueste zuerst, cursor-paginiert. Geeignet für eigene Auswertungen oder ein Änderungsprotokoll.\n\nLese-Token genügt (`read`).",
        "x-scope": "read",
        "parameters": [
          {
            "name": "organization",
            "in": "path",
            "required": true,
            "description": "Slug der Organisation, steht in der Adresse des Dashboards und unter Einstellungen → Integrationen → API-Tokens. Ein Token erreicht nur seine eigene Organisation, andere antworten mit 404.",
            "schema": {
              "type": "string",
              "example": "meine-agentur"
            }
          },
          {
            "name": "severity",
            "in": "query",
            "required": false,
            "description": "Schweregrade, kommagetrennt: info, warning, critical",
            "schema": {
              "type": "string",
              "example": "critical,warning"
            }
          },
          {
            "name": "type",
            "in": "query",
            "required": false,
            "description": "Ereignisarten, kommagetrennt",
            "schema": {
              "type": "string",
              "example": "dns.record_changed,tls.renewed"
            }
          },
          {
            "name": "domain",
            "in": "query",
            "required": false,
            "description": "Nur Ereignisse dieser Domain",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "customer",
            "in": "query",
            "required": false,
            "description": "Nur Domains dieses Kunden",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "from",
            "in": "query",
            "required": false,
            "description": "Nur Ereignisse ab diesem Zeitpunkt",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "to",
            "in": "query",
            "required": false,
            "description": "Nur Ereignisse bis zu diesem Zeitpunkt; nicht vor `from` und höchstens 366 Tage danach",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "per_page",
            "in": "query",
            "required": false,
            "description": "Einträge je Seite (1 bis 200)",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 200,
              "default": 50
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "description": "Cursor der nächsten Seite aus `meta.next_cursor` der vorigen Antwort",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Erfolg",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Event"
                      }
                    },
                    "links": {
                      "$ref": "#/components/schemas/Links"
                    },
                    "meta": {
                      "$ref": "#/components/schemas/CursorMeta"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        }
      }
    },
    "/orgs/{organization}/domains/{domain}/timeline": {
      "get": {
        "operationId": "getDomainTimeline",
        "tags": [
          "Ereignisse"
        ],
        "summary": "Zeitleiste einer Domain",
        "description": "Ereignisse einer Domain, neueste zuerst; dieselben Filter wie bei allen Ereignissen.\n\nLese-Token genügt (`read`).",
        "x-scope": "read",
        "parameters": [
          {
            "name": "organization",
            "in": "path",
            "required": true,
            "description": "Slug der Organisation, steht in der Adresse des Dashboards und unter Einstellungen → Integrationen → API-Tokens. Ein Token erreicht nur seine eigene Organisation, andere antworten mit 404.",
            "schema": {
              "type": "string",
              "example": "meine-agentur"
            }
          },
          {
            "name": "domain",
            "in": "path",
            "required": true,
            "description": "ID der Domain",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "severity",
            "in": "query",
            "required": false,
            "description": "Schweregrade, kommagetrennt: info, warning, critical",
            "schema": {
              "type": "string",
              "example": "critical,warning"
            }
          },
          {
            "name": "type",
            "in": "query",
            "required": false,
            "description": "Ereignisarten, kommagetrennt",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "from",
            "in": "query",
            "required": false,
            "description": "Ab Zeitpunkt",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "to",
            "in": "query",
            "required": false,
            "description": "Bis Zeitpunkt; nicht vor `from` und höchstens 366 Tage danach",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "per_page",
            "in": "query",
            "required": false,
            "description": "Einträge je Seite (1 bis 200)",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 200,
              "default": 100
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "description": "Cursor der nächsten Seite aus `meta.next_cursor` der vorigen Antwort",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Erfolg",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Event"
                      }
                    },
                    "links": {
                      "$ref": "#/components/schemas/Links"
                    },
                    "meta": {
                      "$ref": "#/components/schemas/CursorMeta"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        }
      }
    },
    "/orgs/{organization}/customers/{customer}/announcements": {
      "get": {
        "operationId": "listAnnouncements",
        "tags": [
          "Kunden"
        ],
        "summary": "Meldungen der Status-Seite",
        "description": "Störungen, Wartungen und Hinweise in eigenen Worten, wie sie oben auf der Status-Seite stehen: laufende sofort, angekündigte Wartungen bis 14 Tage im Voraus.\n\nLese-Token genügt (`read`).",
        "x-scope": "read",
        "parameters": [
          {
            "name": "organization",
            "in": "path",
            "required": true,
            "description": "Slug der Organisation, steht in der Adresse des Dashboards und unter Einstellungen → Integrationen → API-Tokens. Ein Token erreicht nur seine eigene Organisation, andere antworten mit 404.",
            "schema": {
              "type": "string",
              "example": "meine-agentur"
            }
          },
          {
            "name": "customer",
            "in": "path",
            "required": true,
            "description": "ID des Kunden",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Erfolg",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "additionalProperties": true
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        }
      },
      "post": {
        "operationId": "createAnnouncement",
        "tags": [
          "Kunden"
        ],
        "summary": "Meldung veröffentlichen",
        "description": "Erscheint auf der Status-Seite des Kunden. Ohne Beginn gilt sie sofort, ohne Ende bis sie als behoben markiert wird.\n\nBraucht ein Token mit Schreibrecht (`write`).",
        "x-scope": "write",
        "parameters": [
          {
            "name": "organization",
            "in": "path",
            "required": true,
            "description": "Slug der Organisation, steht in der Adresse des Dashboards und unter Einstellungen → Integrationen → API-Tokens. Ein Token erreicht nur seine eigene Organisation, andere antworten mit 404.",
            "schema": {
              "type": "string",
              "example": "meine-agentur"
            }
          },
          {
            "name": "customer",
            "in": "path",
            "required": true,
            "description": "ID des Kunden",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "201": {
            "description": "Angelegt",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "additionalProperties": true
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "kind",
                  "title"
                ],
                "properties": {
                  "kind": {
                    "type": "string",
                    "enum": [
                      "incident",
                      "maintenance",
                      "info"
                    ],
                    "description": "Art der Meldung"
                  },
                  "title": {
                    "type": "string",
                    "maxLength": 190,
                    "description": "Titel"
                  },
                  "body": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "description": "Text"
                  },
                  "starts_at": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "format": "date-time",
                    "description": "Beginn; leer = jetzt"
                  },
                  "ends_at": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "format": "date-time",
                    "description": "Ende"
                  }
                }
              },
              "example": {
                "kind": "maintenance",
                "title": "Serverumzug am Samstag",
                "body": "Von 8 bis 10 Uhr ist der Shop nicht erreichbar.",
                "starts_at": "2026-10-03T06:00:00Z",
                "ends_at": "2026-10-03T08:00:00Z"
              }
            }
          }
        }
      }
    },
    "/orgs/{organization}/customers/{customer}/announcements/{announcement}": {
      "patch": {
        "operationId": "updateAnnouncement",
        "tags": [
          "Kunden"
        ],
        "summary": "Meldung ändern",
        "description": "Text, Zeitraum oder Art ändern; als behoben markieren beendet sie.\n\nBraucht ein Token mit Schreibrecht (`write`).",
        "x-scope": "write",
        "parameters": [
          {
            "name": "organization",
            "in": "path",
            "required": true,
            "description": "Slug der Organisation, steht in der Adresse des Dashboards und unter Einstellungen → Integrationen → API-Tokens. Ein Token erreicht nur seine eigene Organisation, andere antworten mit 404.",
            "schema": {
              "type": "string",
              "example": "meine-agentur"
            }
          },
          {
            "name": "customer",
            "in": "path",
            "required": true,
            "description": "ID des Kunden",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "announcement",
            "in": "path",
            "required": true,
            "description": "ID der Meldung auf der Status-Seite",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Erfolg",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "additionalProperties": true
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        }
      },
      "delete": {
        "operationId": "deleteAnnouncement",
        "tags": [
          "Kunden"
        ],
        "summary": "Meldung löschen",
        "description": "Entfernt die Meldung von der Status-Seite.\n\nBraucht ein Token mit Schreibrecht (`write`).",
        "x-scope": "write",
        "parameters": [
          {
            "name": "organization",
            "in": "path",
            "required": true,
            "description": "Slug der Organisation, steht in der Adresse des Dashboards und unter Einstellungen → Integrationen → API-Tokens. Ein Token erreicht nur seine eigene Organisation, andere antworten mit 404.",
            "schema": {
              "type": "string",
              "example": "meine-agentur"
            }
          },
          {
            "name": "customer",
            "in": "path",
            "required": true,
            "description": "ID des Kunden",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "announcement",
            "in": "path",
            "required": true,
            "description": "ID der Meldung auf der Status-Seite",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Gelöscht, keine Antwort"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        }
      }
    },
    "/orgs/{organization}/customers/{customer}/status-subscribers": {
      "get": {
        "operationId": "listStatusSubscribers",
        "tags": [
          "Kunden"
        ],
        "summary": "Abonnenten der Status-Seite",
        "description": "E-Mail-Adressen, die sich auf der Status-Seite des Kunden für Störungsmeldungen eingetragen haben, mit Sprache und Zeitpunkt der Bestätigung (leer = noch unbestätigt). Höchstens 500, neueste zuerst.\n\nLese-Token genügt (`read`).",
        "x-scope": "read",
        "parameters": [
          {
            "name": "organization",
            "in": "path",
            "required": true,
            "description": "Slug der Organisation, steht in der Adresse des Dashboards und unter Einstellungen → Integrationen → API-Tokens. Ein Token erreicht nur seine eigene Organisation, andere antworten mit 404.",
            "schema": {
              "type": "string",
              "example": "meine-agentur"
            }
          },
          {
            "name": "customer",
            "in": "path",
            "required": true,
            "description": "ID des Kunden",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Erfolg",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "additionalProperties": true
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        }
      }
    },
    "/orgs/{organization}/customers/{customer}/status-subscribers/{subscriber}": {
      "delete": {
        "operationId": "deleteStatusSubscriber",
        "tags": [
          "Kunden"
        ],
        "summary": "Abonnenten entfernen",
        "description": "Entfernt die Adresse; sie bekommt keine Störungsmeldungen mehr und kann sich auf der Seite neu eintragen.\n\nBraucht ein Token mit Schreibrecht (`write`).",
        "x-scope": "write",
        "parameters": [
          {
            "name": "organization",
            "in": "path",
            "required": true,
            "description": "Slug der Organisation, steht in der Adresse des Dashboards und unter Einstellungen → Integrationen → API-Tokens. Ein Token erreicht nur seine eigene Organisation, andere antworten mit 404.",
            "schema": {
              "type": "string",
              "example": "meine-agentur"
            }
          },
          {
            "name": "customer",
            "in": "path",
            "required": true,
            "description": "ID des Kunden",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "subscriber",
            "in": "path",
            "required": true,
            "description": "ID des Abonnenten der Status-Seite",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Gelöscht, keine Antwort"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        }
      }
    },
    "/orgs/{organization}/customers": {
      "get": {
        "operationId": "listCustomers",
        "tags": [
          "Kunden"
        ],
        "summary": "Kunden auflisten",
        "description": "Kunden der Organisation mit Anzahl der Domains, alphabetisch; archivierte nur auf Wunsch.\n\nLese-Token genügt (`read`).",
        "x-scope": "read",
        "parameters": [
          {
            "name": "organization",
            "in": "path",
            "required": true,
            "description": "Slug der Organisation, steht in der Adresse des Dashboards und unter Einstellungen → Integrationen → API-Tokens. Ein Token erreicht nur seine eigene Organisation, andere antworten mit 404.",
            "schema": {
              "type": "string",
              "example": "meine-agentur"
            }
          },
          {
            "name": "search",
            "in": "query",
            "required": false,
            "description": "Teil von Name oder Referenz",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "archived",
            "in": "query",
            "required": false,
            "description": "true liefert nur archivierte, false nur aktive (Standard)",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "page",
            "in": "query",
            "required": false,
            "description": "Seitennummer",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "default": 1
            }
          },
          {
            "name": "per_page",
            "in": "query",
            "required": false,
            "description": "Einträge je Seite (1 bis 200)",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 200,
              "default": 100
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Erfolg",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Customer"
                      }
                    },
                    "links": {
                      "$ref": "#/components/schemas/Links"
                    },
                    "meta": {
                      "$ref": "#/components/schemas/PageMeta"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        }
      },
      "post": {
        "operationId": "createCustomer",
        "tags": [
          "Kunden"
        ],
        "summary": "Kunden anlegen",
        "description": "Braucht ein Token mit Schreibrecht (`write`).",
        "x-scope": "write",
        "parameters": [
          {
            "name": "organization",
            "in": "path",
            "required": true,
            "description": "Slug der Organisation, steht in der Adresse des Dashboards und unter Einstellungen → Integrationen → API-Tokens. Ein Token erreicht nur seine eigene Organisation, andere antworten mit 404.",
            "schema": {
              "type": "string",
              "example": "meine-agentur"
            }
          }
        ],
        "responses": {
          "201": {
            "description": "Angelegt",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Customer"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "name"
                ],
                "properties": {
                  "name": {
                    "type": "string",
                    "maxLength": 160,
                    "description": "Name, eindeutig je Organisation"
                  },
                  "reference": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "maxLength": 64,
                    "description": "Eigene Referenz"
                  },
                  "notes": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "maxLength": 5000,
                    "description": "Notizen"
                  },
                  "contact_email": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "format": "email",
                    "description": "Kontaktadresse für Berichte"
                  },
                  "logo": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "description": "Logo als Data-URL (PNG, JPEG oder SVG ohne Skripte, bis 300 KB); null entfernt es"
                  },
                  "monthly_report": {
                    "type": "boolean",
                    "description": "Monatlichen Bericht senden"
                  },
                  "report_locale": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "enum": [
                      "de",
                      "en",
                      null
                    ],
                    "description": "Sprache des Berichts"
                  }
                }
              },
              "example": {
                "name": "Musterfirma GmbH",
                "reference": "K-1042",
                "contact_email": "it@musterfirma.de",
                "monthly_report": true,
                "report_locale": "de"
              }
            }
          }
        }
      }
    },
    "/orgs/{organization}/customers/{customer}": {
      "get": {
        "operationId": "getCustomer",
        "tags": [
          "Kunden"
        ],
        "summary": "Kunden abrufen",
        "description": "Lese-Token genügt (`read`).",
        "x-scope": "read",
        "parameters": [
          {
            "name": "organization",
            "in": "path",
            "required": true,
            "description": "Slug der Organisation, steht in der Adresse des Dashboards und unter Einstellungen → Integrationen → API-Tokens. Ein Token erreicht nur seine eigene Organisation, andere antworten mit 404.",
            "schema": {
              "type": "string",
              "example": "meine-agentur"
            }
          },
          {
            "name": "customer",
            "in": "path",
            "required": true,
            "description": "ID des Kunden",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Erfolg",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Customer"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        }
      },
      "patch": {
        "operationId": "updateCustomer",
        "tags": [
          "Kunden"
        ],
        "summary": "Kunden ändern",
        "description": "Dieselben Felder wie beim Anlegen, dazu `is_archived`. `name` muss immer mitgesendet werden.\n\nBraucht ein Token mit Schreibrecht (`write`).",
        "x-scope": "write",
        "parameters": [
          {
            "name": "organization",
            "in": "path",
            "required": true,
            "description": "Slug der Organisation, steht in der Adresse des Dashboards und unter Einstellungen → Integrationen → API-Tokens. Ein Token erreicht nur seine eigene Organisation, andere antworten mit 404.",
            "schema": {
              "type": "string",
              "example": "meine-agentur"
            }
          },
          {
            "name": "customer",
            "in": "path",
            "required": true,
            "description": "ID des Kunden",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Erfolg",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Customer"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "name"
                ],
                "properties": {
                  "name": {
                    "type": "string",
                    "maxLength": 160,
                    "description": "Name"
                  },
                  "reference": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "maxLength": 64,
                    "description": "Eigene Referenz"
                  },
                  "notes": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "maxLength": 5000,
                    "description": "Notizen"
                  },
                  "contact_email": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "format": "email",
                    "description": "Kontaktadresse"
                  },
                  "logo": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "description": "Logo als Data-URL; null entfernt es, ohne das Feld bleibt es"
                  },
                  "is_archived": {
                    "type": "boolean",
                    "description": "Archivieren oder wiederherstellen"
                  },
                  "monthly_report": {
                    "type": "boolean",
                    "description": "Monatlichen Bericht senden"
                  },
                  "report_locale": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "enum": [
                      "de",
                      "en",
                      null
                    ],
                    "description": "Sprache des Berichts"
                  }
                }
              },
              "example": {
                "name": "Musterfirma GmbH",
                "is_archived": true
              }
            }
          }
        }
      },
      "delete": {
        "operationId": "deleteCustomer",
        "tags": [
          "Kunden"
        ],
        "summary": "Kunden löschen",
        "description": "Entfernt den Kunden; seine Domains bleiben erhalten und verlieren nur die Zuordnung.\n\nBraucht ein Token mit Schreibrecht (`write`).",
        "x-scope": "write",
        "parameters": [
          {
            "name": "organization",
            "in": "path",
            "required": true,
            "description": "Slug der Organisation, steht in der Adresse des Dashboards und unter Einstellungen → Integrationen → API-Tokens. Ein Token erreicht nur seine eigene Organisation, andere antworten mit 404.",
            "schema": {
              "type": "string",
              "example": "meine-agentur"
            }
          },
          {
            "name": "customer",
            "in": "path",
            "required": true,
            "description": "ID des Kunden",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Gelöscht, keine Antwort"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        }
      }
    },
    "/orgs/{organization}/customers/{customer}/report": {
      "get": {
        "operationId": "getCustomerReport",
        "tags": [
          "Kunden"
        ],
        "summary": "Monatsbericht abrufen",
        "description": "Der Monatsbericht des Kunden als Daten: Zusammenfassung, je Domain Verfügbarkeit, Ausfallzeit, Meldungen und Zertifikat, dazu Meldungen, Änderungen und anstehende Abläufe. Ohne `month` der Vormonat, Sprache über `locale`.\n\nLese-Token genügt (`read`).",
        "x-scope": "read",
        "parameters": [
          {
            "name": "organization",
            "in": "path",
            "required": true,
            "description": "Slug der Organisation, steht in der Adresse des Dashboards und unter Einstellungen → Integrationen → API-Tokens. Ein Token erreicht nur seine eigene Organisation, andere antworten mit 404.",
            "schema": {
              "type": "string",
              "example": "meine-agentur"
            }
          },
          {
            "name": "customer",
            "in": "path",
            "required": true,
            "description": "ID des Kunden",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "month",
            "in": "query",
            "required": false,
            "description": "Berichtsmonat als YYYY-MM; Standard ist der Vormonat",
            "schema": {
              "type": "string",
              "pattern": "^\\d{4}-(0[1-9]|1[0-2])$",
              "example": "2026-08"
            }
          },
          {
            "name": "locale",
            "in": "query",
            "required": false,
            "description": "Sprache des Berichts (Texte, Datumsformate); ohne Angabe die Berichtssprache des Kunden, sonst die der Organisation. Accept-Language gilt hier nicht.",
            "schema": {
              "type": "string",
              "enum": [
                "de",
                "en"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Erfolg",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/CustomerReport"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        }
      }
    },
    "/orgs/{organization}/customers/{customer}/report/pdf": {
      "get": {
        "operationId": "getCustomerReportPdf",
        "tags": [
          "Kunden"
        ],
        "summary": "Monatsbericht als PDF",
        "description": "Derselbe Bericht als PDF; `download=1` liefert ihn als Anhang statt inline.\n\nLese-Token genügt (`read`).",
        "x-scope": "read",
        "parameters": [
          {
            "name": "organization",
            "in": "path",
            "required": true,
            "description": "Slug der Organisation, steht in der Adresse des Dashboards und unter Einstellungen → Integrationen → API-Tokens. Ein Token erreicht nur seine eigene Organisation, andere antworten mit 404.",
            "schema": {
              "type": "string",
              "example": "meine-agentur"
            }
          },
          {
            "name": "customer",
            "in": "path",
            "required": true,
            "description": "ID des Kunden",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "month",
            "in": "query",
            "required": false,
            "description": "Berichtsmonat als YYYY-MM; Standard ist der Vormonat",
            "schema": {
              "type": "string",
              "pattern": "^\\d{4}-(0[1-9]|1[0-2])$",
              "example": "2026-08"
            }
          },
          {
            "name": "locale",
            "in": "query",
            "required": false,
            "description": "Sprache des Berichts (Texte, Datumsformate); ohne Angabe die Berichtssprache des Kunden, sonst die der Organisation. Accept-Language gilt hier nicht.",
            "schema": {
              "type": "string",
              "enum": [
                "de",
                "en"
              ]
            }
          },
          {
            "name": "download",
            "in": "query",
            "required": false,
            "description": "Als Download (Content-Disposition attachment)",
            "schema": {
              "type": "boolean",
              "default": false
            }
          }
        ],
        "responses": {
          "200": {
            "description": "PDF-Datei",
            "content": {
              "application/pdf": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        }
      }
    },
    "/orgs/{organization}/customers/{customer}/report/share": {
      "post": {
        "operationId": "shareCustomerReport",
        "tags": [
          "Kunden"
        ],
        "summary": "Bericht freigeben",
        "description": "Erzeugt einen signierten Link auf das PDF, 60 Tage gültig, ohne Login abrufbar – zum Weitergeben an den Kunden.\n\nBraucht ein Token mit Schreibrecht (`write`).",
        "x-scope": "write",
        "parameters": [
          {
            "name": "organization",
            "in": "path",
            "required": true,
            "description": "Slug der Organisation, steht in der Adresse des Dashboards und unter Einstellungen → Integrationen → API-Tokens. Ein Token erreicht nur seine eigene Organisation, andere antworten mit 404.",
            "schema": {
              "type": "string",
              "example": "meine-agentur"
            }
          },
          {
            "name": "customer",
            "in": "path",
            "required": true,
            "description": "ID des Kunden",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "month",
            "in": "query",
            "required": false,
            "description": "Berichtsmonat als YYYY-MM; Standard ist der Vormonat",
            "schema": {
              "type": "string",
              "pattern": "^\\d{4}-(0[1-9]|1[0-2])$",
              "example": "2026-08"
            }
          },
          {
            "name": "locale",
            "in": "query",
            "required": false,
            "description": "Sprache des Berichts (Texte, Datumsformate); ohne Angabe die Berichtssprache des Kunden, sonst die der Organisation. Accept-Language gilt hier nicht.",
            "schema": {
              "type": "string",
              "enum": [
                "de",
                "en"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Erfolg",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "url": {
                          "type": "string",
                          "format": "uri",
                          "description": "Signierter Link"
                        },
                        "expires_at": {
                          "type": "string",
                          "format": "date-time",
                          "description": "Gültig bis"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        }
      }
    },
    "/orgs/{organization}/customers/{customer}/compliance": {
      "get": {
        "operationId": "getCustomerCompliance",
        "tags": [
          "Kunden"
        ],
        "summary": "Compliance-Bericht des Kunden",
        "description": "Ordnet die letzten Prüfergebnisse den Anforderungen aus BSI TR-03108 (sicherer E-Mail-Transport), BSI TR-03182 (E-Mail-Authentifizierung) und NIS2 Art. 21 Abs. 2 zu: je Anforderung `met`, `partial`, `failed` oder `unknown` mit Beleg und Empfehlung. Technische Indikation von außen, keine Zertifizierung. Ab Agency (Tariffeature `reports`, sonst 402).\n\nLese-Token genügt (`read`).",
        "x-scope": "read",
        "parameters": [
          {
            "name": "organization",
            "in": "path",
            "required": true,
            "description": "Slug der Organisation, steht in der Adresse des Dashboards und unter Einstellungen → Integrationen → API-Tokens. Ein Token erreicht nur seine eigene Organisation, andere antworten mit 404.",
            "schema": {
              "type": "string",
              "example": "meine-agentur"
            }
          },
          {
            "name": "customer",
            "in": "path",
            "required": true,
            "description": "ID des Kunden",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "locale",
            "in": "query",
            "required": false,
            "description": "Sprache des Berichts (Texte, Datumsformate); ohne Angabe die Berichtssprache des Kunden, sonst die der Organisation. Accept-Language gilt hier nicht.",
            "schema": {
              "type": "string",
              "enum": [
                "de",
                "en"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Erfolg",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "additionalProperties": true,
                      "description": "Organisation, Kunde, Abschnitte (frameworks), Summen und je Domain die Prüfpunkte"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        }
      }
    },
    "/orgs/{organization}/customers/{customer}/compliance/pdf": {
      "get": {
        "operationId": "getCustomerCompliancePdf",
        "tags": [
          "Kunden"
        ],
        "summary": "Compliance-Bericht des Kunden als PDF",
        "description": "Derselbe Bericht als PDF im Stil des Monatsberichts, mit White-Label; `download=1` liefert ihn als Anhang.\n\nLese-Token genügt (`read`).",
        "x-scope": "read",
        "parameters": [
          {
            "name": "organization",
            "in": "path",
            "required": true,
            "description": "Slug der Organisation, steht in der Adresse des Dashboards und unter Einstellungen → Integrationen → API-Tokens. Ein Token erreicht nur seine eigene Organisation, andere antworten mit 404.",
            "schema": {
              "type": "string",
              "example": "meine-agentur"
            }
          },
          {
            "name": "customer",
            "in": "path",
            "required": true,
            "description": "ID des Kunden",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "locale",
            "in": "query",
            "required": false,
            "description": "Sprache des Berichts (Texte, Datumsformate); ohne Angabe die Berichtssprache des Kunden, sonst die der Organisation. Accept-Language gilt hier nicht.",
            "schema": {
              "type": "string",
              "enum": [
                "de",
                "en"
              ]
            }
          },
          {
            "name": "download",
            "in": "query",
            "required": false,
            "description": "Als Download (Content-Disposition attachment)",
            "schema": {
              "type": "boolean",
              "default": false
            }
          }
        ],
        "responses": {
          "200": {
            "description": "PDF-Datei",
            "content": {
              "application/pdf": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        }
      }
    },
    "/orgs/{organization}/customers/{customer}/report/settings": {
      "put": {
        "operationId": "updateCustomerReportSettings",
        "tags": [
          "Kunden"
        ],
        "summary": "Inhalt des Monatsberichts",
        "description": "Was der Bericht des Kunden zeigt – Vorschau, PDF, Link und Versand: Abschnitte, Details je Meldung und welche Meldungen. Fehlende Schlüssel bleiben unverändert; der Standard entspricht dem Bericht ohne Einstellung (alle Abschnitte, Meldungen mit Dauer, ohne weitere Details). Der Stand steht am Kunden unter `report_settings`.\n\nBraucht ein Token mit Schreibrecht (`write`).",
        "x-scope": "write",
        "parameters": [
          {
            "name": "organization",
            "in": "path",
            "required": true,
            "description": "Slug der Organisation, steht in der Adresse des Dashboards und unter Einstellungen → Integrationen → API-Tokens. Ein Token erreicht nur seine eigene Organisation, andere antworten mit 404.",
            "schema": {
              "type": "string",
              "example": "meine-agentur"
            }
          },
          {
            "name": "customer",
            "in": "path",
            "required": true,
            "description": "ID des Kunden",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Erfolg",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "additionalProperties": true,
                      "description": "Vollständige Einstellungen mit Standardwerten"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [],
                "properties": {
                  "sections": {
                    "type": "object",
                    "properties": {
                      "availability": {
                        "type": "boolean"
                      },
                      "pages": {
                        "type": "boolean"
                      },
                      "pagespeed": {
                        "type": "boolean"
                      },
                      "expiring": {
                        "type": "boolean"
                      },
                      "hosting": {
                        "type": "boolean"
                      },
                      "upcoming": {
                        "type": "boolean"
                      },
                      "incidents": {
                        "type": "boolean"
                      },
                      "changes": {
                        "type": "boolean"
                      }
                    },
                    "description": "Abschnitte des Berichts"
                  },
                  "incident_details": {
                    "type": "object",
                    "properties": {
                      "duration": {
                        "type": "boolean"
                      },
                      "timeline": {
                        "type": "boolean"
                      },
                      "channels": {
                        "type": "boolean"
                      },
                      "acknowledged_by": {
                        "type": "boolean"
                      },
                      "note": {
                        "type": "boolean"
                      },
                      "changes": {
                        "type": "boolean"
                      }
                    },
                    "description": "Details je Meldung: Dauer, Verlauf, benachrichtigte Kanalarten, wer quittiert hat, Ursache und Maßnahmen, Änderungen mit Vorher/Nachher"
                  },
                  "incident_filter": {
                    "type": "object",
                    "properties": {
                      "severity": {
                        "type": "string",
                        "enum": [
                          "all",
                          "critical"
                        ]
                      },
                      "status": {
                        "type": "string",
                        "enum": [
                          "all",
                          "resolved"
                        ]
                      }
                    },
                    "description": "Welche Meldungen: alle oder nur kritische, alle oder nur behobene"
                  }
                }
              },
              "example": {
                "sections": {
                  "changes": false
                },
                "incident_details": {
                  "timeline": true,
                  "note": true
                },
                "incident_filter": {
                  "severity": "critical"
                }
              }
            }
          }
        }
      }
    },
    "/orgs/{organization}/customers/{customer}/status-page": {
      "post": {
        "operationId": "enableCustomerStatusPage",
        "tags": [
          "Kunden"
        ],
        "summary": "Status-Seite einschalten",
        "description": "Erzeugt das Token der öffentlichen Status-Seite des Kunden (ohne Login erreichbar); ein bestehendes wird ersetzt, die alte Adresse gilt dann nicht mehr. Die Adresse steht in `status_page_url`. Für archivierte Kunden antwortet der Server mit 422.\n\nBraucht ein Token mit Schreibrecht (`write`).",
        "x-scope": "write",
        "parameters": [
          {
            "name": "organization",
            "in": "path",
            "required": true,
            "description": "Slug der Organisation, steht in der Adresse des Dashboards und unter Einstellungen → Integrationen → API-Tokens. Ein Token erreicht nur seine eigene Organisation, andere antworten mit 404.",
            "schema": {
              "type": "string",
              "example": "meine-agentur"
            }
          },
          {
            "name": "customer",
            "in": "path",
            "required": true,
            "description": "ID des Kunden",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Eingeschaltet, Adresse in `status_page_url`",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Customer"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        }
      },
      "delete": {
        "operationId": "disableCustomerStatusPage",
        "tags": [
          "Kunden"
        ],
        "summary": "Status-Seite abschalten",
        "description": "Löscht das Token; die Adresse antwortet danach mit 404. Liefert den Kunden zurück (`status_page_url` ist null).\n\nBraucht ein Token mit Schreibrecht (`write`).",
        "x-scope": "write",
        "parameters": [
          {
            "name": "organization",
            "in": "path",
            "required": true,
            "description": "Slug der Organisation, steht in der Adresse des Dashboards und unter Einstellungen → Integrationen → API-Tokens. Ein Token erreicht nur seine eigene Organisation, andere antworten mit 404.",
            "schema": {
              "type": "string",
              "example": "meine-agentur"
            }
          },
          {
            "name": "customer",
            "in": "path",
            "required": true,
            "description": "ID des Kunden",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Abgeschaltet",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Customer"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        }
      }
    },
    "/orgs/{organization}/customers/{customer}/status-page/host/verify": {
      "post": {
        "operationId": "verifyCustomerStatusPageHost",
        "tags": [
          "Kunden"
        ],
        "summary": "Eigene Adresse der Status-Seite nachweisen",
        "description": "Prüft den TXT-Record aus `status_page_host_record` (Name `_domainwarn.<Adresse>`). Erst nach dem Nachweis liefert die Website die Status-Seite unter `status_page_host` aus. Fehlt der Record oder ist das DNS gerade nicht abfragbar, antwortet der Server mit 422.\n\nBraucht ein Token mit Schreibrecht (`write`).",
        "x-scope": "write",
        "parameters": [
          {
            "name": "organization",
            "in": "path",
            "required": true,
            "description": "Slug der Organisation, steht in der Adresse des Dashboards und unter Einstellungen → Integrationen → API-Tokens. Ein Token erreicht nur seine eigene Organisation, andere antworten mit 404.",
            "schema": {
              "type": "string",
              "example": "meine-agentur"
            }
          },
          {
            "name": "customer",
            "in": "path",
            "required": true,
            "description": "ID des Kunden",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Nachgewiesen, `status_page_host_verified` ist true",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Customer"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/ValidationError"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "bearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "description": "API-Token aus dem Dashboard (Einstellungen → Integrationen → API-Tokens) im Header `Authorization: Bearer <TOKEN>`; dazu `Accept: application/json`."
      }
    },
    "responses": {
      "Unauthorized": {
        "description": "Token fehlt, ist abgelaufen oder widerrufen",
        "content": {
          "application/problem+json": {
            "schema": {
              "$ref": "#/components/schemas/ProblemDetails"
            }
          }
        }
      },
      "Forbidden": {
        "description": "Token darf das nicht (Lese-Token bei schreibender Methode oder gesperrter Bereich)",
        "content": {
          "application/problem+json": {
            "schema": {
              "$ref": "#/components/schemas/ProblemDetails"
            }
          }
        }
      },
      "NotFound": {
        "description": "Organisation oder Objekt nicht gefunden, auch bei fremder Organisation",
        "content": {
          "application/problem+json": {
            "schema": {
              "$ref": "#/components/schemas/ProblemDetails"
            }
          }
        }
      },
      "PaymentRequired": {
        "description": "Organisation gesperrt oder ohne aktiven Tarif",
        "content": {
          "application/problem+json": {
            "schema": {
              "$ref": "#/components/schemas/PlanProblem"
            }
          }
        }
      },
      "ValidationError": {
        "description": "Eingabe ungültig, Meldungen je Feld in `errors`",
        "content": {
          "application/problem+json": {
            "schema": {
              "$ref": "#/components/schemas/ValidationProblem"
            }
          }
        }
      },
      "TooManyRequests": {
        "description": "Limit überschritten; `Retry-After` nennt die Wartezeit in Sekunden",
        "content": {
          "application/problem+json": {
            "schema": {
              "$ref": "#/components/schemas/ProblemDetails"
            }
          }
        }
      }
    },
    "schemas": {
      "Fix": {
        "type": "object",
        "description": "Vorschlag zu einem Befund, den DomainWarn über die Integration eines DNS-Anbieters (z. B. Cloudflare) umsetzen kann: einen fehlenden Record anlegen (action create) oder einen bestehenden ändern (action update)",
        "properties": {
          "key": {
            "type": "string",
            "description": "Schlüssel des Vorschlags, z. B. dmarc_missing, spf_missing, spf_all, tls_rpt_missing, caa_missing, caa_issuer"
          },
          "finding": {
            "type": "string",
            "description": "Befund, der den Vorschlag auslöst"
          },
          "type": {
            "type": "string",
            "description": "Record-Typ (TXT, CAA)"
          },
          "name": {
            "type": "string",
            "description": "Name des Records"
          },
          "content": {
            "type": "string",
            "description": "Inhalt des Records, wie er angelegt würde"
          },
          "monitor_id": {
            "type": "string",
            "format": "uuid",
            "description": "Monitor, dessen Befund den Vorschlag auslöst"
          },
          "action": {
            "type": "string",
            "enum": [
              "create",
              "update"
            ],
            "description": "create legt einen Record zusätzlich an, update ändert genau einen bestehenden (nur mit replace und current)"
          },
          "current": {
            "type": "string",
            "description": "Bestehender Wert laut letzter Prüfung (nur bei action update)"
          },
          "existing": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Records desselben Namens und Typs, die unverändert bleiben (etwa der CAA-Satz bei caa_issuer)"
          },
          "note_key": {
            "type": "string",
            "description": "Schlüssel des Hinweises zum Vorschlag, z. B. dmarc_missing, spf_include, spf_mx, caa_missing; das Dashboard übersetzt ihn"
          },
          "note_params": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            },
            "description": "Platzhalter des Hinweises, z. B. provider (spf_include) oder ca (caa_missing)"
          },
          "input": {
            "type": "string",
            "enum": [
              "rua",
              "senders"
            ],
            "description": "Pflichtangabe beim Anwenden: Berichtsadresse (rua) oder Versanddienste (senders); fehlt, wenn keine nötig ist"
          },
          "input_default": {
            "type": "string",
            "description": "Vorschlag für die Pflichtangabe (nur mit `input`)"
          },
          "input_value": {
            "type": "string",
            "description": "Wert, der sicher gilt und vorbelegt werden kann: die Berichtsadresse von DomainWarn für die Domain (tls_rpt_missing)"
          }
        },
        "required": [
          "key",
          "finding",
          "type",
          "name",
          "content",
          "monitor_id",
          "action",
          "note_key",
          "note_params"
        ]
      },
      "Organization": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "description": "ID der Organisation"
          },
          "name": {
            "type": "string",
            "description": "Name"
          },
          "slug": {
            "type": "string",
            "description": "Slug für die Adresse `/orgs/{organization}`"
          },
          "plan": {
            "type": "string",
            "enum": [
              "trial",
              "free",
              "freelancer",
              "agency",
              "agency_pro"
            ],
            "description": "Wirksamer Tarif: trial während der Testphase (danach free), sonst der gebuchte oder geschenkte Tarif"
          },
          "monitoring_active": {
            "type": "boolean",
            "description": "Ob die Prüfungen laufen (false bei gesperrter Organisation)"
          },
          "trial_days_left": {
            "type": [
              "integer",
              "null"
            ],
            "description": "Verbleibende Tage der Testphase, null außerhalb der Testphase"
          },
          "timezone": {
            "type": "string",
            "description": "Zeitzone der Organisation"
          },
          "locale": {
            "type": "string",
            "enum": [
              "de",
              "en"
            ],
            "description": "Sprache der Organisation"
          },
          "suspended": {
            "type": "boolean",
            "description": "Vom Betreiber gesperrt"
          },
          "role": {
            "type": "string",
            "enum": [
              "viewer",
              "member"
            ],
            "description": "Rolle des Tokens: viewer (read) oder member (write)"
          },
          "created_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "Anlagezeitpunkt"
          }
        }
      },
      "Customer": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "description": "ID des Kunden"
          },
          "name": {
            "type": "string",
            "description": "Name, eindeutig je Organisation"
          },
          "reference": {
            "type": [
              "string",
              "null"
            ],
            "description": "Eigene Referenz, z. B. Kundennummer"
          },
          "notes": {
            "type": [
              "string",
              "null"
            ],
            "description": "Notizen"
          },
          "contact_email": {
            "type": [
              "string",
              "null"
            ],
            "format": "email",
            "description": "Kontaktadresse für Berichte"
          },
          "logo": {
            "type": [
              "string",
              "null"
            ],
            "description": "Logo als Data-URL (PNG, JPEG oder SVG bis 300 KB) für Status-Seite, Bericht und Liste"
          },
          "is_archived": {
            "type": "boolean",
            "description": "Archiviert"
          },
          "monthly_report": {
            "type": "boolean",
            "description": "Monatlicher Kundenbericht per E-Mail"
          },
          "report_locale": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "de",
              "en",
              null
            ],
            "description": "Sprache des Berichts"
          },
          "report_settings": {
            "type": "object",
            "additionalProperties": true,
            "description": "Inhalt des Monatsberichts: `sections`, `incident_details`, `incident_filter` (siehe Einstellungen des Monatsberichts)"
          },
          "last_report_sent_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "Letzter Berichtsversand"
          },
          "status_page_url": {
            "type": [
              "string",
              "null"
            ],
            "format": "uri",
            "description": "Öffentliche Status-Seite des Kunden (enthält das Token); null, solange keine eingeschaltet ist"
          },
          "status_page_host": {
            "type": [
              "string",
              "null"
            ],
            "description": "Eigene Adresse der Status-Seite (CNAME auf die Website), z. B. status.kunde.de"
          },
          "status_page_host_verified": {
            "type": "boolean",
            "description": "Eigene Adresse per TXT-Record nachgewiesen; erst dann liefert die Website die Seite dort aus"
          },
          "status_page_host_record": {
            "type": [
              "object",
              "null"
            ],
            "description": "TXT-Record zum Nachweis der eigenen Adresse (type, name, value); null ohne Adresse oder nach dem Nachweis",
            "properties": {
              "type": {
                "type": "string"
              },
              "name": {
                "type": "string"
              },
              "value": {
                "type": "string"
              }
            }
          },
          "status_badge_url": {
            "type": [
              "string",
              "null"
            ],
            "format": "uri",
            "description": "SVG-Siegel mit dem Gesamtzustand zum Einbetten; null ohne eingeschaltete Status-Seite"
          },
          "sla_target": {
            "type": [
              "number",
              "null"
            ],
            "description": "Zugesicherte Verfügbarkeit in Prozent (90–100); null = kein SLA"
          },
          "domains_count": {
            "type": "integer",
            "description": "Anzahl zugeordneter Domains"
          },
          "created_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "Anlagezeitpunkt"
          }
        }
      },
      "Monitor": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "description": "ID des Monitors"
          },
          "domain_id": {
            "type": "string",
            "format": "uuid",
            "description": "ID der Domain"
          },
          "type": {
            "type": "string",
            "enum": [
              "http",
              "tls",
              "dns",
              "mx",
              "spf",
              "dmarc",
              "domain",
              "dkim",
              "dnssec",
              "mta_sts",
              "blacklist",
              "tls_rpt",
              "bimi",
              "smtp",
              "reverse_dns",
              "ct_log",
              "redirects",
              "caa",
              "nameservers",
              "ipv6",
              "dane",
              "cms",
              "privacy",
              "pagespeed",
              "heartbeat",
              "security_txt",
              "ports",
              "lookalike",
              "crawl",
              "journey",
              "autodiscover",
              "takeover",
              "http3",
              "safe_browsing",
              "accessibility",
              "visual",
              "subdomains"
            ],
            "description": "Prüfart"
          },
          "target": {
            "type": "string",
            "description": "Ziel: URL bei http, sonst Hostname"
          },
          "config": {
            "type": "object",
            "additionalProperties": true,
            "description": "Konfiguration je Prüfart, z. B. expected_status und slow_ms (http), port und starttls (tls), selectors (dkim)"
          },
          "interval_seconds": {
            "type": "integer",
            "description": "Prüfintervall in Sekunden (vom Tarif begrenzt)"
          },
          "is_enabled": {
            "type": "boolean",
            "description": "Aktiv"
          },
          "current_status": {
            "type": "string",
            "enum": [
              "ok",
              "warning",
              "critical",
              "unknown"
            ],
            "description": "Aktueller Zustand"
          },
          "next_check_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "Nächste Prüfung"
          },
          "last_checked_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "Letzte Prüfung"
          },
          "consecutive_failures": {
            "type": "integer",
            "description": "Fehlschläge in Folge"
          },
          "consecutive_errors": {
            "type": "integer",
            "description": "Prüffehler in Folge (Prüfung selbst nicht möglich)"
          },
          "failure_locations": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Prüfstandorte, die den aktuellen Ausfall sehen; leer, solange die Prüfung besteht"
          },
          "is_volatile": {
            "type": "boolean",
            "description": "Ergebnis schwankt zwischen Prüfungen"
          },
          "last_payload": {
            "type": [
              "object",
              "null"
            ],
            "additionalProperties": true,
            "description": "Rohdaten der letzten Prüfung, Aufbau je Prüfart"
          },
          "last_payload_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "Zeitpunkt der Rohdaten"
          },
          "last_findings": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Finding"
            },
            "description": "Befunde der letzten Prüfung"
          },
          "ping_url": {
            "type": [
              "string",
              "null"
            ],
            "format": "uri",
            "description": "Nur bei heartbeat: Adresse, die der Cronjob oder die Erweiterung aufruft (mit /fail für einen fehlgeschlagenen Lauf)"
          },
          "pending_change": {
            "type": "boolean",
            "description": "Änderung erkannt, Bestätigungsprüfung steht aus"
          },
          "last_fingerprint": {
            "type": [
              "string",
              "null"
            ],
            "description": "Fingerabdruck der zuletzt gesehenen Konfiguration"
          }
        }
      },
      "JourneyStep": {
        "type": "object",
        "description": "Ein Schritt eines Klickwegs. Welche Felder gelten, bestimmt `type`: goto (url), click (selector oder text), fill (selector, value – nur beim Schreiben; gelesen wird nur has_value), select (selector, value), expect_text (text), expect_url (contains oder pattern), expect_status (status), wait (ms, höchstens 5000).",
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "goto",
              "click",
              "fill",
              "select",
              "expect_text",
              "expect_url",
              "expect_status",
              "wait"
            ],
            "description": "Schrittart"
          },
          "url": {
            "type": "string",
            "description": "goto: Adresse (absolut mit http(s) oder Pfad ab /)"
          },
          "selector": {
            "type": "string",
            "description": "CSS-Selektor (click, fill, select)"
          },
          "text": {
            "type": "string",
            "description": "Sichtbarer Text (click: anzuklickendes Element; expect_text: erwarteter Text)"
          },
          "value": {
            "type": "string",
            "description": "fill/select: einzutragender Wert; fill-Werte werden verschlüsselt gespeichert und nie zurückgegeben"
          },
          "has_value": {
            "type": "boolean",
            "description": "fill, nur beim Lesen: ein Wert ist hinterlegt"
          },
          "keep_value": {
            "type": "boolean",
            "description": "fill, nur beim Schreiben: gespeicherten Wert behalten statt neu setzen"
          },
          "contains": {
            "type": "string",
            "description": "expect_url: Teil der Adresse"
          },
          "pattern": {
            "type": "string",
            "description": "expect_url: regulärer Ausdruck"
          },
          "status": {
            "type": "integer",
            "description": "expect_status: erwarteter HTTP-Status der letzten Navigation"
          },
          "ms": {
            "type": "integer",
            "description": "wait: Wartezeit in ms (höchstens 5000)"
          }
        }
      },
      "Journey": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "description": "ID des Klickwegs"
          },
          "domain_id": {
            "type": "string",
            "format": "uuid",
            "description": "ID der Domain"
          },
          "name": {
            "type": "string",
            "description": "Name, je Domain eindeutig"
          },
          "start_url": {
            "type": "string",
            "description": "Startadresse, muss zur Domain gehören"
          },
          "steps": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/JourneyStep"
            },
            "description": "Schritte in Reihenfolge; fill ohne Wert, nur has_value"
          },
          "slow_ms": {
            "type": "integer",
            "description": "Gesamtdauer in ms, ab der der Klickweg als langsam gilt"
          },
          "interval_seconds": {
            "type": "integer",
            "description": "Prüfintervall in Sekunden (ab Agency 900)"
          },
          "is_enabled": {
            "type": "boolean",
            "description": "Aktiv"
          },
          "current_status": {
            "type": "string",
            "enum": [
              "ok",
              "warning",
              "critical",
              "unknown"
            ],
            "description": "Aktueller Zustand"
          },
          "next_check_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "Nächste Prüfung"
          },
          "last_checked_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "Letzte Prüfung"
          },
          "consecutive_failures": {
            "type": "integer",
            "description": "Fehlschläge in Folge"
          },
          "consecutive_errors": {
            "type": "integer",
            "description": "Läufe ohne Ergebnis in Folge (Browser-Runner nicht erreichbar)"
          },
          "last_findings": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Finding"
            },
            "description": "Befunde des letzten Laufs"
          },
          "last_result": {
            "type": [
              "object",
              "null"
            ],
            "additionalProperties": true,
            "description": "Letzter Lauf mit Urteil: status, ok, duration_ms, final_url, steps (index, type, label, status ok|failed|skipped|blocked, duration_ms, error), failed_step (index, url, page_title, page_text), at"
          },
          "last_error": {
            "type": [
              "object",
              "null"
            ],
            "additionalProperties": true,
            "description": "Nur wenn der jüngste Lauf kein Ergebnis hatte (Runner nicht erreichbar): at, message"
          },
          "runs": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": true
            },
            "description": "Letzte Läufe, neueste zuerst: at, status, duration_ms, failed_step"
          }
        }
      },
      "VisualMonitor": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "description": "ID des Seitenbilds (Monitor vom Typ visual)"
          },
          "domain_id": {
            "type": "string",
            "format": "uuid",
            "description": "ID der Domain"
          },
          "url": {
            "type": "string",
            "description": "Überwachte Adresse, gehört zur Domain"
          },
          "viewports": {
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "desktop",
                "mobile"
              ]
            },
            "description": "Ansichten: desktop (1280 px) und/oder mobile (390 px)"
          },
          "threshold_percent": {
            "type": "number",
            "description": "Abweichung in Prozent der Fläche, ab der gemeldet wird"
          },
          "ignore_selectors": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "CSS-Selektoren, die vor der Aufnahme übermalt werden"
          },
          "hide_cookie_banners": {
            "type": "boolean",
            "description": "Cookie-Banner vor der Aufnahme bestätigen (Zustimmung) und übrige Banner übermalen"
          },
          "interval_seconds": {
            "type": "integer",
            "description": "Prüfintervall in Sekunden (mindestens 3600)"
          },
          "is_enabled": {
            "type": "boolean",
            "description": "Aktiv"
          },
          "current_status": {
            "type": "string",
            "enum": [
              "ok",
              "warning",
              "critical",
              "unknown"
            ],
            "description": "Aktueller Zustand"
          },
          "next_check_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "Nächste Prüfung"
          },
          "last_checked_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "Letzte Prüfung"
          },
          "last_findings": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Finding"
            },
            "description": "Befunde des letzten Laufs"
          },
          "last_result": {
            "type": [
              "object",
              "null"
            ],
            "additionalProperties": true,
            "description": "Letzter Lauf: status, at, title, http_status, error, shots (viewport, state baseline|unchanged|changed, ratio_percent)"
          },
          "baselines": {
            "type": "object",
            "additionalProperties": true,
            "description": "Gültige Referenz je Ansicht (desktop, mobile) oder null: id, width, height, created_at, image_url (signiert, zwei Stunden gültig)"
          },
          "changes": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": true
            },
            "description": "Letzte Abweichungen, neueste zuerst: id, viewport, ratio_percent, created_at, accepted_at, open, image_url, diff_url, baseline_url"
          },
          "can_accept": {
            "type": "boolean",
            "description": "Es gibt eine offene Abweichung, die sich als neue Referenz übernehmen lässt"
          }
        }
      },
      "Finding": {
        "type": "object",
        "description": "Befund einer Prüfung, Text in der Sprache aus dem Accept-Language-Header",
        "properties": {
          "code": {
            "type": "string",
            "description": "Maschinenlesbarer Schlüssel, z. B. spf.too_many_lookups"
          },
          "severity": {
            "type": "string",
            "enum": [
              "info",
              "warning",
              "critical"
            ],
            "description": "Schweregrad"
          },
          "params": {
            "type": "object",
            "additionalProperties": true,
            "description": "Werte zum Befund, z. B. Anzahl der Lookups"
          },
          "message": {
            "type": "string",
            "description": "Übersetzte Beschreibung"
          },
          "recommendation": {
            "type": [
              "string",
              "null"
            ],
            "description": "Übersetzte Empfehlung, wenn es eine gibt"
          }
        },
        "additionalProperties": true
      },
      "Domain": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "description": "ID der Domain"
          },
          "name": {
            "type": "string",
            "description": "Domain in ASCII (Punycode)"
          },
          "unicode_name": {
            "type": "string",
            "description": "Domain in Unicode"
          },
          "customer_id": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid",
            "description": "ID des Kunden"
          },
          "customer": {
            "type": [
              "object",
              "null"
            ],
            "properties": {
              "id": {
                "type": "string",
                "format": "uuid",
                "description": "ID"
              },
              "name": {
                "type": "string",
                "description": "Name"
              }
            },
            "description": "Zugeordneter Kunde"
          },
          "is_active": {
            "type": "boolean",
            "description": "Überwachung aktiv"
          },
          "paused_until": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "Pausiert bis"
          },
          "is_paused": {
            "type": "boolean",
            "description": "Derzeit pausiert"
          },
          "in_maintenance": {
            "type": "boolean",
            "description": "Gerade in einem aktiven Wartungsfenster (keine Meldungen und Benachrichtigungen)"
          },
          "plan_paused": {
            "type": "boolean",
            "description": "Vom Tarif pausiert (über dem Domainlimit)"
          },
          "cms": {
            "type": [
              "object",
              "null"
            ],
            "properties": {
              "key": {
                "type": "string",
                "description": "Schlüssel, z. B. wordpress"
              },
              "name": {
                "type": "string",
                "description": "Name"
              },
              "version": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "Erkannte Version"
              }
            },
            "description": "Erkanntes Content-Management-System"
          },
          "cms_detected_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "Zeitpunkt der CMS-Erkennung"
          },
          "mail_detected": {
            "type": [
              "boolean",
              "null"
            ],
            "description": "Ob die Domain Mail empfängt (MX vorhanden)"
          },
          "monitoring_groups": {
            "type": "object",
            "properties": {
              "web": {
                "type": "boolean",
                "description": "Website und Zertifikate"
              },
              "mail": {
                "type": "boolean",
                "description": "Mail-Infrastruktur"
              },
              "dns": {
                "type": "boolean",
                "description": "DNS, DNSSEC, Domain und Blacklists"
              }
            },
            "description": "Ein- oder ausgeschaltete Überwachungsbereiche"
          },
          "notification_overrides": {
            "type": [
              "object",
              "null"
            ],
            "description": "Abweichende Benachrichtigungsregeln nur für diese Domain; null übernimmt die Einstellungen der Organisation",
            "properties": {
              "failure_minutes": {
                "type": "integer",
                "description": "Minuten bis zur Meldung eines Ausfalls (1 bis 1440)",
                "minimum": 1,
                "maximum": 1440
              },
              "recovery_minutes": {
                "type": "integer",
                "description": "Minuten bis zur Entwarnung (1 bis 1440)",
                "minimum": 1,
                "maximum": 1440
              },
              "min_severity": {
                "type": "string",
                "enum": [
                  "info",
                  "warning",
                  "critical"
                ],
                "description": "Kleinster gemeldeter Schweregrad"
              },
              "ignore_quiet_hours": {
                "type": "boolean",
                "description": "Auch in den Ruhezeiten melden"
              },
              "notify_on_change": {
                "type": "array",
                "items": {
                  "type": "string"
                },
                "description": "Änderungsarten, die gemeldet werden"
              }
            }
          },
          "health_status": {
            "type": "string",
            "enum": [
              "healthy",
              "warning",
              "critical",
              "unknown"
            ],
            "description": "Gesamtzustand aus allen Monitoren"
          },
          "health_computed_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "Zeitpunkt der Berechnung"
          },
          "last_checked_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "Letzte Prüfung"
          },
          "expires_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "Ablauf der Domain (Registry), nicht für .de"
          },
          "expiry_available": {
            "type": "boolean",
            "description": "Ob ein Ablaufdatum ermittelt werden kann"
          },
          "monitors": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Monitor"
            },
            "description": "Monitore (nur bei Einzelabruf, Anlegen und Ändern)"
          },
          "open_incidents_count": {
            "type": "integer",
            "description": "Offene Meldungen"
          },
          "suggestions_count": {
            "type": "integer",
            "description": "Offene Hostnamen-Vorschläge (nur bei Einzelabruf)"
          },
          "created_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "Anlagezeitpunkt"
          }
        }
      },
      "HostnameSuggestion": {
        "type": "object",
        "description": "Aus Certificate-Transparency-Logs entdeckter Hostname unter einer Domain, der noch nicht überwacht wird",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "description": "ID des Vorschlags"
          },
          "domain_id": {
            "type": "string",
            "format": "uuid",
            "description": "ID der Domain"
          },
          "hostname": {
            "type": "string",
            "description": "Vorgeschlagener Hostname"
          },
          "source": {
            "type": "string",
            "enum": [
              "ct_log"
            ],
            "description": "Quelle des Vorschlags"
          },
          "status": {
            "type": "string",
            "enum": [
              "new",
              "added",
              "dismissed"
            ],
            "description": "new (offen), added (Monitor angelegt) oder dismissed (verworfen)"
          },
          "first_seen_at": {
            "type": "string",
            "format": "date-time",
            "description": "Erstmals gesehen"
          },
          "last_seen_at": {
            "type": "string",
            "format": "date-time",
            "description": "Zuletzt gesehen"
          }
        }
      },
      "DomainImport": {
        "type": "object",
        "description": "Import einer bestätigten Domainliste im Hintergrund; die Zähler wachsen blockweise, bis status done oder failed ist",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "description": "ID des Imports"
          },
          "status": {
            "type": "string",
            "enum": [
              "queued",
              "running",
              "done",
              "failed"
            ],
            "description": "Wartend, läuft, abgeschlossen oder abgebrochen"
          },
          "customer_id": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid",
            "description": "Kunde für alle angelegten Domains"
          },
          "total": {
            "type": "integer",
            "description": "Namen im Import (ohne Leerzeilen, Kommentare und Doppelte)"
          },
          "created": {
            "type": "integer",
            "description": "Angelegt (neue Domains und Hostnamen bestehender Domains)"
          },
          "skipped": {
            "type": "integer",
            "description": "Übersprungen: bereits überwacht oder vorhanden"
          },
          "failed": {
            "type": "integer",
            "description": "Abgelehnt, Grund in errors"
          },
          "errors": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "name": {
                  "type": "string",
                  "description": "Eingabe"
                },
                "reason": {
                  "type": "string",
                  "description": "Meldung"
                }
              }
            },
            "description": "Abgelehnte und übersprungene Namen mit Grund"
          },
          "error": {
            "type": [
              "string",
              "null"
            ],
            "description": "Grund bei status failed"
          },
          "started_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "Beginn der Verarbeitung"
          },
          "finished_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "Ende der Verarbeitung"
          },
          "created_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "Angelegt am"
          }
        }
      },
      "DomainBulkOperation": {
        "type": "object",
        "description": "Massenaktion auf ausgewählte Domains mit Ergebnis je Domain; im Hintergrund wachsen processed und results, bis status done oder failed ist",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "description": "ID der Massenaktion"
          },
          "action": {
            "type": "string",
            "enum": [
              "pause",
              "resume",
              "assign_customer",
              "set_areas",
              "set_interval",
              "check_now",
              "delete"
            ],
            "description": "Ausgeführte Aktion"
          },
          "status": {
            "type": "string",
            "enum": [
              "queued",
              "running",
              "done",
              "failed"
            ],
            "description": "Wartend, läuft, abgeschlossen oder abgebrochen"
          },
          "total": {
            "type": "integer",
            "description": "Angeforderte Domains"
          },
          "processed": {
            "type": "integer",
            "description": "Bisher verarbeitet"
          },
          "succeeded": {
            "type": "integer",
            "description": "Erfolgreich"
          },
          "skipped": {
            "type": "integer",
            "description": "Übersprungen, Grund in results"
          },
          "failed": {
            "type": "integer",
            "description": "Fehlgeschlagen"
          },
          "results": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string",
                  "format": "uuid",
                  "description": "Angeforderte Domain-ID"
                },
                "name": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "description": "Name der Domain; null, wenn es sie in der Organisation nicht gibt"
                },
                "status": {
                  "type": "string",
                  "enum": [
                    "ok",
                    "skipped",
                    "failed"
                  ]
                },
                "reason": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "enum": [
                    "not_found",
                    "unchanged",
                    "not_paused",
                    "plan_paused",
                    "paused",
                    "no_monitor",
                    "rate_limited",
                    "error",
                    null
                  ],
                  "description": "Grund bei skipped oder failed"
                }
              }
            },
            "description": "Ergebnis je Domain in der Reihenfolge der Anfrage"
          },
          "error": {
            "type": [
              "string",
              "null"
            ],
            "description": "Grund bei status failed"
          },
          "started_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "Beginn der Verarbeitung"
          },
          "finished_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "Ende der Verarbeitung"
          },
          "created_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "Angelegt am"
          }
        }
      },
      "MaintenanceWindow": {
        "type": "object",
        "description": "Wartungsfenster: für eine Domain, einen Kunden oder die ganze Organisation; währenddessen entstehen keine Meldungen und Benachrichtigungen",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "description": "ID des Wartungsfensters"
          },
          "name": {
            "type": "string",
            "description": "Bezeichnung"
          },
          "kind": {
            "type": "string",
            "enum": [
              "once",
              "weekly"
            ],
            "description": "Einmalig (starts_at bis ends_at) oder wöchentlich (weekdays, time_from, time_to)"
          },
          "customer_id": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid",
            "description": "Kunde, dessen Domains betroffen sind; null für alle"
          },
          "customer_name": {
            "type": [
              "string",
              "null"
            ],
            "description": "Name des Kunden"
          },
          "domain_id": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid",
            "description": "Einzelne betroffene Domain; null für alle"
          },
          "domain_name": {
            "type": [
              "string",
              "null"
            ],
            "description": "Domain in Unicode"
          },
          "starts_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "Beginn (einmalig)"
          },
          "ends_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "Ende (einmalig)"
          },
          "weekdays": {
            "type": [
              "array",
              "null"
            ],
            "items": {
              "type": "integer",
              "minimum": 1,
              "maximum": 7
            },
            "description": "Wochentage 1 (Montag) bis 7 (Sonntag), wöchentlich"
          },
          "time_from": {
            "type": [
              "string",
              "null"
            ],
            "description": "Beginn HH:MM in der Zeitzone des Fensters (wöchentlich)"
          },
          "time_to": {
            "type": [
              "string",
              "null"
            ],
            "description": "Ende HH:MM; vor time_from reicht das Fenster über Mitternacht"
          },
          "timezone": {
            "type": "string",
            "description": "Zeitzone des Fensters"
          },
          "is_enabled": {
            "type": "boolean",
            "description": "Aktiv"
          },
          "is_active": {
            "type": "boolean",
            "description": "Gerade wirksam"
          },
          "is_expired": {
            "type": "boolean",
            "description": "Einmaliges Fenster, dessen Ende vorbei ist"
          }
        }
      },
      "DomainContract": {
        "type": "object",
        "description": "Vertrags- und Kostendaten einer Domain (teamintern). Ohne gespeicherten Vertrag kommt dieselbe Form mit leeren Feldern und exists = false",
        "properties": {
          "domain_id": {
            "type": "string",
            "format": "uuid",
            "description": "ID der Domain"
          },
          "exists": {
            "type": "boolean",
            "description": "Ob ein Vertrag gespeichert ist"
          },
          "registrar": {
            "type": [
              "string",
              "null"
            ],
            "description": "Registrar (Freitext)"
          },
          "registrar_suggestion": {
            "type": [
              "string",
              "null"
            ],
            "description": "Vom Domain-Check (RDAP) erkannter Registrar als Vorschlag"
          },
          "hosting_provider": {
            "type": [
              "string",
              "null"
            ],
            "description": "Hosting-Anbieter"
          },
          "ends_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date",
            "description": "Vertragsende als Kalendertag (YYYY-MM-DD)"
          },
          "notice_period_days": {
            "type": [
              "integer",
              "null"
            ],
            "description": "Kündigungsfrist in Tagen"
          },
          "notice_deadline": {
            "type": [
              "string",
              "null"
            ],
            "format": "date",
            "description": "Letzter Kündigungstermin: Vertragsende minus Frist"
          },
          "auto_renews": {
            "type": "boolean",
            "description": "Verlängert sich automatisch"
          },
          "annual_cost": {
            "type": [
              "number",
              "null"
            ],
            "description": "Kosten je Jahr"
          },
          "currency": {
            "type": "string",
            "description": "Währung (ISO 4217), Standard EUR"
          },
          "cost_reference": {
            "type": [
              "string",
              "null"
            ],
            "description": "Kostenstelle oder Referenz"
          },
          "responsible_user_id": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid",
            "description": "Zuständiges Mitglied"
          },
          "responsible": {
            "type": [
              "object",
              "null"
            ],
            "properties": {
              "id": {
                "type": "string",
                "format": "uuid",
                "description": "ID"
              },
              "name": {
                "type": "string",
                "description": "Name"
              }
            },
            "description": "Zuständiges Mitglied"
          },
          "notes": {
            "type": [
              "string",
              "null"
            ],
            "description": "Notiz"
          },
          "updated_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "Zuletzt geändert"
          }
        }
      },
      "Expiration": {
        "type": "object",
        "description": "Eine Zeile der Ablaufübersicht: Domainablauf, Zertifikatsablauf, Vertragsende oder letzter Kündigungstermin",
        "properties": {
          "kind": {
            "type": "string",
            "enum": [
              "domain",
              "certificate",
              "contract_end",
              "notice_deadline"
            ],
            "description": "Art des Termins"
          },
          "date": {
            "type": "string",
            "format": "date",
            "description": "Termin als Kalendertag in der Zeitzone der Organisation"
          },
          "days_left": {
            "type": "integer",
            "description": "Tage bis zum Termin, negativ wenn vorbei"
          },
          "action_required": {
            "type": "boolean",
            "description": "Jemand muss handeln: Kündigungstermin, Vertragsende ohne Verlängerung, Domainablauf, Zertifikat mit höchstens 14 Tagen Restlaufzeit"
          },
          "domain": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string",
                "format": "uuid",
                "description": "ID der Domain"
              },
              "name": {
                "type": "string",
                "description": "Domain in Unicode"
              }
            }
          },
          "customer": {
            "type": [
              "object",
              "null"
            ],
            "properties": {
              "id": {
                "type": "string",
                "format": "uuid",
                "description": "ID des Kunden"
              },
              "name": {
                "type": "string",
                "description": "Name"
              }
            },
            "description": "Kunde der Domain"
          },
          "responsible": {
            "type": [
              "object",
              "null"
            ],
            "properties": {
              "id": {
                "type": "string",
                "format": "uuid",
                "description": "ID"
              },
              "name": {
                "type": "string",
                "description": "Name"
              }
            },
            "description": "Zuständiges Mitglied aus dem Vertrag"
          },
          "provider": {
            "type": [
              "string",
              "null"
            ],
            "description": "Registrar, Hosting-Anbieter oder Zertifikatsaussteller"
          },
          "auto_renews": {
            "type": [
              "boolean",
              "null"
            ],
            "description": "Automatische Verlängerung laut Vertrag"
          },
          "annual_cost": {
            "type": [
              "number",
              "null"
            ],
            "description": "Kosten je Jahr laut Vertrag"
          },
          "currency": {
            "type": [
              "string",
              "null"
            ],
            "description": "Währung der Kosten"
          },
          "cost_reference": {
            "type": [
              "string",
              "null"
            ],
            "description": "Kostenstelle oder Referenz"
          },
          "target": {
            "type": [
              "string",
              "null"
            ],
            "description": "Bei Zertifikaten: Hostname und Port"
          }
        }
      },
      "Incident": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "description": "ID der Meldung"
          },
          "domain_id": {
            "type": "string",
            "format": "uuid",
            "description": "ID der Domain"
          },
          "domain": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string",
                "format": "uuid",
                "description": "ID"
              },
              "name": {
                "type": "string",
                "description": "Domain"
              },
              "unicode_name": {
                "type": "string",
                "description": "Domain in Unicode"
              },
              "customer_id": {
                "type": [
                  "string",
                  "null"
                ],
                "format": "uuid"
              }
            },
            "description": "Betroffene Domain"
          },
          "monitor_id": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid",
            "description": "ID des Monitors"
          },
          "monitor": {
            "type": [
              "object",
              "null"
            ],
            "properties": {
              "id": {
                "type": "string",
                "format": "uuid",
                "description": "ID"
              },
              "type": {
                "type": "string",
                "description": "Prüfart"
              },
              "target": {
                "type": "string",
                "description": "Ziel"
              }
            },
            "description": "Auslösender Monitor"
          },
          "type": {
            "type": "string",
            "description": "Art, z. B. http.down, tls.expiring, spf.invalid"
          },
          "severity": {
            "type": "string",
            "enum": [
              "info",
              "warning",
              "critical"
            ],
            "description": "Schweregrad"
          },
          "status": {
            "type": "string",
            "enum": [
              "open",
              "acknowledged",
              "resolved"
            ],
            "description": "Status"
          },
          "started_at": {
            "type": "string",
            "format": "date-time",
            "description": "Beginn"
          },
          "acknowledged_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "Quittiert am"
          },
          "acknowledged_by": {
            "type": [
              "string",
              "null"
            ],
            "description": "Name des Quittierenden"
          },
          "resolved_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "Behoben am"
          },
          "resolved_reason": {
            "type": [
              "string",
              "null"
            ],
            "description": "Grund der Auflösung, z. B. recovered, monitor_removed"
          },
          "failure_count": {
            "type": "integer",
            "description": "Fehlgeschlagene Prüfungen"
          },
          "notification_count": {
            "type": "integer",
            "description": "Versendete Benachrichtigungen"
          },
          "reminder_count": {
            "type": "integer",
            "description": "Versendete Erinnerungen"
          },
          "cause": {
            "type": "object",
            "additionalProperties": true,
            "description": "Ursache mit Befunden (`findings`) und Rohdaten"
          },
          "report": {
            "type": "object",
            "properties": {
              "note": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "hidden": {
                "type": "boolean"
              }
            },
            "description": "Angaben für den Kundenbericht: Ursache und Maßnahmen, ausgeblendet"
          }
        }
      },
      "MailDelivery": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "description": "ID des Eintrags"
          },
          "recipient": {
            "type": "string",
            "description": "Empfänger, maskiert (z. B. j***@kunde.de); die Adresse selbst gibt die API nie heraus"
          },
          "recipient_hash": {
            "type": "string",
            "description": "Kennung der Adresse für die Reaktivierung",
            "pattern": "^[a-f0-9]{64}$"
          },
          "is_member": {
            "type": "boolean",
            "description": "Adresse gehört einem Nutzerkonto"
          },
          "mail_type": {
            "type": "string",
            "enum": [
              "notification",
              "monthly_report",
              "status_page",
              "invitation",
              "sender_verification",
              "sender_test",
              "trial",
              "email_verification",
              "password_reset",
              "other"
            ],
            "description": "Art der Mail"
          },
          "transport": {
            "type": "string",
            "enum": [
              "system",
              "customer_smtp"
            ],
            "description": "Versandweg: über DomainWarn oder den eigenen SMTP-Server"
          },
          "status": {
            "type": "string",
            "enum": [
              "sent",
              "failed",
              "bounced",
              "complained",
              "suppressed"
            ],
            "description": "sent: versendet; failed: vom Mailserver abgelehnt; bounced: nachträglich unzustellbar; complained: als Spam gemeldet; suppressed: nicht versendet, weil die Adresse als unerreichbar markiert ist"
          },
          "error": {
            "type": [
              "string",
              "null"
            ],
            "description": "Fehler oder Grund, Adressen maskiert"
          },
          "sent_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "Versandzeitpunkt"
          },
          "event_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "Zeitpunkt des Bounces bzw. der Beschwerde"
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "description": "Zeitpunkt des Versuchs"
          }
        }
      },
      "Event": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "description": "ID des Ereignisses"
          },
          "type": {
            "type": "string",
            "description": "Art, z. B. dns.record_changed, tls.renewed, incident.opened"
          },
          "severity": {
            "type": "string",
            "enum": [
              "info",
              "warning",
              "critical"
            ],
            "description": "Schweregrad"
          },
          "domain_id": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid",
            "description": "ID der Domain"
          },
          "domain": {
            "type": [
              "object",
              "null"
            ],
            "properties": {
              "id": {
                "type": "string",
                "format": "uuid",
                "description": "ID"
              },
              "name": {
                "type": "string",
                "description": "Domain"
              },
              "unicode_name": {
                "type": "string",
                "description": "Domain in Unicode"
              }
            },
            "description": "Betroffene Domain"
          },
          "monitor_id": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid",
            "description": "ID des Monitors"
          },
          "incident_id": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid",
            "description": "Zugehörige Meldung"
          },
          "previous_value": {
            "description": "Wert vor der Änderung (Aufbau je Art)"
          },
          "new_value": {
            "description": "Wert nach der Änderung"
          },
          "context": {
            "type": [
              "object",
              "null"
            ],
            "additionalProperties": true,
            "description": "Weitere Angaben"
          },
          "occurred_at": {
            "type": "string",
            "format": "date-time",
            "description": "Zeitpunkt"
          }
        }
      },
      "DnsSnapshot": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "description": "ID des Schnappschusses"
          },
          "fingerprint": {
            "type": "string",
            "description": "Fingerabdruck aller Records"
          },
          "source": {
            "type": "string",
            "description": "Quelle der Abfrage"
          },
          "resolver": {
            "type": [
              "string",
              "null"
            ],
            "description": "Benutzter Resolver"
          },
          "first_seen_at": {
            "type": "string",
            "format": "date-time",
            "description": "Erstmals gesehen"
          },
          "last_seen_at": {
            "type": "string",
            "format": "date-time",
            "description": "Zuletzt bestätigt"
          },
          "previous_snapshot_id": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid",
            "description": "Vorheriger Schnappschuss"
          },
          "records": {
            "type": "object",
            "additionalProperties": {
              "type": "array",
              "items": {
                "oneOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "array",
                    "prefixItems": [
                      {
                        "type": "integer"
                      },
                      {
                        "type": "string"
                      }
                    ],
                    "minItems": 2,
                    "maxItems": 2,
                    "description": "MX: [Priorität, Host]"
                  }
                ]
              }
            },
            "description": "Records je Typ (A, AAAA, MX, NS, TXT, …), MX als Paar [Priorität, Host]; fehlt in der Liste der Schnappschüsse"
          },
          "record_count": {
            "type": "integer",
            "description": "Anzahl aller Records"
          }
        }
      },
      "ZoneBackup": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "description": "ID des Stands"
          },
          "domain_id": {
            "type": "string",
            "format": "uuid",
            "description": "ID der Domain"
          },
          "integration_id": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid",
            "description": "Integration, über die gelesen wurde (null, wenn sie inzwischen entfernt ist)"
          },
          "provider": {
            "type": "string",
            "description": "Schlüssel des DNS-Anbieters",
            "example": "cloudflare"
          },
          "provider_name": {
            "type": "string",
            "description": "Name des DNS-Anbieters"
          },
          "zone": {
            "type": "string",
            "description": "Zone beim Anbieter"
          },
          "hash": {
            "type": "string",
            "description": "SHA-256 der kanonisch sortierten Record-Liste"
          },
          "records_count": {
            "type": "integer",
            "description": "Anzahl der Records (ohne SOA)"
          },
          "changes": {
            "type": [
              "object",
              "null"
            ],
            "properties": {
              "added": {
                "type": "integer"
              },
              "removed": {
                "type": "integer"
              },
              "changed": {
                "type": "integer"
              }
            },
            "description": "Unterschied zum vorigen Stand je Name und Typ; null beim ersten Stand"
          },
          "previous_backup_id": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid",
            "description": "Voriger Stand"
          },
          "first_seen_at": {
            "type": "string",
            "format": "date-time",
            "description": "Erstmals so gesehen"
          },
          "last_seen_at": {
            "type": "string",
            "format": "date-time",
            "description": "Zuletzt unverändert bestätigt"
          },
          "records": {
            "type": "array",
            "description": "Nur im Einzelabruf: alle Records, key = „name|TYP“",
            "items": {
              "type": "object",
              "properties": {
                "key": {
                  "type": "string"
                },
                "name": {
                  "type": "string"
                },
                "type": {
                  "type": "string"
                },
                "ttl": {
                  "type": [
                    "integer",
                    "null"
                  ]
                },
                "content": {
                  "type": "string",
                  "description": "Inhalt wie im Zonenfile, TXT ohne Anführungszeichen, Hostnamen ohne Punkt am Ende"
                },
                "proxied": {
                  "type": "boolean",
                  "description": "Nur Cloudflare: hinter dem Proxy"
                }
              }
            }
          },
          "diff": {
            "type": "array",
            "description": "Nur im Einzelabruf: Unterschied zum vorigen Stand je Name und Typ",
            "items": {
              "type": "object",
              "properties": {
                "key": {
                  "type": "string"
                },
                "name": {
                  "type": "string"
                },
                "type": {
                  "type": "string"
                },
                "change": {
                  "type": "string",
                  "enum": [
                    "added",
                    "removed",
                    "changed"
                  ]
                },
                "previous": {
                  "type": "array",
                  "items": {
                    "type": "object"
                  }
                },
                "new": {
                  "type": "array",
                  "items": {
                    "type": "object"
                  }
                }
              }
            }
          }
        }
      },
      "CheckResult": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "description": "ID"
          },
          "checked_at": {
            "type": "string",
            "format": "date-time",
            "description": "Zeitpunkt"
          },
          "status": {
            "type": "string",
            "enum": [
              "ok",
              "warning",
              "critical",
              "error"
            ],
            "description": "Ergebnis; `error`, wenn die Prüfung nicht möglich war (dann `error_code`)"
          },
          "latency_ms": {
            "type": [
              "integer",
              "null"
            ],
            "description": "Antwortzeit in Millisekunden"
          },
          "http_status": {
            "type": [
              "integer",
              "null"
            ],
            "description": "HTTP-Status (nur http)"
          },
          "error_code": {
            "type": [
              "integer",
              "null"
            ],
            "enum": [
              0,
              1,
              2,
              3,
              4,
              5,
              6,
              7,
              8,
              9,
              10,
              null
            ],
            "description": "Grund bei status error: 0 unbekannt, 1 Resolver nicht erreichbar, 2 Resolver-Timeout, 3 Abruf nicht möglich, 4 Ziel vom Schutz abgelehnt, 5 Timeout, 6 interner Fehler, 7 Ausfall vom zweiten Standort widerlegt (zählt nicht als Ausfall), 8 Hilfsprobe eines zweiten Standorts (zählt nicht in die Verfügbarkeit), 9 Domain existiert nicht (NXDOMAIN), 10 Prüfung unvollständig (Zeitbudget: nicht alle Nameserver erreicht, kein Urteil)"
          },
          "location": {
            "type": [
              "string",
              "null"
            ],
            "description": "Prüfstandort, z. B. primary; null bei älteren Ergebnissen"
          },
          "payload": {
            "type": [
              "object",
              "null"
            ],
            "additionalProperties": true,
            "description": "Rohdaten"
          },
          "findings": {
            "type": [
              "array",
              "null"
            ],
            "items": {
              "$ref": "#/components/schemas/Finding"
            },
            "description": "Befunde"
          }
        }
      },
      "Uptime": {
        "type": "object",
        "properties": {
          "range": {
            "type": "string",
            "enum": [
              "24h",
              "7d",
              "30d",
              "90d"
            ],
            "description": "Zeitraum"
          },
          "source": {
            "type": "string",
            "enum": [
              "raw",
              "check_result_hourly",
              "check_result_daily"
            ],
            "description": "Auflösung: Einzelprüfungen (24h), Stunden (7d, 30d) oder Tage (90d)"
          },
          "summary": {
            "type": "object",
            "properties": {
              "uptime_ratio": {
                "type": [
                  "number",
                  "null"
                ],
                "description": "Verfügbarkeit 0 bis 1"
              },
              "checks_total": {
                "type": "integer",
                "description": "Prüfungen im Zeitraum"
              },
              "latency_p50": {
                "type": [
                  "integer",
                  "null"
                ],
                "description": "Median der Antwortzeit in ms"
              },
              "latency_p95": {
                "type": [
                  "integer",
                  "null"
                ],
                "description": "95. Perzentil der Antwortzeit in ms"
              },
              "downtime_seconds": {
                "type": "integer",
                "description": "Ausfallzeit in Sekunden (nicht bei 24h)"
              }
            }
          },
          "points": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": true
            },
            "description": "Messpunkte: bei 24h je Prüfung (t, status, latency_ms), sonst je Stunde oder Tag (t, uptime_ratio, latency_p50, latency_p95, checks_failed, downtime_seconds)"
          }
        }
      },
      "Usage": {
        "type": "object",
        "properties": {
          "plan": {
            "type": "object",
            "properties": {
              "key": {
                "type": "string",
                "description": "Tarifschlüssel"
              },
              "name": {
                "type": "string",
                "description": "Tarifname"
              },
              "domains": {
                "type": "integer",
                "description": "Domainlimit"
              },
              "hostnames_per_domain": {
                "type": "integer",
                "description": "Hostnamen je Domain"
              },
              "retention_days": {
                "type": "integer",
                "description": "Verlauf in Tagen"
              },
              "members": {
                "type": "integer",
                "description": "Mitglieder"
              },
              "channels": {
                "type": "integer",
                "description": "Kanäle"
              },
              "min_interval": {
                "type": "object",
                "additionalProperties": {
                  "type": "integer"
                },
                "description": "Kleinstes Prüfintervall je Check-Typ in Minuten"
              },
              "sms_per_month": {
                "type": "integer",
                "description": "SMS je Monat"
              }
            },
            "additionalProperties": true
          },
          "domains": {
            "type": "integer",
            "description": "Domains"
          },
          "monitors": {
            "type": "integer",
            "description": "Monitore"
          },
          "members": {
            "type": "integer",
            "description": "Mitglieder"
          },
          "channels": {
            "type": "integer",
            "description": "Kanäle"
          },
          "checks_24h": {
            "type": "integer",
            "description": "Prüfungen der letzten 24 Stunden"
          }
        }
      },
      "CustomerReport": {
        "type": "object",
        "description": "Monatsbericht; Zeitangaben sind für die Anzeige formatiert (Sprache des Berichts)",
        "properties": {
          "organization": {
            "type": "object",
            "properties": {
              "name": {
                "type": "string",
                "description": "Agentur"
              }
            }
          },
          "customer": {
            "type": [
              "object",
              "null"
            ],
            "properties": {
              "name": {
                "type": "string",
                "description": "Kunde"
              },
              "reference": {
                "type": [
                  "string",
                  "null"
                ]
              }
            }
          },
          "period": {
            "type": "object",
            "properties": {
              "from": {
                "type": "string",
                "format": "date"
              },
              "to": {
                "type": "string",
                "format": "date"
              },
              "label": {
                "type": "string",
                "description": "Monat als Text"
              },
              "month": {
                "type": "string",
                "description": "YYYY-MM"
              }
            }
          },
          "generated_at": {
            "type": "string",
            "description": "Erstellt am (formatiert)"
          },
          "locale": {
            "type": "string",
            "description": "Sprache des Berichts"
          },
          "summary": {
            "type": "object",
            "properties": {
              "domains": {
                "type": "integer"
              },
              "healthy": {
                "type": "integer"
              },
              "warning": {
                "type": "integer"
              },
              "critical": {
                "type": "integer"
              },
              "uptime": {
                "type": [
                  "number",
                  "null"
                ],
                "description": "Verfügbarkeit in Prozent"
              },
              "incidents": {
                "type": "integer"
              },
              "critical_incidents": {
                "type": "integer"
              },
              "changes": {
                "type": "integer"
              },
              "downtime_minutes": {
                "type": "integer"
              }
            }
          },
          "domains": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "name": {
                  "type": "string",
                  "description": "Domain"
                },
                "health": {
                  "type": "string",
                  "enum": [
                    "healthy",
                    "warning",
                    "critical",
                    "unknown"
                  ]
                },
                "uptime": {
                  "type": [
                    "number",
                    "null"
                  ]
                },
                "downtime_minutes": {
                  "type": "integer"
                },
                "incidents": {
                  "type": "integer"
                },
                "critical_incidents": {
                  "type": "integer"
                },
                "certificate_valid_to": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "certificate_days_left": {
                  "type": [
                    "integer",
                    "null"
                  ]
                },
                "certificate_issuer": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "domain_expires_at": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "format": "date"
                },
                "registrar": {
                  "type": [
                    "string",
                    "null"
                  ]
                }
              },
              "additionalProperties": true
            }
          },
          "incidents": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "domain": {
                  "type": "string",
                  "description": "Domain"
                },
                "type": {
                  "type": "string",
                  "description": "Art der Meldung"
                },
                "label": {
                  "type": "string",
                  "description": "Bezeichnung"
                },
                "severity": {
                  "type": "string",
                  "enum": [
                    "info",
                    "warning",
                    "critical"
                  ]
                },
                "started_at": {
                  "type": "string",
                  "description": "Beginn (formatiert)"
                },
                "resolved_at": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "duration_minutes": {
                  "type": [
                    "integer",
                    "null"
                  ]
                },
                "status": {
                  "type": "string",
                  "enum": [
                    "open",
                    "acknowledged",
                    "resolved"
                  ]
                }
              }
            }
          },
          "changes": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "domain": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "type": {
                  "type": "string",
                  "description": "Ereignistyp"
                },
                "label": {
                  "type": "string",
                  "description": "Bezeichnung"
                },
                "severity": {
                  "type": "string",
                  "enum": [
                    "info",
                    "warning",
                    "critical"
                  ]
                },
                "occurred_at": {
                  "type": "string",
                  "description": "Zeitpunkt (formatiert)"
                },
                "previous": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "new": {
                  "type": [
                    "string",
                    "null"
                  ]
                }
              }
            }
          },
          "expiring_certificates": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": true
            },
            "description": "Zertifikate, die bald ablaufen"
          },
          "expiring_domains": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": true
            },
            "description": "Domains, die bald ablaufen"
          }
        },
        "additionalProperties": true
      },
      "Dashboard": {
        "type": "object",
        "properties": {
          "domains": {
            "type": "object",
            "properties": {
              "total": {
                "type": "integer",
                "description": "Alle Domains"
              },
              "healthy": {
                "type": "integer",
                "description": "Gesund"
              },
              "warning": {
                "type": "integer",
                "description": "Warnung"
              },
              "critical": {
                "type": "integer",
                "description": "Kritisch"
              },
              "unknown": {
                "type": "integer",
                "description": "Noch nicht geprüft"
              }
            }
          },
          "needs_attention": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Incident"
            },
            "description": "Offene Meldungen, kritische zuerst (höchstens 50)"
          },
          "recent_changes": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Event"
            },
            "description": "Erkannte Änderungen der letzten 24 Stunden (höchstens 30)"
          },
          "usage": {
            "type": "object",
            "properties": {
              "domains": {
                "type": "integer",
                "description": "Genutzte Domains"
              },
              "domains_limit": {
                "type": "integer",
                "description": "Domainlimit des Tarifs"
              },
              "plan": {
                "type": "string",
                "description": "Tarifschlüssel"
              },
              "plan_name": {
                "type": "string",
                "description": "Tarifname"
              }
            }
          },
          "history": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "day": {
                  "type": "string",
                  "format": "date"
                },
                "incidents": {
                  "type": "integer"
                },
                "changes": {
                  "type": "integer"
                },
                "checks_failed": {
                  "type": "integer"
                },
                "checks_total": {
                  "type": "integer"
                }
              }
            },
            "description": "Letzte 14 Tage je Tag"
          },
          "generated_at": {
            "type": "string",
            "format": "date-time",
            "description": "Erstellt am (bis 30 Sekunden gecacht, ETag wird gesetzt)"
          }
        }
      },
      "PageMeta": {
        "type": "object",
        "description": "Seitenweise Paginierung",
        "properties": {
          "current_page": {
            "type": "integer"
          },
          "from": {
            "type": [
              "integer",
              "null"
            ]
          },
          "to": {
            "type": [
              "integer",
              "null"
            ]
          },
          "last_page": {
            "type": "integer"
          },
          "per_page": {
            "type": "integer"
          },
          "total": {
            "type": "integer"
          },
          "path": {
            "type": "string"
          }
        }
      },
      "CursorMeta": {
        "type": "object",
        "description": "Cursor-Paginierung: `next_cursor` als Parameter `cursor` der nächsten Anfrage mitgeben, null am Ende",
        "properties": {
          "path": {
            "type": "string"
          },
          "per_page": {
            "type": "integer"
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ]
          },
          "prev_cursor": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      },
      "Links": {
        "type": "object",
        "properties": {
          "first": {
            "type": [
              "string",
              "null"
            ]
          },
          "last": {
            "type": [
              "string",
              "null"
            ]
          },
          "prev": {
            "type": [
              "string",
              "null"
            ]
          },
          "next": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      },
      "ProblemDetails": {
        "type": "object",
        "description": "Fehler nach RFC 9457 (Content-Type application/problem+json)",
        "required": [
          "type",
          "title",
          "status"
        ],
        "properties": {
          "type": {
            "type": "string",
            "format": "uri",
            "description": "Fehlerart, z. B. https://domainwarn.com/errors/not-found"
          },
          "title": {
            "type": "string",
            "description": "Kurzbezeichnung"
          },
          "status": {
            "type": "integer",
            "description": "HTTP-Status"
          },
          "detail": {
            "type": "string",
            "description": "Erklärung"
          }
        }
      },
      "PlanProblem": {
        "allOf": [
          {
            "$ref": "#/components/schemas/ProblemDetails"
          },
          {
            "type": "object",
            "properties": {
              "plan": {
                "type": "string",
                "description": "Wirksamer Tarif"
              },
              "suspended": {
                "type": "boolean",
                "description": "Vom Betreiber gesperrt"
              }
            }
          }
        ]
      },
      "ValidationProblem": {
        "allOf": [
          {
            "$ref": "#/components/schemas/ProblemDetails"
          },
          {
            "type": "object",
            "properties": {
              "errors": {
                "type": "object",
                "additionalProperties": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                },
                "description": "Meldungen je Feld"
              }
            }
          }
        ]
      }
    }
  }
}