Dispatch API v1.0

Self-hosted HTTP API zum Versand transaktionaler E-Mails via SMTP.

Endpunkte

POST /emails E-Mail senden
GET /templates Verfügbare Templates auflisten
GET /health Status prüfen

Authentifizierung

Jeder Request benötigt einen Authorization-Header mit Bearer Token.

# Header
Authorization: Bearer YOUR_API_KEY

Integrationen

MCP Claude Desktop / Cursor / Windsurf Anleitung →

Quick Start — E-Mail senden

curl -X POST https://dispatch.knerpi.de/emails \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "from": "noreply@dispatch.knerpi.de",
    "to": ["empfaenger@example.com"],
    "subject": "Hallo Welt",
    "html": "<p>Das ist meine erste Mail.</p>",
    "text": "Das ist meine erste Mail."
  }'
// Antwort (200 OK)
{
  "id": "3c4a1b2e-...@dispatch.knerpi.de"
}

Request Body

Feld Typ Pflicht Beschreibung
from string ja Absender-Adresse
to string[] ja Empfänger (ein oder mehrere)
subject string ja Betreff
html string ja* HTML-Body (*oder react_template)
text string nein Plaintext-Fallback
react_template string nein Name eines Server-Templates (statt html)
react_props object nein Props für das Template
reply_to string nein Reply-To Adresse
cc string[] nein CC-Empfänger
bcc string[] nein BCC-Empfänger
headers object nein Zusätzliche Mail-Header

Template verwenden

curl -X POST https://dispatch.knerpi.de/emails \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "from": "noreply@dispatch.knerpi.de",
    "to": ["empfaenger@example.com"],
    "subject": "Willkommen",
    "react_template": "welcome",
    "react_props": { "name": "Arne" }
  }'
Templates liegen auf dem Server unter /opt/dispatch-api/src/templates/ als JSX-Dateien. Verfügbare Templates: GET /templates