Mailaki Documentation

Send transactional emails, receive inbound email, and manage deliverability — all through a simple REST API.

Quickstart

Get from zero to sending your first email in under 5 minutes.

1

Create an account

Sign up at mailaki.com/portal. You'll get an API key immediately.

2

Add and verify your domain

Go to Domains in the portal, add your domain, and configure the DNS records (DKIM, SPF, MX).

3

Send an email

Make a single API call to send your first email.

cURL
curl -X POST https://mailaki.com/v1/messages \
  -H "Authorization: Bearer mf_live_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{
    "domain_id": "YOUR_DOMAIN_UUID",
    "from": "[email protected]",
    "to": ["[email protected]"],
    "subject": "Welcome to our app!",
    "html": "<h1>Welcome!</h1><p>Thanks for signing up.</p>",
    "text": "Welcome! Thanks for signing up."
  }'

You'll get back a message ID confirming it's queued for delivery:

{
  "ids": ["0193abc0-1234-7000-8000-000000000001"],
  "status": "queued",
  "dropped": []
}

Authentication

All API requests require a Bearer token in the Authorization header:

Authorization: Bearer mf_live_your_api_key

You can also use the x-api-key header:

x-api-key: mf_live_your_api_key

Your API key is shown once when you create your account. You can create additional keys in the portal under API Keys.

Keep your API key secret. Never expose it in client-side code or commit it to version control.

Base URL

https://mailaki.com/v1

Send your first email

Before sending, you need your domain_id. Find it in the portal under Domains, or via the API:

Get your domains
curl https://mailaki.com/v1/domains \
  -H "Authorization: Bearer mf_live_..."

Then send:

Send an email
curl -X POST https://mailaki.com/v1/messages \
  -H "Authorization: Bearer mf_live_..." \
  -H "Content-Type: application/json" \
  -d '{
    "domain_id": "019d7397-ca06-7781-b212-726e03ecb96b",
    "from": "[email protected]",
    "to": ["[email protected]"],
    "subject": "Hello from Mailaki",
    "text": "This is a test email sent via the Mailaki API.",
    "html": "

This is a test email sent via the Mailaki API.

" }'

Send via JSON

POST /v1/messages

Request body

FieldTypeRequiredDescription
domain_idUUIDYesYour verified domain ID
fromStringYesSender address (must match domain)
toString[]YesRecipient addresses
ccString[]NoCC recipients
bccString[]NoBCC recipients
subjectStringNoEmail subject
textStringNoPlain text body
htmlStringNoHTML body
headersObjectNoCustom email headers
tagsString[]NoTags for analytics
scheduled_atISO 8601NoSchedule for later delivery
template_idUUIDNoUse a stored template
variablesObjectNoTemplate variables

Response

{
  "ids": ["0193abc0-..."],
  "status": "queued",
  "dropped": []
}

If a recipient is on the suppression list, they'll appear in dropped with a reason.

HTML emails

Include both text and html fields. Mailaki sends a multipart/alternative message so email clients can pick their preferred format.

{
  "from": "[email protected]",
  "to": ["[email protected]"],
  "subject": "Your weekly report",
  "text": "Your report is ready. Visit https://app.example.com/reports",
  "html": "<h2>Your weekly report</h2><p>Visit <a href='https://app.example.com/reports'>your dashboard</a>.</p>"
}

Templates

Create reusable templates with {{variable}} substitution.

Create a template
curl -X POST https://mailaki.com/v1/templates \
  -H "Authorization: Bearer mf_live_..." \
  -d '{
    "name": "welcome",
    "subject": "Welcome, {{name}}!",
    "html": "<h1>Hi {{name}}</h1><p>Thanks for joining {{company}}.</p>"
  }'
Send with template
curl -X POST https://mailaki.com/v1/messages \
  -H "Authorization: Bearer mf_live_..." \
  -d '{
    "domain_id": "...",
    "from": "[email protected]",
    "to": ["[email protected]"],
    "template_id": "TEMPLATE_UUID",
    "variables": {"name": "Alice", "company": "Acme Inc"}
  }'

Open & click tracking

Mailaki automatically tracks opens (via tracking pixel) and clicks (via link rewriting). Both are enabled by default.

Disable tracking per message:

{
  "tracking": {"opens": false, "clicks": false}
}

Inbound email setup

Receive emails at your domain and process them via the API or webhooks.

1

Add MX record

Point your domain's MX record to mail.mailaki.com with priority 10.

2

Create an inbound route

In the portal under Inbound Routes, create a route matching your desired address pattern.

3

Read your emails

View stored messages in the portal Inbox page or via the API.

DNS setup

RecordTypeValuePriority
yourdomain.comMXmail.mailaki.com10

Inbound routes

Routes match incoming email addresses against patterns and perform actions.

ActionDescription
storeSave the message — read it via API or portal Inbox
forwardPOST the message to a webhook URL
dropSilently discard the message
Create a route via API
curl -X POST https://mailaki.com/v1/routes \
  -H "Authorization: Bearer mf_live_..." \
  -d '{
    "pattern": "[email protected]",
    "action": "store"
  }'

Patterns support wildcards: *@yourdomain.com catches all addresses.

Reading emails

GET /v1/stored-messages — list stored inbound messages

GET /v1/stored-messages/:id — get full message content

curl https://mailaki.com/v1/stored-messages \
  -H "Authorization: Bearer mf_live_..."
[
  {
    "id": "0193abc1-...",
    "from_addr": "[email protected]",
    "to_addr": "[email protected]",
    "subject": "Help with my order",
    "body_text": "Hi, I need help...",
    "raw_size": 1234,
    "created_at": "2026-04-13T10:00:00Z"
  }
]

Add a domain

Add your domain in the portal under Domains, then configure the DNS records we provide.

DNS records

After adding a domain, set up these DNS records:

RecordTypePurpose
mf1._domainkey.yourdomain.comTXTDKIM public key (we generate this)
yourdomain.comTXTSPF: v=spf1 include:mailaki.com ~all
_dmarc.yourdomain.comTXTDMARC: v=DMARC1; p=none; rua=mailto:[email protected]
yourdomain.comMXmail.mailaki.com (for inbound only)

Event webhooks

Get notified when emails are delivered, bounced, opened, or clicked.

Create a webhook
curl -X POST https://mailaki.com/v1/webhooks \
  -H "Authorization: Bearer mf_live_..." \
  -d '{
    "url": "https://yourapp.com/webhooks/email",
    "event_types": ["delivered", "bounced", "opened", "clicked"],
    "secret": "whsec_your_webhook_secret"
  }'

Events are signed with HMAC-SHA256. Verify the X-Mailaki-Signature header:

import hmac, hashlib

def verify(payload_bytes, signature, secret):
    expected = hmac.new(secret.encode(), payload_bytes, hashlib.sha256).hexdigest()
    return hmac.compare_digest(expected, signature)

Event types

EventDescription
acceptedMessage accepted by Mailaki
deliveredDelivered to recipient's mail server
bouncedPermanent delivery failure
deferredTemporary failure, will retry
openedRecipient opened the email
clickedRecipient clicked a link
complainedRecipient marked as spam
unsubscribedRecipient unsubscribed

Python SDK

Install
pip install mailaki
Usage
from mailaki import Mailaki

client = Mailaki(api_key="mf_live_...")

# Send an email
result = client.messages.send(
    domain_id="YOUR_DOMAIN_UUID",
    from_addr="[email protected]",
    to=["[email protected]"],
    subject="Welcome!",
    text="Thanks for signing up.",
    html="<h1>Welcome!</h1><p>Thanks for signing up.</p>"
)
print(result["ids"])  # ['0193abc0-...']

# Create an inbox for receiving
inbox = client.inboxes.create(address="[email protected]")

# Read inbound emails
messages = client.inboxes.list_messages(inbox["id"])

TypeScript SDK

Install
npm install mailaki
Usage
import { Mailaki } from "mailaki";

const client = new Mailaki("mf_live_...");

// Send an email
const result = await client.messages.send({
  domain_id: "YOUR_DOMAIN_UUID",
  from: "[email protected]",
  to: ["[email protected]"],
  subject: "Welcome!",
  text: "Thanks for signing up.",
  html: "<h1>Welcome!</h1><p>Thanks for signing up.</p>"
});

// Create an inbox
const inbox = await client.inboxes.create({
  address: "[email protected]"
});

// Read emails
const messages = await client.inboxes.listMessages(inbox.id);

cURL

No SDK needed — the API is a standard REST JSON API. Set two headers and you're done:

curl -X POST https://mailaki.com/v1/messages \
  -H "Authorization: Bearer mf_live_..." \
  -H "Content-Type: application/json" \
  -d '{"domain_id":"...","from":"[email protected]","to":["[email protected]"],"subject":"Hi","text":"Hello"}'

Full API Reference

See the complete interactive API reference with all endpoints, request/response schemas, and try-it-out functionality:

Open API Reference →