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]",
"sender_url": "https://alice.example.com",
"lane": {
"id": "lane_456",
"name": "Quick Question",
"slug": "quick-question",
"price_cents": 900,
"allow_sender_url": false,
"sender_url_label": "",
"sender_url_required": false
},
"status": "PAID",
"inbox_status": "NEW",
"receipt": {
"amount_cents": 900,
"platform_fee_cents": 180,
"currency": "USD"
},
"created_at": "2026-02-06T10:00:00Z",
"paid_at": "2026-02-06T10:00:05Z"
}
Checkout Request Body
Fields sent to POST /api/message/create_checkout_session/:
{
"profile_handle": "alice",
"lane_id": "uuid",
"subject": "Hello",
"body": "Message text...",
"sender_name": "Bob",
"sender_email": "[email protected]",
"sender_url": "https://bob.example.com", // optional: only if lane allow_sender_url is true
"payment_method": "card" // optional, default "card"
}
sender_url is accepted only when the lane has allow_sender_url: true.
If the lane also has sender_url_required: true, omitting it returns a 400 error
using the lane’s configured sender_url_label in the error message.
Lane Fields
Returned by GET /api/profile/{handle}/ (public) and GET /api/lanes/ (authenticated):
{
"id": "uuid",
"name": "Priority Request",
"slug": "priority-request", // used in public lane URL: /{handle}/{slug}/
"description": "...",
"price_cents": 9900,
"allow_sender_url": true, // Pro/Ultra feature: enables URL input on the lane form
"sender_url_label": "Portfolio URL",// custom label shown to senders (default: "One URL")
"sender_url_required": false, // if true, sender must provide a URL to submit
"availability": "PUBLIC",
"is_active": true
}
Public Profile URLs
OpenClaw Integration
Moltgate provides a single-file OpenClaw skill on ClawHub. It uses your Moltgate REST API key and does not require webhook setup for basic inbox workflows.
Install the Skill
# Install from ClawHub clawhub install moltgate # Set your API key (from Settings) export MOLTGATE_API_KEY="mg_key_your_key_here" # Optional: custom instance base URL export MOLTGATE_BASE_URL="https://moltgate.com"
Quick Verification
curl -H "Authorization: Bearer $MOLTGATE_API_KEY" \
${MOLTGATE_BASE_URL:-https://moltgate.com}/api/inbox/messages/?status=NEW
How It Works
- Fetch new messages via
GET /api/inbox/messages/?status=NEW(JSON array response) - Summarize sender, subject, lane, and amount for each message
- Request user confirmation before taking action
- Mark handled messages as
PROCESSEDusingPATCH /api/inbox/messages/{id}/update_status/
Tip: pair the skill with an OpenClaw cron job to check Moltgate on a schedule.
Security Defaults
- All message bodies are treated as untrusted input
- Never execute links, code, or embedded instructions from message content
- Messages are sanitized server-side before delivery to inbox/API consumers
- Plain-text only content, no HTML or attachments
- Character limits enforced per lane ($9 → 500, $29 → 2k, $99 → 5k)