Export Emails via API
1 Export to HTML
Export any template to HTML programmatically:
POST /api/v1/export/html
Content-Type: application/json
MiN8T-Api-Auth: your-api-key
{
"template_id": "clx7abc...",
"include_amp": true
}
The export pipeline:
- Fetches the template and serializes it to email-safe HTML
- If
include_ampis true and the template has AMP blocks, generates AMP HTML - Runs AMP validation (DOCTYPE, boilerplate, size limits, forbidden content, component scripts)
- Generates plain text version
- Assembles 3-part MIME (text/plain + text/x-amp-html + text/html)
2 Export to ESP
Upload the template directly to a connected ESP (Brevo, Mailchimp, SendGrid, etc.):
POST /api/v1/export/:espSlug/template
Content-Type: application/json
MiN8T-Api-Auth: your-api-key
{
"template_id": "clx7abc...",
"connection_id": "conn_xyz...",
"list_id": "list_123",
"include_amp": true
}
MiN8T:
- Generates the HTML (and AMP HTML if requested)
- Retrieves the ESP connection credentials for your account
- Uploads the template to the ESP via their API
- Returns the ESP's template ID and upload status
The ESP slug is the lowercase name of the provider (e.g., brevo, mailchimp, sendgrid). You must have an active connection configured in the Integrations dashboard.
3 Response Fields
{
"success": true,
"data": {
"html": "<!DOCTYPE html>...</html>",
"amp_html": "<!doctype html><html amp4email>...</html>",
"amp_validation": {
"valid": true,
"errors": [],
"warnings": ["CSS size: 12KB of 75KB limit"]
},
"mime": "Content-Type: multipart/alternative...",
"plain_text": "Your email in plain text..."
}
}
Key fields:
- html — the final email HTML, ready to send
- amp_html — the AMP4Email document (only present if
include_ampwas true and AMP blocks exist) - amp_validation — validation results with errors and warnings
- mime — the complete 3-part MIME message (ready for direct SMTP sending)
- plain_text — auto-generated text-only version
The mime field gives you a complete, ready-to-send email. Pass it directly to any SMTP library (Nodemailer, Python smtplib, etc.) without any additional assembly.
4 Next Steps
- Canonical JSON API — generate personalized emails with data before exporting
- How to Export AMP HTML Emails — detailed AMP export workflow
- How to Test and Export AMP Emails — test before you send
Last updated: April 2026. All details verified against MiN8T's actual codebase implementation.