Developer Documentation

API reference and OpenClaw integration.

Authentication

Authenticated endpoints require an API key. Find yours in Settings. Pass it as a Bearer token:

curl -H "Authorization: Bearer mg_key_your_key_here" \
     https://moltgate.com/api/inbox/messages/

Keep your key secret. You can regenerate it anytime in Settings — the old key stops working immediately.


REST API

Public Endpoints

No authentication required.

MethodEndpointDescription
GET/api/profile/{handle}/Public profile + lanes
POST/api/message/create_checkout_session/Create Stripe checkout

Authenticated Endpoints

Requires Authorization: Bearer mg_key_...

MethodEndpointDescription
GET/api/inbox/messages/List inbox messages
GET/api/inbox/messages/?status=NEW&lane_id={lane_id}Filter by lane and status (NEW, PROCESSED, ARCHIVED)
GET/api/inbox/messages/?is_read=falseUnread only (NEW); is_read=true returns read messages
GET/api/inbox/messages/{id}/Message detail
PATCH/api/inbox/messages/{id}/update_status/Update status via inbox_status or is_read
PATCH/api/inbox/messages/{id}/mark_read/Shortcut to mark as read
PATCH/api/inbox/messages/{id}/mark_unread/Shortcut to mark as unread
GET/api/lanes/List your lanes
POST/api/lanes/Create lane
PATCH/api/lanes/{id}/Update lane

Polling for New Messages

The simplest integration: poll for new messages and mark them as processed.

# 1. Fetch new messages
curl -H "Authorization: Bearer mg_key_..." \
     https://moltgate.com/api/inbox/messages/?status=NEW

# Optional: filter for one lane
curl -H "Authorization: Bearer mg_key_..." \
     https://moltgate.com/api/inbox/messages/?status=NEW&lane_id={lane_id}

# 2. Process each message in your agent / workflow

# 3. Mark as read
curl -X PATCH \
     -H "Authorization: Bearer mg_key_..." \
     https://moltgate.com/api/inbox/messages/{id}/mark_read/

Read/unread mapping: NEW means unread. Read messages are any non-NEW status (typically PROCESSED or ARCHIVED).

Message Payload

{
  "id": "msg_123",
  "subject": "Partnership inquiry",
  "sanitized_body": "Hello, I'd like to discuss...",
  "sender_name": "Alice",
  "sender_email": "[email protected]",
  "lane": {
    "id": "lane_456",
    "name": "Quick Question",
    "price_cents": 1000
  },
  "status": "PAID",
  "inbox_status": "NEW",
  "receipt": {
    "amount_cents": 1000,
    "platform_fee_cents": 200,
    "currency": "USD"
  },
  "created_at": "2026-02-06T10:00:00Z",
  "paid_at": "2026-02-06T10:00:05Z"
}

🦞 OpenClaw Integration

Moltgate provides an OpenClaw skill that teaches your agent how to fetch and process paid messages via the API. Install it from ClawHub or copy the skill folder into your workspace.

Install the Skill

# Install from ClawHub
clawhub install moltgate

# Set your API key (from Settings)
export MOLTGATE_API_KEY="mg_key_your_key_here"

# Or configure in ~/.openclaw/openclaw.json
{
  "skills": {
    "entries": {
      "moltgate": {
        "enabled": true,
        "apiKey": "mg_key_your_key_here"
      }
    }
  }
}

How It Works

Once the skill is installed, your OpenClaw agent knows how to use the Moltgate REST API. Ask it to check for messages and it will:

  1. Fetch new messages via GET /api/inbox/messages/?status=NEW
  2. Summarize each message (sender, subject, lane, body)
  3. Ask you how to respond or handle each one
  4. Mark handled messages as PROCESSED so they don't reappear

Tip: pair the skill with an OpenClaw cron job to have your agent check Moltgate automatically on a schedule.

Safety Defaults

  • All payloads are treated as untrusted input
  • Messages are sanitized server-side: HTML stripped, prompt-injection patterns removed, dangerous Unicode filtered
  • Only normal characters allowed (letters, digits, common punctuation)
  • Character limits enforced per lane ($10 → 500, $30 → 2k, $100 → 5k)
  • Plain-text only — no HTML, no attachments