REST API
Send tracked emails from your own Gmail and read opens and clicks — from any language, with no browser or extension.
Authentication
Create an API key in the dashboard under Developers. It is shown once — store it safely. Send it as a Bearer token:
Authorization: Bearer mc_live_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Base URL: https://app.mconfirm.com/api/v1. Requests and responses are JSON. Emails are sent from the Gmail account connected to the key's owner, so Gmail must be connected.
Endpoints
| Method | Path | Description |
|---|---|---|
POST | /api/v1/emails | Send a tracked email. |
GET | /api/v1/emails | List tracked emails. Query: filter=all|opened|unopened|clicked|individual|group, q, limit (1–100, default 25), before (cursor). |
GET | /api/v1/emails/{id} | One email with its recipients, events and link stats. |
GET | /api/v1/emails/{id}/events | Every open and click of one email, newest first. |
GET | /api/v1/events | Your activity feed. Query: since (ISO time), limit. |
GET | /api/v1/links | Link click stats. Query: email_id (optional). |
GET | /api/v1/stats | Sent, opened, clicked and rates. Query: days (default 30). |
GET | /api/v1/me | Your account, Gmail connection and settings. |
Send a tracked email
POST /api/v1/emails
| Field | Type | Description |
|---|---|---|
to | array, required | Recipients. Each is a string ("Ann <ann@acme.com>" or "ann@acme.com") or { "address", "name" }. |
cc | array | Cc recipients, same format. |
bcc | array | Bcc recipients. Each gets a private copy with no Bcc line. |
subject | string | Subject line. Optional when reply_to is given ("Re: …" is used). |
html | string | HTML body. Either html or text is needed. |
text | string | Plain-text body; turned into simple HTML so it can be tracked. |
attachments | array | Up to 20: { "filename", "contentType", "contentBase64" }. 20 MB total. |
track | boolean | Track opens. Default: your “Track emails by default” setting. |
track_clicks | boolean | Track link clicks. Default: your setting. |
individual | boolean | One copy per recipient. Default: your “Individual tracking” setting. |
signature | boolean | Add the MConfirm signature. Default: your setting. |
reply_to | string | Gmail message id or RFC Message-ID of the email you're answering — threads the reply. |
remind_if_not_opened_hours | integer | 0–720. Alert you if nobody opens it within this many hours. |
curl
curl https://app.mconfirm.com/api/v1/emails \
-H "Authorization: Bearer $MCONFIRM_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"to": ["Priya Shah <priya@acme.com>", "marco@acme.com"],
"bcc": ["lena@acme.com"],
"subject": "Q1 proposal",
"html": "<p>Hi both, the final numbers are <a href=\"https://acme.com/q1\">here</a>.</p>",
"individual": true,
"remind_if_not_opened_hours": 48
}'Response — 201 Created
{
"id": "eml_7dKq2mWzR4pXbN8sTa",
"status": "sent",
"mode": "individual",
"messageId": "<3f9c2a...e1.mc@acme.com>",
"recipients": [
{ "address": "priya@acme.com", "kind": "to", "status": "sent" },
{ "address": "marco@acme.com", "kind": "to", "status": "sent" },
{ "address": "lena@acme.com", "kind": "bcc", "status": "sent" }
]
}status is sent, or partial when some recipients failed (each failed recipient carries an error). mode is individual, group or untracked. A warning appears if the email was sent but the Sent folder could not be tidied.
Node.js
const res = await fetch("https://app.mconfirm.com/api/v1/emails", {
method: "POST",
headers: { Authorization: `Bearer ${process.env.MCONFIRM_API_KEY}`, "Content-Type": "application/json" },
body: JSON.stringify({ to: ["priya@acme.com"], subject: "Hello", text: "Quick question…" }),
});
const email = await res.json();
if (!res.ok) throw new Error(email.error.message);Python
import os, requests
r = requests.post(
"https://app.mconfirm.com/api/v1/emails",
headers={"Authorization": f"Bearer {os.environ['MCONFIRM_API_KEY']}"},
json={"to": ["priya@acme.com"], "subject": "Hello", "text": "Quick question…"},
timeout=120,
)
r.raise_for_status()
print(r.json()["id"])List emails
curl "https://app.mconfirm.com/api/v1/emails?filter=opened&limit=10" \
-H "Authorization: Bearer $MCONFIRM_API_KEY"{
"emails": [
{
"id": "eml_7dKq2mWzR4pXbN8sTa",
"subject": "Q1 proposal",
"from": "you@acme.com",
"message_id": "<3f9c2a...e1.mc@acme.com>",
"gmail_message_id": "18c2f0a9d3b4e5f6",
"gmail_thread_id": "18c2f0a9d3b4e5f6",
"mode": "individual",
"source": "api",
"status": "sent",
"tracking": { "opens": true, "clicks": true },
"sent_at": "2026-11-28T10:42:00.000Z",
"opens": 4,
"clicks": 1,
"opened": true,
"first_open_at": "2026-11-28T10:51:13.000Z",
"last_open_at": "2026-11-28T14:02:40.000Z",
"recipients_summary": "Priya Shah, marco@acme.com, lena@acme.com",
"recipient_count": 3
}
],
"next_cursor": "2026-11-27T08:15:00.000Z"
}Pass next_cursor as before to get the next page; it is null on the last page.
One email
GET /api/v1/emails/{id} returns email (as above), recipients, events and links:
{
"email": { "id": "eml_7dKq…", "subject": "Q1 proposal", "opens": 4, "clicks": 1, "...": "..." },
"recipients": [
{
"id": "rcp_Hn3…", "address": "priya@acme.com", "name": "Priya Shah", "kind": "to", "status": "sent",
"opens": 3, "clicks": 0,
"first_open_at": "2026-11-28T10:51:13.000Z", "last_open_at": "2026-11-28T14:02:40.000Z"
}
],
"events": [
{ "id": "evt_9a…", "type": "click", "at": "2026-11-28T11:20:02.000Z", "recipient": "marco@acme.com",
"recipient_id": "rcp_Q2…", "url": "https://acme.com/q1", "device": "desktop", "counted": true },
{ "id": "evt_8b…", "type": "open", "at": "2026-11-28T10:44:10.000Z", "recipient": "Priya Shah",
"recipient_id": "rcp_Hn3…", "url": null, "device": "gmail", "counted": false, "not_counted_because": "self-view" }
],
"links": [
{ "url": "https://acme.com/q1", "clicks": 1, "recipients_clicked": 1, "last_click_at": "2026-11-28T11:20:02.000Z" }
]
}not_counted_because is one of self-cookie, self-view, prefetch, duplicate or bot — see Self-opens & accuracy.
Activity feed
curl "https://app.mconfirm.com/api/v1/events?since=2026-11-28T00:00:00Z" \
-H "Authorization: Bearer $MCONFIRM_API_KEY"{
"events": [
{ "id": "ntf_…", "type": "open", "title": "Priya Shah opened your email",
"body": "“Q1 proposal” — opened 3 times", "email_id": "eml_7dKq…", "created_at": "2026-11-28T14:02:40.000Z" }
]
}Types: open, click, reopen, hot, unopened.
Errors
{ "error": { "code": "gmail_not_connected", "message": "Gmail is not connected" } }| HTTP | code | Meaning |
|---|---|---|
| 400 | invalid_request | A field is missing or invalid; the message says which. |
| 401 | unauthorized | Missing, wrong or revoked API key. |
| 404 | not_found | No such email in your account. |
| 409 | gmail_not_connected | Connect or reconnect Gmail in the dashboard. |
| 429 | rate_limited | Too many requests — wait and retry. |
| 502 | delivery_failed | Gmail accepted none of the recipients. |