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.
Authenticated Endpoints
Requires Authorization: Bearer mg_key_...
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:
- Fetch new messages via
GET /api/inbox/messages/?status=NEW - Summarize each message (sender, subject, lane, body)
- Ask you how to respond or handle each one
- Mark handled messages as
PROCESSEDso 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