You can take your data with you at any time through the API. There is no export button in the dashboard today.
What you can export
| Data | Endpoint | Notes |
|---|---|---|
| Sent emails | GET /v1/emails |
id, from, to, subject, status, created_at. Filter with status. |
| One sent email’s history | GET /v1/emails/{id} |
Adds every event, with bounce explanations. |
| Received emails | GET /v1/emails/receiving and /{id} |
The single item includes html, text, headers and attachments. |
| Received attachments | GET /v1/emails/receiving/{id}/attachments/{attachmentId} |
Returns a download_url valid for one hour. |
| Suppressions | GET /v1/suppressions |
Address, origin, reason. |
| Audiences and contacts | GET /v1/audiences, GET /v1/audiences/{id}/contacts |
|
| Topics, templates, broadcasts | GET /v1/topics, /v1/templates, /v1/broadcasts |
|
| Domains and webhooks | GET /v1/domains, GET /v1/webhooks |
|
| Audit log | GET /v1/audit-events |
|
| Invoices | Billing page in the dashboard | Shows each invoice’s period, amount, status and how it was worked out. |
All of these need a full-access key. Sending-only keys get 403 restricted_api_key.
How paging works
Every list returns:
{ "object": "list", "has_more": true, "data": [ ... ] }
Lists are newest first. Ask for up to 100 items with limit=100, then pass the last item’s id as after to get the next, older page. Stop when has_more is false.
Example: export every email to a file (Node.js 18+)
import { writeFileSync } from 'node:fs';
const base = 'https://api.mailcandor.com/v1';
const headers = { Authorization: `Bearer ${process.env.MAILCANDOR_KEY}` };
const sleep = (ms) => new Promise((r) => setTimeout(r, ms));
async function exportAll(path) {
const rows = [];
let after = null;
while (true) {
const url = `${base}${path}${path.includes('?') ? '&' : '?'}limit=100${after ? `&after=${after}` : ''}`;
const res = await fetch(url, { headers });
if (res.status === 429) { await sleep(1000); continue; }
if (!res.ok) throw new Error(`${res.status} ${await res.text()}`);
const page = await res.json();
rows.push(...page.data);
if (!page.has_more) return rows;
after = page.data[page.data.length - 1].id;
}
}
for (const path of ['/emails', '/suppressions', '/audit-events', '/emails/receiving']) {
const rows = await exportAll(path);
writeFileSync(`mailcandor${path.replaceAll('/', '-')}.json`, JSON.stringify(rows, null, 2));
console.log(path, rows.length);
}
The script waits a second and tries again when it hits the rate limit. For each email’s full event history, call GET /v1/emails/{id} for the ids you need.
What you cannot export through the API
- The HTML and text of emails you sent. The API returns metadata and events, not bodies. The dashboard shows a sent email’s plain text under Plain text on its page.
- Webhook payloads beyond what
GET /v1/webhooks/{id}/messagesshows (id, type, status, attempts). - Invoices as files. The Billing page lists them; there is no API for invoices.
If you need something that is not listed here, write to hello@mailcandor.com.
After an account closes
Our Terms of Service say you can export your data for 30 days after an account closes. After that it is deleted, except billing records, which are kept for six years. Export before you ask us to close the account if you can. See Delete your account.
If it does not work
- 401 invalid_api_key. The key was revoked. Create a new full-access key under API keys.
- 403 restricted_api_key. You used a sending-only key.
- 429 rate_limit_exceeded. Slow down to your plan’s limit. See 429 rate limited.
- 422 on after. The
aftervalue must be theidof an item from the same list.
Endpoints and fields are in the API reference.