API
Send API
POST /v1/emails, every field and what comes back.
POST https://app.emitemail.com/api/v1/emails
Authorization: Bearer <your Email Service API key>
Content-Type: application/jsonRequest body#
| Field | Type | Notes |
|---|---|---|
from |
string | orders@shop.com or Shop <orders@shop.com>. The domain must be verified on your account. |
to |
string or string[] | Names allowed: Ana <ana@x.com>. |
cc, bcc |
string or string[] | bcc is delivered but never appears in the message. |
reply_to |
string or string[] | replyTo also works. |
subject |
string | Required. No line breaks. |
html, text |
string | At least one is required. Send both for best results. |
headers |
object | Up to 20 custom headers. Headers Xenkloud sets itself (From, To, Subject, Message-ID, DKIM-Signature and similar) are refused. |
attachments |
array | { filename, content, content_type?, content_id? }. content is base64. Up to 10 files, 7 MB in total. Executable file types are refused. |
tags |
array | { name, value }, letters, numbers, _ and -. Stored with the send and returned in webhooks. |
track_clicks |
boolean | Count clicks on the links in html. Leave it out to follow the sending domain's setting (Domains, Click tracking, off by default). false turns it off for this email, which suits password resets. See Click tracking. |
Up to 50 recipients across to, cc and bcc. Every recipient counts toward your monthly cap. Unknown fields are refused with a 400 instead of being ignored, so a typo never fails silently.
Not available yet: scheduled_at, stored templates, attachment URLs.
Response#
{ "id": "emt_k3Xv9...", "status": "sent", "suppressed": [] }202 means Xenkloud accepted the message and handed it to the mail server. suppressed appears only when some recipients were skipped because they bounced or reported spam before.
Attachments#
{
"from": "Shop <orders@shop.com>",
"to": "ana@example.com",
"subject": "Your invoice",
"text": "Invoice attached.",
"attachments": [
{ "filename": "invoice.pdf", "content": "JVBERi0xLjQK...", "content_type": "application/pdf" }
]
}Tags#
Tags travel with the message and come back in webhooks, so you can match a bounce to an order.
{ "tags": [{ "name": "order_id", "value": "1042" }] }Errors#
If something is wrong you get a JSON error with a code and a plain-language message. See Errors for every code.
Click tracking#
With click tracking on, each web link in your html is swapped for a short link on app.emitemail.com. When someone opens it, Xenkloud records the click and sends them on to your real link straight away. The email page in the console then shows each link and how often it was opened.
- It is off until you turn it on for a domain or send
"track_clicks": true. - Only links in
htmlare tracked.mailto:,tel:, unsubscribe links and plain-text parts are left alone. - Many mail systems open links to check them for viruses, sometimes within a second of delivery. Those clicks are listed as automatic checks and kept out of the click count.
- Clicks are counted per email, not per recipient, because one tracked link is shared by everyone the email went to.
- The stored copy of the email shows your real links.
- Tracked links keep working for two years. Click records follow your plan's log retention.