# Sendingbloom Kunden-API

Lokale Vorschau; keine SMTP-Zustellung. Basis: http://127.0.0.1:8787/api/v1. Bearer-Authentifizierung, außer bei öffentlich lesbaren Plänen.

[OpenAPI](/api/openapi.json) · [Domain-/DNS-Vertrag](/api/management-openapi.json) · [Kunden-MCP](/mcp/index.md)

## POST /api/v1/email/check

E-Mail-Adresse prüfen

Strukturierte Syntax-, DNS- und optionale SMTP-Prüfung. mailbox_exists bleibt unbekannt; ownership bleibt not_verified. Keine Nachricht, keine Catch-all-Probes. mode=dns ist Standard; mode=smtp benötigt die konfigurierte eigene Prüfidentität. Null-MX, implizites MX, vorübergehende DNS-Fehler und SMTP-Policy werden getrennt behandelt. 5 Prüfungen/Minute, 100/24 Stunden je Account; Admins haben einen getrennten Bucket. Globale Schutzlimits: 60/Minute, 4 gleichzeitig, 12 Sekunden Budget. Überschreitung: 429. Prüfergebnis invalid ist HTTP200; ungültige Request-Struktur ist422. Keine Idempotency-Key-Pflicht, keine automatische Wiederholung.

### Vertrag (inklusive Parameter, Pflichtfelder und Schemas)

```json
{
  "parameters": [],
  "summary": "E-Mail-Adresse prüfen",
  "security": [
    {
      "bearerAuth": []
    }
  ],
  "responses": {
    "200": {
      "description": "Strukturiertes Prüfergebnis, auch bei ungültiger Adresse oder unklarer Zustellbarkeit.",
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "required": [
              "data"
            ],
            "properties": {
              "data": {
                "$ref": "#/components/schemas/EmailCheckResult"
              }
            }
          }
        }
      }
    },
    "401": {
      "description": "Structured error: error.code, error.message, request_id"
    },
    "403": {
      "description": "Structured error: error.code, error.message, request_id"
    },
    "415": {
      "description": "Structured error: error.code, error.message, request_id"
    },
    "422": {
      "description": "Structured error: error.code, error.message, request_id"
    },
    "429": {
      "description": "Structured error: error.code, error.message, request_id"
    },
    "400": {
      "description": "Structured error: error.code, error.message, request_id"
    }
  },
  "requestBody": {
    "required": true,
    "content": {
      "application/json": {
        "schema": {
          "type": "object",
          "additionalProperties": false,
          "required": [
            "email"
          ],
          "properties": {
            "email": {
              "type": "string",
              "maxLength": 320,
              "description": "Eine einzelne Adresse. Ungültige Syntax wird als Prüfergebnis zurückgegeben."
            },
            "mode": {
              "type": "string",
              "enum": [
                "dns",
                "smtp"
              ],
              "default": "dns",
              "description": "dns prüft Syntax und Mailroute; smtp fragt optional den Empfänger ohne DATA an."
            }
          }
        }
      }
    }
  },
  "operationId": "checkEmail",
  "description": "Strukturierte Syntax-, DNS- und optionale SMTP-Prüfung. mailbox_exists bleibt unbekannt; ownership bleibt not_verified. Keine Nachricht, keine Catch-all-Probes. mode=dns ist Standard; mode=smtp benötigt die konfigurierte eigene Prüfidentität. Null-MX, implizites MX, vorübergehende DNS-Fehler und SMTP-Policy werden getrennt behandelt. 5 Prüfungen/Minute, 100/24 Stunden je Account; Admins haben einen getrennten Bucket. Globale Schutzlimits: 60/Minute, 4 gleichzeitig, 12 Sekunden Budget. Überschreitung: 429. Prüfergebnis invalid ist HTTP200; ungültige Request-Struktur ist422. Keine Idempotency-Key-Pflicht, keine automatische Wiederholung.",
  "x-sdk-methods": {
    "node": "checkEmail",
    "python": "check_email"
  },
  "x-codeSamples": [
    {
      "lang": "curl",
      "label": "REST (cURL)",
      "source": "curl 'http://127.0.0.1:8787/api/v1/email/check' -H \"Authorization: Bearer $BLOOM_API_KEY\" -H 'Content-Type: application/json' -d '{\"email\":\"keine-adresse\",\"mode\":\"dns\"}'"
    },
    {
      "lang": "node",
      "label": "Node.js",
      "source": "import { Sendingbloom } from '@sendingbloom/node';\n\nconst bloom = new Sendingbloom({\n  apiKey: process.env.BLOOM_API_KEY,\n  baseUrl: 'http://127.0.0.1:8787/api/v1'\n});\n\nconst result = await bloom.checkEmail('keine-adresse', { mode: 'dns' });\nconsole.log(result.data.verdict, result.data.reason_code);"
    },
    {
      "lang": "python",
      "label": "Python",
      "source": "import os\nfrom sendingbloom import Sendingbloom\n\nbloom = Sendingbloom(\n    api_key=os.environ[\"BLOOM_API_KEY\"],\n    base_url=\"http://127.0.0.1:8787/api/v1\",\n)\n\nresult = bloom.check_email(\"keine-adresse\", mode=\"dns\")\nprint(result[\"data\"][\"verdict\"], result[\"data\"][\"reason_code\"])"
    }
  ]
}
```

## POST /api/v1/messages

Nachricht vormerken

Speichert einen Versandauftrag dauerhaft. Im lokalen Test bleibt der Status accepted_local: keine SMTP-Übergabe und keine Zustellzusage. Mindestens text oder html muss nicht leer sein. Unbekannte Optionen und Templates werden abgewiesen.

### Vertrag (inklusive Parameter, Pflichtfelder und Schemas)

```json
{
  "parameters": [
    {
      "name": "Idempotency-Key",
      "in": "header",
      "required": true,
      "schema": {
        "type": "string",
        "minLength": 1,
        "maxLength": 128
      },
      "description": "Pflicht für Versand. 1–128 Zeichen; bei Wiederholung denselben Schlüssel und Inhalt verwenden. Anderer Inhalt ergibt 409. Schlüssel ist accountgebunden und bleibt lokal bis zum Entfernen der Datenbank gespeichert."
    }
  ],
  "summary": "Nachricht vormerken",
  "security": [
    {
      "bearerAuth": []
    }
  ],
  "responses": {
    "202": {
      "description": "JSON envelope with data and request_id on errors",
      "content": {
        "application/json": {
          "schema": {
            "type": "object"
          }
        }
      }
    },
    "200": {
      "description": "Idempotent replay"
    },
    "400": {
      "description": "Structured error: error.code, error.message, request_id"
    },
    "401": {
      "description": "Structured error: error.code, error.message, request_id"
    },
    "403": {
      "description": "Structured error: error.code, error.message, request_id"
    },
    "409": {
      "description": "Structured error: error.code, error.message, request_id"
    },
    "415": {
      "description": "Structured error: error.code, error.message, request_id"
    },
    "422": {
      "description": "Structured error: error.code, error.message, request_id"
    },
    "429": {
      "description": "Structured error: error.code, error.message, request_id"
    }
  },
  "requestBody": {
    "required": true,
    "content": {
      "application/json": {
        "schema": {
          "$ref": "#/components/schemas/MessageInput"
        }
      }
    }
  },
  "operationId": "sendMessage",
  "description": "Speichert einen Versandauftrag dauerhaft. Im lokalen Test bleibt der Status accepted_local: keine SMTP-Übergabe und keine Zustellzusage. Mindestens text oder html muss nicht leer sein. Unbekannte Optionen und Templates werden abgewiesen.",
  "x-sdk-methods": {
    "node": "messages.send",
    "python": "messages.send"
  },
  "x-codeSamples": [
    {
      "lang": "curl",
      "label": "REST (cURL)",
      "source": "curl 'http://127.0.0.1:8787/api/v1/messages' \\\n  -H \"Authorization: Bearer $BLOOM_API_KEY\" \\\n  -H 'Content-Type: application/json' \\\n  -H 'Idempotency-Key: mein-erster-test' \\\n  -d '{\n  \"from\": \"hallo@preview.example.test\",\n  \"to\": [\n    \"test@example.invalid\"\n  ],\n  \"subject\": \"Hallo!\",\n  \"text\": \"Ein kleiner Anfang.\"\n}'"
    },
    {
      "lang": "node",
      "label": "Node.js",
      "source": "import { Sendingbloom } from '@sendingbloom/node';\n\nconst bloom = new Sendingbloom({\n  apiKey: process.env.BLOOM_API_KEY,\n  baseUrl: 'http://127.0.0.1:8787/api/v1'\n});\n\nconst result = await bloom.messages.send({\n  from: 'hallo@preview.example.test',\n  to: ['test@example.invalid'],\n  subject: 'Hallo!', text: 'Ein kleiner Anfang.'\n});\nconsole.log(result.idempotencyKey); // Für identische Wiederholungen aufbewahren."
    },
    {
      "lang": "python",
      "label": "Python",
      "source": "import os\nfrom sendingbloom import Sendingbloom\n\nbloom = Sendingbloom(\n    api_key=os.environ[\"BLOOM_API_KEY\"],\n    base_url=\"http://127.0.0.1:8787/api/v1\",\n)\n\nresult = bloom.messages.send(\n    sender=\"hallo@preview.example.test\",\n    to=[\"test@example.invalid\"],\n    subject=\"Hallo!\", text=\"Ein kleiner Anfang.\",\n)\nprint(result[\"idempotency_key\"])  # Für identische Wiederholungen aufbewahren."
    }
  ]
}
```

## GET /api/v1/messages

Nachrichten auflisten

Liefert ausschließlich eigene Aufträge, neueste zuerst. Nutze pagination.next_offset für die nächste Anfrage. Bei einer vollen letzten Seite kann noch eine leere Seite folgen. Keine automatische Pagination im SDK.

### Vertrag (inklusive Parameter, Pflichtfelder und Schemas)

```json
{
  "parameters": [
    {
      "name": "limit",
      "in": "query",
      "schema": {
        "type": "integer",
        "minimum": 1,
        "maximum": 100,
        "default": 25
      },
      "description": "Seitengröße 1–100, Standard 25."
    },
    {
      "name": "offset",
      "in": "query",
      "schema": {
        "type": "integer",
        "minimum": 0,
        "default": 0
      },
      "description": "Versatz ab 0; nächste Seite aus pagination.next_offset."
    }
  ],
  "summary": "Nachrichten auflisten",
  "security": [
    {
      "bearerAuth": []
    }
  ],
  "responses": {
    "200": {
      "description": "JSON envelope with data and request_id on errors",
      "content": {
        "application/json": {
          "schema": {
            "type": "object"
          }
        }
      }
    },
    "401": {
      "description": "Structured error: error.code, error.message, request_id"
    },
    "403": {
      "description": "Structured error: error.code, error.message, request_id"
    },
    "422": {
      "description": "Structured error: error.code, error.message, request_id"
    },
    "429": {
      "description": "Structured error: error.code, error.message, request_id"
    }
  },
  "operationId": "listMessages",
  "description": "Liefert ausschließlich eigene Aufträge, neueste zuerst. Nutze pagination.next_offset für die nächste Anfrage. Bei einer vollen letzten Seite kann noch eine leere Seite folgen. Keine automatische Pagination im SDK.",
  "x-sdk-methods": {
    "node": "messages.list",
    "python": "messages.list"
  },
  "x-codeSamples": [
    {
      "lang": "curl",
      "label": "REST (cURL)",
      "source": "curl 'http://127.0.0.1:8787/api/v1/messages?limit=25&offset=0' \\\n  -H \"Authorization: Bearer $BLOOM_API_KEY\""
    },
    {
      "lang": "node",
      "label": "Node.js",
      "source": "import { Sendingbloom } from '@sendingbloom/node';\n\nconst bloom = new Sendingbloom({\n  apiKey: process.env.BLOOM_API_KEY,\n  baseUrl: 'http://127.0.0.1:8787/api/v1'\n});\n\nconst result = await bloom.messages.list({ limit: 25, offset: 0 });"
    },
    {
      "lang": "python",
      "label": "Python",
      "source": "import os\nfrom sendingbloom import Sendingbloom\n\nbloom = Sendingbloom(\n    api_key=os.environ[\"BLOOM_API_KEY\"],\n    base_url=\"http://127.0.0.1:8787/api/v1\",\n)\n\nresult = bloom.messages.list(limit=25, offset=0)"
    }
  ]
}
```

## GET /api/v1/messages/{id}

Nachricht abfragen

Liefert die eigene Nachricht und den Status je Empfänger. Eine fremde oder unbekannte ID ergibt 404. accepted_local bedeutet ausschließlich lokal gespeichert, nicht vom Empfängerserver angenommen.

### Vertrag (inklusive Parameter, Pflichtfelder und Schemas)

```json
{
  "parameters": [
    {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
        "type": "string"
      },
      "description": "Nachrichten-ID aus messages.send() oder messages.list()."
    }
  ],
  "summary": "Nachricht abfragen",
  "security": [
    {
      "bearerAuth": []
    }
  ],
  "responses": {
    "200": {
      "description": "JSON envelope with data and request_id on errors",
      "content": {
        "application/json": {
          "schema": {
            "type": "object"
          }
        }
      }
    },
    "401": {
      "description": "Structured error: error.code, error.message, request_id"
    },
    "403": {
      "description": "Structured error: error.code, error.message, request_id"
    },
    "422": {
      "description": "Structured error: error.code, error.message, request_id"
    },
    "429": {
      "description": "Structured error: error.code, error.message, request_id"
    }
  },
  "operationId": "getMessage",
  "description": "Liefert die eigene Nachricht und den Status je Empfänger. Eine fremde oder unbekannte ID ergibt 404. accepted_local bedeutet ausschließlich lokal gespeichert, nicht vom Empfängerserver angenommen.",
  "x-sdk-methods": {
    "node": "messages.get",
    "python": "messages.get"
  },
  "x-codeSamples": [
    {
      "lang": "curl",
      "label": "REST (cURL)",
      "source": "curl 'http://127.0.0.1:8787/api/v1/messages/msg_BEISPIEL' \\\n  -H \"Authorization: Bearer $BLOOM_API_KEY\""
    },
    {
      "lang": "node",
      "label": "Node.js",
      "source": "import { Sendingbloom } from '@sendingbloom/node';\n\nconst bloom = new Sendingbloom({\n  apiKey: process.env.BLOOM_API_KEY,\n  baseUrl: 'http://127.0.0.1:8787/api/v1'\n});\n\nconst result = await bloom.messages.get('msg_BEISPIEL');"
    },
    {
      "lang": "python",
      "label": "Python",
      "source": "import os\nfrom sendingbloom import Sendingbloom\n\nbloom = Sendingbloom(\n    api_key=os.environ[\"BLOOM_API_KEY\"],\n    base_url=\"http://127.0.0.1:8787/api/v1\",\n)\n\nresult = bloom.messages.get('msg_BEISPIEL')"
    }
  ]
}
```

## GET /api/v1/events

Ereignisse abfragen

Liefert bis zu 50 eigene Empfängerereignisse nach der angegebenen Ereignis-ID. next_cursor beim nächsten Abruf als after übergeben. Ein Event je Empfänger, noch keine Kunden-Webhooks.

### Vertrag (inklusive Parameter, Pflichtfelder und Schemas)

```json
{
  "parameters": [
    {
      "name": "after",
      "in": "query",
      "schema": {
        "type": "integer",
        "minimum": 0,
        "default": 0
      },
      "description": "Letzte bekannte Ereignis-ID ab 0; nächste Position aus next_cursor."
    }
  ],
  "summary": "Ereignisse abfragen",
  "security": [
    {
      "bearerAuth": []
    }
  ],
  "responses": {
    "200": {
      "description": "JSON envelope with data and request_id on errors",
      "content": {
        "application/json": {
          "schema": {
            "type": "object"
          }
        }
      }
    },
    "401": {
      "description": "Structured error: error.code, error.message, request_id"
    },
    "403": {
      "description": "Structured error: error.code, error.message, request_id"
    },
    "422": {
      "description": "Structured error: error.code, error.message, request_id"
    },
    "429": {
      "description": "Structured error: error.code, error.message, request_id"
    }
  },
  "operationId": "listEvents",
  "description": "Liefert bis zu 50 eigene Empfängerereignisse nach der angegebenen Ereignis-ID. next_cursor beim nächsten Abruf als after übergeben. Ein Event je Empfänger, noch keine Kunden-Webhooks.",
  "x-sdk-methods": {
    "node": "events.list",
    "python": "events.list"
  },
  "x-codeSamples": [
    {
      "lang": "curl",
      "label": "REST (cURL)",
      "source": "curl 'http://127.0.0.1:8787/api/v1/events?after=0' \\\n  -H \"Authorization: Bearer $BLOOM_API_KEY\""
    },
    {
      "lang": "node",
      "label": "Node.js",
      "source": "import { Sendingbloom } from '@sendingbloom/node';\n\nconst bloom = new Sendingbloom({\n  apiKey: process.env.BLOOM_API_KEY,\n  baseUrl: 'http://127.0.0.1:8787/api/v1'\n});\n\nconst result = await bloom.events.list({ after: 0 });"
    },
    {
      "lang": "python",
      "label": "Python",
      "source": "import os\nfrom sendingbloom import Sendingbloom\n\nbloom = Sendingbloom(\n    api_key=os.environ[\"BLOOM_API_KEY\"],\n    base_url=\"http://127.0.0.1:8787/api/v1\",\n)\n\nresult = bloom.events.list(after=0)"
    }
  ]
}
```

## GET /api/v1/domains

Domains auflisten

Liefert eigene Domains, Prüfschritte und den öffentlichen TXT-Nachweis. Keine erfundenen SPF-/DKIM-Werte. Domainverwaltung über REST/MCP benötigt den ausdrücklich erteilten Scope domains:write; DNS-Verwaltung hat getrennte Scopes dns:read und dns:write. Details in der MCP-Anleitung.

### Vertrag (inklusive Parameter, Pflichtfelder und Schemas)

```json
{
  "parameters": [],
  "summary": "Domains auflisten",
  "security": [
    {
      "bearerAuth": []
    }
  ],
  "responses": {
    "200": {
      "description": "JSON envelope with data and request_id on errors",
      "content": {
        "application/json": {
          "schema": {
            "type": "object"
          }
        }
      }
    },
    "401": {
      "description": "Structured error: error.code, error.message, request_id"
    },
    "403": {
      "description": "Structured error: error.code, error.message, request_id"
    },
    "422": {
      "description": "Structured error: error.code, error.message, request_id"
    },
    "429": {
      "description": "Structured error: error.code, error.message, request_id"
    }
  },
  "operationId": "listDomains",
  "description": "Liefert eigene Domains, Prüfschritte und den öffentlichen TXT-Nachweis. Keine erfundenen SPF-/DKIM-Werte. Domainverwaltung über REST/MCP benötigt den ausdrücklich erteilten Scope domains:write; DNS-Verwaltung hat getrennte Scopes dns:read und dns:write. Details in der MCP-Anleitung.",
  "x-sdk-methods": {
    "node": "domains.list",
    "python": "domains.list"
  },
  "x-codeSamples": [
    {
      "lang": "curl",
      "label": "REST (cURL)",
      "source": "curl 'http://127.0.0.1:8787/api/v1/domains' \\\n  -H \"Authorization: Bearer $BLOOM_API_KEY\""
    },
    {
      "lang": "node",
      "label": "Node.js",
      "source": "import { Sendingbloom } from '@sendingbloom/node';\n\nconst bloom = new Sendingbloom({\n  apiKey: process.env.BLOOM_API_KEY,\n  baseUrl: 'http://127.0.0.1:8787/api/v1'\n});\n\nconst result = await bloom.domains.list();"
    },
    {
      "lang": "python",
      "label": "Python",
      "source": "import os\nfrom sendingbloom import Sendingbloom\n\nbloom = Sendingbloom(\n    api_key=os.environ[\"BLOOM_API_KEY\"],\n    base_url=\"http://127.0.0.1:8787/api/v1\",\n)\n\nresult = bloom.domains.list()"
    }
  ]
}
```

## GET /api/v1/domains/{id}/records.csv

DNS-Einträge exportieren

Liefert CSV-Text für die eigene Domain. Der Export enthält derzeit nur den TXT-Nachweis der Domainkontrolle. Er ändert keine DNS-Einträge und schreibt auch im SDK nicht selbst auf die Festplatte.

### Vertrag (inklusive Parameter, Pflichtfelder und Schemas)

```json
{
  "parameters": [
    {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
        "type": "string"
      },
      "description": "Eigene Domain-ID aus domains.list()."
    }
  ],
  "summary": "DNS-Einträge exportieren",
  "security": [
    {
      "bearerAuth": []
    }
  ],
  "responses": {
    "200": {
      "description": "TXT ownership challenge; SMTP DNS not configured",
      "content": {
        "text/csv": {
          "schema": {
            "type": "string"
          }
        }
      }
    }
  },
  "operationId": "domainRecords",
  "description": "Liefert CSV-Text für die eigene Domain. Der Export enthält derzeit nur den TXT-Nachweis der Domainkontrolle. Er ändert keine DNS-Einträge und schreibt auch im SDK nicht selbst auf die Festplatte.",
  "x-sdk-methods": {
    "node": "domains.records",
    "python": "domains.records"
  },
  "x-codeSamples": [
    {
      "lang": "curl",
      "label": "REST (cURL)",
      "source": "curl 'http://127.0.0.1:8787/api/v1/domains/dom_fixture/records.csv' \\\n  -H \"Authorization: Bearer $BLOOM_API_KEY\""
    },
    {
      "lang": "node",
      "label": "Node.js",
      "source": "import { Sendingbloom } from '@sendingbloom/node';\n\nconst bloom = new Sendingbloom({\n  apiKey: process.env.BLOOM_API_KEY,\n  baseUrl: 'http://127.0.0.1:8787/api/v1'\n});\n\nconst result = await bloom.domains.records('dom_fixture');"
    },
    {
      "lang": "python",
      "label": "Python",
      "source": "import os\nfrom sendingbloom import Sendingbloom\n\nbloom = Sendingbloom(\n    api_key=os.environ[\"BLOOM_API_KEY\"],\n    base_url=\"http://127.0.0.1:8787/api/v1\",\n)\n\nresult = bloom.domains.records('dom_fixture')"
    }
  ]
}
```

## GET /api/v1/account

Account abfragen

Liefert den Account des verwendeten Schlüssels mit Status und wirksamen Limits. Keine fremden Accounts, Adminaktionen oder ZITADEL-Zugangsdaten.

### Vertrag (inklusive Parameter, Pflichtfelder und Schemas)

```json
{
  "parameters": [],
  "summary": "Account abfragen",
  "security": [
    {
      "bearerAuth": []
    }
  ],
  "responses": {
    "200": {
      "description": "JSON envelope with data and request_id on errors",
      "content": {
        "application/json": {
          "schema": {
            "type": "object"
          }
        }
      }
    },
    "401": {
      "description": "Structured error: error.code, error.message, request_id"
    },
    "403": {
      "description": "Structured error: error.code, error.message, request_id"
    },
    "422": {
      "description": "Structured error: error.code, error.message, request_id"
    },
    "429": {
      "description": "Structured error: error.code, error.message, request_id"
    }
  },
  "operationId": "getAccount",
  "description": "Liefert den Account des verwendeten Schlüssels mit Status und wirksamen Limits. Keine fremden Accounts, Adminaktionen oder ZITADEL-Zugangsdaten.",
  "x-sdk-methods": {
    "node": "account.get",
    "python": "account.get"
  },
  "x-codeSamples": [
    {
      "lang": "curl",
      "label": "REST (cURL)",
      "source": "curl 'http://127.0.0.1:8787/api/v1/account' \\\n  -H \"Authorization: Bearer $BLOOM_API_KEY\""
    },
    {
      "lang": "node",
      "label": "Node.js",
      "source": "import { Sendingbloom } from '@sendingbloom/node';\n\nconst bloom = new Sendingbloom({\n  apiKey: process.env.BLOOM_API_KEY,\n  baseUrl: 'http://127.0.0.1:8787/api/v1'\n});\n\nconst result = await bloom.account.get();"
    },
    {
      "lang": "python",
      "label": "Python",
      "source": "import os\nfrom sendingbloom import Sendingbloom\n\nbloom = Sendingbloom(\n    api_key=os.environ[\"BLOOM_API_KEY\"],\n    base_url=\"http://127.0.0.1:8787/api/v1\",\n)\n\nresult = bloom.account.get()"
    }
  ]
}
```

## GET /api/v1/usage

Verbrauch und Limits

Liefert Tages-, Wochen- und Monatsverbrauch sowie wirksame Kontingente. Gezählt werden unterschiedliche Empfänger pro lokal angenommenem Auftrag. Kalenderzeit UTC, Wochenbeginn Montag; Woche kann offen sein. Diese Pilotregel ist kein endgültiger Abrechnungsvertrag.

### Vertrag (inklusive Parameter, Pflichtfelder und Schemas)

```json
{
  "parameters": [],
  "summary": "Verbrauch und Limits",
  "security": [
    {
      "bearerAuth": []
    }
  ],
  "responses": {
    "200": {
      "description": "JSON envelope with data and request_id on errors",
      "content": {
        "application/json": {
          "schema": {
            "type": "object"
          }
        }
      }
    },
    "401": {
      "description": "Structured error: error.code, error.message, request_id"
    },
    "403": {
      "description": "Structured error: error.code, error.message, request_id"
    },
    "422": {
      "description": "Structured error: error.code, error.message, request_id"
    },
    "429": {
      "description": "Structured error: error.code, error.message, request_id"
    }
  },
  "operationId": "getUsage",
  "description": "Liefert Tages-, Wochen- und Monatsverbrauch sowie wirksame Kontingente. Gezählt werden unterschiedliche Empfänger pro lokal angenommenem Auftrag. Kalenderzeit UTC, Wochenbeginn Montag; Woche kann offen sein. Diese Pilotregel ist kein endgültiger Abrechnungsvertrag.",
  "x-sdk-methods": {
    "node": "usage.get",
    "python": "usage.get"
  },
  "x-codeSamples": [
    {
      "lang": "curl",
      "label": "REST (cURL)",
      "source": "curl 'http://127.0.0.1:8787/api/v1/usage' \\\n  -H \"Authorization: Bearer $BLOOM_API_KEY\""
    },
    {
      "lang": "node",
      "label": "Node.js",
      "source": "import { Sendingbloom } from '@sendingbloom/node';\n\nconst bloom = new Sendingbloom({\n  apiKey: process.env.BLOOM_API_KEY,\n  baseUrl: 'http://127.0.0.1:8787/api/v1'\n});\n\nconst result = await bloom.usage.get();"
    },
    {
      "lang": "python",
      "label": "Python",
      "source": "import os\nfrom sendingbloom import Sendingbloom\n\nbloom = Sendingbloom(\n    api_key=os.environ[\"BLOOM_API_KEY\"],\n    base_url=\"http://127.0.0.1:8787/api/v1\",\n)\n\nresult = bloom.usage.get()"
    }
  ]
}
```

## GET /api/v1/plans

Pläne anzeigen

Zeigt den Testkatalog. Nur Seedling ist verfügbar. Bloom bleibt deaktiviert; Meadow hat keinen festen Preis, sondern wird nach vereinbarten Ressourcen kalkuliert. Dieser Endpunkt ist ohne Anmeldung lesbar.

### Vertrag (inklusive Parameter, Pflichtfelder und Schemas)

```json
{
  "parameters": [],
  "summary": "Pläne anzeigen",
  "security": [],
  "responses": {
    "200": {
      "description": "JSON envelope with data and request_id on errors",
      "content": {
        "application/json": {
          "schema": {
            "type": "object"
          }
        }
      }
    },
    "401": {
      "description": "Structured error: error.code, error.message, request_id"
    },
    "403": {
      "description": "Structured error: error.code, error.message, request_id"
    },
    "422": {
      "description": "Structured error: error.code, error.message, request_id"
    },
    "429": {
      "description": "Structured error: error.code, error.message, request_id"
    }
  },
  "operationId": "listPlans",
  "description": "Zeigt den Testkatalog. Nur Seedling ist verfügbar. Bloom bleibt deaktiviert; Meadow hat keinen festen Preis, sondern wird nach vereinbarten Ressourcen kalkuliert. Dieser Endpunkt ist ohne Anmeldung lesbar.",
  "x-sdk-methods": {
    "node": "plans.list",
    "python": "plans.list"
  },
  "x-codeSamples": [
    {
      "lang": "curl",
      "label": "REST (cURL)",
      "source": "curl 'http://127.0.0.1:8787/api/v1/plans' \\\n  -H \"Authorization: Bearer $BLOOM_API_KEY\""
    },
    {
      "lang": "node",
      "label": "Node.js",
      "source": "import { Sendingbloom } from '@sendingbloom/node';\n\nconst bloom = new Sendingbloom({\n  apiKey: process.env.BLOOM_API_KEY,\n  baseUrl: 'http://127.0.0.1:8787/api/v1'\n});\n\nconst result = await bloom.plans.list();"
    },
    {
      "lang": "python",
      "label": "Python",
      "source": "import os\nfrom sendingbloom import Sendingbloom\n\nbloom = Sendingbloom(\n    api_key=os.environ[\"BLOOM_API_KEY\"],\n    base_url=\"http://127.0.0.1:8787/api/v1\",\n)\n\nresult = bloom.plans.list()"
    }
  ]
}
```

## Gemeinsame Schemas

```json
{
  "MessageInput": {
    "type": "object",
    "additionalProperties": false,
    "required": [
      "from",
      "to",
      "subject"
    ],
    "properties": {
      "from": {
        "type": "string",
        "format": "email",
        "description": "Einfache Absenderadresse ohne Anzeigenamen. Die Domain muss dem Account zugeordnet und freigegeben sein."
      },
      "to": {
        "type": "array",
        "minItems": 1,
        "maxItems": 100,
        "items": {
          "type": "string",
          "format": "email"
        },
        "description": "1–100 Empfängereinträge. Identische Adressen innerhalb eines Auftrags werden zusammengeführt."
      },
      "subject": {
        "type": "string",
        "maxLength": 998,
        "description": "Betreff, höchstens 998 Zeichen und ohne Zeilenumbrüche."
      },
      "text": {
        "type": "string",
        "maxLength": 262144,
        "description": "Klartextinhalt. text oder html muss gefüllt sein; jeweils höchstens 256 KiB UTF-8."
      },
      "html": {
        "type": "string",
        "maxLength": 262144,
        "description": "Eigenes HTML, kein Template. Wird in der Dokumentation oder App nicht als HTML ausgeführt."
      },
      "reply_to": {
        "type": "string",
        "format": "email",
        "description": "Optionale Antwortadresse ohne Anzeigenamen."
      }
    },
    "anyOf": [
      {
        "required": [
          "text"
        ]
      },
      {
        "required": [
          "html"
        ]
      }
    ]
  },
  "EmailCheckResult": {
    "type": "object",
    "required": [
      "email",
      "normalized_email",
      "checked_at",
      "verdict",
      "reason_code",
      "message",
      "retryable",
      "mailbox_exists",
      "ownership",
      "syntax",
      "dns",
      "smtp"
    ],
    "properties": {
      "email": {
        "type": "string"
      },
      "normalized_email": {
        "type": [
          "string",
          "null"
        ]
      },
      "checked_at": {
        "type": "string",
        "format": "date-time"
      },
      "verdict": {
        "type": "string",
        "enum": [
          "invalid",
          "undeliverable",
          "route_found",
          "recipient_accepted",
          "recipient_rejected",
          "unknown"
        ]
      },
      "reason_code": {
        "type": "string"
      },
      "message": {
        "type": "string"
      },
      "retryable": {
        "type": "boolean"
      },
      "mailbox_exists": {
        "type": "null",
        "description": "Keine externe Postfachexistenz behauptet."
      },
      "ownership": {
        "type": "string",
        "enum": [
          "not_verified"
        ]
      },
      "syntax": {
        "type": "object",
        "properties": {
          "status": {
            "type": "string"
          }
        }
      },
      "dns": {
        "type": "object",
        "properties": {
          "status": {
            "type": "string"
          },
          "route": {
            "type": [
              "string",
              "null"
            ]
          },
          "mx": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        }
      },
      "smtp": {
        "type": "object",
        "properties": {
          "status": {
            "type": "string"
          },
          "attempts": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "server": {
                  "type": "string"
                },
                "address": {
                  "type": "string"
                },
                "phase": {
                  "type": "string"
                },
                "code": {
                  "type": [
                    "integer",
                    "null"
                  ]
                },
                "enhanced_code": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "reason": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "tls": {
                  "type": "boolean"
                }
              }
            }
          }
        }
      }
    }
  }
}
```

## Zusätzliche Domain-/DNS-Verwaltung

```json
{
  "openapi": "3.1.0",
  "info": {
    "title": "Sendingbloom customer domain/DNS management",
    "version": "0.1.0",
    "description": "Zusätzliche REST-Funktionen für dieselben Kunden-Keys und MCP-Tools. Lokale Vorschau. Noch keine eigenen Node/Python-SDK-Methoden für diese Verwaltungsfunktionen."
  },
  "servers": [
    {
      "url": "http://127.0.0.1:8787"
    }
  ],
  "paths": {
    "/api/v1/domains": {
      "post": {
        "operationId": "domain_add",
        "summary": "Versanddomain hinzufügen; noch keine DNS-/Versandfreigabe.",
        "x-scope": "domains:write",
        "security": [
          {
            "CustomerBearer": []
          }
        ],
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 8,
              "maxLength": 128
            }
          }
        ],
        "responses": {
          "200": {
            "description": "JSON envelope: data. DNS-Providerbestätigung ist keine Propagations-/Versandbestätigung."
          },
          "401": {
            "description": "Key ungültig/widerrufen."
          },
          "403": {
            "description": "Scope fehlt/Account gesperrt."
          },
          "404": {
            "description": "Domain fremd/unbekannt."
          },
          "409": {
            "description": "Kontingent, In-use-Guard, DNS-Konflikt/Drift oder Idempotenzkonflikt."
          },
          "422": {
            "description": "Eingabe/Bestätigung fehlt."
          },
          "429": {
            "description": "API-/DNS-Limit erreicht."
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "name": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 253
                  }
                },
                "required": [
                  "name"
                ]
              }
            }
          }
        }
      }
    },
    "/api/v1/domains/{domain_id}/check": {
      "post": {
        "operationId": "domain_verify",
        "summary": "Domainkontroll-TXT öffentlich prüfen; keine SMTP-Freigabe.",
        "x-scope": "domains:write",
        "security": [
          {
            "CustomerBearer": []
          }
        ],
        "parameters": [
          {
            "name": "domain_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 253
            }
          }
        ],
        "responses": {
          "200": {
            "description": "JSON envelope: data. DNS-Providerbestätigung ist keine Propagations-/Versandbestätigung."
          },
          "401": {
            "description": "Key ungültig/widerrufen."
          },
          "403": {
            "description": "Scope fehlt/Account gesperrt."
          },
          "404": {
            "description": "Domain fremd/unbekannt."
          },
          "409": {
            "description": "Kontingent, In-use-Guard, DNS-Konflikt/Drift oder Idempotenzkonflikt."
          },
          "422": {
            "description": "Eingabe/Bestätigung fehlt."
          },
          "429": {
            "description": "API-/DNS-Limit erreicht."
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "properties": {},
                "required": []
              }
            }
          }
        }
      }
    },
    "/api/v1/domains/{domain_id}": {
      "delete": {
        "operationId": "domain_remove",
        "summary": "Domain nach ausdrücklicher Zustimmung entfernen; In-use-Guards bleiben wirksam.",
        "x-scope": "domains:write",
        "security": [
          {
            "CustomerBearer": []
          }
        ],
        "parameters": [
          {
            "name": "domain_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 253
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 8,
              "maxLength": 128
            }
          }
        ],
        "responses": {
          "200": {
            "description": "JSON envelope: data. DNS-Providerbestätigung ist keine Propagations-/Versandbestätigung."
          },
          "401": {
            "description": "Key ungültig/widerrufen."
          },
          "403": {
            "description": "Scope fehlt/Account gesperrt."
          },
          "404": {
            "description": "Domain fremd/unbekannt."
          },
          "409": {
            "description": "Kontingent, In-use-Guard, DNS-Konflikt/Drift oder Idempotenzkonflikt."
          },
          "422": {
            "description": "Eingabe/Bestätigung fehlt."
          },
          "429": {
            "description": "API-/DNS-Limit erreicht."
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "approved": {
                    "type": "boolean",
                    "const": true
                  }
                },
                "required": [
                  "approved"
                ]
              }
            }
          }
        }
      }
    },
    "/api/v1/domains/{domain_id}/dns": {
      "get": {
        "operationId": "dns_status",
        "summary": "DNS-Verbindung, notwendige Records und manuelle Anleitung lesen; keine Provider-Secrets.",
        "x-scope": "dns:read",
        "security": [
          {
            "CustomerBearer": []
          }
        ],
        "parameters": [
          {
            "name": "domain_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 253
            }
          }
        ],
        "responses": {
          "200": {
            "description": "JSON envelope: data. DNS-Providerbestätigung ist keine Propagations-/Versandbestätigung."
          },
          "401": {
            "description": "Key ungültig/widerrufen."
          },
          "403": {
            "description": "Scope fehlt/Account gesperrt."
          },
          "404": {
            "description": "Domain fremd/unbekannt."
          },
          "409": {
            "description": "Kontingent, In-use-Guard, DNS-Konflikt/Drift oder Idempotenzkonflikt."
          },
          "422": {
            "description": "Eingabe/Bestätigung fehlt."
          },
          "429": {
            "description": "API-/DNS-Limit erreicht."
          }
        }
      }
    },
    "/api/v1/domains/{domain_id}/dns/discover": {
      "post": {
        "operationId": "dns_discover",
        "summary": "Registrar und autoritativen DNS-Anbieter getrennt ermitteln.",
        "x-scope": "dns:read",
        "security": [
          {
            "CustomerBearer": []
          }
        ],
        "parameters": [
          {
            "name": "domain_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 253
            }
          }
        ],
        "responses": {
          "200": {
            "description": "JSON envelope: data. DNS-Providerbestätigung ist keine Propagations-/Versandbestätigung."
          },
          "401": {
            "description": "Key ungültig/widerrufen."
          },
          "403": {
            "description": "Scope fehlt/Account gesperrt."
          },
          "404": {
            "description": "Domain fremd/unbekannt."
          },
          "409": {
            "description": "Kontingent, In-use-Guard, DNS-Konflikt/Drift oder Idempotenzkonflikt."
          },
          "422": {
            "description": "Eingabe/Bestätigung fehlt."
          },
          "429": {
            "description": "API-/DNS-Limit erreicht."
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "properties": {},
                "required": []
              }
            }
          }
        }
      }
    },
    "/api/v1/domains/{domain_id}/dns/manual": {
      "post": {
        "operationId": "dns_manual_plan",
        "summary": "Öffentliche DNS-Bestandswerte prüfen und vollständige manuelle Ergänzungsvorschläge erzeugen, wenn kein Adapter schreiben kann.",
        "x-scope": "dns:read",
        "security": [
          {
            "CustomerBearer": []
          }
        ],
        "parameters": [
          {
            "name": "domain_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 253
            }
          }
        ],
        "responses": {
          "200": {
            "description": "JSON envelope: data. DNS-Providerbestätigung ist keine Propagations-/Versandbestätigung."
          },
          "401": {
            "description": "Key ungültig/widerrufen."
          },
          "403": {
            "description": "Scope fehlt/Account gesperrt."
          },
          "404": {
            "description": "Domain fremd/unbekannt."
          },
          "409": {
            "description": "Kontingent, In-use-Guard, DNS-Konflikt/Drift oder Idempotenzkonflikt."
          },
          "422": {
            "description": "Eingabe/Bestätigung fehlt."
          },
          "429": {
            "description": "API-/DNS-Limit erreicht."
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "properties": {},
                "required": []
              }
            }
          }
        }
      }
    },
    "/api/v1/domains/{domain_id}/dns/plan": {
      "post": {
        "operationId": "dns_plan",
        "summary": "Fehlende Records/Konflikte prüfen. Zuvor im Kunden-UI DNS-API auswählen und Provider verbinden; im manuellen Modus gesperrt.",
        "x-scope": "dns:write",
        "security": [
          {
            "CustomerBearer": []
          }
        ],
        "parameters": [
          {
            "name": "domain_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 253
            }
          }
        ],
        "responses": {
          "200": {
            "description": "JSON envelope: data. DNS-Providerbestätigung ist keine Propagations-/Versandbestätigung."
          },
          "401": {
            "description": "Key ungültig/widerrufen."
          },
          "403": {
            "description": "Scope fehlt/Account gesperrt."
          },
          "404": {
            "description": "Domain fremd/unbekannt."
          },
          "409": {
            "description": "Kontingent, In-use-Guard, DNS-Konflikt/Drift oder Idempotenzkonflikt."
          },
          "422": {
            "description": "Eingabe/Bestätigung fehlt."
          },
          "429": {
            "description": "API-/DNS-Limit erreicht."
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "properties": {},
                "required": []
              }
            }
          }
        }
      }
    },
    "/api/v1/domains/{domain_id}/dns/apply": {
      "post": {
        "operationId": "dns_apply",
        "summary": "Zuerst dns_plan, dann im Kunden-UI den konkreten Plan freigeben lassen. Erst danach mit plan_id ausführen; der API-Key kann sich nicht selbst bestätigen. Bei unklarem Ergebnis neu prüfen.",
        "x-scope": "dns:write",
        "security": [
          {
            "CustomerBearer": []
          }
        ],
        "parameters": [
          {
            "name": "domain_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 253
            }
          }
        ],
        "responses": {
          "200": {
            "description": "JSON envelope: data. DNS-Providerbestätigung ist keine Propagations-/Versandbestätigung."
          },
          "401": {
            "description": "Key ungültig/widerrufen."
          },
          "403": {
            "description": "Scope fehlt/Account gesperrt."
          },
          "404": {
            "description": "Domain fremd/unbekannt."
          },
          "409": {
            "description": "Kontingent, In-use-Guard, DNS-Konflikt/Drift oder Idempotenzkonflikt."
          },
          "422": {
            "description": "Eingabe/Bestätigung fehlt."
          },
          "429": {
            "description": "API-/DNS-Limit erreicht."
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "plan_id": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 253
                  },
                  "approved": {
                    "type": "boolean",
                    "const": true
                  }
                },
                "required": [
                  "plan_id",
                  "approved"
                ]
              }
            }
          }
        }
      }
    },
    "/api/v1/domains/{domain_id}/dns/disconnect": {
      "post": {
        "operationId": "dns_disconnect",
        "summary": "DNS-Verbindung trennen. Keine DNS-Records löschen.",
        "x-scope": "dns:write",
        "security": [
          {
            "CustomerBearer": []
          }
        ],
        "parameters": [
          {
            "name": "domain_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 253
            }
          }
        ],
        "responses": {
          "200": {
            "description": "JSON envelope: data. DNS-Providerbestätigung ist keine Propagations-/Versandbestätigung."
          },
          "401": {
            "description": "Key ungültig/widerrufen."
          },
          "403": {
            "description": "Scope fehlt/Account gesperrt."
          },
          "404": {
            "description": "Domain fremd/unbekannt."
          },
          "409": {
            "description": "Kontingent, In-use-Guard, DNS-Konflikt/Drift oder Idempotenzkonflikt."
          },
          "422": {
            "description": "Eingabe/Bestätigung fehlt."
          },
          "429": {
            "description": "API-/DNS-Limit erreicht."
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "approved": {
                    "type": "boolean",
                    "const": true
                  }
                },
                "required": [
                  "approved"
                ]
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "CustomerBearer": {
        "type": "http",
        "scheme": "bearer"
      }
    }
  }
}
```
