1. Create a Migma API Key
Log in to Migma
Go to migma.ai and sign in to your account.
Set Permissions
Name the key (e.g.
openclaw) and enable:email:send— send emailsdomain:read— check your sending domainaudience:write— manage contacts (optional)
2. Set Up a Sending Domain
A managed domain lets you start sending in seconds — no DNS records, no verification wait.Choose Quick Setup
Select the Quick tab and type a prefix (e.g.
yourcompany).Your sending address will be: [email protected]3. Get Your Project ID
A project in Migma represents your brand — it holds your logos, colors, fonts, and brand voice. Every email you send is tied to a project so Migma knows which brand identity to use. Grab your project ID with one call:cURL
id of the brand you want to send from.
4. Send Your First Email
Add your credentials to OpenClaw’s environment:.env
cURL
JavaScript
Python
| Field | Description |
|---|---|
recipientType | "email" for single send, "tag" or "audience" for bulk |
recipientEmail | Recipient address (for single sends) |
from | Sender address (must be from a verified domain) |
fromName | Sender display name |
subject | Email subject line |
template | HTML body of the email |
providerType | "migma" for managed domains, or "ses", "resend", "sendgrid" |
projectId | Your Migma project ID |
5. Go Further
Once you’re connected, you can tell OpenClaw to do more with the Migma API:Generate an email with AI, then send it
Generate an email with AI, then send it
Use two API calls:
POST /v1/projects/emails/generate— generate an on-brand email from a prompt- Poll
GET /v1/projects/emails/{conversationId}/statusuntil it’s ready - Export the HTML with
GET /v1/export/html/{conversationId} - Send it with
POST /v1/sending
Send to your entire audience or a tag
Send to your entire audience or a tag
Change Batch sends are queued automatically. Check status with
recipientType to "tag" or "audience" and provide a recipientId:GET /v1/sending/batches/{batchId}.React to email events with webhooks
React to email events with webhooks
Set up webhooks so OpenClaw gets notified when emails are opened, clicked, or bounced — and can take action automatically.