API
Send API
POST /v1/emails, every field and what comes back.
POST https://app.emitemail.com/api/v1/emails
Authorization: Bearer <your emitemail 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 emitemail 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. |
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 emitemail 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.