API Reference
MooMermaid provides a high-performance REST API for validating Mermaid syntax and managing cloud-stored diagram flows. All endpoints use JSON for requests and responses.
MooMermaid CLI (mmk)
The mmk terminal tool has been modernized to provide a professional developer experience with
Rich-based UI components, syntax highlighting, and advanced command chaining.
- Rich Terminal Output: All listings and results are rendered in beautiful, color-coded tables.
- Live Status Spinners: Real-time visual feedback for all network and validation operations.
- Syntax Highlighting: Mermaid code is automatically highlighted in the terminal for easy reading.
- Interactive Prompts: Missing required arguments (like titles) will trigger an interactive input prompt.
MooMermaid supports advanced piping for automated workflows. You can extract data from one command and pass it directly to another.
The validate command is "JSON-aware" and will automatically extract code from MooMermaid API responses when piped.
| Flag | Description |
|---|---|
--json |
Suppresses UI elements and returns raw JSON (perfect for scripts/piping). |
--debug |
Shows detailed error tracebacks and network logs. |
--validate |
Used with save or update to trigger server-side syntax checks. |
Pro Tip: Use --private to hide a diagram from public view while keeping the cloud sync active.
Authentication
Authenticate your requests by including your API key in the Authorization header as a Bearer
token.
Authorization: Bearer YOUR_API_KEY
Quota & Limits
Every authenticated request (including failed ones) counts towards your API quota. You can track your usage in real-time via the response body.
Syntax Validation
Checks if the provided code is a valid Mermaid diagram. Supports all modern Mermaid types including Architecture and GitGraph.
{
"code": "graph TD\n A --> B"
}
{
"ok": true,
"valid": true,
"quota_remaining": 4994
}
List Diagrams
Returns a list of all active (non-deleted) diagrams owned by the user.
{
"ok": true,
"codes": [
{
"id": "abc123",
"title": "Auth Flow",
"views": 5,
"is_live": 1,
"url": "https://moomermaid.com/view/abc123"
}
]
}
Create Diagram
| Field | Type | Description |
|---|---|---|
| title | string Req | Diagram name (max 255) |
| code | string Req | Mermaid source code |
| is_live | int | 1 = Public, 0 = Private |
{
"title": "New Design",
"code": "graph LR\n Start --> End",
"is_live": 0
}
Check Quota
Returns detailed information about your API usage, including total hits, quota limit, and remaining requests.
{
"ok": true,
"hits": 258,
"quota": 5000,
"remaining": 4742
}
Update Diagram
Partial update. Only include the fields you want to change (title, code, or is_live).
{
"is_live": 1
}
Soft Delete
Moves the diagram to the Trash. The item remains recoverable for 30 days via the dashboard.
{
"ok": true,
"message": "Moved to trash."
}
OpenAPI Schema
Use this schema to connect MooMermaid to ChatGPT Custom GPTs or other AI agents.
Download Schema: https://moomermaid.com/api-settings