ClawAIMail API Docs

Email infrastructure for AI agents. Full REST API, MCP Server, and SDKs.

Base URL: https://api.clawaimail.com
Auth: Authorization: Bearer pb_your_api_key
OpenAPI Spec: /openapi.yaml  |  AI Info: /llms.txt

Quick Start

1. Register an account and get your API key:

curl -X POST https://api.clawaimail.com/v1/auth/register \
  -H "Content-Type: application/json" \
  -d '{"email":"you@example.com","password":"secret123"}'

2. Create an inbox:

curl -X POST https://api.clawaimail.com/v1/inboxes \
  -H "Authorization: Bearer pb_your_key" \
  -H "Content-Type: application/json" \
  -d '{"username":"mybot"}'

# Returns: {"id":1,"address":"mybot@clawaimail.com",...}

3. Send an email:

curl -X POST https://api.clawaimail.com/v1/messages/send \
  -H "Authorization: Bearer pb_your_key" \
  -H "Content-Type: application/json" \
  -d '{"inbox_id":1,"to":"user@gmail.com","subject":"Hello","text":"Hi from AI!"}'

Authentication

All API requests (except register/login/health) require a Bearer token:

Authorization: Bearer pb_your_api_key
POST /v1/auth/register public
Create account. Body: {"email":"...","password":"..."}. Returns API key.
POST /v1/auth/login public
Login. Body: {"email":"...","password":"..."}. Returns API key.
GET /v1/me auth
Get account info, plan, limits, and usage stats.

Inboxes

POST /v1/inboxes auth
Create inbox. Body: {"username":"mybot"} creates mybot@clawaimail.com
GET /v1/inboxes auth
List all your inboxes.
GET /v1/inboxes/:id auth
Get inbox details.
DELETE /v1/inboxes/:id auth
Delete inbox and all its messages.

Messages

GET /v1/inboxes/:id/messages auth
List messages. Query params: limit, offset, unread=true
GET /v1/inboxes/:id/messages/:mid auth
Read a specific message (auto-marks as read).
POST /v1/messages/send auth
Send email. Body: {"inbox_id":1,"to":"...","subject":"...","text":"..."}
GET /v1/inboxes/:id/search?q=keyword auth
Full-text search across subject and body. Query params: q (required), limit

Threads

GET /v1/inboxes/:id/threads auth
List email threads. Query params: limit, offset
GET /v1/inboxes/:id/threads/:threadId auth
Get all messages in a thread.

Labels

POST /v1/labels auth
Create label. Body: {"name":"important","color":"#ff0000"}
GET /v1/labels auth
List your labels.
POST /v1/messages/:id/labels auth
Add label to message. Body: {"label_id":1}

Webhooks

POST /v1/webhooks auth
Create webhook. Body: {"url":"https://...","events":["email_received"]}
GET /v1/webhooks auth
List webhooks.

Custom Domains

POST /v1/domains auth
Add custom domain (paid plans). Returns DNS verification instructions.
POST /v1/domains/:id/verify auth
Verify domain DNS records.

API Keys

POST /v1/api-keys auth
Create new API key. Body: {"name":"my-bot"}
GET /v1/api-keys auth
List API keys (key_prefix only, full key shown only on creation).

WebSocket (Real-time)

Connect to receive real-time email notifications:

const ws = new WebSocket('wss://api.clawaimail.com/v1/ws?key=pb_your_key');
ws.onmessage = (e) => {
  const data = JSON.parse(e.data);
  console.log('New email:', data);
};

MCP Server

Use ClawAIMail directly from Claude, Cursor, or any MCP-compatible AI tool:

// Add to ~/.claude/mcp.json or Cursor MCP settings:
{
  "mcpServers": {
    "clawaimail": {
      "command": "npx",
      "args": ["clawaimail-mcp"],
      "env": {
        "CLAWAIMAIL_API_KEY": "pb_your_api_key"
      }
    }
  }
}

Available tools: list_inboxes, create_inbox, send_email, list_messages, read_email, search_emails, delete_inbox, account_info

SDKs

Node.js

npm install clawaimail
import ClawAIMail from 'clawaimail';

const mail = new ClawAIMail({ apiKey: 'pb_xxx' });
const inbox = await mail.createInbox({ username: 'mybot' });
await mail.sendMessage({
  inboxId: inbox.id,
  to: 'user@gmail.com',
  subject: 'Hello',
  text: 'Sent by AI!'
});
const messages = await mail.listMessages(inbox.id);

Python

pip install clawaimail
from clawaimail import ClawAIMail

mail = ClawAIMail(api_key="pb_xxx")
inbox = mail.create_inbox(username="mybot")
mail.send_message(
    inbox_id=inbox["id"],
    to="user@gmail.com",
    subject="Hello",
    text="Sent by AI!"
)
messages = mail.list_messages(inbox["id"])

Pricing

PlanInboxesEmails/DayCustom DomainsPrice
Free3100-$0
Pro505,000Yes$29/mo
BusinessUnlimitedUnlimitedYes$99/mo

© 2026 ClawAIMail. Built for AI agents.