Zum Inhalt springen

API-Referenz

Jeder Endpunkt, jedes Feld und jede Antwort der API, erzeugt aus der OpenAPI-Spezifikation. Um in fünf Minuten zu starten, beginne mit der Übersicht für Entwickler.

Die Spezifikation ist auf Italienisch verfasst, und diese Seite gibt sie unverändert wieder, in allen Sprachen der Website.

Übersicht für EntwicklerSpezifikation herunterladen (openapi.yaml)

Version der Spezifikation: 1.13.0

Überblick

Produktion
https://api.mailronix.com
Lokale Entwicklung
http://localhost:8080

Authentifizierung

apiKeyTyp: http bearer

sessionCookieTyp: apiKey

Endpunkte

POST/email/send

Invia un'email transazionale

Authentifizierung: eine von apiKey, sessionCookie

Parameter

Idempotency-Keystring · im Headeroptional

Anfragekörper · erforderlich

Variante 1: SendRequestDirect

fromstring (email)erforderlich
from_namestringoptional
Einschränkungen: lunghezza minima 1; lunghezza massima 78
reply_tostring (email)optional
languagestringoptional
Erlaubte Werte: it, en, es, de, fr
attachmentsarray di valorioptional
Einschränkungen: al massimo 5 elementi
attachments[].filenamestringerforderlich
Einschränkungen: lunghezza minima 1; lunghezza massima 100
attachments[].content_typestringerforderlich
Erlaubte Werte: application/pdf, image/png, image/jpeg, image/gif, text/plain, text/csv, text/calendar
attachments[].contentstring (byte)erforderlich
tostring (email)erforderlich
subjectstringerforderlich
html_bodystringoptional
text_bodystringoptional
brand_idstring (uuid)optional
marketingbooleanoptional
Standardwert: false

Variante 2: SendRequestTemplate

fromstring (email)erforderlich
from_namestringoptional
Einschränkungen: lunghezza minima 1; lunghezza massima 78
reply_tostring (email)optional
languagestringoptional
Erlaubte Werte: it, en, es, de, fr
attachmentsarray di valorioptional
Einschränkungen: al massimo 5 elementi
attachments[].filenamestringerforderlich
Einschränkungen: lunghezza minima 1; lunghezza massima 100
attachments[].content_typestringerforderlich
Erlaubte Werte: application/pdf, image/png, image/jpeg, image/gif, text/plain, text/csv, text/calendar
attachments[].contentstring (byte)erforderlich
tostring (email)erforderlich
template_idstring (uuid)erforderlich
variablesobjectoptional
brand_idstring (uuid)optional
marketingbooleanoptional
Standardwert: false

Beispiele

Contenuto diretto (senza template)

{
  "from": "[email protected]",
  "to": "[email protected]",
  "subject": "Conferma ordine #4821",
  "html_body": "<p>Il tuo ordine #4821 è confermato.</p>"
}

Con brand_id come asserzione (facoltativo)

{
  "from": "[email protected]",
  "to": "[email protected]",
  "subject": "Conferma ordine #4821",
  "html_body": "<p>Il tuo ordine #4821 è confermato.</p>",
  "brand_id": "3f2b8c1d-9a4e-4c7b-8e5f-1a2b3c4d5e6f"
}

Solo testo (la parte HTML viene derivata)

{
  "from": "[email protected]",
  "to": "[email protected]",
  "subject": "Conferma ordine #4821",
  "text_body": "Il tuo ordine #4821 è confermato.\n\nDettaglio: https://negozio.example/ordini/4821"
}

Da template con variabili

{
  "from": "[email protected]",
  "to": "[email protected]",
  "template_id": "5f1d6c2e-3b4a-4f0e-9c1a-2d8e7f6a1b3c",
  "variables": {
    "nome_cliente": "Maria",
    "numero_ordine": "4821"
  }
}

Antworten

202

statusstringerforderlich
Erlaubte Werte: queued
email_log_idstring (uuid)erforderlich
{
  "status": "queued",
  "email_log_id": "9c4e2f1a-7d3b-4a5e-8f6c-1b2a3d4e5f6a"
}

400

errorobjecterforderlich
error.codestringerforderlich
error.messagestringerforderlich

Payload malformato o campi incompatibili/mancanti

{
  "error": {
    "code": "invalid_request",
    "message": "from e to sono obbligatori."
  }
}

Autenticazione via sessione senza brand_id

{
  "error": {
    "code": "invalid_request",
    "message": "brand_id è obbligatorio: indica il brand da cui parte questo invio."
  }
}

from non è un indirizzo email

{
  "error": {
    "code": "invalid_request",
    "message": "from non è un indirizzo email valido."
  }
}

from_name non valido

{
  "error": {
    "code": "invalid_from_name",
    "message": "from_name non è valido: da 1 a 78 caratteri, senza «@», «<», «>», virgolette, a-capo o indirizzi web."
  }
}

reply_to non valido

{
  "error": {
    "code": "invalid_reply_to",
    "message": "reply_to non è un indirizzo email valido: serve un solo indirizzo, senza nome e senza spazi."
  }
}

language non valida

{
  "error": {
    "code": "invalid_language",
    "message": "language deve essere una tra it, en, es, de, fr."
  }
}

Più di 5 allegati

{
  "error": {
    "code": "too_many_attachments",
    "message": "Troppi allegati: al massimo 5 per messaggio."
  }
}

Allegato non valido

{
  "error": {
    "code": "invalid_attachment",
    "message": "Allegato non valido: servono filename, content_type e content in base64 standard, non vuoti."
  }
}

Tipo di allegato non ammesso

{
  "error": {
    "code": "attachment_type_not_allowed",
    "message": "Tipo di allegato non ammesso. Sono ammessi application/pdf, image/png, image/jpeg, image/gif, text/plain, text/csv e text/calendar; il contenuto e l'estensione del nome devono corrispondere al tipo dichiarato."
  }
}

Allegati su un messaggio marketing

{
  "error": {
    "code": "attachments_not_allowed_for_marketing",
    "message": "Un messaggio marketing non può avere allegati: gli allegati sono ammessi solo sui messaggi transazionali."
  }
}

Variabile del template non fornita

{
  "error": {
    "code": "missing_template_variable",
    "message": "Il template referenzia una variabile non fornita."
  }
}

401

errorobjecterforderlich
error.codestringerforderlich
error.messagestringerforderlich
{
  "error": {
    "code": "unauthenticated",
    "message": "Autenticazione richiesta."
  }
}

403

errorobjecterforderlich
error.codestringerforderlich
error.messagestringerforderlich

Il mittente non è sul dominio del brand dell'invio

{
  "error": {
    "code": "from_address_not_of_brand",
    "message": "Il dominio del mittente non è quello del brand da cui parte questo invio: un brand invia dal proprio dominio (o da un suo sottodominio verificato). Vedi il dominio del brand su GET /brands."
  }
}

Dominio del mittente non verificato

{
  "error": {
    "code": "domain_not_verified",
    "message": "Il dominio del mittente non è verificato per questo tenant."
  }
}

Tenant sospeso

{
  "error": {
    "code": "tenant_suspended",
    "message": "Il tenant è sospeso."
  }
}

Limite giornaliero di destinatari unici del piano Free raggiunto

{
  "error": {
    "code": "free_daily_recipients_exceeded",
    "message": "Limite giornaliero di destinatari unici del piano Free raggiunto."
  }
}

Limite mensile del piano superato

{
  "error": {
    "code": "plan_limit_exceeded",
    "message": "Limite mensile del piano superato."
  }
}

reply_to non consentito dal brand

{
  "error": {
    "code": "reply_to_not_allowed",
    "message": "Questo brand non consente di indicare un reply_to nella richiesta: attivalo nelle impostazioni del brand in console."
  }
}

brand_id diverso da quello della chiave

{
  "error": {
    "code": "brand_mismatch",
    "message": "Il brand dichiarato non è quello a cui questa chiave è legata: la chiave scrive sotto un brand solo, e il campo brand_id può solo confermarlo."
  }
}

404

errorobjecterforderlich
error.codestringerforderlich
error.messagestringerforderlich
{
  "error": {
    "code": "template_not_found",
    "message": "Template non trovato."
  }
}

409

errorobjecterforderlich
error.codestringerforderlich
error.messagestringerforderlich

Brand archiviato

{
  "error": {
    "code": "brand_archived",
    "message": "Il brand è archiviato: riattivalo prima di usarlo."
  }
}

Il brand non ha ancora un indirizzo mittente

{
  "error": {
    "code": "brand_sender_not_configured",
    "message": "Questo brand non ha ancora un indirizzo mittente: impostane uno, su un dominio verificato, prima di inviare in suo nome."
  }
}

413

errorobjecterforderlich
error.codestringerforderlich
error.messagestringerforderlich

Allegati oltre 7 MB in totale, o email oltre 10 MB

{
  "error": {
    "code": "attachments_too_large",
    "message": "Gli allegati superano 7 MB in totale (dimensione dopo la decodifica base64)."
  }
}

Corpo della richiesta troppo grande

{
  "error": {
    "code": "payload_too_large",
    "message": "Corpo della richiesta troppo grande."
  }
}

422

errorobjecterforderlich
error.codestringerforderlich
error.messagestringerforderlich
{
  "error": {
    "code": "idempotency_key_body_mismatch",
    "message": "Questa Idempotency-Key è già stata usata con un corpo diverso."
  }
}

429

Header der Antwort

  • Retry-After (integer)

    Secondi da attendere prima di riprovare (solo con attachments_backlog e server_busy).

errorobjecterforderlich
error.codestringerforderlich
error.messagestringerforderlich

Rate limit per chiave

{
  "error": {
    "code": "rate_limited",
    "message": "Troppe richieste, riprova più tardi."
  }
}

Troppe richieste con corpo grande in corso

{
  "error": {
    "code": "server_busy",
    "message": "Troppe richieste con corpo grande in corso: riprova fra qualche secondo."
  }
}

Troppi allegati in attesa di invio

{
  "error": {
    "code": "attachments_backlog",
    "message": "Hai troppi allegati in attesa di invio: riprova fra qualche secondo, quando quelli già accodati saranno partiti."
  }
}

500

errorobjecterforderlich
error.codestringerforderlich
error.messagestringerforderlich
{
  "error": {
    "code": "internal_error",
    "message": "Errore interno."
  }
}

503

errorobjecterforderlich
error.codestringerforderlich
error.messagestringerforderlich
{
  "error": {
    "code": "auth_unavailable",
    "message": "Verifica della chiave non disponibile."
  }
}

GET/email/{id}

Leggi lo stato del tuo invio

Authentifizierung: eine von apiKey, sessionCookie

Parameter

idstring (uuid) · im Pfaderforderlich

Antworten

200

email_log_idstring (uuid)erforderlich
statusstringerforderlich
Erlaubte Werte: queued, sent, complained, undelivered
{
  "email_log_id": "9c4e2f1a-7d3b-4a5e-8f6c-1b2a3d4e5f6a",
  "status": "sent"
}

401

errorobjecterforderlich
error.codestringerforderlich
error.messagestringerforderlich

403

errorobjecterforderlich
error.codestringerforderlich
error.messagestringerforderlich

404

errorobjecterforderlich
error.codestringerforderlich
error.messagestringerforderlich

429

errorobjecterforderlich
error.codestringerforderlich
error.messagestringerforderlich

POST/contacts

Crea un contatto e avvia la conferma double opt-in

Authentifizierung: eine von apiKey, sessionCookie

Anfragekörper · erforderlich

emailstring (email)erforderlich
namestringoptional
brand_idstring (uuid)optional
languagestringoptional
Erlaubte Werte: it, en, es, de, fr

Antworten

201

204

400

errorobjecterforderlich
error.codestringerforderlich
error.messagestringerforderlich

401

errorobjecterforderlich
error.codestringerforderlich
error.messagestringerforderlich

403

errorobjecterforderlich
error.codestringerforderlich
error.messagestringerforderlich

409

errorobjecterforderlich
error.codestringerforderlich
error.messagestringerforderlich

429

errorobjecterforderlich
error.codestringerforderlich
error.messagestringerforderlich

POST/contacts/revoke

Registra la disiscrizione di un contatto

Authentifizierung: eine von apiKey, sessionCookie

Anfragekörper · erforderlich

emailstring (email)erforderlich
brand_idstring (uuid)optional

Antworten

204

400

errorobjecterforderlich
error.codestringerforderlich
error.messagestringerforderlich

401

errorobjecterforderlich
error.codestringerforderlich
error.messagestringerforderlich

403

errorobjecterforderlich
error.codestringerforderlich
error.messagestringerforderlich

409

errorobjecterforderlich
error.codestringerforderlich
error.messagestringerforderlich

POST/contacts/delete

Elimina un contatto

Authentifizierung: eine von apiKey, sessionCookie

Anfragekörper · erforderlich

emailstring (email)erforderlich
brand_idstring (uuid)optional

Antworten

204

400

errorobjecterforderlich
error.codestringerforderlich
error.messagestringerforderlich

401

errorobjecterforderlich
error.codestringerforderlich
error.messagestringerforderlich

403

errorobjecterforderlich
error.codestringerforderlich
error.messagestringerforderlich

409

errorobjecterforderlich
error.codestringerforderlich
error.messagestringerforderlich

GET/contacts/revocations

Scorri le revoche del tuo brand

Authentifizierung: apiKey

Parameter

sincestring · in der Queryoptional
limitinteger · in der Queryoptional

Antworten

200

itemsarray di valorierforderlich
items[].emailstring (email)erforderlich
items[].revoked_atstring (date-time)erforderlich
items[].originstringerforderlich
Erlaubte Werte: unsubscribe_link, console, api_key, undeclared, unknown
next_cursorstring | nullerforderlich
has_morebooleanerforderlich

400

errorobjecterforderlich
error.codestringerforderlich
error.messagestringerforderlich

401

errorobjecterforderlich
error.codestringerforderlich
error.messagestringerforderlich

403

errorobjecterforderlich
error.codestringerforderlich
error.messagestringerforderlich

409

errorobjecterforderlich
error.codestringerforderlich
error.messagestringerforderlich

429

errorobjecterforderlich
error.codestringerforderlich
error.messagestringerforderlich

Webhook-Ereignisse

mailronix sendet dieses Ereignis an Ihre Adresse; es ist kein Endpunkt, den Sie aufrufen. Wie Sie die Signatur prüfen, steht in der Webhook-Anleitung.

Webhook-Anleitung

receiveMailronixEvent

Un evento del tuo account, consegnato al tuo endpoint

Parameter

Mailronix-Signaturestring · im Headererforderlich
Mailronix-Event-Idstring · im Headererforderlich
Mailronix-Delivery-Idstring · im Headererforderlich
Mailronix-Event-Typestring · im Headererforderlich
Erlaubte Werte: email.sent, email.delivered, email.bounced, email.complained, email.failed, email.suppressed, email.clicked, contact.confirmed, contact.unsubscribed, webhook.test

Anfragekörper · erforderlich

idstringerforderlich
typestringerforderlich
Erlaubte Werte: email.sent, email.delivered, email.bounced, email.complained, email.failed, email.suppressed, email.clicked, contact.confirmed, contact.unsubscribed, webhook.test
api_versionstringerforderlich
created_atstring (date-time)erforderlich
brand_idstring | null (uuid)erforderlich
dataerforderlich

Beispiele

Un rifiuto permanente

{
  "id": "evt_3f1a9c2e7b6d4e8f9a0b1c2d3e4f5a6b",
  "type": "email.bounced",
  "api_version": "2026-10-22",
  "created_at": "2026-10-22T14:03:11Z",
  "brand_id": "6f1d2c0e-8b1a-4c53-9a77-0d6a7b3a2c11",
  "data": {
    "email_log_id": "0b7c1e52-3f0a-4d3e-8a8e-5b1f2c9d4e60",
    "recipient": "[email protected]",
    "category": "transactional",
    "bounce_type": "permanent"
  }
}

Una disiscrizione di un indirizzo che non è un contatto

{
  "id": "evt_9c4e2a1b7d3f4a6e8b0c1d2e3f4a5b6c",
  "type": "contact.unsubscribed",
  "api_version": "2026-10-22",
  "created_at": "2026-10-22T14:07:42Z",
  "brand_id": "6f1d2c0e-8b1a-4c53-9a77-0d6a7b3a2c11",
  "data": {
    "contact_id": null,
    "email": "[email protected]"
  }
}

Antworten

2XX

3XX

4XX

5XX