
Use the SDK, CLI, OpenClaw, Skills, or MCP to integrate Migma into your workflow
Installation
migma login or MIGMA_API_KEY (CI). Hosted MCP clients should connect https://migma.ai/mcp instead of constructing the SDK by hand.
Quick Start
OpenClaw
Use Migma from WhatsApp, Telegram, and Discord with OpenClaw.
Configuration
Error Handling
Every method returns{ data, error } — it never throws:
validation_error, not_found, unauthorized, forbidden, rate_limit_exceeded, conflict, timeout, network_error, internal_error, unknown
Async Polling Helpers
Email generation, brand import, and preview creation are asynchronous. The SDK provides*AndWait helpers that poll automatically until the operation completes:
You can cancel any polling operation with an
AbortController:
Generated emails and series
Generate one email or a full series from the same API. Passcount when you want a specific number of emails; otherwise Migma infers the output from the prompt.
result.html and result.subject are always the primary email for backwards compatibility. Use result.emails[] when you need the stable emailId, per-email HTML, screenshots, or series order.
Edit generated emails
Fetch one generated email by ID, or prompt Migma to edit it:Email performance
See how a generated email performed across every API send of it, or pull its per-recipient send log:Resources
SDK resources cover the public v1 surface used by apps and agents (some advanced campaign/preview routes stay HTTP-only).Complete Example
Here’s a full workflow — import a brand, generate an email, export it, and send:conversationId also works. For multi-slot emails and series, send a specific email with emailId:
Resources
npm
View on npm registry
CLI
Use Migma from the command line
API Reference
Full endpoint documentation
Discord
Get help from the community