Skip to main content

Getting started

OpenClaw is an open-source AI personal assistant that runs on your own devices and integrates with messaging platforms like WhatsApp, Telegram, Discord, and Slack. By adding Migma to OpenClaw, your agent gains the ability to design professional emails with AI and send them instantly — no coding, no ESP dashboard. There are two ways to integrate Migma with OpenClaw: using the official Migma skill or creating a custom skill. The easiest way to add email capabilities to OpenClaw is by installing the official Migma skill from ClawHub. This skill is maintained by the Migma team and provides comprehensive email functionality.

Installation

Install the skill using the OpenClaw CLI:
openclaw skills install MigmaAI/migma-skills/migma
Or install via ClawHub:
npx clawhub@latest install migma

Configuration

Add your Migma API key to the skill configuration in ~/.openclaw/openclaw.json:
{
  "skills": {
    "entries": {
      "migma": {
        "enabled": true,
        "env": {
          "MIGMA_API_KEY": "sk_live_your_key_here",
          "MIGMA_PROJECT_ID": "your_project_id"
        }
      }
    }
  }
}
Get your API key from Settings → API Keys.

Features

The official skill includes:
  • AI email generation: Describe what you want and get a professional, on-brand email in seconds
  • Instant sending: Send through a managed domain — no DNS setup. Connect external providers like SES or Resend.
  • Validation: Check deliverability, spam score, link integrity, and client compatibility before sending
  • Audience management: Add contacts, create tags and segments, bulk import from CSV
  • Batch campaigns: Send to an entire tag or segment in one command
  • Platform export: Export to Klaviyo, Mailchimp, HubSpot, PDF, or MJML. See export options.
  • Brand import: Import logos, colors, fonts, and voice from any website automatically
  • Personalization: Contacts and subscriber data included automatically

One-time setup

Before your agent can send emails, set up an instant sending domain:
1

Create a managed domain

Tell your agent: “Set up a sending domain for mycompany”Or do it manually in Migma: Settings → Sending Domains → Quick tab → type a prefix like mycompany.Your sending address will be: hello@mycompany.migma.email — verified instantly, no DNS needed.
2

Set a default project

Tell your agent: “List my projects and set one as default”A project holds your brand identity (logo, colors, fonts, voice). If you don’t have one yet, ask: “Import our brand from https://yourbrand.com
Want to send from your own domain (e.g. hello@yourdomain.com)? See Add a Custom Domain for DNS setup.

Verify installation

Check that the skill is loaded:
openclaw skills list --eligible
You should see migma in the list of available skills.

Option 2: Custom Skill

For more control over the integration, you can create a custom Migma skill. Skills are directories containing a SKILL.md file with instructions for OpenClaw.

Create the skill directory

Create a new skill in your OpenClaw workspace:
mkdir -p ~/.openclaw/skills/migma

Create the skill file

Create ~/.openclaw/skills/migma/SKILL.md with the following content:
---
name: migma
description: Generate, send, validate, and export AI-powered emails from the terminal; manage contacts, segments, tags, domains, and webhooks with Migma.
requires:
  env:
    - MIGMA_API_KEY
---

# Migma

You can generate, send, and manage emails using the Migma API. Use the `exec` tool to run curl commands against the API.

## API Base URL

```
https://api.migma.ai/v1
```

## Authentication

Include your API key in the Authorization header:

```
Authorization: Bearer $MIGMA_API_KEY
```

## Common Operations

### Create a managed sending domain (instant, no DNS)

```bash
curl -s -X POST -H "Authorization: Bearer $MIGMA_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"prefix": "mycompany"}' \
  https://api.migma.ai/v1/domains/managed
```

This gives you `hello@mycompany.migma.email` — ready to send immediately.

### Generate an email with AI

```bash
curl -s -X POST -H "Authorization: Bearer $MIGMA_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"prompt": "Welcome email for new subscribers", "projectId": "YOUR_PROJECT_ID"}' \
  https://api.migma.ai/v1/projects/emails/generate
```

### Send an email

```bash
curl -s -X POST -H "Authorization: Bearer $MIGMA_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "recipientType": "email",
    "recipientEmail": "recipient@example.com",
    "from": "hello@mycompany.migma.email",
    "fromName": "My Company",
    "subject": "Hello from OpenClaw",
    "template": "<h1>Hi there!</h1><p>Sent by my AI assistant.</p>",
    "projectId": "YOUR_PROJECT_ID"
  }' \
  https://api.migma.ai/v1/sending
```

### List projects

```bash
curl -s -H "Authorization: Bearer $MIGMA_API_KEY" \
  https://api.migma.ai/v1/projects
```

### Add a contact

```bash
curl -s -X POST -H "Authorization: Bearer $MIGMA_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"email": "john@example.com", "firstName": "John", "lastName": "Doe"}' \
  https://api.migma.ai/v1/subscribers
```

Configure the skill

Add your Migma API key to the skill configuration in ~/.openclaw/openclaw.json:
{
  "skills": {
    "entries": {
      "migma": {
        "enabled": true,
        "env": {
          "MIGMA_API_KEY": "sk_live_your_key_here"
        }
      }
    }
  }
}

Verify the skill

Check that the skill is loaded:
openclaw skills list --eligible
You should see migma in the list of available skills.

Example use cases

Once Migma is integrated with OpenClaw, you can ask your agent to:
  • “Create a welcome email for new subscribers”
  • “Design a Black Friday sale email with 30% off”
  • “Send that email to sarah@example.com
  • “Check if this email will land in spam”
  • “Send our newsletter to the VIP segment”
  • “Export this email to Klaviyo”
  • “Import our brand from https://ourwebsite.com
  • “Add john@example.com to our contacts”
  • “Create a product launch email, validate it, then send to our launch list”

Real-time notifications

For proactive handling, you can combine Migma webhooks with OpenClaw’s webhook support. This allows OpenClaw to notify you when emails are delivered, opened, or clicked.
  1. Set up a webhook endpoint in OpenClaw (see OpenClaw webhook documentation)
  2. Register the webhook with Migma:
curl -X POST -H "Authorization: Bearer $MIGMA_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "url": "https://your-openclaw-webhook-url",
    "events": ["email.sent", "email.delivered", "email.opened", "email.clicked"]
  }' \
  https://api.migma.ai/v1/webhooks
Now OpenClaw will be notified of email events, allowing your agent to follow up or report delivery status.

Resources

Official Migma Skill

Install from ClawHub

CLI Documentation

Full command reference

API Reference

Endpoint documentation

Node.js SDK

TypeScript SDK guide

OpenClaw Docs

OpenClaw documentation

Discord

Community support