> ## Documentation Index
> Fetch the complete documentation index at: https://docs.migma.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# OpenClaw

> Generate, send, validate, and export emails from WhatsApp, Telegram, or Discord.

## Getting started

[OpenClaw](https://openclaw.ai/) 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.

## Option 1: Official Migma Skill (Recommended)

The easiest way to add email capabilities to OpenClaw is by installing the official Migma skill from [ClawHub](https://clawhub.com/migma). This skill is maintained by the Migma team and provides comprehensive email functionality.

### Installation

Install the skill using the OpenClaw CLI:

```bash theme={null}
openclaw skills install MigmaAI/migma-skills/skills/migma
```

Or install via ClawHub:

```bash theme={null}
npx clawhub@latest install migma
```

### Configuration

Add your Migma API key to the skill configuration in `~/.openclaw/openclaw.json`:

```json theme={null}
{
  "skills": {
    "entries": {
      "migma": {
        "enabled": true,
        "env": {
          "MIGMA_API_KEY": "your_migma_api_key",
          "MIGMA_PROJECT_ID": "your_project_id"
        }
      }
    }
  }
}
```

Get your API key from [Settings → API Integration → API Keys](https://migma.ai/settings?tab=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](/sending-domains/overview) — no DNS setup. Connect [external providers](/integrations/email-service-providers) like SES or Resend.
* **[Validation](/email-editor/email-preflight):** Check deliverability, spam score, link integrity, and client compatibility before sending
* **[Audience management](/audience/overview):** Add contacts, create tags and segments, [bulk import from CSV](/audience/csv-upload)
* **Batch campaigns:** Send to an entire tag or segment in one command
* **Platform export:** Export to [Klaviyo](/integrations/klaviyo), [Mailchimp](/integrations/mailchimp), HubSpot, PDF, or MJML. See [export options](/email-editor/export-options).
* **[Brand import](/get-started/configure-brand):** 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:

<Steps>
  <Step title="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.
  </Step>

  <Step title="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](https://yourbrand.com)"*
  </Step>
</Steps>

<Tip>
  Want to send from your own domain (e.g. `hello@yourdomain.com`)? See [Add a Custom Domain](/sending-domains/add-domain) for DNS setup.
</Tip>

### Verify installation

Check that the skill is loaded:

```bash theme={null}
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:

```bash theme={null}
mkdir -p ~/.openclaw/skills/migma
```

### Create the skill file

Create `~/.openclaw/skills/migma/SKILL.md` with the following content:

````markdown theme={null}
---
name: migma
description: Generate, send, validate, and export emails from the terminal; manage contacts, segments, 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
```

Save the returned `conversationId`, then poll until generation completes:

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

Completed responses include `result.emails[]`. Use one email's `emailId` to fetch, edit, test-send, or send it:

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

### Edit an email with a prompt

```bash
curl -s -X POST -H "Authorization: Bearer $MIGMA_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"prompt": "Make this welcome email shorter and more transactional"}' \
  https://api.migma.ai/v1/emails/EMAIL_ID/edit
```

The response returns updated `html`, `subject`, and `screenshotUrl`.

### 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",
    "emailId": "EMAIL_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`:

```json theme={null}
{
  "skills": {
    "entries": {
      "migma": {
        "enabled": true,
        "env": {
          "MIGMA_API_KEY": "your_migma_api_key"
        }
      }
    }
  }
}
```

### Verify the skill

Check that the skill is loaded:

```bash theme={null}
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"*
* *"Create a three-email onboarding series and show me each email ID"*
* *"Update the welcome email to sound more transactional"*
* *"Design a Black Friday sale email with 30% off"*
* *"Send that email to [sarah@example.com](mailto: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](https://ourwebsite.com)"*
* *"Add [john@example.com](mailto: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, combine Migma webhooks with OpenClaw's webhook support. OpenClaw can react when email generation completes or a subscriber unsubscribes.

1. Set up a webhook endpoint in OpenClaw (see [OpenClaw webhook documentation](https://docs.openclaw.ai/automation/webhook))

2. Register the webhook with Migma:

```bash theme={null}
curl -X POST -H "Authorization: Bearer $MIGMA_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "url": "https://your-openclaw-webhook-url",
    "events": ["email.generation.completed", "subscriber.unsubscribed"]
  }' \
  https://api.migma.ai/v1/webhooks
```

Now OpenClaw receives those workflow events, allowing your agent to follow up or report progress.

## Resources

<CardGroup cols={3}>
  <Card title="Official Migma Skill" icon="box-open" href="https://clawhub.com/migma">
    Install from ClawHub
  </Card>

  <Card title="CLI Documentation" icon="terminal" href="/cli">
    Full command reference
  </Card>

  <Card title="API Reference" icon="code" href="/api-reference/introduction">
    Endpoint documentation
  </Card>
</CardGroup>

<CardGroup cols={3}>
  <Card title="Node.js SDK" icon="npm" href="/sdk">
    TypeScript SDK guide
  </Card>

  <Card title="OpenClaw Docs" icon="book" href="https://docs.openclaw.ai">
    OpenClaw documentation
  </Card>

  <Card title="Discord" icon="discord" href="https://discord.gg/ZB6c2meCUA">
    Community support
  </Card>
</CardGroup>
