Xenaxio

For developers

Email API

Your website, shop or CRM sends email through Xenaxio – over HTTP or SMTP, from your company’s own mailboxes, with a copy in “Sent”. With templates, status per recipient, a suppression list and signed webhooks, like Resend or Postmark.

https://app.xenaxio.com/api/v1/emails

Start in five minutes

  1. Create a key

    As an admin: Administration → Email API → “Keys”. Choose a name, the sending mailbox (a shared mailbox like noreply@, or a person’s own with their consent) and a lifetime. The key xen_api_… is shown once.

  2. Send a message

    POST https://app.xenaxio.com/api/v1/emails with the key as a bearer token. The sender is the key's mailbox or one of its aliases on a verified domain.

  3. See the result

    Status per recipient with GET /emails/:id, events by webhook, and every message in “Outgoing email” with the key’s name.

curl

curl https://app.xenaxio.com/api/v1/emails \
  -H "Authorization: Bearer xen_api_..." \
  -H "Content-Type: application/json" \
  -d '{
    "from": "Acme Shop <[email protected]>",
    "to": "[email protected]",
    "subject": "Ihre Bestellung 1042",
    "html": "<p>Vielen Dank für Ihre Bestellung!</p>",
    "tags": { "kind": "order", "order": "1042" }
  }'

# {"id":"8c0f9b0e-2a51-4d8b-9a55-3c1f6a1f2b7e"}

Node.js

const res = await fetch("https://app.xenaxio.com/api/v1/emails", {
  method: "POST",
  headers: {
    Authorization: `Bearer ${process.env.XENAXIO_API_KEY}`,
    "Content-Type": "application/json",
    "Idempotency-Key": "order-1042-confirmation",
  },
  body: JSON.stringify({
    from: "[email protected]",
    to: ["[email protected]"],
    template: "order-confirmation",
    variables: { name: "Erika", order: { number: 1042, total: 89.9 } },
  }),
});
const body = await res.json();
if (!res.ok) throw new Error(`${body.error.code}: ${body.error.message}`);
console.log(body.id);

Python

import os, requests

res = requests.post(
    "https://app.xenaxio.com/api/v1/emails",
    headers={"Authorization": f"Bearer {os.environ['XENAXIO_API_KEY']}"},
    json={
        "from": "[email protected]",
        "to": "[email protected]",
        "subject": "Ihre Rechnung",
        "text": "Im Anhang finden Sie Ihre Rechnung.",
        "attachments": [{"filename": "rechnung.pdf", "content": pdf_base64}],
    },
    timeout=30,
)
res.raise_for_status()
print(res.json()["id"])

There is no SDK: any HTTP library will do. The description as an OpenAPI file: openapi.json.

Authentication and address

Every request carries Authorization: Bearer xen_api_…. The address is https://app.xenaxio.com/api/v1 or your company’s portal with /api/v1. A key sends from exactly one mailbox; with the right “read status” it may also read statuses and the suppression list. Only a hash of the key is stored; revoking takes effect at once.

Requests

MethodPathWhat
POST/emailsSend one message (Idempotency-Key optional).
POST/emails/batchUp to 100 messages without attachments; one answer per message in data.
GET/emails/:idStatus per recipient (key with read right).
GET/emails?tag=kind:order&since=…The company’s messages, newest first, 100 a page, continue with before=next.
GET/suppressionsThe suppression list (key with read right).
DELETE/suppressions/:addressAllow an address again.
GET/templatesTemplates with languages and variables.

Fields of a message

FieldMeaning
from"[email protected]" or "Company Ltd <[email protected]>"
to · cc · bccOne address or a list; at most 50 together. Bcc goes into the envelope only.
reply_toAddress or list.
subject · html · textSubject and content; html and/or text.
template · variables · localeInstead of subject and content: a template’s key, its values and the language (de or en). subject overrides the template’s subject.
attachments[{ filename, content (base64), content_type? }], up to 10 MB together.
headersOnly X-…, List-Unsubscribe and List-Unsubscribe-Post.
tagsUp to 10 key–value pairs, for filtering and in webhooks.

With an Idempotency-Key header a repeat within 24 hours returns the same id without sending again.

Status

Per recipient: queued, delivered, deferred, failed (with reason: no_mailbox, no_domain, mailbox_full, rejected_as_spam, unreachable, other) or suppressed.

curl https://app.xenaxio.com/api/v1/emails/8c0f9b0e-2a51-4d8b-9a55-3c1f6a1f2b7e -H "Authorization: Bearer xen_api_..."

{
  "id": "8c0f9b0e-2a51-4d8b-9a55-3c1f6a1f2b7e",
  "created_at": "2026-12-04T10:15:02.114Z",
  "from": "[email protected]",
  "status": "sent",
  "tags": { "kind": "order", "order": "1042" },
  "recipients": [
    { "address": "[email protected]", "state": "delivered", "at": "2026-12-04T10:15:04.000Z", "reply": "250 2.0.0 OK" },
    { "address": "[email protected]", "state": "failed", "reason": "no_mailbox", "reply": "550 5.1.1 User unknown" },
    { "address": "[email protected]", "state": "suppressed" }
  ]
}

Templates

The admin creates templates under Email API → “Templates”: key, subject, HTML and text, in German and/or English, with preview and test mail. Placeholders {{…}} use the flow expression language: paths like {{order.number}} and functions like round, upper, coalesce, add_days. {{format_number(order.total, 2)}} writes a number in the template’s language (1.234,50 or 1,234.50; two decimals unless given) and stands alone in its placeholder. Values are escaped in HTML; Xenaxio fills in {{company.name}} itself. If a variable is missing, the API answers 400 missing_variable. The company layout (logo and colour, or your own HTML with {{content}}) wraps the template when it uses it.

<p>Hallo {{name}},</p>
<p>vielen Dank für Ihre Bestellung {{order.number}} über {{format_number(order.total, 2)}} €.</p>
<p>{{coalesce(note, "")}}</p>
<p>Ihr Team von {{company.name}}</p>
{ "from": "[email protected]", "to": "[email protected]", "template": "order-confirmation", "locale": "de",
  "variables": { "name": "Erika", "order": { "number": 1042, "total": 89.9 }, "note": null } }

SMTP with the key as the password

Programs that only speak SMTP (WordPress, a shop, a printer) sign in with the user name api and the key as the password. The same rules apply as over HTTP: sender, suppression list (recipients are refused at RCPT), daily limit, status and webhooks. The reply 250 Queued as <id> carries the id for GET /emails/:id.

SettingValue
Servermail.xenaxio.com (on your own installation: the value on the Email API page)
Port2465 (SSL/TLS) or 2587 (STARTTLS)
User nameapi
Passwordyour API key xen_api_…

Webhooks

Under Email API → “Webhooks” the admin adds up to five HTTPS addresses and picks the events. By default the events of API messages are sent; with the option “All outgoing email of the company” also those of people (channel is then xenaxio or smtp). Message content is never sent.

EventMeaning
email.sentTaken into the mail server’s queue.
email.deliveredThe receiving server accepted the message.
email.deferredTurned away for now; the mail server keeps trying.
email.bouncedTurned away for good, with reason and the server’s reply. With no_mailbox and no_domain the address goes on the suppression list.
email.suppressedNot sent: the address is on the suppression list.
POST /xenaxio-events HTTP/1.1
webhook-id: msg_2f1c0d6e8a7b4c39a1e5f0b2c3d4e5f6
webhook-timestamp: 1796378104
webhook-signature: v1,K5oZfzN95Z9UVu1EsfQmfVNQhnkZ2pj9o9NDN/H/pI4=
content-type: application/json

{
  "type": "email.bounced",
  "created_at": "2026-12-04T10:15:04.000Z",
  "data": {
    "email_id": "8c0f9b0e-2a51-4d8b-9a55-3c1f6a1f2b7e",
    "queue_id": "1a2b3c4d",
    "channel": "api",
    "from": "[email protected]",
    "to": ["[email protected]"],
    "recipient": "[email protected]",
    "reason": "no_mailbox",
    "reply": "550 5.1.1 User unknown",
    "tags": { "kind": "order", "order": "1042" }
  }
}

Check the signature

The signature follows Standard Webhooks: HMAC-SHA256 over webhook-id.webhook-timestamp.body with the address’s secret (whsec_…, base64 after the prefix), base64-encoded after v1,. Check the raw body before you parse it as JSON, and drop timestamps older than five minutes. webhook-id stays the same on retries – use it to spot duplicates.

import { createHmac, timingSafeEqual } from "node:crypto";

// secret: "whsec_..." as shown once on the Webhooks tab; body: the raw request body (a string).
export function verify(secret, headers, body) {
  const id = headers["webhook-id"];
  const timestamp = headers["webhook-timestamp"];
  if (Math.abs(Date.now() / 1000 - Number(timestamp)) > 300) return false; // older than 5 minutes
  const key = Buffer.from(secret.replace(/^whsec_/, ""), "base64");
  const expected = createHmac("sha256", key).update(`${id}.${timestamp}.${body}`).digest();
  return headers["webhook-signature"].split(" ").some((part) => {
    const [version, signature] = part.split(",");
    const given = Buffer.from(signature ?? "", "base64");
    return version === "v1" && given.length === expected.length && timingSafeEqual(given, expected);
  });
}
import base64, hashlib, hmac, time

def verify(secret: str, headers, body: bytes) -> bool:
    msg_id = headers["webhook-id"]
    timestamp = headers["webhook-timestamp"]
    if abs(time.time() - int(timestamp)) > 300:
        return False
    key = base64.b64decode(secret.removeprefix("whsec_"))
    signed = f"{msg_id}.{timestamp}.".encode() + body
    expected = base64.b64encode(hmac.new(key, signed, hashlib.sha256).digest()).decode()
    return any(
        part.startswith("v1,") and hmac.compare_digest(part[3:], expected)
        for part in headers["webhook-signature"].split(" ")
    )

Answer with a 2xx status within 10 seconds. Otherwise Xenaxio tries again after 1 minute, 5 minutes, 30 minutes, 2, 8 and 24 hours. If an address does not answer for three days, it is switched off and the admins get an email. Every delivery is in the log for 30 days, with “Send again”.

Errors

Errors always have the same shape: { "error": { "code", "message", "details"? } }. Messages are in English, codes are stable.

HTTPCodeMeaning
400invalid_requestThe request is not valid (field and reason are in the message).
400missing_variableA variable of the template is missing in variables; details.name names it.
401unauthorizedThe key is missing, unknown, revoked or expired.
403forbiddenThe key may only send, not read.
403forbidden_senderThe sender is neither the key's mailbox nor one of its aliases.
404email · suppressionThe message or the suppression list entry does not exist.
409idempotency_conflictThe same Idempotency-Key was used within 24 hours for a different message.
413too_largeAttachments over 10 MB together (or variables over 100 KB).
422invalid_from · domain_not_verifiedInvalid sender, or its domain is not verified yet.
422no_recipients · too_many_recipientsNo recipients, or more than 50 (to, cc and bcc together).
422header_not_allowed · too_many_tagsOnly X-… and List-Unsubscribe(-Post); at most 10 tags.
422suppressedEvery recipient is on the suppression list; details.addresses lists them.
422template_not_found · template_locale_missing · template_errorUnknown template, no text in this language, or an expression does not fit the values (details.expression).
422batch_too_largeMore than 100 messages in a batch.
429rate_limited · daily_limitMore than 10 requests a second per key, or the company's daily limit is reached.
502send_failedThe mail server did not take the message; try again later.

Limits

  • 10 requests a second per key (429 rate_limited)
  • 1,000 messages a day per company, protecting the shared sending IPs; more on request
  • Up to 10 keys, 5 webhook addresses and 100 templates per company
  • Only from the company’s verified domains
  • No newsletters, no open or click tracking

What is stored and for how long is in the privacy policy.