The Mako API is a RESTful API built with Hono. All endpoints are prefixed with /api.
Method Endpoint Description POST/api/auth/loginLogin with email/password POST/api/auth/registerCreate a new account GET/api/auth/meGet current user session POST/api/auth/logoutEnd session
Method Endpoint Description GET/api/workspacesList user workspaces POST/api/workspacesCreate a workspace GET/api/workspaces/:idGet workspace details
Method Endpoint Description GET/api/workspaces/:wid/connectorsList configured data sources POST/api/workspaces/:wid/connectorsAdd a new data source POST/api/workspaces/:wid/flowsTrigger a flow GET/api/workspaces/:wid/flows/:fidGet flow status
Method Endpoint Description POST/api/executeExecute a SQL/NoSQL query
The Chat API enables programmatic access to Mako’s AI agent. It supports both session-based and API key authentication.
Method Endpoint Description POST/api/agent/chatSend messages and receive streaming AI response GET/api/agent/modelsList available AI models GET/api/agent/agentsList available agent modes
Use an API key in the Authorization header:
Authorization: Bearer revops_YOUR_API_KEY
API keys are created in Settings → API Keys. Each key is scoped to a workspace. Chats created via API key are attributed to the key’s creator, so they appear in the creator’s chat history.
Field Type Required Description messagesUIMessage[]Yes Array of messages. Each has id, role, and parts. chatIdstringYes 24-char MongoDB ObjectId. New ID for new chats; reuse for follow-ups. workspaceIdstringYes 24-char MongoDB ObjectId. Must match the API key’s workspace. modelIdstringNo Model ID (e.g. gpt-5.2, gemini-2.5-flash). Default: gpt-5.2. openConsolesobject[]No Console context for SQL tools. consoleIdstringNo Active console ID. agentIdstringNo Agent mode: console (default) or flow.
"parts" : [{ "type" : " text " , "text" : " Your message here " }]
curl -X POST https://your-mako.com/api/agent/chat \
-H " Authorization: Bearer revops_YOUR_API_KEY " \
-H " Content-Type: application/json " \
"parts": [{ "type": "text", "text": "Show top 5 customers" }]
"chatId": "507f1f77bcf86cd799439011",
"workspaceId": "YOUR_WORKSPACE_ID",
"modelId": "gemini-2.5-flash"
The response is a streaming SSE (Server-Sent Events) stream. Key event types:
Event Type Description startStream started. Contains messageId. text-deltaIncremental text chunk from the assistant. tool-input-availableTool call with full input (e.g. SQL query). tool-resultTool execution result (e.g. query results). finishStream finished. Contains finishReason.
Status Description 400 Missing or invalid messages, chatId, or workspaceId. 401 Unauthorized (missing or invalid API key). 403 API key not authorized for the workspace. 404 Agent not found (invalid agentId).
For full details, see CHAT_API_REFERENCE.md .
Method Endpoint Description GET/api/workspaces/:wid/chatsList chat sessions POST/api/workspaces/:wid/chatsCreate a new chat GET/api/workspaces/:wid/chats/:idGet chat details PUT/api/workspaces/:wid/chats/:idUpdate chat title DELETE/api/workspaces/:wid/chats/:idDelete a chat
For executing saved consoles programmatically, see CONSOLE_API_DOCUMENTATION.md .
Method Endpoint Description POST/api/inngestInngest webhook handler