API, webhooks & rulesAPI, Webhooks & Regeln
Rules
Settings → Rules: "if all/any conditions match → actions". Conditions on sender, recipient, subject, text, "anywhere" or "has attachment" (contains, is, starts/ends with, regex). Actions: move, flag, read, archive, spam, delete, forward, auto-reply, webhook, notify. Rules run on the server for every new mail – also when no browser is open.
Example: sender ends with @supplier.de and subject contains invoice → move to "Invoices" + webhook to your accounting.
REST API
Settings → API & webhooks → create a key with the scopes it needs (read, send, manage). Send it as Authorization: Bearer pwk_…. The full reference is in every installation at /API.md.
curl -H "Authorization: Bearer pwk_…" https://mail.example.com/api/v1/messages?account=all
curl -X POST -H "Authorization: Bearer pwk_…" -H "Content-Type: application/json" \
-d '{"account":1,"to":"customer@example.com","subject":"Hello","text":"…"}' \
https://mail.example.com/api/v1/send
Webhooks
Events: mail.received, mail.sent, rule.matched. Each POST carries X-Postwerk-Signature: sha256=HMAC(secret, timestamp + "." + body) and X-Postwerk-Timestamp. Failed deliveries are retried after 2 s, 20 s and 2 min.
AI assistant
Add your Anthropic API key under Settings → AI. Mail content is only sent to Anthropic when you click ✨ – for a summary, a reply draft or inbox sorting.
Regeln
Einstellungen → Regeln: „wenn alle/eine Bedingung zutrifft → Aktionen“. Bedingungen auf Absender, Empfänger, Betreff, Text, „überall“ oder „hat Anhang“ (enthält, ist, beginnt/endet mit, Regex). Aktionen: verschieben, markieren, gelesen, archivieren, Spam, löschen, weiterleiten, automatisch antworten, Webhook, benachrichtigen. Regeln laufen auf dem Server für jede neue Mail – auch wenn kein Browser offen ist.
Beispiel: Absender endet auf @lieferant.de und Betreff enthält Rechnung → nach „Rechnungen“ verschieben + Webhook an die Buchhaltung.
REST-API
Einstellungen → API & Webhooks → Schlüssel mit den nötigen Rechten anlegen (read, send, manage). Als Authorization: Bearer pwk_… senden. Die vollständige Referenz liegt in jeder Installation unter /API.md.
curl -H "Authorization: Bearer pwk_…" https://mail.example.com/api/v1/messages?account=all
curl -X POST -H "Authorization: Bearer pwk_…" -H "Content-Type: application/json" \
-d '{"account":1,"to":"kunde@example.com","subject":"Hallo","text":"…"}' \
https://mail.example.com/api/v1/send
Webhooks
Ereignisse: mail.received, mail.sent, rule.matched. Jeder POST trägt X-Postwerk-Signature: sha256=HMAC(secret, timestamp + "." + body) und X-Postwerk-Timestamp. Fehlgeschlagene Zustellungen werden nach 2 s, 20 s und 2 min wiederholt.
KI-Assistent
Anthropic-API-Schlüssel unter Einstellungen → KI eintragen. Mail-Inhalte gehen nur an Anthropic, wenn du auf ✨ klickst – für eine Zusammenfassung, einen Antwortentwurf oder das Sortieren.
Something missing or unclear? Write to info@weblogy.eu. Fehlt etwas oder ist unklar? Schreib an info@weblogy.eu.
