Skip to main content

Welcome to Migma.ai

Migma lets you generate, edit, validate, and send on-brand emails through a REST API, Node.js SDK, CLI, or MCP server. Import your brand from a URL, generate emails with AI, and send to individuals, tags, or segments — or export to Klaviyo, Mailchimp, and HubSpot.

Quickstart

Get started with your first API call in under 5 minutes

Node.js SDK

Official TypeScript SDK — install, configure, and start building

CLI

Generate, send, validate, and export AI-powered emails from the terminal

Events & Webhooks

Receive event notifications for API automations and contact changes

MCP

Connect Cursor, Codex, Claude, and other AI agents to Migma

Skills

Add Migma to AI coding assistants

API Reference

Explore all available endpoints and responses

What can you build?

Generate personalized email campaigns at scale. Import your brand, define your audience, and let AI create perfectly on-brand emails automatically.
Build integrations with Shopify, WooCommerce, or any e-commerce platform. Generate product announcements, promotional emails, and cart abandonment campaigns. Export to platforms like Mailchimp and Klaviyo with one click.
Connect Migma to your CRM or marketing automation platform. Trigger email generation based on customer events (purchases, cart abandons, page visits). Sync with Mailchimp, Klaviyo, HubSpot, and more.
Build prompt-to-email workflows for transactional emails, onboarding series, newsletters, and agentic tools. Generate emails, retrieve HTML and screenshots by emailId, prompt-edit them, then send through Migma.

Key Features

AI-Powered Generation

Generate on-brand emails in 30 seconds with Migma Memory that learns your style

One-Click Brand Import

Auto-fetch logo, colors, fonts, and brand voice from any website URL

Events & Webhooks

Get notified for email generation, test sends, project imports, and subscriber events

Cross-Client Compatible

Export clean, production-ready email code that works perfectly across 30+ email clients

Audience Management

Manage subscribers, track events, create segments, and personalize campaigns

Export Integrations

One-click export to Mailchimp, Klaviyo, HubSpot, and custom webhooks

Marketing Automation

Node.js SDK
import Migma from 'migma';
const migma = new Migma(process.env.MIGMA_API_KEY);

// Generate and wait for a promotional email
const { data } = await migma.emails.generateAndWait({
  projectId: 'your_project_id',
  prompt: 'Create a summer sale announcement with 30% off, highlighting our new collection',
  languages: ['en']
});

const selectedEmail = data.result.emails[0];
console.log(selectedEmail.emailId);
console.log(selectedEmail.html);
console.log(selectedEmail.screenshotUrl);
JavaScript
// Generate a promotional email with async generation
const response = await fetch('https://api.migma.ai/v1/projects/emails/generate', {
  method: 'POST',
  headers: {
    'Authorization': 'Bearer YOUR_API_KEY',
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({
    projectId: "your_project_id",
    prompt: "Create a summer sale announcement with 30% off, highlighting our new collection",
    languages: ["en"]
  })
});

// Check status at /v1/projects/emails/{conversationId}/status,
// then use result.emails[0].emailId to fetch, edit, or send.

E-commerce Integration with Mailchimp Export

Node.js SDK
// Export a generated email to Mailchimp
const { data } = await migma.export.mailchimp('conversation_id');

console.log(data.files[0].url);
JavaScript
// Generate and export to Mailchimp
const response = await fetch('https://api.migma.ai/v1/export/mailchimp/conv_123', {
  headers: {
    'Authorization': 'Bearer YOUR_API_KEY'
  }
});

Need Help?

Join Our Community

Connect with other developers and get support

Contact Support

Get in touch with our support team