Drop-in send APIs
Keep your existing client. Change the base URL (and put a Werkmail bearer in the token field). Bodies and success envelopes match the foreign SDK. Gates do not change — content score, consent, suppressions, and stream split still apply. Failures return that vendor’s error shape plus our hint in the message text.
Set BASE=https://werkmail.eu. Authenticate with Authorization: Bearer $TOKEN (wm_team_… or wm_proj_…). A project token already knows the workspace. A session bearer must pass practice_id (query, body, or X-Werkmail-Practice).
Postmark clients may send X-Postmark-Server-Token instead of Authorization — use the same Werkmail token value.
Native (recommended)
POST /api/practices/{id}/send and POST /api/emails (workspace from the token).
Flexible JSON: text/html or text_body/html_body; to as string, array, or comma-separated list; PascalCase Postmark fields; Resend-style tags: [{name, value}].
Success is 202 with { "id", "message_id", "status", "code", "hint" } — code/hint appear when something is blocked.
Resend SDK
Base URL: https://werkmail.eu/api/compat/resend
| SDK call | Werkmail path |
|---|---|
emails.send |
POST /emails |
emails.send batch |
POST /emails/batch (max 100) |
| retrieve | GET /emails/{id} |
emails.list |
GET /emails |
emails.update |
PATCH /emails/{id} (scheduled_at) |
emails.cancel |
POST /emails/{id}/cancel |
emails.receiving.list / get |
GET /emails/receiving, GET /emails/receiving/{id} |
emails.receiving.attachments.list |
GET /emails/receiving/{id}/attachments (always empty, attachment bodies are not kept) |
suppressions.add / list / get / remove |
POST|GET /suppressions, GET|DELETE /suppressions/{id or email} |
suppressions.batch.add / remove |
POST /suppressions/batch/add, POST /suppressions/batch/remove |
domains.create |
POST /domains |
domains.list |
GET /domains |
domains.get |
GET /domains/{id} |
domains.update |
PATCH /domains/{id} (open_tracking, click_tracking, tls) |
domains.verify |
POST /domains/{id}/verify |
domains.remove |
DELETE /domains/{id} |
contacts.create / list / get / update / remove |
POST|GET /contacts, GET|PATCH|DELETE /contacts/{id or email} |
contacts.segments.* |
GET /contacts/{id}/segments, POST|DELETE /contacts/{id}/segments/{segmentId} |
contacts.topics.* |
GET|PATCH /contacts/{id}/topics |
broadcasts.create / list / get / update / remove |
POST|GET /broadcasts, GET|PATCH|DELETE /broadcasts/{id} |
broadcasts.send / cancel / duplicate |
POST /broadcasts/{id}/send, /cancel, /duplicate |
broadcasts.clickedLinks |
GET /broadcasts/{id}/clicked-links |
templates.create / list / get / update / remove |
POST|GET /templates, GET|PATCH|DELETE /templates/{id or alias} |
templates.publish / duplicate |
POST /templates/{id}/publish, /duplicate |
emails.send with template |
POST /emails with template: { id, variables } |
automations.create / list / get / update / remove |
POST|GET /automations, GET|PATCH|DELETE /automations/{id} |
automations.duplicate / stop |
POST /automations/{id}/duplicate, /stop |
automations.runs.list / get |
GET /automations/{id}/runs, /runs/{runId} |
events.create / list / get / update / remove |
POST|GET /events, GET|PATCH|DELETE /events/{id or name} |
events.send |
POST /events/send |
webhooks.create / list / get / update / remove |
POST|GET /webhooks, GET|PATCH|DELETE /webhooks/{id} |
webhooks.rotateSigningSecret |
POST /webhooks/{id}/signing-secret/rotate |
webhooks.events.*, webhooks.events.attempts.list |
GET /webhooks/{id}/events, GET /webhooks/{id}/events/{eventId}, POST …/replay, GET …/attempts |
webhooks.verify |
works on deliveries to endpoints created here |
segments.* |
POST|GET /segments, GET|PATCH|DELETE /segments/{id} |
topics.* |
POST|GET /topics, GET|PATCH|DELETE /topics/{id} |
contactProperties.* |
POST|GET /contact-properties, GET|PATCH|DELETE /contact-properties/{id} |
Success is 200 { "id": "…" } (batch: { "data": [{ "id" }] }). Errors use { "statusCode", "name", "message" }.
A workspace owns many domains. A send must come from a verified domain of the workspace or one of its subdomains; otherwise it fails with 403 domain_not_verified. Domain region is reported as eu-central-1, and capabilities.receiving is disabled here because receiving is configured per workspace.
Only an email that is scheduled and has not been sent yet can be updated or canceled; a canceled email reports last_event: canceled. Suppressions created through the API are workspace-wide and have the origin manual.
Broadcasts target a segment (segment_id); audience_id is not supported. A broadcast reaches only the segment members who hold marketing consent: an active subscription in one of the workspace's lists and the newsletter channel opted in. Contacts created through the API have neither, so they are left out until they sign up or are imported with consent evidence. Werkmail's compliance gates (verified domain, warm-up, impressum, topic, suppression, pauses) apply to every recipient. Broadcast calls need a full-access key. status is draft, queued (scheduled, waiting or running) or sent; canceling a scheduled broadcast returns it to draft, and only drafts can be deleted. preview_text becomes the hidden inbox preview line of the HTML.
Templates have a draft and a published version. Editing changes the draft only; a send uses the published version, so a template that was never published cannot be sent. Reference a template by id or alias and pass variables for placeholders written as {{{NAME}}}. Values are HTML-escaped inside the HTML part, a declared variable without a value or fallback fails the send, and a send may not carry html or text next to template. subject, from and reply_to on the send win over the template's defaults.
Automations follow Resend's step and connection format; see Automations for the steps Werkmail runs and how consent applies. events.send needs an event defined first and an existing contact. Automation and event calls need a full-access key.
Webhooks created through this API deliver Resend's payload (type, created_at, data) and are signed the way the Resend SDK verifies, with webhook-id, webhook-timestamp and webhook-signature (the same values also go out as svix-* headers). Werkmail sends email.sent, email.delivered, email.delivery_delayed, email.bounced, email.complained, email.opened, email.clicked, email.failed, email.suppressed, suppression.added and suppression.removed. Other Resend event types have no source in Werkmail and are refused when you create the endpoint. Endpoints created in the dashboard use Werkmail's own payload and are not listed here.
Audience calls follow Resend's shapes (limit, after, before, has_more). Werkmail keeps its compliance rules on top: creating a contact through the API never records marketing consent, a contact who unsubscribed cannot be re-subscribed through the API (they opt back in on the preference page), and properties must be defined first. Segments created here are static segments.
These calls are checked in CI by running the official Resend Node SDK against Werkmail.
curl -sS -X POST "$BASE/api/compat/resend/emails" \
-H "Authorization: Bearer $TOKEN" \
-H "Idempotency-Key: order-123" \
-d '{
"from": "Praxis <noreply@your-domain.example>",
"to": ["you@example.com"],
"subject": "Terminbestätigung",
"html": "<p>Ihr Termin ist bestätigt.</p>",
"tags": [{"name": "kind", "value": "termin"}]
}'
scheduled_at accepts an RFC3339 timestamp (e.g. 2026-09-02T16:00:00Z) or a relative time (in 1 hour, in 2 days) for delayed dispatch. Werkmail holds the message in queued status until the designated time before running compliance checks and delivering.
Postmark SDK
Base URL: https://werkmail.eu/api/compat/postmark
| SDK call | Werkmail path |
|---|---|
| send | POST /email |
| send batch | POST /email/batch |
Success is 200 { "ErrorCode": 0, "Message": "OK", "MessageID", "To", "SubmittedAt" }. Errors use { "ErrorCode", "Message" }.
MessageStream outbound maps to outgoing; broadcast stays broadcast. To may be a comma-separated string. Headers may be [{ "Name", "Value" }]. Attachments accept Name / Content / ContentType.
Lettermint
Base URL: https://werkmail.eu/api/compat/lettermint
Use this when your app already speaks Lettermint (or a Lettermint-shaped REST client). Put the Werkmail token in the same place you used the Lettermint key.
| Call | Path |
|---|---|
| send | POST /send |
| send (emails alias) | POST /emails |
| batch | POST /send/batch (max 100) |
curl -sS -X POST "$BASE/api/compat/lettermint/send" \
-H "Authorization: Bearer $TOKEN" \
-H "Idempotency-Key: order-123" \
-d '{
"from": "Praxis <noreply@your-domain.example>",
"to": ["you@example.com"],
"subject": "Terminbestätigung",
"html": "<p>Ihr Termin ist bestätigt.</p>",
"text": "Ihr Termin ist bestätigt."
}'
Same flexible body as native send (from, to, subject, html / text). Response is the native envelope (id, message_id, status, plus code / hint when blocked). Templated bulk stays at POST /api/emails/send-bulk (project_id = workspace).
/api/compat/eu/send, /api/compat/eu/send/batch, and /api/compat/lettermind/… (send, emails, send/batch) are aliases of this base if a client was already pointed there. Prefer /api/compat/lettermint.
What is never a silent drop-in
| Foreign feature | Werkmail behaviour |
|---|---|
| React Email / server-side JSX | Render HTML in your app, send html |
| Dedicated IP / stream product names | Use outgoing vs broadcast |
| Skipping unsubscribe or DOI | Broadcast still requires Impressum + DOI |
| Provider-account suppression as the only list | Our Postgres suppressions still apply |
See Errors, Send, and Regulated transactional.