Quick start
- In Sermiva, create a key under System → API-Schlüssel (API keys). It is shown only once – store it safely right away.
- Every request goes to
https://api.sermiva.com/v1and carries the key in a header. - Try it:
curl https://api.sermiva.com/v1/workspace \
-H "Authorization: Bearer sv_YOUR_KEY"
Authentication
Every key belongs to exactly one workspace; all requests act only there. Send it as a bearer token:
Authorization: Bearer sv_…
Keys never belong in browser code or public repositories – only on servers. A compromised key is revoked in Sermiva and stops working immediately.
Requests & responses
- JSON in both directions:
Content-Type: application/json,Accept: application/json. - Contacts are addressed by their email address (case-insensitive). URL-encode it in paths, e.g.
nina%2Bnews%40example.org. - Tags are addressed by their name (case-insensitive). Unknown tags are created when added.
- All writing calls are repeatable: the same call twice leads to the same result. Ideal for IPN retries.
- Responses always contain a
dataobject; times in UTC (ISO 8601).
The contact object
{
"data": {
"email": "nina@example.org",
"first_name": "Nina",
"last_name": "Muster",
"phone": "+43 664 1234567",
"status": "subscribed",
"tags": ["Summit-Suite Käufer"],
"fields": { "land": "AT" },
"created_at": "2026-10-18T09:12:44Z",
"updated_at": "2026-10-18T09:12:44Z"
}
}
Errors & limits
| HTTP | error.code | Meaning |
|---|---|---|
| 401 | unauthenticated | Key missing, wrong or revoked |
| 404 | not_found | Contact or endpoint does not exist |
| 422 | validation_failed | Invalid data – details in error.fields |
| 429 | rate_limited | More than 120 requests per minute and key – wait briefly and retry |
{ "error": { "code": "validation_failed", "message": "The request is invalid.",
"fields": { "email": ["The email field must be a valid email address."] } } }
On 429 and 5xx, please retry with a pause (e.g. after 10 s, 1 min, 5 min).
Status & consent
Newsletters only go to contacts with status subscribed. You control the status when creating a contact with subscription:
subscription.status | Effect |
|---|---|
| (omitted) | A new contact gets pending (no newsletters); an existing one stays as it is. |
subscribed | Subscribed. The consent is documented with method, consent_text, ip, confirmed_at and note. method: existing_customer (existing customer, default) or confirmed_opt_in (opt-in already confirmed elsewhere). |
double_opt_in | Sermiva sends the confirmation email; subscribed only after the click or code. |
unsubscribed | Unsubscribe. |
Sign-up through a form: subscription.form
With the number of a Sermiva form (e.g. "form": 1), the sign-up behaves exactly as if it came through that form:
subscribed | double_opt_in | |
|---|---|---|
| Tags “on submit” | immediately | immediately |
| Tags “after confirmation” | immediately | after click/code |
| Automations “sign-up confirmed in form …” | start immediately | start after confirmation |
| Confirmation page / redirect of the form | – | after clicking the link |
Unknown form number, or a form switched off in Sermiva → 422. With "start_automations": false tags are set, but no automations start.
Unsubscribed or undeliverable contacts are never subscribed again through the API – only a confirmed double opt-in lifts that. This protects you legally and protects your deliverability.
/v1/contacts
Creates a contact or updates it (by email address). Response 201 if new, otherwise 200. POST works the same way.
| Field | Type | Description |
|---|---|---|
email | string, required | Email address |
first_name, last_name | string | Overwritten when sent |
phone | string | Phone number, stored as sent (e.g. +49 170 1234567, 0170/1234567). Allowed: digits, spaces, + ( ) / . -, max. 50 characters. Overwritten when sent; null deletes it. |
fields | object | Custom fields by key, e.g. {"land": "AT"} – see Custom fields. |
tags | string[] | Add tags (missing ones are created). Existing tags stay. |
remove_tags | string[] | Remove tags |
subscription | object | See Status & consent |
start_automations | boolean | Default true: newly added tags start matching automations. false e.g. for data syncs. |
curl -X PUT https://api.sermiva.com/v1/contacts \
-H "Authorization: Bearer sv_…" -H "Content-Type: application/json" \
-d '{
"email": "nina@example.org",
"first_name": "Nina",
"tags": ["Summit-Suite Käufer"],
"subscription": { "status": "subscribed", "method": "existing_customer",
"note": "upay.me order 4711" }
}'
Custom fields
You create custom fields in Sermiva under System → Eigene Felder (custom fields); in the API you address them by their key (GET /v1/fields lists them all). Unknown keys and wrong values are rejected with 422. Fields you send are overwritten, the others stay; null deletes a value.
| Type | Allowed | Stored as |
|---|---|---|
| Text | text, number | text (max. 2000 characters) |
| Number | 42, "42", 3.5 | number |
| Date | "1984-10-18", "18.10.1984", ISO 8601 | "1984-10-18" |
| Select | one of the defined options (case-insensitive) | the option in its exact spelling |
In newsletters the values are available as placeholders, e.g. {{ land }}.
/v1/contacts/{email}
Returns the contact or 404.
/v1/contacts/{email}/tags
Adds tags. Body: {"tags": ["kunde", "vip"], "start_automations": true}.
/v1/contacts/{email}/tags/{tag}
Removes a tag. If the contact does not have it, that is not an error.
curl -X DELETE "https://api.sermiva.com/v1/contacts/nina%40example.org/tags/Summit-Suite%20K%C3%A4ufer" \
-H "Authorization: Bearer sv_…"
/v1/contacts/{email}/unsubscribe
Unsubscribes the contact (no more newsletters, running automations end).
/v1/tags
All tags of the workspace with their number of contacts: {"data": [{"name": "kunde", "aliases": ["Kunden"], "contacts": 17}]}. aliases are former names of merged tags – they keep working everywhere and lead to the merged tag.
/v1/fields
All custom fields of the workspace: {"data": [{"key": "paket", "label": "Paket", "type": "select", "options": ["Basic", "Pro"]}]}. Types: text, number, date, select.
/v1/workspace
Name and slug of the workspace – to check that the key works.
/v1/emails
Sends a transactional email to any address: an email that answers an action of the recipient, e.g. the confirmation of a listing or login details. No advertising – that is what newsletters and automations are for. Either you send finished HTML, or you name a process email from Sermiva as a template and pass the values for its placeholders (see below). Sermiva sends the email without an unsubscribe link and without open and click tracking. The recipient does not need to be a contact and does not become one.
Only with a key that has “Darf Transaktionsmails senden” (may send transactional emails) switched on under System → API-Schlüssel in Sermiva. Sent emails are listed under Transaktionsmails, their content for 30 days.
| Field | Type | |
|---|---|---|
to | string | Required. Recipient address |
subject | string | Subject, max. 255 characters. Required with html; with a template it replaces the template’s subject (placeholders work here too) |
html | string | Finished HTML of the email (max. 2 MB), email-safe: tables, inline styles. Required when no template is given |
template | string / number | Instead of html: a process email of the workspace, by its API name (e.g. "kongress-bestaetigen") or its number (12). Both are shown in Sermiva under Einstellungen → Allgemein → API (settings → general → API) and stay the same when the email is renamed. The internal name still works, but changes when the email is renamed |
data | object | Values for the template’s placeholders, e.g. {"kongress_url": "…"} for {{ kongress_url }}. Names of letters, digits and _, values text or number. Values for first_name, last_name, phone and custom fields take precedence over a contact’s data |
text | string | Plain-text part. If missing, Sermiva creates it from the HTML |
from | string | A confirmed sender of the workspace, in full (kalender@online-kongress.events) or just the part before the @ (kalender). Without: the default sender |
reply_to | string | Reply-to address. Without: the sender’s |
idempotency_key | string | Your own ID, max. 100 characters. If the same value comes again, Sermiva does not send again and answers with the first email (200 instead of 201). Recommended, so a retry never sends twice |
curl -X POST https://api.sermiva.com/v1/emails \
-H "Authorization: Bearer sv_…" -H "Content-Type: application/json" \
-d '{"to": "organizer@example.org",
"subject": "Please confirm your listing",
"html": "<p>Hello, please confirm: <a href=\"https://…\">Confirm listing</a></p>",
"from": "kalender",
"idempotency_key": "listing-4711"}'
With a template – you maintain design, images and texts in Sermiva, the other system only sends the values:
curl -X POST https://api.sermiva.com/v1/emails \
-H "Authorization: Bearer sv_…" -H "Content-Type: application/json" \
-d '{"to": "organizer@example.org",
"template": "kongress-bestaetigen",
"data": {"kongress_url": "https://…", "bestaetigungs_url": "https://…"},
"idempotency_key": "listing-4711"}'
If a placeholder is left without a value, Sermiva does not send and answers with missing_data and the missing names. Conditions ({% if … %}) only know the contact fields, not the values from data.
Response 201: {"data": {"id": 12, "to": "organizer@example.org", "from": "kalender@online-kongress.events", "subject": "…", "template": null, "status": "sent", "error": null, "idempotency_key": "listing-4711", "sent_at": "…", "delivered_at": null, "failed_at": null, "created_at": "…"}}
The email goes out immediately. status: sent (accepted by the sending service), later delivered, bounced (the address does not exist), complained (reported as spam) or failed.
| HTTP | error.code | Meaning |
|---|---|---|
| 403 | forbidden | The key may not send transactional emails |
| 409 | sending_not_set_up | Sending is not set up in the workspace yet (confirmed sender) |
| 422 | recipient_blocked | The address bounced or complained about spam – Sermiva no longer sends to it |
| 422 | unknown_template / ambiguous_template | template is not a process email of the workspace, or the name matches several – then use the API name or the number |
| 422 | missing_data / missing_subject | The template needs values missing from data, or has no subject |
| 422 | unknown_sender / ambiguous_sender | from is not a confirmed sender or matches several – then give the full address |
| 429 | rate_limited | More than 60 transactional emails per hour in the workspace; Retry-After gives the seconds until the next possible email |
| 502 | sending_failed | The sending service did not accept the email – try again later, ideally with the same idempotency_key |
/v1/emails/{id}
Status of a transactional email, with the id from the response when sending. The same object as above.
/v1/newsletters
Creates a newsletter draft: the content as finished HTML plus everything the send page needs – subject, sender, topic and recipients. The API never sends. The response contains send_url: there the recipients are already set, you see the count, can still change them and send with „Jetzt senden“ (Send now).
| Field | Type | |
|---|---|---|
name | string | Required. Internal name, e.g. "December newsletter" |
subject | string | Required. Subject, max. 255 characters. Placeholders and conditions work here too |
preheader | string | Preview text shown after the subject in the inbox |
html | string | Required. Email-safe HTML (tables, inline styles, about 600 px wide, max. 2 MB). Placeholders such as {{ first_name }}, custom fields, {{ unsubscribe_url }} and {{ web_version_url }}; conditions such as {% if not tag "Summit-Suite Käufer" %}…{% endif %}. Sermiva adds the unsubscribe link if it is missing. Images need a public https:// address |
web_version | boolean | Add a "view in browser" link. Default: false |
sender | string | A verified sender of the workspace, in full (martin@summit-suite.de) or just the part before the @ (martin). Without: the default sender |
topic | string | Topic: a tag marked as topic in Sermiva. Contacts who opted out of this topic do not get the newsletter. "general" = general, to all subscribed contacts. Without a topic Sermiva asks for one before sending |
audience | object | Recipients, either a saved segment or tags – not both. {"segment": "Kongress-Interessenten"} (name or number; the segment is live, new contacts count) or {"tags": {"any": [...], "all": [...], "none": [...]}}: has one of the tags / all of them / none of them. Several entries apply together. Without: all subscribed contacts, as on the send page so far. Other conditions (opened, clicked, fields) go into a segment you build in Sermiva and name here |
curl -X POST https://api.sermiva.com/v1/newsletters \
-H "Authorization: Bearer sv_…" -H "Content-Type: application/json" \
-d '{"name": "December newsletter",
"subject": "{% if first_name %}{{ first_name }}, {% endif %}the summit starts",
"preheader": "Three days, twelve speakers",
"html": "<table …>…</table>",
"sender": "martin",
"topic": "summit-news",
"audience": {"tags": {"any": ["Summit-Suite Interesse"], "none": ["Summit-Suite Käufer"]}}}'
Response 201:
{"data": {"id": 14, "name": "December newsletter", "subject": "…", "preheader": "…", "html": "…",
"web_version": false, "topic": "summit-news", "sender": "martin@summit-suite.de",
"audience": {"tags": {"any": ["Summit-Suite Interesse"], "none": ["Summit-Suite Käufer"]}},
"recipients": 1240, "status": "draft", "editor": "html", "warnings": [],
"stats": {"sent": 0, "opened": 0, "clicked": 0},
"edit_url": "https://…/newsletters/14/editor", "send_url": "https://…/newsletters/14/send",
"sent_at": null, "created_at": "…", "updated_at": "…"}}
recipients is the number the send page would show right now: subscribed contacts of the audience, without those who opted out of the topic. warnings lists what to check before sending: unknown placeholders (they would be sent as literal text), condition errors (sending is blocked until fixed), conditions on unknown tags, images without a public address, a segment deleted in the meantime.
| HTTP | error.code | Meaning |
|---|---|---|
| 422 | validation_failed | A field is missing or invalid, or a name is unknown: tag, segment, sender (not verified or ambiguous), topic (tag is not a topic). error.fields names the field. Nothing is saved |
/v1/newsletters/{id}
Changes a draft. Only the fields you send change; null clears preheader, sender, audience and topic (the topic is then "not chosen" again). Response as above.
| HTTP | error.code | Meaning |
|---|---|---|
| 404 | not_found | No newsletter with this number in the workspace |
| 409 | not_a_draft | The newsletter was already sent and stays as it was |
| 409 | editor_mismatch | The draft was written in the block editor; its content cannot be replaced with HTML. Subject, sender, topic and recipients still work |
/v1/newsletters
The workspace's newsletters, newest first, without HTML: {"data": [...], "meta": {"total": 37}}. Parameters: status (draft or sent), limit (1–100, default 25), offset. Process and confirmation emails are not included.
/v1/newsletters/{id}
One newsletter with HTML and warnings, the same object as when creating it. For sent newsletters stats shows sends, opens and clicks.
Example: purchase & refund (IPN)
This is how a payment provider (e.g. upay.me) connects to Sermiva:
Payment received
PUT /v1/contacts
{
"email": "{buyer_email}",
"first_name": "{first_name}",
"last_name": "{last_name}",
"tags": ["Summit-Suite Käufer"],
"subscription": { "status": "subscribed", "method": "existing_customer",
"note": "Purchase {product} · order {order_id}" }
}
A tag like “Summit-Suite Käufer” can start an automation in Sermiva, e.g. a welcome series.
Refund / chargeback
DELETE /v1/contacts/{buyer_email}/tags/Summit-Suite%20K%C3%A4ufer
POST /v1/contacts/{buyer_email}/tags {"tags": ["Summit-Suite erstattet"]}
Under German law (§ 7 (3) UWG), existing customers may receive advertising for similar products if they were told about their right to object when they bought. Without that notice, use "status": "double_opt_in".
Sermiva with Claude & co. (MCP)
Through the Model Context Protocol an AI assistant works directly with your workspace – in the chat, e.g.: “Here is a list of addresses. Whoever is already a contact gets the tag ZoomCalls, add everyone else with the tag Interessenten.”
- Address:
https://api.sermiva.com/mcp(Streamable HTTP) - Two ways to sign in: in claude.ai and the Claude apps by login (OAuth) – you choose the workspace while doing so; in Claude Code, Cursor & co. with an API key as above – ideally a separate one, e.g. “Claude”, so you can revoke it on its own.
- Tools: workspace overview, tags (with the automations they start), custom fields, checking and searching contacts, reading a contact’s history (emails sent, automations, tags, consents – newest first), creating/updating contacts, adding and removing tags – up to 500 addresses per call each.
- Newsletters: create and change drafts in your own HTML, read newsletters and their statistics, list saved segments, count recipients by tags and segments and send test emails to the users of the workspace. You always start the actual sending to contacts yourself in Sermiva.
- Conditional content in HTML, subject and preview text:
{% if first_name %}Hallo {{ first_name }}{% else %}Hallo{% endif %}for a greeting with or without first name,{% if not tag "summit-suite käufer" %}…{% endif %}for content only for contacts without (or, withtag, only with) a tag,{% if segment "Eltern" %}…{% endif %}for contacts in a saved segment (which allows and/or rules). Parts that do not apply are removed before sending. The assistant reports errors in the conditions; such a newsletter can only be sent after they are fixed. - The assistant cannot delete, unsubscribe or send to contacts.
- The same rules as in the API apply: new contacts are “pending” as long as you do not name a legal basis; unsubscribed contacts are never subscribed again. Consents show the source “KI-Assistent” (AI assistant).
claude.ai & Claude app (web, desktop, mobile)
- Settings → Connectors → “Add custom connector”.
- Name “Sermiva”, URL
https://api.sermiva.com/mcp– nothing else. - “Connect”: you sign in to Sermiva, choose the workspace and allow access.
A connector works with exactly one workspace. For a second workspace, add the connector once more. Anyone who is no longer a member of the workspace loses access immediately.
Claude Code (terminal or Claude app, “Code” tab)
claude mcp add --transport http --scope user sermiva https://api.sermiva.com/mcp \
--header "Authorization: Bearer sv_YOUR_KEY"
Cursor & others
Clients that can send a header enter URL and header directly. Clients without a header option connect the server e.g. through mcp-remote:
{
"mcpServers": {
"sermiva": {
"command": "npx",
"args": ["-y", "mcp-remote", "https://api.sermiva.com/mcp",
"--header", "Authorization:${SERMIVA_AUTH}"],
"env": { "SERMIVA_AUTH": "Bearer sv_YOUR_KEY" }
}
}
}