Quick start
Five commands to go from zero to a sent email:Authentication
migma login --claim, or fetch https://api.migma.ai/auth.md. CI and servers: set MIGMA_API_KEY.
Generate
Create on-brand emails with AI from a single command.
Create a series and save each email as a separate HTML file:
--save ./onboarding.html writes onboarding-1.html, onboarding-2.html, and so on. The status output also lists each email ID, which you use to fetch, edit, or send that email.
Check on a running generation:
Send
Send to an individual, a segment, or a tag. Emails send through Migma by default — you can also connect external providers.--email with the email ID returned by generation status or selected in the editor, especially multi-slot emails and series. --from-conversation works for single-email conversations.
Validate
Run preflight checks before you send.
All commands accept
--html <file> or --conversation <id>.
Export
Export generated emails to files or platforms. See export options for details on each format.
All export commands support
--output <file> to download the result locally.
Campaigns
Create and manage marketing campaigns with lifecycle tracking (create, schedule, send, cancel).Campaigns vs
migma send: Use migma send for quick fire-and-forget sends (transactional emails, one-off blasts). Use migma campaigns when you need a named, trackable campaign tied to a project — with scheduling, status tracking, and recipient counts.campaigns logs accepts --status (delivered, opened, clicked, bounced, spam_report), --limit (1-100), and --cursor for the next page. Stats come from the tracking worker and may be slightly stale; botOpens, botClicks, and mppOpens reflect Apple Mail Privacy Protection and bot detection when available.
Emails
List, fetch, and prompt-edit your generated emails.emails logs accepts --status (delivered, opened, clicked, bounced, complained, suppressed, sent), --limit (1-100), and --cursor for the next page. Stats come from the tracking worker and may be slightly stale; opens are directional (Apple Mail Privacy Protection and bots inflate them) while clicks and delivery are stronger signals.
Audience
Contacts
Contacts
The CSV importer auto-detects common column names (
email, firstName, first_name, First Name, etc.). Any unrecognized columns become custom fields.contacts add accepts --idempotency-key <key> so a retried create won’t duplicate the contact: the same key with the same body within 24 hours replays the original response. A deterministic key like contact-<email> works well.Segments
Segments
Infrastructure
Projects
Projects
Domains
Domains
Events & Webhooks
Events & Webhooks
Options
The root CLI accepts--json, and most project-scoped commands accept --project <id>:
Configuration
The CLI stores config in~/.migma/config.json:
Common workflows
1
Generate → Validate → Send
2
Import → Generate → Export to Klaviyo
3
CSV import → Tag → Send
npm
View on npm
Node.js SDK
Use the SDK in your apps
API Reference
Full endpoint docs