sermiva

API documentation

With the REST API, other systems – payment providers, shops, webinar tools – create contacts in Sermiva, add and remove tags, unsubscribe contacts and send transactional emails.

Quick start

  1. In Sermiva, create a key under System → API-Schlüssel (API keys). It is shown only once – store it safely right away.
  2. Every request goes to https://api.sermiva.com/v1 and carries the key in a header.
  3. 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

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

HTTPerror.codeMeaning
401unauthenticatedKey missing, wrong or revoked
404not_foundContact or endpoint does not exist
422validation_failedInvalid data – details in error.fields
429rate_limitedMore 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.statusEffect
(omitted)A new contact gets pending (no newsletters); an existing one stays as it is.
subscribedSubscribed. 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_inSermiva sends the confirmation email; subscribed only after the click or code.
unsubscribedUnsubscribe.

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:

subscribeddouble_opt_in
Tags “on submit”immediatelyimmediately
Tags “after confirmation”immediatelyafter click/code
Automations “sign-up confirmed in form …”start immediatelystart 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.

PUT

/v1/contacts

Creates a contact or updates it (by email address). Response 201 if new, otherwise 200. POST works the same way.

FieldTypeDescription
emailstring, requiredEmail address
first_name, last_namestringOverwritten when sent
phonestringPhone number, stored as sent (e.g. +49 170 1234567, 0170/1234567). Allowed: digits, spaces, + ( ) / . -, max. 50 characters. Overwritten when sent; null deletes it.
fieldsobjectCustom fields by key, e.g. {"land": "AT"} – see Custom fields.
tagsstring[]Add tags (missing ones are created). Existing tags stay.
remove_tagsstring[]Remove tags
subscriptionobjectSee Status & consent
start_automationsbooleanDefault 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.

TypeAllowedStored as
Texttext, numbertext (max. 2000 characters)
Number42, "42", 3.5number
Date"1984-10-18", "18.10.1984", ISO 8601"1984-10-18"
Selectone of the defined options (case-insensitive)the option in its exact spelling

In newsletters the values are available as placeholders, e.g. {{ land }}.

GET

/v1/contacts/{email}

Returns the contact or 404.

POST

/v1/contacts/{email}/tags

Adds tags. Body: {"tags": ["kunde", "vip"], "start_automations": true}.

DELETE

/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_…"
POST

/v1/contacts/{email}/unsubscribe

Unsubscribes the contact (no more newsletters, running automations end).

GET

/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.

GET

/v1/fields

All custom fields of the workspace: {"data": [{"key": "paket", "label": "Paket", "type": "select", "options": ["Basic", "Pro"]}]}. Types: text, number, date, select.

GET

/v1/workspace

Name and slug of the workspace – to check that the key works.

POST

/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.

FieldType
tostringRequired. Recipient address
subjectstringSubject, max. 255 characters. Required with html; with a template it replaces the template’s subject (placeholders work here too)
htmlstringFinished HTML of the email (max. 2 MB), email-safe: tables, inline styles. Required when no template is given
templatestring / numberInstead 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
dataobjectValues 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
textstringPlain-text part. If missing, Sermiva creates it from the HTML
fromstringA confirmed sender of the workspace, in full (kalender@online-kongress.events) or just the part before the @ (kalender). Without: the default sender
reply_tostringReply-to address. Without: the sender’s
idempotency_keystringYour 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.

HTTPerror.codeMeaning
403forbiddenThe key may not send transactional emails
409sending_not_set_upSending is not set up in the workspace yet (confirmed sender)
422recipient_blockedThe address bounced or complained about spam – Sermiva no longer sends to it
422unknown_template / ambiguous_templatetemplate is not a process email of the workspace, or the name matches several – then use the API name or the number
422missing_data / missing_subjectThe template needs values missing from data, or has no subject
422unknown_sender / ambiguous_senderfrom is not a confirmed sender or matches several – then give the full address
429rate_limitedMore than 60 transactional emails per hour in the workspace; Retry-After gives the seconds until the next possible email
502sending_failedThe sending service did not accept the email – try again later, ideally with the same idempotency_key
GET

/v1/emails/{id}

Status of a transactional email, with the id from the response when sending. The same object as above.

POST

/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).

FieldType
namestringRequired. Internal name, e.g. "December newsletter"
subjectstringRequired. Subject, max. 255 characters. Placeholders and conditions work here too
preheaderstringPreview text shown after the subject in the inbox
htmlstringRequired. 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_versionbooleanAdd a "view in browser" link. Default: false
senderstringA verified sender of the workspace, in full (martin@summit-suite.de) or just the part before the @ (martin). Without: the default sender
topicstringTopic: 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
audienceobjectRecipients, 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.

HTTPerror.codeMeaning
422validation_failedA 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
PATCH

/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.

HTTPerror.codeMeaning
404not_foundNo newsletter with this number in the workspace
409not_a_draftThe newsletter was already sent and stays as it was
409editor_mismatchThe draft was written in the block editor; its content cannot be replaced with HTML. Subject, sender, topic and recipients still work
GET

/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.

GET

/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.”

claude.ai & Claude app (web, desktop, mobile)

  1. Settings → Connectors → “Add custom connector”.
  2. Name “Sermiva”, URL https://api.sermiva.com/mcp – nothing else.
  3. “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" }
    }
  }
}