MiN8T All Insights

Export Emails via API

M
MiN8T Team
Email Engineering

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:

  1. Fetches the template and serializes it to email-safe HTML
  2. If include_amp is true and the template has AMP blocks, generates AMP HTML
  3. Runs AMP validation (DOCTYPE, boilerplate, size limits, forbidden content, component scripts)
  4. Generates plain text version
  5. 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:

  1. Generates the HTML (and AMP HTML if requested)
  2. Retrieves the ESP connection credentials for your account
  3. Uploads the template to the ESP via their API
  4. Returns the ESP's template ID and upload status
i

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:

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

Last updated: April 2026. All details verified against MiN8T's actual codebase implementation.