{ "openapi": "3.1.0", "info": { "title": "Nexu Controller API", "version": "1.0.0" }, "components": { "schemas": {}, "parameters": {} }, "paths": { "/api/v1/bots": { "get": { "tags": [ "Bots" ], "responses": { "200": { "description": "Bot list", "content": { "application/json": { "schema": { "type": "object", "properties": { "bots": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string" }, "name": { "type": "string" }, "slug": { "type": "string" }, "poolId": { "type": "string", "nullable": true }, "status": { "type": "string", "enum": [ "active", "paused", "deleted" ] }, "modelId": { "type": "string" }, "systemPrompt": { "type": "string", "nullable": true }, "createdAt": { "type": "string" }, "updatedAt": { "type": "string" } }, "required": [ "id", "name", "slug", "poolId", "status", "modelId", "systemPrompt", "createdAt", "updatedAt" ] } } }, "required": [ "bots" ] } } } } } }, "post": { "tags": [ "Bots" ], "requestBody": { "content": { "application/json": { "schema": { "type": "object", "properties": { "name": { "type": "string", "minLength": 1, "maxLength": 255 }, "slug": { "type": "string", "minLength": 1, "maxLength": 100, "pattern": "^[a-z0-9-]+$" }, "systemPrompt": { "type": "string" }, "modelId": { "type": "string", "default": "gpt-4o" }, "poolId": { "type": "string" } }, "required": [ "name", "slug" ] } } } }, "responses": { "200": { "description": "Created", "content": { "application/json": { "schema": { "type": "object", "properties": { "id": { "type": "string" }, "name": { "type": "string" }, "slug": { "type": "string" }, "poolId": { "type": "string", "nullable": true }, "status": { "type": "string", "enum": [ "active", "paused", "deleted" ] }, "modelId": { "type": "string" }, "systemPrompt": { "type": "string", "nullable": true }, "createdAt": { "type": "string" }, "updatedAt": { "type": "string" } }, "required": [ "id", "name", "slug", "poolId", "status", "modelId", "systemPrompt", "createdAt", "updatedAt" ] } } } } } } }, "/api/v1/bots/{botId}": { "get": { "tags": [ "Bots" ], "parameters": [ { "schema": { "type": "string" }, "required": true, "name": "botId", "in": "path" } ], "responses": { "200": { "description": "Bot", "content": { "application/json": { "schema": { "type": "object", "properties": { "id": { "type": "string" }, "name": { "type": "string" }, "slug": { "type": "string" }, "poolId": { "type": "string", "nullable": true }, "status": { "type": "string", "enum": [ "active", "paused", "deleted" ] }, "modelId": { "type": "string" }, "systemPrompt": { "type": "string", "nullable": true }, "createdAt": { "type": "string" }, "updatedAt": { "type": "string" } }, "required": [ "id", "name", "slug", "poolId", "status", "modelId", "systemPrompt", "createdAt", "updatedAt" ] } } } }, "404": { "description": "Not found", "content": { "application/json": { "schema": { "type": "object", "properties": { "message": { "type": "string" } }, "required": [ "message" ] } } } } } }, "patch": { "tags": [ "Bots" ], "parameters": [ { "schema": { "type": "string" }, "required": true, "name": "botId", "in": "path" } ], "requestBody": { "content": { "application/json": { "schema": { "type": "object", "properties": { "name": { "type": "string", "minLength": 1, "maxLength": 255 }, "systemPrompt": { "type": "string" }, "modelId": { "type": "string" } } } } } }, "responses": { "200": { "description": "Updated", "content": { "application/json": { "schema": { "type": "object", "properties": { "id": { "type": "string" }, "name": { "type": "string" }, "slug": { "type": "string" }, "poolId": { "type": "string", "nullable": true }, "status": { "type": "string", "enum": [ "active", "paused", "deleted" ] }, "modelId": { "type": "string" }, "systemPrompt": { "type": "string", "nullable": true }, "createdAt": { "type": "string" }, "updatedAt": { "type": "string" } }, "required": [ "id", "name", "slug", "poolId", "status", "modelId", "systemPrompt", "createdAt", "updatedAt" ] } } } }, "404": { "description": "Not found", "content": { "application/json": { "schema": { "type": "object", "properties": { "message": { "type": "string" } }, "required": [ "message" ] } } } } } }, "delete": { "tags": [ "Bots" ], "parameters": [ { "schema": { "type": "string" }, "required": true, "name": "botId", "in": "path" } ], "responses": { "200": { "description": "Deleted", "content": { "application/json": { "schema": { "type": "object", "properties": { "success": { "type": "boolean" } }, "required": [ "success" ] } } } } } } }, "/api/v1/bots/{botId}/pause": { "post": { "tags": [ "Bots" ], "parameters": [ { "schema": { "type": "string" }, "required": true, "name": "botId", "in": "path" } ], "responses": { "200": { "description": "Paused", "content": { "application/json": { "schema": { "type": "object", "properties": { "id": { "type": "string" }, "name": { "type": "string" }, "slug": { "type": "string" }, "poolId": { "type": "string", "nullable": true }, "status": { "type": "string", "enum": [ "active", "paused", "deleted" ] }, "modelId": { "type": "string" }, "systemPrompt": { "type": "string", "nullable": true }, "createdAt": { "type": "string" }, "updatedAt": { "type": "string" } }, "required": [ "id", "name", "slug", "poolId", "status", "modelId", "systemPrompt", "createdAt", "updatedAt" ] } } } }, "404": { "description": "Not found", "content": { "application/json": { "schema": { "type": "object", "properties": { "message": { "type": "string" } }, "required": [ "message" ] } } } } } } }, "/api/v1/bots/{botId}/resume": { "post": { "tags": [ "Bots" ], "parameters": [ { "schema": { "type": "string" }, "required": true, "name": "botId", "in": "path" } ], "responses": { "200": { "description": "Resumed", "content": { "application/json": { "schema": { "type": "object", "properties": { "id": { "type": "string" }, "name": { "type": "string" }, "slug": { "type": "string" }, "poolId": { "type": "string", "nullable": true }, "status": { "type": "string", "enum": [ "active", "paused", "deleted" ] }, "modelId": { "type": "string" }, "systemPrompt": { "type": "string", "nullable": true }, "createdAt": { "type": "string" }, "updatedAt": { "type": "string" } }, "required": [ "id", "name", "slug", "poolId", "status", "modelId", "systemPrompt", "createdAt", "updatedAt" ] } } } }, "404": { "description": "Not found", "content": { "application/json": { "schema": { "type": "object", "properties": { "message": { "type": "string" } }, "required": [ "message" ] } } } } } } }, "/api/auth/check-email": { "post": { "tags": [ "Auth" ], "requestBody": { "content": { "application/json": { "schema": { "type": "object", "properties": { "email": { "type": "string" } } } } } }, "responses": { "200": { "description": "Email check", "content": { "application/json": { "schema": { "type": "object", "properties": { "exists": { "type": "boolean" }, "verified": { "type": "boolean" } }, "required": [ "exists", "verified" ] } } } } } } }, "/api/v1/auth/desktop-authorize": { "post": { "tags": [ "Auth" ], "requestBody": { "content": { "application/json": { "schema": { "type": "object", "properties": { "deviceId": { "type": "string" } }, "required": [ "deviceId" ] } } } }, "responses": { "200": { "description": "Desktop authorize", "content": { "application/json": { "schema": { "type": "object", "properties": { "ok": { "type": "boolean" }, "error": { "type": "string" } }, "required": [ "ok" ] } } } } } } }, "/api/v1/invite/validate": { "post": { "tags": [ "Invite" ], "requestBody": { "content": { "application/json": { "schema": { "type": "object", "properties": { "code": { "type": "string", "minLength": 1 } }, "required": [ "code" ] } } } }, "responses": { "200": { "description": "Invite validate", "content": { "application/json": { "schema": { "type": "object", "properties": { "valid": { "type": "boolean" }, "message": { "type": "string" } }, "required": [ "valid" ] } } } } } } }, "/api/v1/feishu/bind/oauth-url": { "get": { "tags": [ "Feishu" ], "parameters": [ { "schema": { "type": "string", "minLength": 1 }, "required": true, "name": "workspaceKey", "in": "query" }, { "schema": { "type": "string", "minLength": 1 }, "required": true, "name": "botId", "in": "query" } ], "responses": { "200": { "description": "Feishu bind url", "content": { "application/json": { "schema": { "type": "object", "properties": { "url": { "type": "string" } }, "required": [ "url" ] } } } } } } }, "/api/shared-slack/resolve-claim-key": { "get": { "tags": [ "Shared Slack App" ], "parameters": [ { "schema": { "type": "string", "minLength": 1 }, "required": true, "name": "token", "in": "query" } ], "responses": { "200": { "description": "Resolve claim", "content": { "application/json": { "schema": { "type": "object", "properties": { "valid": { "type": "boolean" }, "expired": { "type": "boolean" }, "used": { "type": "boolean" }, "teamId": { "type": "string" }, "teamName": { "type": "string", "nullable": true }, "imUserId": { "type": "string" }, "isExistingWorkspace": { "type": "boolean" }, "memberCount": { "type": "number" } }, "required": [ "valid", "expired", "used" ] } } } } } } }, "/api/v1/shared-slack/claim": { "post": { "tags": [ "Shared Slack App" ], "requestBody": { "content": { "application/json": { "schema": { "type": "object", "properties": { "token": { "type": "string", "minLength": 1 } }, "required": [ "token" ] } } } }, "responses": { "200": { "description": "Shared slack claim", "content": { "application/json": { "schema": { "type": "object", "properties": { "ok": { "type": "boolean" }, "orgAuthorized": { "type": "boolean" } }, "required": [ "ok", "orgAuthorized" ] } } } } } } }, "/api/internal/desktop/cloud-status": { "get": { "tags": [ "Desktop" ], "responses": { "200": { "description": "Cloud status", "content": { "application/json": { "schema": { "type": "object", "properties": { "connected": { "type": "boolean" }, "polling": { "type": "boolean" }, "userName": { "type": "string", "nullable": true }, "userEmail": { "type": "string", "nullable": true }, "connectedAt": { "type": "string", "nullable": true }, "models": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string" }, "name": { "type": "string" }, "provider": { "type": "string" } }, "required": [ "id", "name" ] } } }, "required": [ "connected" ] } } } } } } }, "/api/internal/desktop/cloud-connect": { "post": { "tags": [ "Desktop" ], "responses": { "200": { "description": "Cloud connect", "content": { "application/json": { "schema": { "type": "object", "properties": { "browserUrl": { "type": "string" }, "error": { "type": "string" } } } } } } } } }, "/api/internal/desktop/cloud-disconnect": { "post": { "tags": [ "Desktop" ], "responses": { "200": { "description": "Cloud disconnect", "content": { "application/json": { "schema": { "type": "object", "properties": { "ok": { "type": "boolean" } }, "required": [ "ok" ] } } } } } } }, "/api/internal/desktop/cloud-models": { "put": { "tags": [ "Desktop" ], "requestBody": { "content": { "application/json": { "schema": { "type": "object", "properties": { "enabledModelIds": { "type": "array", "items": { "type": "string" } } }, "required": [ "enabledModelIds" ] } } } }, "responses": { "200": { "description": "Cloud models", "content": { "application/json": { "schema": { "type": "object", "properties": { "ok": { "type": "boolean" }, "models": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string" }, "name": { "type": "string" }, "provider": { "type": "string" } }, "required": [ "id", "name" ] } } }, "required": [ "ok" ] } } } } } } }, "/api/internal/desktop/default-model": { "get": { "tags": [ "Desktop" ], "responses": { "200": { "description": "Default model", "content": { "application/json": { "schema": { "type": "object", "properties": { "modelId": { "type": "string", "nullable": true } }, "required": [ "modelId" ] } } } } } }, "put": { "tags": [ "Desktop" ], "requestBody": { "content": { "application/json": { "schema": { "type": "object", "properties": { "modelId": { "type": "string" } }, "required": [ "modelId" ] } } } }, "responses": { "200": { "description": "Set default model", "content": { "application/json": { "schema": { "type": "object", "properties": { "ok": { "type": "boolean" }, "modelId": { "type": "string" } }, "required": [ "ok", "modelId" ] } } } } } } }, "/api/v1/channels": { "get": { "tags": [ "Channels" ], "responses": { "200": { "description": "Channel list", "content": { "application/json": { "schema": { "type": "object", "properties": { "channels": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string" }, "botId": { "type": "string" }, "channelType": { "type": "string", "enum": [ "slack", "discord", "feishu" ] }, "accountId": { "type": "string" }, "status": { "type": "string", "enum": [ "pending", "connected", "disconnected", "error" ] }, "teamName": { "type": "string", "nullable": true }, "appId": { "type": "string", "nullable": true }, "botUserId": { "type": "string", "nullable": true }, "createdAt": { "type": "string" }, "updatedAt": { "type": "string" } }, "required": [ "id", "botId", "channelType", "accountId", "status", "teamName", "createdAt", "updatedAt" ] } } }, "required": [ "channels" ] } } } } } } }, "/api/v1/channels/slack/redirect-uri": { "get": { "tags": [ "Channels" ], "responses": { "200": { "description": "Deprecated Slack redirect URI", "content": { "application/json": { "schema": { "type": "object", "properties": { "redirectUri": { "type": "string" } }, "required": [ "redirectUri" ] } } } } } } }, "/api/v1/channels/slack/oauth-url": { "get": { "tags": [ "Channels" ], "parameters": [ { "schema": { "type": "string" }, "required": false, "name": "returnTo", "in": "query" } ], "responses": { "200": { "description": "Deprecated Slack OAuth placeholder", "content": { "application/json": { "schema": { "type": "object", "properties": { "url": { "type": "string" }, "redirectUri": { "type": "string" } }, "required": [ "url", "redirectUri" ] } } } } } } }, "/api/v1/channels/slack/connect": { "post": { "tags": [ "Channels" ], "requestBody": { "content": { "application/json": { "schema": { "type": "object", "properties": { "botToken": { "type": "string", "minLength": 1 }, "signingSecret": { "type": "string", "minLength": 1 }, "teamId": { "type": "string" }, "teamName": { "type": "string" }, "appId": { "type": "string" } }, "required": [ "botToken", "signingSecret" ] } } } }, "responses": { "200": { "description": "Connected slack channel", "content": { "application/json": { "schema": { "type": "object", "properties": { "id": { "type": "string" }, "botId": { "type": "string" }, "channelType": { "type": "string", "enum": [ "slack", "discord", "feishu" ] }, "accountId": { "type": "string" }, "status": { "type": "string", "enum": [ "pending", "connected", "disconnected", "error" ] }, "teamName": { "type": "string", "nullable": true }, "appId": { "type": "string", "nullable": true }, "botUserId": { "type": "string", "nullable": true }, "createdAt": { "type": "string" }, "updatedAt": { "type": "string" } }, "required": [ "id", "botId", "channelType", "accountId", "status", "teamName", "createdAt", "updatedAt" ] } } } }, "409": { "description": "Invalid credentials", "content": { "application/json": { "schema": { "type": "object", "properties": { "message": { "type": "string" } }, "required": [ "message" ] } } } } } } }, "/api/v1/channels/discord/connect": { "post": { "tags": [ "Channels" ], "requestBody": { "content": { "application/json": { "schema": { "type": "object", "properties": { "botToken": { "type": "string", "minLength": 1 }, "appId": { "type": "string", "minLength": 1 }, "guildId": { "type": "string" }, "guildName": { "type": "string" } }, "required": [ "botToken", "appId" ] } } } }, "responses": { "200": { "description": "Connected discord channel", "content": { "application/json": { "schema": { "type": "object", "properties": { "id": { "type": "string" }, "botId": { "type": "string" }, "channelType": { "type": "string", "enum": [ "slack", "discord", "feishu" ] }, "accountId": { "type": "string" }, "status": { "type": "string", "enum": [ "pending", "connected", "disconnected", "error" ] }, "teamName": { "type": "string", "nullable": true }, "appId": { "type": "string", "nullable": true }, "botUserId": { "type": "string", "nullable": true }, "createdAt": { "type": "string" }, "updatedAt": { "type": "string" } }, "required": [ "id", "botId", "channelType", "accountId", "status", "teamName", "createdAt", "updatedAt" ] } } } }, "409": { "description": "Invalid credentials", "content": { "application/json": { "schema": { "type": "object", "properties": { "message": { "type": "string" } }, "required": [ "message" ] } } } } } } }, "/api/v1/channels/feishu/connect": { "post": { "tags": [ "Channels" ], "requestBody": { "content": { "application/json": { "schema": { "type": "object", "properties": { "appId": { "type": "string", "minLength": 1 }, "appSecret": { "type": "string", "minLength": 1 }, "connectionMode": { "type": "string", "enum": [ "websocket", "webhook" ] }, "verificationToken": { "type": "string" } }, "required": [ "appId", "appSecret" ] } } } }, "responses": { "200": { "description": "Connected feishu channel", "content": { "application/json": { "schema": { "type": "object", "properties": { "id": { "type": "string" }, "botId": { "type": "string" }, "channelType": { "type": "string", "enum": [ "slack", "discord", "feishu" ] }, "accountId": { "type": "string" }, "status": { "type": "string", "enum": [ "pending", "connected", "disconnected", "error" ] }, "teamName": { "type": "string", "nullable": true }, "appId": { "type": "string", "nullable": true }, "botUserId": { "type": "string", "nullable": true }, "createdAt": { "type": "string" }, "updatedAt": { "type": "string" } }, "required": [ "id", "botId", "channelType", "accountId", "status", "teamName", "createdAt", "updatedAt" ] } } } }, "409": { "description": "Invalid credentials", "content": { "application/json": { "schema": { "type": "object", "properties": { "message": { "type": "string" } }, "required": [ "message" ] } } } } } } }, "/api/v1/channels/{channelId}/status": { "get": { "tags": [ "Channels" ], "parameters": [ { "schema": { "type": "string" }, "required": true, "name": "channelId", "in": "path" } ], "responses": { "200": { "description": "Channel status", "content": { "application/json": { "schema": { "type": "object", "properties": { "id": { "type": "string" }, "botId": { "type": "string" }, "channelType": { "type": "string", "enum": [ "slack", "discord", "feishu" ] }, "accountId": { "type": "string" }, "status": { "type": "string", "enum": [ "pending", "connected", "disconnected", "error" ] }, "teamName": { "type": "string", "nullable": true }, "appId": { "type": "string", "nullable": true }, "botUserId": { "type": "string", "nullable": true }, "createdAt": { "type": "string" }, "updatedAt": { "type": "string" } }, "required": [ "id", "botId", "channelType", "accountId", "status", "teamName", "createdAt", "updatedAt" ] } } } }, "404": { "description": "Not found", "content": { "application/json": { "schema": { "type": "object", "properties": { "message": { "type": "string" } }, "required": [ "message" ] } } } } } } }, "/api/v1/bot-quota": { "get": { "tags": [ "Channels" ], "responses": { "200": { "description": "Bot quota", "content": { "application/json": { "schema": { "type": "object", "properties": { "available": { "type": "boolean" }, "resetsAt": { "type": "string" } }, "required": [ "available", "resetsAt" ] } } } } } } }, "/api/v1/channels/{channelId}": { "delete": { "tags": [ "Channels" ], "parameters": [ { "schema": { "type": "string" }, "required": true, "name": "channelId", "in": "path" } ], "responses": { "200": { "description": "Disconnected channel", "content": { "application/json": { "schema": { "type": "object", "properties": { "success": { "type": "boolean" } }, "required": [ "success" ] } } } } } } }, "/api/internal/sessions": { "post": { "tags": [ "Sessions", "Internal" ], "requestBody": { "content": { "application/json": { "schema": { "type": "object", "properties": { "botId": { "type": "string", "minLength": 1 }, "sessionKey": { "type": "string", "minLength": 1 }, "title": { "type": "string", "minLength": 1, "maxLength": 500 }, "channelType": { "type": "string" }, "channelId": { "type": "string" }, "status": { "type": "string", "enum": [ "active", "ended" ] }, "messageCount": { "type": "integer" }, "lastMessageAt": { "type": "string" }, "metadata": { "type": "object", "additionalProperties": { "nullable": true } } }, "required": [ "botId", "sessionKey", "title" ] } } } }, "responses": { "201": { "description": "Created or updated session", "content": { "application/json": { "schema": { "type": "object", "properties": { "id": { "type": "string" }, "botId": { "type": "string" }, "sessionKey": { "type": "string" }, "channelType": { "type": "string", "nullable": true }, "channelId": { "type": "string", "nullable": true }, "title": { "type": "string" }, "status": { "type": "string" }, "messageCount": { "type": "number" }, "lastMessageAt": { "type": "string", "nullable": true }, "metadata": { "type": "object", "nullable": true, "additionalProperties": { "nullable": true } }, "createdAt": { "type": "string" }, "updatedAt": { "type": "string" } }, "required": [ "id", "botId", "sessionKey", "channelType", "channelId", "title", "status", "messageCount", "lastMessageAt", "metadata", "createdAt", "updatedAt" ] } } } } } } }, "/api/internal/sessions/{id}": { "patch": { "tags": [ "Sessions", "Internal" ], "parameters": [ { "schema": { "type": "string" }, "required": true, "name": "id", "in": "path" } ], "requestBody": { "content": { "application/json": { "schema": { "type": "object", "properties": { "title": { "type": "string", "minLength": 1, "maxLength": 500 }, "status": { "type": "string", "enum": [ "active", "ended" ] }, "messageCount": { "type": "integer" }, "lastMessageAt": { "type": "string" }, "metadata": { "type": "object", "additionalProperties": { "nullable": true } } } } } } }, "responses": { "200": { "description": "Updated session", "content": { "application/json": { "schema": { "type": "object", "properties": { "id": { "type": "string" }, "botId": { "type": "string" }, "sessionKey": { "type": "string" }, "channelType": { "type": "string", "nullable": true }, "channelId": { "type": "string", "nullable": true }, "title": { "type": "string" }, "status": { "type": "string" }, "messageCount": { "type": "number" }, "lastMessageAt": { "type": "string", "nullable": true }, "metadata": { "type": "object", "nullable": true, "additionalProperties": { "nullable": true } }, "createdAt": { "type": "string" }, "updatedAt": { "type": "string" } }, "required": [ "id", "botId", "sessionKey", "channelType", "channelId", "title", "status", "messageCount", "lastMessageAt", "metadata", "createdAt", "updatedAt" ] } } } }, "404": { "description": "Not found", "content": { "application/json": { "schema": { "type": "object", "properties": { "message": { "type": "string" } }, "required": [ "message" ] } } } } } } }, "/api/v1/sessions": { "get": { "tags": [ "Sessions" ], "parameters": [ { "schema": { "type": "string" }, "required": false, "name": "botId", "in": "query" }, { "schema": { "type": "string" }, "required": false, "name": "channelType", "in": "query" }, { "schema": { "type": "string" }, "required": false, "name": "status", "in": "query" }, { "schema": { "type": "integer", "minimum": 1, "maximum": 100, "default": 20 }, "required": false, "name": "limit", "in": "query" }, { "schema": { "type": "integer", "nullable": true, "minimum": 0, "default": 0 }, "required": false, "name": "offset", "in": "query" } ], "responses": { "200": { "description": "Session list", "content": { "application/json": { "schema": { "type": "object", "properties": { "sessions": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string" }, "botId": { "type": "string" }, "sessionKey": { "type": "string" }, "channelType": { "type": "string", "nullable": true }, "channelId": { "type": "string", "nullable": true }, "title": { "type": "string" }, "status": { "type": "string" }, "messageCount": { "type": "number" }, "lastMessageAt": { "type": "string", "nullable": true }, "metadata": { "type": "object", "nullable": true, "additionalProperties": { "nullable": true } }, "createdAt": { "type": "string" }, "updatedAt": { "type": "string" } }, "required": [ "id", "botId", "sessionKey", "channelType", "channelId", "title", "status", "messageCount", "lastMessageAt", "metadata", "createdAt", "updatedAt" ] } }, "total": { "type": "number" }, "limit": { "type": "number" }, "offset": { "type": "number" } }, "required": [ "sessions", "total", "limit", "offset" ] } } } } } } }, "/api/v1/sessions/{id}": { "get": { "tags": [ "Sessions" ], "parameters": [ { "schema": { "type": "string" }, "required": true, "name": "id", "in": "path" } ], "responses": { "200": { "description": "Session details", "content": { "application/json": { "schema": { "type": "object", "properties": { "id": { "type": "string" }, "botId": { "type": "string" }, "sessionKey": { "type": "string" }, "channelType": { "type": "string", "nullable": true }, "channelId": { "type": "string", "nullable": true }, "title": { "type": "string" }, "status": { "type": "string" }, "messageCount": { "type": "number" }, "lastMessageAt": { "type": "string", "nullable": true }, "metadata": { "type": "object", "nullable": true, "additionalProperties": { "nullable": true } }, "createdAt": { "type": "string" }, "updatedAt": { "type": "string" } }, "required": [ "id", "botId", "sessionKey", "channelType", "channelId", "title", "status", "messageCount", "lastMessageAt", "metadata", "createdAt", "updatedAt" ] } } } }, "404": { "description": "Session not found", "content": { "application/json": { "schema": { "type": "object", "properties": { "message": { "type": "string" } }, "required": [ "message" ] } } } } } }, "delete": { "tags": [ "Sessions" ], "parameters": [ { "schema": { "type": "string" }, "required": true, "name": "id", "in": "path" } ], "responses": { "200": { "description": "Delete session", "content": { "application/json": { "schema": { "type": "object", "properties": { "ok": { "type": "boolean" } }, "required": [ "ok" ] } } } } } } }, "/api/v1/sessions/{id}/reset": { "post": { "tags": [ "Sessions" ], "parameters": [ { "schema": { "type": "string" }, "required": true, "name": "id", "in": "path" } ], "responses": { "200": { "description": "Reset session", "content": { "application/json": { "schema": { "type": "object", "properties": { "id": { "type": "string" }, "botId": { "type": "string" }, "sessionKey": { "type": "string" }, "channelType": { "type": "string", "nullable": true }, "channelId": { "type": "string", "nullable": true }, "title": { "type": "string" }, "status": { "type": "string" }, "messageCount": { "type": "number" }, "lastMessageAt": { "type": "string", "nullable": true }, "metadata": { "type": "object", "nullable": true, "additionalProperties": { "nullable": true } }, "createdAt": { "type": "string" }, "updatedAt": { "type": "string" } }, "required": [ "id", "botId", "sessionKey", "channelType", "channelId", "title", "status", "messageCount", "lastMessageAt", "metadata", "createdAt", "updatedAt" ] } } } }, "404": { "description": "Not found", "content": { "application/json": { "schema": { "type": "object", "properties": { "message": { "type": "string" } }, "required": [ "message" ] } } } } } } }, "/api/v1/models": { "get": { "tags": [ "Models" ], "responses": { "200": { "description": "Model list", "content": { "application/json": { "schema": { "type": "object", "properties": { "models": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string" }, "name": { "type": "string" }, "provider": { "type": "string" }, "isDefault": { "type": "boolean" }, "description": { "type": "string" } }, "required": [ "id", "name", "provider" ] } } }, "required": [ "models" ] } } } } } } }, "/api/v1/providers": { "get": { "tags": [ "Providers" ], "responses": { "200": { "description": "Provider list", "content": { "application/json": { "schema": { "type": "object", "properties": { "providers": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string" }, "providerId": { "type": "string" }, "displayName": { "type": "string", "nullable": true }, "enabled": { "type": "boolean" }, "baseUrl": { "type": "string", "nullable": true }, "hasApiKey": { "type": "boolean" }, "modelsJson": { "type": "string", "nullable": true }, "createdAt": { "type": "string" }, "updatedAt": { "type": "string" } }, "required": [ "id", "providerId", "displayName", "enabled", "baseUrl", "hasApiKey", "modelsJson" ] } } }, "required": [ "providers" ] } } } } } } }, "/api/v1/providers/{providerId}": { "put": { "tags": [ "Providers" ], "parameters": [ { "schema": { "type": "string" }, "required": true, "name": "providerId", "in": "path" } ], "requestBody": { "content": { "application/json": { "schema": { "type": "object", "properties": { "apiKey": { "type": "string" }, "baseUrl": { "type": "string", "nullable": true }, "enabled": { "type": "boolean" }, "displayName": { "type": "string" }, "modelsJson": { "type": "string" } } } } } }, "responses": { "200": { "description": "Updated provider", "content": { "application/json": { "schema": { "type": "object", "properties": { "provider": { "type": "object", "properties": { "id": { "type": "string" }, "providerId": { "type": "string" }, "displayName": { "type": "string", "nullable": true }, "enabled": { "type": "boolean" }, "baseUrl": { "type": "string", "nullable": true }, "hasApiKey": { "type": "boolean" }, "modelsJson": { "type": "string", "nullable": true }, "createdAt": { "type": "string" }, "updatedAt": { "type": "string" } }, "required": [ "id", "providerId", "displayName", "enabled", "baseUrl", "hasApiKey", "modelsJson" ] } }, "required": [ "provider" ] } } } }, "201": { "description": "Created provider", "content": { "application/json": { "schema": { "type": "object", "properties": { "provider": { "type": "object", "properties": { "id": { "type": "string" }, "providerId": { "type": "string" }, "displayName": { "type": "string", "nullable": true }, "enabled": { "type": "boolean" }, "baseUrl": { "type": "string", "nullable": true }, "hasApiKey": { "type": "boolean" }, "modelsJson": { "type": "string", "nullable": true }, "createdAt": { "type": "string" }, "updatedAt": { "type": "string" } }, "required": [ "id", "providerId", "displayName", "enabled", "baseUrl", "hasApiKey", "modelsJson" ] } }, "required": [ "provider" ] } } } } } }, "delete": { "tags": [ "Providers" ], "parameters": [ { "schema": { "type": "string" }, "required": true, "name": "providerId", "in": "path" } ], "responses": { "200": { "description": "Deleted provider", "content": { "application/json": { "schema": { "type": "object", "properties": { "ok": { "type": "boolean" } }, "required": [ "ok" ] } } } } } } }, "/api/v1/providers/{providerId}/verify": { "post": { "tags": [ "Providers" ], "parameters": [ { "schema": { "type": "string" }, "required": true, "name": "providerId", "in": "path" } ], "requestBody": { "content": { "application/json": { "schema": { "type": "object", "properties": { "apiKey": { "type": "string" }, "baseUrl": { "type": "string" } }, "required": [ "apiKey" ] } } } }, "responses": { "200": { "description": "Verify provider", "content": { "application/json": { "schema": { "type": "object", "properties": { "valid": { "type": "boolean" }, "models": { "type": "array", "items": { "type": "string" } }, "error": { "type": "string" } }, "required": [ "valid" ] } } } } } } }, "/api/v1/link-catalog": { "get": { "tags": [ "Models" ], "responses": { "200": { "description": "Link catalog placeholder", "content": { "application/json": { "schema": { "type": "object", "properties": { "providers": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string" }, "name": { "type": "string" }, "kind": { "type": "string" }, "models": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string" }, "name": { "type": "string" }, "externalName": { "type": "string" }, "inputPrice": { "type": "string", "nullable": true }, "outputPrice": { "type": "string", "nullable": true } }, "required": [ "id", "name", "externalName", "inputPrice", "outputPrice" ] } } }, "required": [ "id", "name", "kind", "models" ] } } }, "required": [ "providers" ] } } } } } } }, "/api/v1/integrations": { "get": { "tags": [ "Integrations" ], "responses": { "200": { "description": "Integrations", "content": { "application/json": { "schema": { "type": "object", "properties": { "integrations": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string" }, "toolkit": { "type": "object", "properties": { "slug": { "type": "string" }, "displayName": { "type": "string" }, "description": { "type": "string" }, "iconUrl": { "type": "string" }, "fallbackIconUrl": { "type": "string" }, "category": { "type": "string" }, "authScheme": { "type": "string", "enum": [ "oauth2", "api_key_global", "api_key_user" ] }, "authFields": { "type": "array", "items": { "type": "object", "properties": { "key": { "type": "string" }, "label": { "type": "string" }, "type": { "type": "string", "enum": [ "text", "secret" ] }, "placeholder": { "type": "string" } }, "required": [ "key", "label", "type" ] } } }, "required": [ "slug", "displayName", "description", "iconUrl", "fallbackIconUrl", "category", "authScheme" ] }, "status": { "type": "string", "enum": [ "pending", "initiated", "active", "failed", "expired", "disconnected" ] }, "connectUrl": { "type": "string" }, "connectedAt": { "type": "string" }, "credentialHints": { "type": "object", "additionalProperties": { "type": "string" } }, "returnTo": { "type": "string" }, "source": { "type": "string", "enum": [ "page", "chat" ] } }, "required": [ "toolkit", "status" ] } } }, "required": [ "integrations" ] } } } } } } }, "/api/v1/integrations/connect": { "post": { "tags": [ "Integrations" ], "requestBody": { "content": { "application/json": { "schema": { "type": "object", "properties": { "toolkitSlug": { "type": "string" }, "credentials": { "type": "object", "additionalProperties": { "type": "string" } }, "source": { "type": "string", "enum": [ "page", "chat" ] }, "returnTo": { "type": "string" } }, "required": [ "toolkitSlug" ] } } } }, "responses": { "200": { "description": "Connection initiated", "content": { "application/json": { "schema": { "type": "object", "properties": { "integration": { "type": "object", "properties": { "id": { "type": "string" }, "toolkit": { "type": "object", "properties": { "slug": { "type": "string" }, "displayName": { "type": "string" }, "description": { "type": "string" }, "iconUrl": { "type": "string" }, "fallbackIconUrl": { "type": "string" }, "category": { "type": "string" }, "authScheme": { "type": "string", "enum": [ "oauth2", "api_key_global", "api_key_user" ] }, "authFields": { "type": "array", "items": { "type": "object", "properties": { "key": { "type": "string" }, "label": { "type": "string" }, "type": { "type": "string", "enum": [ "text", "secret" ] }, "placeholder": { "type": "string" } }, "required": [ "key", "label", "type" ] } } }, "required": [ "slug", "displayName", "description", "iconUrl", "fallbackIconUrl", "category", "authScheme" ] }, "status": { "type": "string", "enum": [ "pending", "initiated", "active", "failed", "expired", "disconnected" ] }, "connectUrl": { "type": "string" }, "connectedAt": { "type": "string" }, "credentialHints": { "type": "object", "additionalProperties": { "type": "string" } }, "returnTo": { "type": "string" }, "source": { "type": "string", "enum": [ "page", "chat" ] } }, "required": [ "toolkit", "status" ] }, "connectUrl": { "type": "string" }, "state": { "type": "string" } }, "required": [ "integration" ] } } } } } } }, "/api/v1/integrations/{integrationId}/refresh": { "post": { "tags": [ "Integrations" ], "parameters": [ { "schema": { "type": "string" }, "required": true, "name": "integrationId", "in": "path" } ], "requestBody": { "content": { "application/json": { "schema": { "type": "object", "properties": { "state": { "type": "string" } } } } } }, "responses": { "200": { "description": "Refreshed integration", "content": { "application/json": { "schema": { "type": "object", "properties": { "id": { "type": "string" }, "toolkit": { "type": "object", "properties": { "slug": { "type": "string" }, "displayName": { "type": "string" }, "description": { "type": "string" }, "iconUrl": { "type": "string" }, "fallbackIconUrl": { "type": "string" }, "category": { "type": "string" }, "authScheme": { "type": "string", "enum": [ "oauth2", "api_key_global", "api_key_user" ] }, "authFields": { "type": "array", "items": { "type": "object", "properties": { "key": { "type": "string" }, "label": { "type": "string" }, "type": { "type": "string", "enum": [ "text", "secret" ] }, "placeholder": { "type": "string" } }, "required": [ "key", "label", "type" ] } } }, "required": [ "slug", "displayName", "description", "iconUrl", "fallbackIconUrl", "category", "authScheme" ] }, "status": { "type": "string", "enum": [ "pending", "initiated", "active", "failed", "expired", "disconnected" ] }, "connectUrl": { "type": "string" }, "connectedAt": { "type": "string" }, "credentialHints": { "type": "object", "additionalProperties": { "type": "string" } }, "returnTo": { "type": "string" }, "source": { "type": "string", "enum": [ "page", "chat" ] } }, "required": [ "toolkit", "status" ] } } } }, "404": { "description": "Not found", "content": { "application/json": { "schema": { "type": "object", "properties": { "message": { "type": "string" } }, "required": [ "message" ] } } } } } } }, "/api/v1/integrations/{integrationId}": { "delete": { "tags": [ "Integrations" ], "parameters": [ { "schema": { "type": "string" }, "required": true, "name": "integrationId", "in": "path" } ], "responses": { "200": { "description": "Disconnected integration", "content": { "application/json": { "schema": { "type": "object", "properties": { "id": { "type": "string" }, "toolkit": { "type": "object", "properties": { "slug": { "type": "string" }, "displayName": { "type": "string" }, "description": { "type": "string" }, "iconUrl": { "type": "string" }, "fallbackIconUrl": { "type": "string" }, "category": { "type": "string" }, "authScheme": { "type": "string", "enum": [ "oauth2", "api_key_global", "api_key_user" ] }, "authFields": { "type": "array", "items": { "type": "object", "properties": { "key": { "type": "string" }, "label": { "type": "string" }, "type": { "type": "string", "enum": [ "text", "secret" ] }, "placeholder": { "type": "string" } }, "required": [ "key", "label", "type" ] } } }, "required": [ "slug", "displayName", "description", "iconUrl", "fallbackIconUrl", "category", "authScheme" ] }, "status": { "type": "string", "enum": [ "pending", "initiated", "active", "failed", "expired", "disconnected" ] }, "connectUrl": { "type": "string" }, "connectedAt": { "type": "string" }, "credentialHints": { "type": "object", "additionalProperties": { "type": "string" } }, "returnTo": { "type": "string" }, "source": { "type": "string", "enum": [ "page", "chat" ] } }, "required": [ "toolkit", "status" ] } } } }, "404": { "description": "Not found", "content": { "application/json": { "schema": { "type": "object", "properties": { "message": { "type": "string" } }, "required": [ "message" ] } } } } } } }, "/api/internal/artifacts": { "post": { "tags": [ "Artifacts", "Internal" ], "requestBody": { "content": { "application/json": { "schema": { "type": "object", "properties": { "botId": { "type": "string", "minLength": 1 }, "title": { "type": "string", "minLength": 1, "maxLength": 500 }, "sessionKey": { "type": "string" }, "chatId": { "type": "string" }, "threadId": { "type": "string" }, "channelType": { "type": "string" }, "channelId": { "type": "string" }, "artifactType": { "type": "string", "enum": [ "code", "content", "deployment" ] }, "source": { "type": "string", "enum": [ "coding", "content" ] }, "contentType": { "type": "string" }, "status": { "type": "string", "enum": [ "building", "live", "failed", "stopped" ] }, "previewUrl": { "type": "string", "format": "uri" }, "deployTarget": { "type": "string" }, "linesOfCode": { "type": "integer" }, "fileCount": { "type": "integer" }, "durationMs": { "type": "integer" }, "metadata": { "type": "object", "additionalProperties": { "nullable": true } } }, "required": [ "botId", "title" ] } } } }, "responses": { "201": { "description": "Created artifact", "content": { "application/json": { "schema": { "type": "object", "properties": { "id": { "type": "string" }, "botId": { "type": "string" }, "sessionKey": { "type": "string", "nullable": true }, "channelType": { "type": "string", "nullable": true }, "channelId": { "type": "string", "nullable": true }, "title": { "type": "string" }, "artifactType": { "type": "string", "nullable": true }, "source": { "type": "string", "nullable": true }, "contentType": { "type": "string", "nullable": true }, "status": { "type": "string" }, "previewUrl": { "type": "string", "nullable": true }, "deployTarget": { "type": "string", "nullable": true }, "linesOfCode": { "type": "number", "nullable": true }, "fileCount": { "type": "number", "nullable": true }, "durationMs": { "type": "number", "nullable": true }, "metadata": { "type": "object", "nullable": true, "additionalProperties": { "nullable": true } }, "createdAt": { "type": "string" }, "updatedAt": { "type": "string" } }, "required": [ "id", "botId", "sessionKey", "channelType", "channelId", "title", "artifactType", "source", "contentType", "status", "previewUrl", "deployTarget", "linesOfCode", "fileCount", "durationMs", "metadata", "createdAt", "updatedAt" ] } } } } } } }, "/api/internal/artifacts/{id}": { "patch": { "tags": [ "Artifacts", "Internal" ], "parameters": [ { "schema": { "type": "string" }, "required": true, "name": "id", "in": "path" } ], "requestBody": { "content": { "application/json": { "schema": { "type": "object", "properties": { "title": { "type": "string", "minLength": 1, "maxLength": 500 }, "status": { "type": "string", "enum": [ "building", "live", "failed", "stopped" ] }, "previewUrl": { "type": "string", "format": "uri" }, "deployTarget": { "type": "string" }, "linesOfCode": { "type": "integer" }, "fileCount": { "type": "integer" }, "durationMs": { "type": "integer" }, "metadata": { "type": "object", "additionalProperties": { "nullable": true } } } } } } }, "responses": { "200": { "description": "Updated artifact", "content": { "application/json": { "schema": { "type": "object", "properties": { "id": { "type": "string" }, "botId": { "type": "string" }, "sessionKey": { "type": "string", "nullable": true }, "channelType": { "type": "string", "nullable": true }, "channelId": { "type": "string", "nullable": true }, "title": { "type": "string" }, "artifactType": { "type": "string", "nullable": true }, "source": { "type": "string", "nullable": true }, "contentType": { "type": "string", "nullable": true }, "status": { "type": "string" }, "previewUrl": { "type": "string", "nullable": true }, "deployTarget": { "type": "string", "nullable": true }, "linesOfCode": { "type": "number", "nullable": true }, "fileCount": { "type": "number", "nullable": true }, "durationMs": { "type": "number", "nullable": true }, "metadata": { "type": "object", "nullable": true, "additionalProperties": { "nullable": true } }, "createdAt": { "type": "string" }, "updatedAt": { "type": "string" } }, "required": [ "id", "botId", "sessionKey", "channelType", "channelId", "title", "artifactType", "source", "contentType", "status", "previewUrl", "deployTarget", "linesOfCode", "fileCount", "durationMs", "metadata", "createdAt", "updatedAt" ] } } } }, "404": { "description": "Artifact not found", "content": { "application/json": { "schema": { "type": "object", "properties": { "message": { "type": "string" } }, "required": [ "message" ] } } } } } } }, "/api/v1/artifacts": { "get": { "tags": [ "Artifacts" ], "parameters": [ { "schema": { "type": "integer", "minimum": 0, "exclusiveMinimum": true, "default": 50 }, "required": false, "name": "limit", "in": "query" }, { "schema": { "type": "integer", "nullable": true, "minimum": 0, "default": 0 }, "required": false, "name": "offset", "in": "query" }, { "schema": { "type": "string" }, "required": false, "name": "sessionKey", "in": "query" } ], "responses": { "200": { "description": "Artifacts", "content": { "application/json": { "schema": { "type": "object", "properties": { "artifacts": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string" }, "botId": { "type": "string" }, "sessionKey": { "type": "string", "nullable": true }, "channelType": { "type": "string", "nullable": true }, "channelId": { "type": "string", "nullable": true }, "title": { "type": "string" }, "artifactType": { "type": "string", "nullable": true }, "source": { "type": "string", "nullable": true }, "contentType": { "type": "string", "nullable": true }, "status": { "type": "string" }, "previewUrl": { "type": "string", "nullable": true }, "deployTarget": { "type": "string", "nullable": true }, "linesOfCode": { "type": "number", "nullable": true }, "fileCount": { "type": "number", "nullable": true }, "durationMs": { "type": "number", "nullable": true }, "metadata": { "type": "object", "nullable": true, "additionalProperties": { "nullable": true } }, "createdAt": { "type": "string" }, "updatedAt": { "type": "string" } }, "required": [ "id", "botId", "sessionKey", "channelType", "channelId", "title", "artifactType", "source", "contentType", "status", "previewUrl", "deployTarget", "linesOfCode", "fileCount", "durationMs", "metadata", "createdAt", "updatedAt" ] } }, "total": { "type": "number" }, "limit": { "type": "number" }, "offset": { "type": "number" } }, "required": [ "artifacts", "total", "limit", "offset" ] } } } } } } }, "/api/v1/artifacts/stats": { "get": { "tags": [ "Artifacts" ], "responses": { "200": { "description": "Artifact stats", "content": { "application/json": { "schema": { "type": "object", "properties": { "totalArtifacts": { "type": "number" }, "liveCount": { "type": "number" }, "buildingCount": { "type": "number" }, "failedCount": { "type": "number" }, "codingCount": { "type": "number" }, "contentCount": { "type": "number" }, "totalLinesOfCode": { "type": "number" } }, "required": [ "totalArtifacts", "liveCount", "buildingCount", "failedCount", "codingCount", "contentCount", "totalLinesOfCode" ] } } } } } } }, "/api/v1/artifacts/{id}": { "get": { "tags": [ "Artifacts" ], "parameters": [ { "schema": { "type": "string" }, "required": true, "name": "id", "in": "path" } ], "responses": { "200": { "description": "Artifact", "content": { "application/json": { "schema": { "type": "object", "properties": { "id": { "type": "string" }, "botId": { "type": "string" }, "sessionKey": { "type": "string", "nullable": true }, "channelType": { "type": "string", "nullable": true }, "channelId": { "type": "string", "nullable": true }, "title": { "type": "string" }, "artifactType": { "type": "string", "nullable": true }, "source": { "type": "string", "nullable": true }, "contentType": { "type": "string", "nullable": true }, "status": { "type": "string" }, "previewUrl": { "type": "string", "nullable": true }, "deployTarget": { "type": "string", "nullable": true }, "linesOfCode": { "type": "number", "nullable": true }, "fileCount": { "type": "number", "nullable": true }, "durationMs": { "type": "number", "nullable": true }, "metadata": { "type": "object", "nullable": true, "additionalProperties": { "nullable": true } }, "createdAt": { "type": "string" }, "updatedAt": { "type": "string" } }, "required": [ "id", "botId", "sessionKey", "channelType", "channelId", "title", "artifactType", "source", "contentType", "status", "previewUrl", "deployTarget", "linesOfCode", "fileCount", "durationMs", "metadata", "createdAt", "updatedAt" ] } } } }, "404": { "description": "Artifact not found", "content": { "application/json": { "schema": { "type": "object", "properties": { "message": { "type": "string" } }, "required": [ "message" ] } } } } } }, "delete": { "tags": [ "Artifacts" ], "parameters": [ { "schema": { "type": "string" }, "required": true, "name": "id", "in": "path" } ], "responses": { "200": { "description": "Deleted artifact", "content": { "application/json": { "schema": { "type": "object", "properties": { "ok": { "type": "boolean" } }, "required": [ "ok" ] } } } } } } }, "/api/v1/skills": { "get": { "tags": [ "Skills" ], "responses": { "200": { "description": "Skills catalog", "content": { "application/json": { "schema": { "type": "object", "properties": { "skills": { "type": "object", "properties": { "version": { "type": "integer", "minimum": 0, "exclusiveMinimum": true, "default": 1 }, "defaults": { "type": "object", "properties": { "enabled": { "type": "boolean", "default": true }, "source": { "type": "string", "enum": [ "inline", "local-path" ], "default": "inline" } }, "default": { "enabled": true, "source": "inline" } }, "items": { "type": "object", "additionalProperties": { "type": "object", "properties": { "name": { "type": "string" }, "enabled": { "type": "boolean", "default": true }, "source": { "type": "string", "enum": [ "inline", "local-path" ], "default": "inline" }, "content": { "type": "string", "default": "" }, "localPath": { "type": "string" }, "files": { "type": "object", "additionalProperties": { "type": "string" }, "default": {} }, "metadata": { "type": "object", "properties": { "title": { "type": "string" }, "description": { "type": "string" }, "owner": { "type": "string" }, "tags": { "type": "array", "items": { "type": "string" } }, "category": { "type": "string" } }, "default": {} } }, "required": [ "name" ] }, "default": {} } } } }, "required": [ "skills" ] } } } } } } }, "/api/internal/skills/latest": { "get": { "tags": [ "Internal" ], "responses": { "200": { "description": "Latest skill runtime snapshot", "content": { "application/json": { "schema": { "type": "object", "properties": { "version": { "type": "integer", "minimum": 0 }, "skillsHash": { "type": "string" }, "skills": { "type": "object", "additionalProperties": { "type": "object", "additionalProperties": { "type": "string" } } }, "createdAt": { "type": "string", "format": "date-time" } }, "required": [ "version", "skillsHash", "skills", "createdAt" ] } } } } } } }, "/api/internal/skills/{name}": { "put": { "tags": [ "Internal" ], "parameters": [ { "schema": { "type": "string" }, "required": true, "name": "name", "in": "path" } ], "requestBody": { "content": { "application/json": { "schema": { "type": "object", "properties": { "content": { "type": "string", "minLength": 1 }, "files": { "type": "object", "additionalProperties": { "type": "string" } }, "status": { "type": "string", "enum": [ "active", "inactive" ] }, "metadata": { "type": "object", "properties": { "title": { "type": "string" }, "description": { "type": "string" }, "owner": { "type": "string" }, "tags": { "type": "array", "items": { "type": "string" } }, "category": { "type": "string" } }, "default": {} } }, "required": [ "content" ] } } } }, "responses": { "200": { "description": "Upserted skill", "content": { "application/json": { "schema": { "type": "object", "properties": { "ok": { "type": "boolean" }, "name": { "type": "string" }, "version": { "type": "integer" } }, "required": [ "ok", "name", "version" ] } } } } } } }, "/api/v1/skillhub/catalog": { "get": { "tags": [ "SkillHub" ], "responses": { "200": { "description": "SkillHub catalog", "content": { "application/json": { "schema": { "type": "object", "properties": { "skills": { "type": "array", "items": { "type": "object", "properties": { "slug": { "type": "string" }, "name": { "type": "string" }, "description": { "type": "string" }, "downloads": { "type": "number" }, "stars": { "type": "number" }, "tags": { "type": "array", "items": { "type": "string" } }, "version": { "type": "string" }, "updatedAt": { "type": "string" }, "homepage": { "type": "string" } }, "required": [ "slug", "name", "description", "downloads", "stars", "tags", "version", "updatedAt", "homepage" ] } }, "installedSlugs": { "type": "array", "items": { "type": "string" } }, "meta": { "type": "object", "nullable": true, "properties": { "version": { "type": "string" }, "updatedAt": { "type": "string" }, "skillCount": { "type": "number" } }, "required": [ "version", "updatedAt", "skillCount" ] } }, "required": [ "skills", "installedSlugs", "meta" ] } } } } } } }, "/api/v1/skillhub/install": { "post": { "tags": [ "SkillHub" ], "requestBody": { "content": { "application/json": { "schema": { "type": "object", "properties": { "slug": { "type": "string", "minLength": 1 } }, "required": [ "slug" ] } } } }, "responses": { "200": { "description": "Install", "content": { "application/json": { "schema": { "type": "object", "properties": { "ok": { "type": "boolean" }, "error": { "type": "string" } }, "required": [ "ok" ] } } } } } } }, "/api/v1/skillhub/uninstall": { "post": { "tags": [ "SkillHub" ], "requestBody": { "content": { "application/json": { "schema": { "type": "object", "properties": { "slug": { "type": "string", "minLength": 1 } }, "required": [ "slug" ] } } } }, "responses": { "200": { "description": "Uninstall", "content": { "application/json": { "schema": { "type": "object", "properties": { "ok": { "type": "boolean" }, "error": { "type": "string" } }, "required": [ "ok" ] } } } } } } }, "/api/v1/skillhub/refresh": { "post": { "tags": [ "SkillHub" ], "responses": { "200": { "description": "Refresh", "content": { "application/json": { "schema": { "type": "object", "properties": { "ok": { "type": "boolean" }, "skillCount": { "type": "number" }, "error": { "type": "string" } }, "required": [ "ok", "skillCount" ] } } } } } } }, "/api/v1/skillhub/skills/{slug}": { "get": { "tags": [ "SkillHub" ], "parameters": [ { "schema": { "type": "string", "minLength": 1 }, "required": true, "name": "slug", "in": "path" } ], "responses": { "200": { "description": "Skill detail", "content": { "application/json": { "schema": { "type": "object", "properties": { "slug": { "type": "string" }, "name": { "type": "string" }, "description": { "type": "string" }, "downloads": { "type": "number" }, "stars": { "type": "number" }, "tags": { "type": "array", "items": { "type": "string" } }, "version": { "type": "string" }, "updatedAt": { "type": "string" }, "homepage": { "type": "string" }, "installed": { "type": "boolean" }, "skillContent": { "type": "string", "nullable": true }, "files": { "type": "array", "items": { "type": "string" } } }, "required": [ "slug", "name", "description", "downloads", "stars", "tags", "version", "updatedAt", "homepage", "installed", "skillContent", "files" ] } } } }, "404": { "description": "Not found", "content": { "application/json": { "schema": { "type": "object", "properties": { "message": { "type": "string" } }, "required": [ "message" ] } } } } } } }, "/api/v1/me": { "get": { "tags": [ "User" ], "responses": { "200": { "description": "Current local user", "content": { "application/json": { "schema": { "type": "object", "properties": { "id": { "type": "string" }, "email": { "type": "string" }, "name": { "type": "string" }, "image": { "type": "string", "nullable": true }, "plan": { "type": "string" }, "inviteAccepted": { "type": "boolean" }, "onboardingCompleted": { "type": "boolean" }, "authSource": { "type": "string", "nullable": true } }, "required": [ "id", "email", "name", "plan", "inviteAccepted", "onboardingCompleted" ] } } } } } }, "patch": { "tags": [ "User" ], "requestBody": { "content": { "application/json": { "schema": { "type": "object", "properties": { "name": { "type": "string", "minLength": 1, "maxLength": 80 }, "image": { "anyOf": [ { "type": "string", "format": "uri" }, { "type": "string", "pattern": "^data:image\\/(?:png|jpeg|jpg|webp|gif);base64,[A-Za-z0-9+/=]+$" }, { "nullable": true } ] } } } } } }, "responses": { "200": { "description": "Updated local user", "content": { "application/json": { "schema": { "type": "object", "properties": { "ok": { "type": "boolean" }, "profile": { "type": "object", "properties": { "id": { "type": "string" }, "email": { "type": "string" }, "name": { "type": "string" }, "image": { "type": "string", "nullable": true }, "plan": { "type": "string" }, "inviteAccepted": { "type": "boolean" }, "onboardingCompleted": { "type": "boolean" }, "authSource": { "type": "string", "nullable": true } }, "required": [ "id", "email", "name", "plan", "inviteAccepted", "onboardingCompleted" ] } }, "required": [ "ok", "profile" ] } } } } } } }, "/api/v1/me/auth-source": { "post": { "tags": [ "User" ], "requestBody": { "content": { "application/json": { "schema": { "type": "object", "properties": { "source": { "type": "string", "enum": [ "email", "google", "slack_shared_claim", "IM", "Landing" ] }, "detail": { "type": "string" } }, "required": [ "source" ] } } } }, "responses": { "200": { "description": "Updated auth source", "content": { "application/json": { "schema": { "type": "object", "properties": { "ok": { "type": "boolean" } }, "required": [ "ok" ] } } } } } } }, "/api/v1/runtime-config": { "get": { "tags": [ "Runtime Config" ], "responses": { "200": { "description": "Runtime config", "content": { "application/json": { "schema": { "type": "object", "properties": { "runtime": { "type": "object", "properties": { "gateway": { "type": "object", "properties": { "port": { "type": "integer", "minimum": 0, "exclusiveMinimum": true, "default": 18789 }, "bind": { "type": "string", "enum": [ "loopback", "lan", "auto" ], "default": "loopback" }, "authMode": { "type": "string", "enum": [ "none", "token" ], "default": "none" } }, "default": { "port": 18789, "bind": "loopback", "authMode": "none" } }, "defaultModelId": { "type": "string", "default": "anthropic/claude-sonnet-4" } } } }, "required": [ "runtime" ] } } } } } }, "put": { "tags": [ "Runtime Config" ], "requestBody": { "content": { "application/json": { "schema": { "type": "object", "properties": { "gateway": { "type": "object", "properties": { "port": { "type": "integer", "minimum": 0, "exclusiveMinimum": true, "default": 18789 }, "bind": { "type": "string", "enum": [ "loopback", "lan", "auto" ], "default": "loopback" }, "authMode": { "type": "string", "enum": [ "none", "token" ], "default": "none" } }, "default": { "port": 18789, "bind": "loopback", "authMode": "none" } }, "defaultModelId": { "type": "string", "default": "anthropic/claude-sonnet-4" } } } } } }, "responses": { "200": { "description": "Updated runtime config", "content": { "application/json": { "schema": { "type": "object", "properties": { "runtime": { "type": "object", "properties": { "gateway": { "type": "object", "properties": { "port": { "type": "integer", "minimum": 0, "exclusiveMinimum": true, "default": 18789 }, "bind": { "type": "string", "enum": [ "loopback", "lan", "auto" ], "default": "loopback" }, "authMode": { "type": "string", "enum": [ "none", "token" ], "default": "none" } }, "default": { "port": 18789, "bind": "loopback", "authMode": "none" } }, "defaultModelId": { "type": "string", "default": "anthropic/claude-sonnet-4" } } } }, "required": [ "runtime" ] } } } } } } }, "/api/v1/workspace-templates": { "get": { "tags": [ "Workspace Templates" ], "responses": { "200": { "description": "Workspace templates", "content": { "application/json": { "schema": { "type": "object", "properties": { "templates": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string" }, "name": { "type": "string" }, "content": { "type": "string" }, "writeMode": { "type": "string", "enum": [ "seed", "inject" ], "default": "seed" }, "status": { "type": "string", "enum": [ "active", "inactive" ], "default": "active" }, "createdAt": { "type": "string" }, "updatedAt": { "type": "string" } }, "required": [ "id", "name", "content", "createdAt", "updatedAt" ] } } }, "required": [ "templates" ] } } } } } } }, "/api/internal/workspace-templates/latest": { "get": { "tags": [ "Internal" ], "responses": { "200": { "description": "Latest template runtime snapshot", "content": { "application/json": { "schema": { "type": "object", "properties": { "version": { "type": "integer", "minimum": 0 }, "templatesHash": { "type": "string" }, "templates": { "type": "object", "additionalProperties": { "type": "object", "properties": { "content": { "type": "string" }, "writeMode": { "type": "string", "enum": [ "seed", "inject" ] } }, "required": [ "content", "writeMode" ] } }, "createdAt": { "type": "string", "format": "date-time" } }, "required": [ "version", "templatesHash", "templates", "createdAt" ] } } } } } } }, "/api/internal/workspace-templates/{name}": { "put": { "tags": [ "Internal" ], "parameters": [ { "schema": { "type": "string" }, "required": true, "name": "name", "in": "path" } ], "requestBody": { "content": { "application/json": { "schema": { "type": "object", "properties": { "content": { "type": "string", "minLength": 1 }, "writeMode": { "type": "string", "enum": [ "seed", "inject" ] }, "status": { "type": "string", "enum": [ "active", "inactive" ] } }, "required": [ "content" ] } } } }, "responses": { "200": { "description": "Upserted template", "content": { "application/json": { "schema": { "type": "object", "properties": { "ok": { "type": "boolean" }, "name": { "type": "string" }, "version": { "type": "integer" } }, "required": [ "ok", "name", "version" ] } } } } } } } } }