Files
Memoh/spec/docs.go
T
BBQ cc5f00355f feat: add email service with multi-adapter support (#146)
* feat: add email service with multi-adapter support

Implement a full-stack email service with global provider management,
per-bot bindings with granular read/write permissions, outbox audit
storage, and MCP tool integration for direct mailbox access.

Backend:
- Email providers: CRUD with dynamic config schema (generic SMTP/IMAP, Mailgun)
- Generic adapter: go-mail (SMTP) + go-imap/v2 (IMAP IDLE real-time push via
  UnilateralDataHandler + UID-based tracking + periodic check fallback)
- Mailgun adapter: mailgun-go/v5 with dual inbound mode (webhook + poll)
- Bot email bindings: per-bot provider binding with independent r/w permissions
- Outbox: outbound email audit log with status tracking
- Trigger: inbound emails push notification to bot_inbox (from/subject only,
  LLM reads full content on demand via MCP tools)
- MailboxReader interface: on-demand IMAP queries for listing/reading emails
- MCP tools: email_accounts, email_send, email_list (paginated mailbox),
  email_read (by UID) — all with multi-binding and provider_id selection
- Webhook: /email/mailgun/webhook/:config_id (JWT-skipped, signature-verified)
- DB migration: 0019_add_email (email_providers, bot_email_bindings, email_outbox)

Frontend:
- Email Providers page: /email-providers with MasterDetailSidebarLayout
- Dynamic config form rendered from ordered provider meta schema with i18n keys
- Bot detail: Email tab with bindings management + outbox audit table
- Sidebar navigation entry
- Full i18n support (en + zh)
- Auto-generated SDK from Swagger

Closes #17

* feat(email): trigger bot conversation immediately on inbound email

Instead of only storing an inbox item and waiting for the next chat,
the email trigger now proactively invokes the conversation resolver
so the bot processes new emails right away — aligned with the
schedule/heartbeat trigger pattern.

* fix: lint

---------

Co-authored-by: Acbox <acbox0328@gmail.com>
2026-02-28 21:03:59 +08:00

9534 lines
320 KiB
Go

// Package spec Code generated by swaggo/swag. DO NOT EDIT
package spec
import "github.com/swaggo/swag"
const docTemplate = `{
"schemes": {{ marshal .Schemes }},
"swagger": "2.0",
"info": {
"description": "{{escape .Description}}",
"title": "{{.Title}}",
"contact": {},
"version": "{{.Version}}"
},
"host": "{{.Host}}",
"basePath": "{{.BasePath}}",
"paths": {
"/auth/login": {
"post": {
"description": "Validate user credentials and issue a JWT",
"tags": [
"auth"
],
"summary": "Login",
"parameters": [
{
"description": "Login request",
"name": "payload",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/handlers.LoginRequest"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/handlers.LoginResponse"
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"401": {
"description": "Unauthorized",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
}
}
}
},
"/auth/refresh": {
"post": {
"security": [
{
"BearerAuth": []
}
],
"description": "Issue a new JWT using the existing claims with updated expiration",
"tags": [
"auth"
],
"summary": "Refresh Token",
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/handlers.RefreshResponse"
}
},
"401": {
"description": "Unauthorized",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
}
}
}
},
"/bots": {
"get": {
"description": "List bots accessible to current user (admin can specify owner_id)",
"tags": [
"bots"
],
"summary": "List bots",
"parameters": [
{
"type": "string",
"description": "Owner user ID (admin only)",
"name": "owner_id",
"in": "query"
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/bots.ListBotsResponse"
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"403": {
"description": "Forbidden",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
}
}
},
"post": {
"description": "Create a bot user owned by current user (or admin-specified owner)",
"tags": [
"bots"
],
"summary": "Create bot user",
"parameters": [
{
"description": "Bot payload",
"name": "payload",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/bots.CreateBotRequest"
}
}
],
"responses": {
"201": {
"description": "Created",
"schema": {
"$ref": "#/definitions/bots.Bot"
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"403": {
"description": "Forbidden",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
}
}
}
},
"/bots/{bot_id}/cli/messages": {
"post": {
"description": "Post a user message (with optional attachments) through the local channel pipeline.",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"local-channel"
],
"summary": "Send a message to a local channel",
"parameters": [
{
"type": "string",
"description": "Bot ID",
"name": "bot_id",
"in": "path",
"required": true
},
{
"description": "Message payload",
"name": "payload",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/handlers.LocalChannelMessageRequest"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "object",
"additionalProperties": {
"type": "string"
}
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"403": {
"description": "Forbidden",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
}
}
}
},
"/bots/{bot_id}/cli/stream": {
"get": {
"description": "Open a persistent SSE connection to receive real-time stream events for the given bot.",
"produces": [
"text/event-stream"
],
"tags": [
"local-channel"
],
"summary": "Subscribe to local channel events via SSE",
"parameters": [
{
"type": "string",
"description": "Bot ID",
"name": "bot_id",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "SSE stream",
"schema": {
"type": "string"
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"403": {
"description": "Forbidden",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
}
}
}
},
"/bots/{bot_id}/container": {
"get": {
"tags": [
"containerd"
],
"summary": "Get container info for bot",
"parameters": [
{
"type": "string",
"description": "Bot ID",
"name": "bot_id",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/handlers.GetContainerResponse"
}
},
"404": {
"description": "Not Found",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
}
}
},
"post": {
"tags": [
"containerd"
],
"summary": "Create and start MCP container for bot",
"parameters": [
{
"type": "string",
"description": "Bot ID",
"name": "bot_id",
"in": "path",
"required": true
},
{
"description": "Create container payload",
"name": "payload",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/handlers.CreateContainerRequest"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/handlers.CreateContainerResponse"
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
}
}
},
"delete": {
"tags": [
"containerd"
],
"summary": "Delete MCP container for bot",
"parameters": [
{
"type": "string",
"description": "Bot ID",
"name": "bot_id",
"in": "path",
"required": true
}
],
"responses": {
"204": {
"description": "No Content"
},
"404": {
"description": "Not Found",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
}
}
}
},
"/bots/{bot_id}/container/fs": {
"get": {
"description": "Returns metadata about a file or directory at the given container path",
"tags": [
"containerd"
],
"summary": "Get file or directory info",
"parameters": [
{
"type": "string",
"description": "Bot ID",
"name": "bot_id",
"in": "path",
"required": true
},
{
"type": "string",
"description": "Container path",
"name": "path",
"in": "query",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/handlers.FSFileInfo"
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"403": {
"description": "Forbidden",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"404": {
"description": "Not Found",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
}
}
}
},
"/bots/{bot_id}/container/fs/delete": {
"post": {
"description": "Deletes a file or directory at the given container path",
"tags": [
"containerd"
],
"summary": "Delete a file or directory",
"parameters": [
{
"type": "string",
"description": "Bot ID",
"name": "bot_id",
"in": "path",
"required": true
},
{
"description": "Delete request",
"name": "payload",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/handlers.FSDeleteRequest"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/handlers.fsOpResponse"
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"403": {
"description": "Forbidden",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"404": {
"description": "Not Found",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
}
}
}
},
"/bots/{bot_id}/container/fs/download": {
"get": {
"description": "Downloads a file from the container with appropriate Content-Type",
"produces": [
"application/octet-stream"
],
"tags": [
"containerd"
],
"summary": "Download a file as binary stream",
"parameters": [
{
"type": "string",
"description": "Bot ID",
"name": "bot_id",
"in": "path",
"required": true
},
{
"type": "string",
"description": "Container file path",
"name": "path",
"in": "query",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "file"
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"404": {
"description": "Not Found",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
}
}
}
},
"/bots/{bot_id}/container/fs/list": {
"get": {
"description": "Lists files and directories at the given container path",
"tags": [
"containerd"
],
"summary": "List directory contents",
"parameters": [
{
"type": "string",
"description": "Bot ID",
"name": "bot_id",
"in": "path",
"required": true
},
{
"type": "string",
"description": "Container directory path",
"name": "path",
"in": "query",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/handlers.FSListResponse"
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"404": {
"description": "Not Found",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
}
}
}
},
"/bots/{bot_id}/container/fs/mkdir": {
"post": {
"description": "Creates a directory (and parents) at the given container path",
"tags": [
"containerd"
],
"summary": "Create a directory",
"parameters": [
{
"type": "string",
"description": "Bot ID",
"name": "bot_id",
"in": "path",
"required": true
},
{
"description": "Mkdir request",
"name": "payload",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/handlers.FSMkdirRequest"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/handlers.fsOpResponse"
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"403": {
"description": "Forbidden",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
}
}
}
},
"/bots/{bot_id}/container/fs/read": {
"get": {
"description": "Reads the content of a file and returns it as a JSON string",
"tags": [
"containerd"
],
"summary": "Read file content as text",
"parameters": [
{
"type": "string",
"description": "Bot ID",
"name": "bot_id",
"in": "path",
"required": true
},
{
"type": "string",
"description": "Container file path",
"name": "path",
"in": "query",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/handlers.FSReadResponse"
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"404": {
"description": "Not Found",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
}
}
}
},
"/bots/{bot_id}/container/fs/rename": {
"post": {
"description": "Renames or moves a file/directory from oldPath to newPath",
"tags": [
"containerd"
],
"summary": "Rename or move a file/directory",
"parameters": [
{
"type": "string",
"description": "Bot ID",
"name": "bot_id",
"in": "path",
"required": true
},
{
"description": "Rename request",
"name": "payload",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/handlers.FSRenameRequest"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/handlers.fsOpResponse"
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"403": {
"description": "Forbidden",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"404": {
"description": "Not Found",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
}
}
}
},
"/bots/{bot_id}/container/fs/upload": {
"post": {
"description": "Uploads a binary file to the given container path",
"consumes": [
"multipart/form-data"
],
"tags": [
"containerd"
],
"summary": "Upload a file via multipart form",
"parameters": [
{
"type": "string",
"description": "Bot ID",
"name": "bot_id",
"in": "path",
"required": true
},
{
"type": "string",
"description": "Destination container path",
"name": "path",
"in": "formData",
"required": true
},
{
"type": "file",
"description": "File to upload",
"name": "file",
"in": "formData",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/handlers.FSUploadResponse"
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"403": {
"description": "Forbidden",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
}
}
}
},
"/bots/{bot_id}/container/fs/write": {
"post": {
"description": "Creates or overwrites a file with the provided text content",
"tags": [
"containerd"
],
"summary": "Write text content to a file",
"parameters": [
{
"type": "string",
"description": "Bot ID",
"name": "bot_id",
"in": "path",
"required": true
},
{
"description": "Write request",
"name": "payload",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/handlers.FSWriteRequest"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/handlers.fsOpResponse"
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"403": {
"description": "Forbidden",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
}
}
}
},
"/bots/{bot_id}/container/skills": {
"get": {
"tags": [
"containerd"
],
"summary": "List skills from data directory",
"parameters": [
{
"type": "string",
"description": "Bot ID",
"name": "bot_id",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/handlers.SkillsResponse"
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"404": {
"description": "Not Found",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
}
}
},
"post": {
"tags": [
"containerd"
],
"summary": "Upload skills into data directory",
"parameters": [
{
"type": "string",
"description": "Bot ID",
"name": "bot_id",
"in": "path",
"required": true
},
{
"description": "Skills payload",
"name": "payload",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/handlers.SkillsUpsertRequest"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/handlers.skillsOpResponse"
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"404": {
"description": "Not Found",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
}
}
},
"delete": {
"tags": [
"containerd"
],
"summary": "Delete skills from data directory",
"parameters": [
{
"type": "string",
"description": "Bot ID",
"name": "bot_id",
"in": "path",
"required": true
},
{
"description": "Delete skills payload",
"name": "payload",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/handlers.SkillsDeleteRequest"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/handlers.skillsOpResponse"
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"404": {
"description": "Not Found",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
}
}
}
},
"/bots/{bot_id}/container/snapshots": {
"get": {
"tags": [
"containerd"
],
"summary": "List snapshots",
"parameters": [
{
"type": "string",
"description": "Bot ID",
"name": "bot_id",
"in": "path",
"required": true
},
{
"type": "string",
"description": "Snapshotter name",
"name": "snapshotter",
"in": "query"
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/handlers.ListSnapshotsResponse"
}
},
"501": {
"description": "Snapshots currently not supported on this backend",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
}
}
},
"post": {
"tags": [
"containerd"
],
"summary": "Create container snapshot for bot",
"parameters": [
{
"type": "string",
"description": "Bot ID",
"name": "bot_id",
"in": "path",
"required": true
},
{
"description": "Create snapshot payload",
"name": "payload",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/handlers.CreateSnapshotRequest"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/handlers.CreateSnapshotResponse"
}
},
"404": {
"description": "Not Found",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"501": {
"description": "Snapshots currently not supported on this backend",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
}
}
}
},
"/bots/{bot_id}/container/start": {
"post": {
"tags": [
"containerd"
],
"summary": "Start container task for bot",
"parameters": [
{
"type": "string",
"description": "Bot ID",
"name": "bot_id",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "object"
}
},
"404": {
"description": "Not Found",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
}
}
}
},
"/bots/{bot_id}/container/stop": {
"post": {
"tags": [
"containerd"
],
"summary": "Stop container task for bot",
"parameters": [
{
"type": "string",
"description": "Bot ID",
"name": "bot_id",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "object"
}
},
"404": {
"description": "Not Found",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
}
}
}
},
"/bots/{bot_id}/email-bindings": {
"get": {
"produces": [
"application/json"
],
"tags": [
"email-bindings"
],
"summary": "List email bindings for a bot",
"parameters": [
{
"type": "string",
"description": "Bot ID",
"name": "bot_id",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "array",
"items": {
"$ref": "#/definitions/email.BindingResponse"
}
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
}
}
},
"post": {
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"email-bindings"
],
"summary": "Bind an email provider to a bot",
"parameters": [
{
"type": "string",
"description": "Bot ID",
"name": "bot_id",
"in": "path",
"required": true
},
{
"description": "Binding configuration",
"name": "request",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/email.CreateBindingRequest"
}
}
],
"responses": {
"201": {
"description": "Created",
"schema": {
"$ref": "#/definitions/email.BindingResponse"
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
}
}
}
},
"/bots/{bot_id}/email-bindings/{id}": {
"put": {
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"email-bindings"
],
"summary": "Update an email binding",
"parameters": [
{
"type": "string",
"description": "Bot ID",
"name": "bot_id",
"in": "path",
"required": true
},
{
"type": "string",
"description": "Binding ID",
"name": "id",
"in": "path",
"required": true
},
{
"description": "Updated binding",
"name": "request",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/email.UpdateBindingRequest"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/email.BindingResponse"
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
}
}
},
"delete": {
"tags": [
"email-bindings"
],
"summary": "Remove an email binding",
"parameters": [
{
"type": "string",
"description": "Bot ID",
"name": "bot_id",
"in": "path",
"required": true
},
{
"type": "string",
"description": "Binding ID",
"name": "id",
"in": "path",
"required": true
}
],
"responses": {
"204": {
"description": "No Content"
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
}
}
}
},
"/bots/{bot_id}/email-outbox": {
"get": {
"produces": [
"application/json"
],
"tags": [
"email-outbox"
],
"summary": "List outbox emails for a bot (audit)",
"parameters": [
{
"type": "string",
"description": "Bot ID",
"name": "bot_id",
"in": "path",
"required": true
},
{
"type": "integer",
"default": 20,
"description": "Limit",
"name": "limit",
"in": "query"
},
{
"type": "integer",
"default": 0,
"description": "Offset",
"name": "offset",
"in": "query"
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "object",
"additionalProperties": true
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
}
}
}
},
"/bots/{bot_id}/email-outbox/{id}": {
"get": {
"produces": [
"application/json"
],
"tags": [
"email-outbox"
],
"summary": "Get outbox email detail",
"parameters": [
{
"type": "string",
"description": "Bot ID",
"name": "bot_id",
"in": "path",
"required": true
},
{
"type": "string",
"description": "Email ID",
"name": "id",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/email.OutboxItemResponse"
}
},
"404": {
"description": "Not Found",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
}
}
}
},
"/bots/{bot_id}/heartbeat/logs": {
"get": {
"description": "List heartbeat execution logs for a bot",
"tags": [
"heartbeat"
],
"summary": "List heartbeat logs",
"parameters": [
{
"type": "string",
"description": "Bot ID",
"name": "bot_id",
"in": "path",
"required": true
},
{
"type": "string",
"description": "Before timestamp (RFC3339)",
"name": "before",
"in": "query"
},
{
"type": "integer",
"default": 50,
"description": "Limit",
"name": "limit",
"in": "query"
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/heartbeat.ListLogsResponse"
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
}
}
},
"delete": {
"description": "Delete all heartbeat execution logs for a bot",
"tags": [
"heartbeat"
],
"summary": "Delete heartbeat logs",
"parameters": [
{
"type": "string",
"description": "Bot ID",
"name": "bot_id",
"in": "path",
"required": true
}
],
"responses": {
"204": {
"description": "No Content"
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
}
}
}
},
"/bots/{bot_id}/inbox": {
"get": {
"description": "List inbox items for a bot with optional filters",
"tags": [
"inbox"
],
"summary": "List inbox items",
"parameters": [
{
"type": "string",
"description": "Bot ID",
"name": "bot_id",
"in": "path",
"required": true
},
{
"type": "string",
"description": "Filter by read status (true/false)",
"name": "is_read",
"in": "query"
},
{
"type": "string",
"description": "Filter by source",
"name": "source",
"in": "query"
},
{
"type": "integer",
"default": 50,
"description": "Max items to return",
"name": "limit",
"in": "query"
},
{
"type": "integer",
"default": 0,
"description": "Offset for pagination",
"name": "offset",
"in": "query"
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "array",
"items": {
"$ref": "#/definitions/inbox.Item"
}
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
}
}
},
"post": {
"description": "Create a new inbox item (for external integrations)",
"tags": [
"inbox"
],
"summary": "Create inbox item",
"parameters": [
{
"type": "string",
"description": "Bot ID",
"name": "bot_id",
"in": "path",
"required": true
},
{
"description": "Inbox item payload",
"name": "payload",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/inbox.CreateRequest"
}
}
],
"responses": {
"201": {
"description": "Created",
"schema": {
"$ref": "#/definitions/inbox.Item"
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
}
}
}
},
"/bots/{bot_id}/inbox/count": {
"get": {
"description": "Count unread and total inbox items",
"tags": [
"inbox"
],
"summary": "Count inbox items",
"parameters": [
{
"type": "string",
"description": "Bot ID",
"name": "bot_id",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/inbox.CountResult"
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
}
}
}
},
"/bots/{bot_id}/inbox/mark-read": {
"post": {
"description": "Batch mark inbox items as read",
"tags": [
"inbox"
],
"summary": "Mark inbox items as read",
"parameters": [
{
"type": "string",
"description": "Bot ID",
"name": "bot_id",
"in": "path",
"required": true
},
{
"description": "Item IDs to mark as read",
"name": "payload",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/handlers.markReadRequest"
}
}
],
"responses": {
"204": {
"description": "No Content"
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
}
}
}
},
"/bots/{bot_id}/inbox/{id}": {
"get": {
"description": "Get a single inbox item by ID",
"tags": [
"inbox"
],
"summary": "Get inbox item",
"parameters": [
{
"type": "string",
"description": "Bot ID",
"name": "bot_id",
"in": "path",
"required": true
},
{
"type": "string",
"description": "Inbox item ID",
"name": "id",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/inbox.Item"
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"404": {
"description": "Not Found",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
}
}
},
"delete": {
"description": "Delete a single inbox item",
"tags": [
"inbox"
],
"summary": "Delete inbox item",
"parameters": [
{
"type": "string",
"description": "Bot ID",
"name": "bot_id",
"in": "path",
"required": true
},
{
"type": "string",
"description": "Inbox item ID",
"name": "id",
"in": "path",
"required": true
}
],
"responses": {
"204": {
"description": "No Content"
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
}
}
}
},
"/bots/{bot_id}/mcp": {
"get": {
"description": "List MCP connections for a bot",
"tags": [
"mcp"
],
"summary": "List MCP connections",
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/mcp.ListResponse"
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"403": {
"description": "Forbidden",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"404": {
"description": "Not Found",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
}
}
},
"post": {
"description": "Create a MCP connection for a bot",
"tags": [
"mcp"
],
"summary": "Create MCP connection",
"parameters": [
{
"description": "MCP payload",
"name": "payload",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/mcp.UpsertRequest"
}
}
],
"responses": {
"201": {
"description": "Created",
"schema": {
"$ref": "#/definitions/github_com_memohai_memoh_internal_mcp.Connection"
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"403": {
"description": "Forbidden",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"404": {
"description": "Not Found",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
}
}
}
},
"/bots/{bot_id}/mcp-ops/batch-delete": {
"post": {
"description": "Delete multiple MCP connections by IDs.",
"tags": [
"mcp"
],
"summary": "Batch delete MCP connections",
"parameters": [
{
"description": "IDs to delete",
"name": "payload",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/handlers.BatchDeleteRequest"
}
}
],
"responses": {
"204": {
"description": "No Content"
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"403": {
"description": "Forbidden",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
}
}
}
},
"/bots/{bot_id}/mcp-stdio": {
"post": {
"description": "Start a stdio MCP process in the bot container and expose it as MCP HTTP endpoint.",
"tags": [
"containerd"
],
"summary": "Create MCP stdio proxy",
"parameters": [
{
"type": "string",
"description": "Bot ID",
"name": "bot_id",
"in": "path",
"required": true
},
{
"description": "Stdio MCP payload",
"name": "payload",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/handlers.MCPStdioRequest"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/handlers.MCPStdioResponse"
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"404": {
"description": "Not Found",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
}
}
}
},
"/bots/{bot_id}/mcp-stdio/{connection_id}": {
"post": {
"description": "Proxies MCP JSON-RPC requests to a stdio MCP process in the container.",
"tags": [
"containerd"
],
"summary": "MCP stdio proxy (JSON-RPC)",
"parameters": [
{
"type": "string",
"description": "Bot ID",
"name": "bot_id",
"in": "path",
"required": true
},
{
"type": "string",
"description": "Connection ID",
"name": "connection_id",
"in": "path",
"required": true
},
{
"description": "JSON-RPC request",
"name": "payload",
"in": "body",
"required": true,
"schema": {
"type": "object"
}
}
],
"responses": {
"200": {
"description": "JSON-RPC response: {jsonrpc,id,result|error}",
"schema": {
"type": "object"
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"404": {
"description": "Not Found",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
}
}
}
},
"/bots/{bot_id}/mcp/export": {
"get": {
"description": "Export all MCP connections for a bot in standard mcpServers format.",
"tags": [
"mcp"
],
"summary": "Export MCP connections",
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/mcp.ExportResponse"
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"403": {
"description": "Forbidden",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
}
}
}
},
"/bots/{bot_id}/mcp/import": {
"put": {
"description": "Batch import MCP connections from standard mcpServers format. Existing connections (matched by name) get config updated with is_active preserved. New connections are created as active.",
"tags": [
"mcp"
],
"summary": "Import MCP connections",
"parameters": [
{
"description": "mcpServers dict",
"name": "payload",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/mcp.ImportRequest"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/mcp.ListResponse"
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"403": {
"description": "Forbidden",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
}
}
}
},
"/bots/{bot_id}/mcp/{id}": {
"get": {
"description": "Get a MCP connection by ID",
"tags": [
"mcp"
],
"summary": "Get MCP connection",
"parameters": [
{
"type": "string",
"description": "MCP ID",
"name": "id",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/github_com_memohai_memoh_internal_mcp.Connection"
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"403": {
"description": "Forbidden",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"404": {
"description": "Not Found",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
}
}
},
"put": {
"description": "Update a MCP connection by ID",
"tags": [
"mcp"
],
"summary": "Update MCP connection",
"parameters": [
{
"type": "string",
"description": "MCP ID",
"name": "id",
"in": "path",
"required": true
},
{
"description": "MCP payload",
"name": "payload",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/mcp.UpsertRequest"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/github_com_memohai_memoh_internal_mcp.Connection"
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"403": {
"description": "Forbidden",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"404": {
"description": "Not Found",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
}
}
},
"delete": {
"description": "Delete a MCP connection by ID",
"tags": [
"mcp"
],
"summary": "Delete MCP connection",
"parameters": [
{
"type": "string",
"description": "MCP ID",
"name": "id",
"in": "path",
"required": true
}
],
"responses": {
"204": {
"description": "No Content"
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"403": {
"description": "Forbidden",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"404": {
"description": "Not Found",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
}
}
}
},
"/bots/{bot_id}/memory": {
"get": {
"description": "List all memories in the bot-shared namespace",
"produces": [
"application/json"
],
"tags": [
"memory"
],
"summary": "Get all memories",
"parameters": [
{
"type": "string",
"description": "Bot ID",
"name": "bot_id",
"in": "path",
"required": true
},
{
"type": "boolean",
"description": "Skip sparse vector stats (top_k_buckets, cdf_curve) to reduce overhead",
"name": "no_stats",
"in": "query"
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/memory.SearchResponse"
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"403": {
"description": "Forbidden",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"503": {
"description": "Service Unavailable",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
}
}
},
"post": {
"description": "Add memory into the bot-shared namespace",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"memory"
],
"summary": "Add memory",
"parameters": [
{
"type": "string",
"description": "Bot ID",
"name": "bot_id",
"in": "path",
"required": true
},
{
"description": "Memory add payload",
"name": "payload",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/handlers.memoryAddPayload"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/memory.SearchResponse"
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"403": {
"description": "Forbidden",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"503": {
"description": "Service Unavailable",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
}
}
},
"delete": {
"description": "Delete specific memories by IDs, or delete all memories if no IDs are provided",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"memory"
],
"summary": "Delete memories",
"parameters": [
{
"type": "string",
"description": "Bot ID",
"name": "bot_id",
"in": "path",
"required": true
},
{
"description": "Optional: specify memory_ids to delete; if omitted, deletes all",
"name": "payload",
"in": "body",
"schema": {
"$ref": "#/definitions/handlers.memoryDeletePayload"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/memory.DeleteResponse"
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"403": {
"description": "Forbidden",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"503": {
"description": "Service Unavailable",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
}
}
}
},
"/bots/{bot_id}/memory/compact": {
"post": {
"description": "Consolidate memories by merging similar/redundant entries using LLM.\n\n**ratio** (required, range (0,1]):\n- 0.8 = light compression, mostly dedup, keep ~80% of entries\n- 0.5 = moderate compression, merge similar facts, keep ~50%\n- 0.3 = aggressive compression, heavily consolidate, keep ~30%\n\n**decay_days** (optional): enable time decay — memories older than N days are treated as low priority and more likely to be merged/dropped.",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"memory"
],
"summary": "Compact memories",
"parameters": [
{
"type": "string",
"description": "Bot ID",
"name": "bot_id",
"in": "path",
"required": true
},
{
"description": "ratio (0,1] required; decay_days optional",
"name": "payload",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/handlers.memoryCompactPayload"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/memory.CompactResult"
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"403": {
"description": "Forbidden",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"503": {
"description": "Service Unavailable",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
}
}
}
},
"/bots/{bot_id}/memory/rebuild": {
"post": {
"description": "Read memory files from the container filesystem (source of truth) and restore missing entries to Qdrant",
"produces": [
"application/json"
],
"tags": [
"memory"
],
"summary": "Rebuild memories from filesystem",
"parameters": [
{
"type": "string",
"description": "Bot ID",
"name": "bot_id",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/memory.RebuildResult"
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"403": {
"description": "Forbidden",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"503": {
"description": "Service Unavailable",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
}
}
}
},
"/bots/{bot_id}/memory/search": {
"post": {
"description": "Search memory in the bot-shared namespace",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"memory"
],
"summary": "Search memory",
"parameters": [
{
"type": "string",
"description": "Bot ID",
"name": "bot_id",
"in": "path",
"required": true
},
{
"description": "Memory search payload",
"name": "payload",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/handlers.memorySearchPayload"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/memory.SearchResponse"
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"403": {
"description": "Forbidden",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"404": {
"description": "Not Found",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"503": {
"description": "Service Unavailable",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
}
}
}
},
"/bots/{bot_id}/memory/usage": {
"get": {
"description": "Query the estimated storage usage of current memories",
"produces": [
"application/json"
],
"tags": [
"memory"
],
"summary": "Get memory usage",
"parameters": [
{
"type": "string",
"description": "Bot ID",
"name": "bot_id",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/memory.UsageResponse"
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"403": {
"description": "Forbidden",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"503": {
"description": "Service Unavailable",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
}
}
}
},
"/bots/{bot_id}/memory/{id}": {
"delete": {
"description": "Delete a single memory by its ID",
"produces": [
"application/json"
],
"tags": [
"memory"
],
"summary": "Delete a single memory",
"parameters": [
{
"type": "string",
"description": "Bot ID",
"name": "bot_id",
"in": "path",
"required": true
},
{
"type": "string",
"description": "Memory ID",
"name": "id",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/memory.DeleteResponse"
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"403": {
"description": "Forbidden",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"503": {
"description": "Service Unavailable",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
}
}
}
},
"/bots/{bot_id}/messages": {
"get": {
"description": "List messages for a bot history with optional pagination",
"produces": [
"application/json"
],
"tags": [
"messages"
],
"summary": "List bot history messages",
"parameters": [
{
"type": "string",
"description": "Bot ID",
"name": "bot_id",
"in": "path",
"required": true
},
{
"type": "integer",
"description": "Limit",
"name": "limit",
"in": "query"
},
{
"type": "string",
"description": "Before",
"name": "before",
"in": "query"
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "object",
"additionalProperties": {
"type": "array",
"items": {
"$ref": "#/definitions/message.Message"
}
}
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"403": {
"description": "Forbidden",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
}
}
},
"delete": {
"description": "Clear all persisted bot-level history messages",
"produces": [
"application/json"
],
"tags": [
"messages"
],
"summary": "Delete all bot history messages",
"parameters": [
{
"type": "string",
"description": "Bot ID",
"name": "bot_id",
"in": "path",
"required": true
}
],
"responses": {
"204": {
"description": "No Content"
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"403": {
"description": "Forbidden",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
}
}
}
},
"/bots/{bot_id}/schedule": {
"get": {
"description": "List schedules for current user",
"tags": [
"schedule"
],
"summary": "List schedules",
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/schedule.ListResponse"
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
}
}
},
"post": {
"description": "Create a schedule for current user",
"tags": [
"schedule"
],
"summary": "Create schedule",
"parameters": [
{
"description": "Schedule payload",
"name": "payload",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/schedule.CreateRequest"
}
}
],
"responses": {
"201": {
"description": "Created",
"schema": {
"$ref": "#/definitions/schedule.Schedule"
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
}
}
}
},
"/bots/{bot_id}/schedule/{id}": {
"get": {
"description": "Get a schedule by ID",
"tags": [
"schedule"
],
"summary": "Get schedule",
"parameters": [
{
"type": "string",
"description": "Schedule ID",
"name": "id",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/schedule.Schedule"
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"404": {
"description": "Not Found",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
}
}
},
"put": {
"description": "Update a schedule by ID",
"tags": [
"schedule"
],
"summary": "Update schedule",
"parameters": [
{
"type": "string",
"description": "Schedule ID",
"name": "id",
"in": "path",
"required": true
},
{
"description": "Schedule payload",
"name": "payload",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/schedule.UpdateRequest"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/schedule.Schedule"
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
}
}
},
"delete": {
"description": "Delete a schedule by ID",
"tags": [
"schedule"
],
"summary": "Delete schedule",
"parameters": [
{
"type": "string",
"description": "Schedule ID",
"name": "id",
"in": "path",
"required": true
}
],
"responses": {
"204": {
"description": "No Content"
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
}
}
}
},
"/bots/{bot_id}/settings": {
"get": {
"description": "Get agent settings for current user",
"tags": [
"settings"
],
"summary": "Get user settings",
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/settings.Settings"
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
}
}
},
"put": {
"description": "Update or create agent settings for current user",
"tags": [
"settings"
],
"summary": "Update user settings",
"parameters": [
{
"description": "Settings payload",
"name": "payload",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/settings.UpsertRequest"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/settings.Settings"
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
}
}
},
"post": {
"description": "Update or create agent settings for current user",
"tags": [
"settings"
],
"summary": "Update user settings",
"parameters": [
{
"description": "Settings payload",
"name": "payload",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/settings.UpsertRequest"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/settings.Settings"
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
}
}
},
"delete": {
"description": "Remove agent settings for current user",
"tags": [
"settings"
],
"summary": "Delete user settings",
"responses": {
"204": {
"description": "No Content"
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
}
}
}
},
"/bots/{bot_id}/subagents": {
"get": {
"description": "List subagents for current user",
"tags": [
"subagent"
],
"summary": "List subagents",
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/subagent.ListResponse"
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
}
}
},
"post": {
"description": "Create a subagent for current user",
"tags": [
"subagent"
],
"summary": "Create subagent",
"parameters": [
{
"description": "Subagent payload",
"name": "payload",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/subagent.CreateRequest"
}
}
],
"responses": {
"201": {
"description": "Created",
"schema": {
"$ref": "#/definitions/subagent.Subagent"
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
}
}
}
},
"/bots/{bot_id}/subagents/{id}": {
"get": {
"description": "Get a subagent by ID",
"tags": [
"subagent"
],
"summary": "Get subagent",
"parameters": [
{
"type": "string",
"description": "Subagent ID",
"name": "id",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/subagent.Subagent"
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"404": {
"description": "Not Found",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
}
}
},
"put": {
"description": "Update a subagent by ID",
"tags": [
"subagent"
],
"summary": "Update subagent",
"parameters": [
{
"type": "string",
"description": "Subagent ID",
"name": "id",
"in": "path",
"required": true
},
{
"description": "Subagent payload",
"name": "payload",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/subagent.UpdateRequest"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/subagent.Subagent"
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"404": {
"description": "Not Found",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
}
}
},
"delete": {
"description": "Delete a subagent by ID",
"tags": [
"subagent"
],
"summary": "Delete subagent",
"parameters": [
{
"type": "string",
"description": "Subagent ID",
"name": "id",
"in": "path",
"required": true
}
],
"responses": {
"204": {
"description": "No Content"
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"404": {
"description": "Not Found",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
}
}
}
},
"/bots/{bot_id}/subagents/{id}/context": {
"get": {
"description": "Get a subagent's message context",
"tags": [
"subagent"
],
"summary": "Get subagent context",
"parameters": [
{
"type": "string",
"description": "Subagent ID",
"name": "id",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/subagent.ContextResponse"
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"404": {
"description": "Not Found",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
}
}
},
"put": {
"description": "Update a subagent's message context",
"tags": [
"subagent"
],
"summary": "Update subagent context",
"parameters": [
{
"type": "string",
"description": "Subagent ID",
"name": "id",
"in": "path",
"required": true
},
{
"description": "Context payload",
"name": "payload",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/subagent.UpdateContextRequest"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/subagent.ContextResponse"
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"404": {
"description": "Not Found",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
}
}
}
},
"/bots/{bot_id}/subagents/{id}/skills": {
"get": {
"description": "Get a subagent's skills",
"tags": [
"subagent"
],
"summary": "Get subagent skills",
"parameters": [
{
"type": "string",
"description": "Subagent ID",
"name": "id",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/subagent.SkillsResponse"
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"404": {
"description": "Not Found",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
}
}
},
"put": {
"description": "Replace a subagent's skills",
"tags": [
"subagent"
],
"summary": "Update subagent skills",
"parameters": [
{
"type": "string",
"description": "Subagent ID",
"name": "id",
"in": "path",
"required": true
},
{
"description": "Skills payload",
"name": "payload",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/subagent.UpdateSkillsRequest"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/subagent.SkillsResponse"
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"404": {
"description": "Not Found",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
}
}
},
"post": {
"description": "Add skills to a subagent",
"tags": [
"subagent"
],
"summary": "Add subagent skills",
"parameters": [
{
"type": "string",
"description": "Subagent ID",
"name": "id",
"in": "path",
"required": true
},
{
"description": "Skills payload",
"name": "payload",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/subagent.AddSkillsRequest"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/subagent.SkillsResponse"
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"404": {
"description": "Not Found",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
}
}
}
},
"/bots/{bot_id}/tools": {
"post": {
"description": "MCP endpoint for tool discovery and invocation.",
"tags": [
"containerd"
],
"summary": "Unified MCP tools gateway",
"parameters": [
{
"type": "string",
"description": "Bot ID",
"name": "bot_id",
"in": "path",
"required": true
},
{
"description": "JSON-RPC request",
"name": "payload",
"in": "body",
"required": true,
"schema": {
"type": "object"
}
}
],
"responses": {
"200": {
"description": "JSON-RPC response: {jsonrpc,id,result|error}",
"schema": {
"type": "object"
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"404": {
"description": "Not Found",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
}
}
}
},
"/bots/{bot_id}/web/messages": {
"post": {
"description": "Post a user message (with optional attachments) through the local channel pipeline.",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"local-channel"
],
"summary": "Send a message to a local channel",
"parameters": [
{
"type": "string",
"description": "Bot ID",
"name": "bot_id",
"in": "path",
"required": true
},
{
"description": "Message payload",
"name": "payload",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/handlers.LocalChannelMessageRequest"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "object",
"additionalProperties": {
"type": "string"
}
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"403": {
"description": "Forbidden",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
}
}
}
},
"/bots/{bot_id}/web/stream": {
"get": {
"description": "Open a persistent SSE connection to receive real-time stream events for the given bot.",
"produces": [
"text/event-stream"
],
"tags": [
"local-channel"
],
"summary": "Subscribe to local channel events via SSE",
"parameters": [
{
"type": "string",
"description": "Bot ID",
"name": "bot_id",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "SSE stream",
"schema": {
"type": "string"
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"403": {
"description": "Forbidden",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
}
}
}
},
"/bots/{id}": {
"get": {
"description": "Get a bot by ID (owner/admin only)",
"tags": [
"bots"
],
"summary": "Get bot details",
"parameters": [
{
"type": "string",
"description": "Bot ID",
"name": "id",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/bots.Bot"
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"403": {
"description": "Forbidden",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"404": {
"description": "Not Found",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
}
}
},
"put": {
"description": "Update bot profile (owner/admin only)",
"tags": [
"bots"
],
"summary": "Update bot details",
"parameters": [
{
"type": "string",
"description": "Bot ID",
"name": "id",
"in": "path",
"required": true
},
{
"description": "Bot update payload",
"name": "payload",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/bots.UpdateBotRequest"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/bots.Bot"
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"403": {
"description": "Forbidden",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"404": {
"description": "Not Found",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
}
}
},
"delete": {
"description": "Delete a bot user (owner/admin only)",
"tags": [
"bots"
],
"summary": "Delete bot",
"parameters": [
{
"type": "string",
"description": "Bot ID",
"name": "id",
"in": "path",
"required": true
}
],
"responses": {
"202": {
"description": "Accepted",
"schema": {
"type": "object",
"additionalProperties": {
"type": "string"
}
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"403": {
"description": "Forbidden",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"404": {
"description": "Not Found",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
}
}
}
},
"/bots/{id}/channel/{platform}": {
"get": {
"description": "Get bot channel configuration",
"tags": [
"bots"
],
"summary": "Get bot channel config",
"parameters": [
{
"type": "string",
"description": "Bot ID",
"name": "id",
"in": "path",
"required": true
},
{
"type": "string",
"description": "Channel platform",
"name": "platform",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/channel.ChannelConfig"
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"403": {
"description": "Forbidden",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"404": {
"description": "Not Found",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
}
}
},
"put": {
"description": "Update bot channel configuration",
"tags": [
"bots"
],
"summary": "Update bot channel config",
"parameters": [
{
"type": "string",
"description": "Bot ID",
"name": "id",
"in": "path",
"required": true
},
{
"type": "string",
"description": "Channel platform",
"name": "platform",
"in": "path",
"required": true
},
{
"description": "Channel config payload",
"name": "payload",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/channel.UpsertConfigRequest"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/channel.ChannelConfig"
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"403": {
"description": "Forbidden",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"404": {
"description": "Not Found",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
}
}
},
"delete": {
"description": "Remove bot channel configuration",
"tags": [
"bots"
],
"summary": "Delete bot channel config",
"parameters": [
{
"type": "string",
"description": "Bot ID",
"name": "id",
"in": "path",
"required": true
},
{
"type": "string",
"description": "Channel platform",
"name": "platform",
"in": "path",
"required": true
}
],
"responses": {
"204": {
"description": "No Content"
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"403": {
"description": "Forbidden",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
}
}
}
},
"/bots/{id}/channel/{platform}/send": {
"post": {
"description": "Send a message using bot channel configuration",
"tags": [
"bots"
],
"summary": "Send message via bot channel",
"parameters": [
{
"type": "string",
"description": "Bot ID",
"name": "id",
"in": "path",
"required": true
},
{
"type": "string",
"description": "Channel platform",
"name": "platform",
"in": "path",
"required": true
},
{
"description": "Send payload",
"name": "payload",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/channel.SendRequest"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "object",
"additionalProperties": {
"type": "string"
}
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"403": {
"description": "Forbidden",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"404": {
"description": "Not Found",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
}
}
}
},
"/bots/{id}/channel/{platform}/send_chat": {
"post": {
"description": "Send a message using a session-scoped token (reply only)",
"tags": [
"bots"
],
"summary": "Send message via bot channel session token",
"parameters": [
{
"type": "string",
"description": "Bot ID",
"name": "id",
"in": "path",
"required": true
},
{
"type": "string",
"description": "Channel platform",
"name": "platform",
"in": "path",
"required": true
},
{
"description": "Send payload",
"name": "payload",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/channel.SendRequest"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "object",
"additionalProperties": {
"type": "string"
}
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"401": {
"description": "Unauthorized",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"403": {
"description": "Forbidden",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
}
}
}
},
"/bots/{id}/channel/{platform}/status": {
"patch": {
"description": "Update bot channel enabled/disabled status",
"tags": [
"bots"
],
"summary": "Update bot channel status",
"parameters": [
{
"type": "string",
"description": "Bot ID",
"name": "id",
"in": "path",
"required": true
},
{
"type": "string",
"description": "Channel platform",
"name": "platform",
"in": "path",
"required": true
},
{
"description": "Channel status payload",
"name": "payload",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/channel.UpdateChannelStatusRequest"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/channel.ChannelConfig"
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"403": {
"description": "Forbidden",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"404": {
"description": "Not Found",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
}
}
}
},
"/bots/{id}/checks": {
"get": {
"description": "Evaluate bot attached resource checks in runtime",
"tags": [
"bots"
],
"summary": "List bot runtime checks",
"parameters": [
{
"type": "string",
"description": "Bot ID",
"name": "id",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/bots.ListChecksResponse"
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"403": {
"description": "Forbidden",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"404": {
"description": "Not Found",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
}
}
}
},
"/bots/{id}/members": {
"get": {
"description": "List members for a bot",
"tags": [
"bots"
],
"summary": "List bot members",
"parameters": [
{
"type": "string",
"description": "Bot ID",
"name": "id",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/bots.ListMembersResponse"
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"403": {
"description": "Forbidden",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"404": {
"description": "Not Found",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
}
}
},
"put": {
"description": "Add or update bot member role",
"tags": [
"bots"
],
"summary": "Upsert bot member",
"parameters": [
{
"type": "string",
"description": "Bot ID",
"name": "id",
"in": "path",
"required": true
},
{
"description": "Member payload",
"name": "payload",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/bots.UpsertMemberRequest"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/bots.BotMember"
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"403": {
"description": "Forbidden",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"404": {
"description": "Not Found",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
}
}
}
},
"/bots/{id}/members/{user_id}": {
"delete": {
"description": "Remove a member from a bot",
"tags": [
"bots"
],
"summary": "Delete bot member",
"parameters": [
{
"type": "string",
"description": "Bot ID",
"name": "id",
"in": "path",
"required": true
},
{
"type": "string",
"description": "User ID",
"name": "user_id",
"in": "path",
"required": true
}
],
"responses": {
"204": {
"description": "No Content"
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"403": {
"description": "Forbidden",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"404": {
"description": "Not Found",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
}
}
}
},
"/bots/{id}/owner": {
"put": {
"description": "Transfer bot ownership to another human user",
"tags": [
"bots"
],
"summary": "Transfer bot owner (admin only)",
"parameters": [
{
"type": "string",
"description": "Bot ID",
"name": "id",
"in": "path",
"required": true
},
{
"description": "Transfer payload",
"name": "payload",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/bots.TransferBotRequest"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/bots.Bot"
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"403": {
"description": "Forbidden",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"404": {
"description": "Not Found",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
}
}
}
},
"/channels": {
"get": {
"description": "List channel meta information including capabilities and schemas",
"tags": [
"channel"
],
"summary": "List channel capabilities and schemas",
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "array",
"items": {
"$ref": "#/definitions/handlers.ChannelMeta"
}
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
}
}
}
},
"/channels/{platform}": {
"get": {
"description": "Get channel meta information including capabilities and schemas",
"tags": [
"channel"
],
"summary": "Get channel capabilities and schemas",
"parameters": [
{
"type": "string",
"description": "Channel platform",
"name": "platform",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/handlers.ChannelMeta"
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"404": {
"description": "Not Found",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
}
}
}
},
"/email-providers": {
"get": {
"produces": [
"application/json"
],
"tags": [
"email-providers"
],
"summary": "List email providers",
"parameters": [
{
"type": "string",
"description": "Provider type filter",
"name": "provider",
"in": "query"
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "array",
"items": {
"$ref": "#/definitions/email.ProviderResponse"
}
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
}
}
},
"post": {
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"email-providers"
],
"summary": "Create an email provider",
"parameters": [
{
"description": "Email provider configuration",
"name": "request",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/email.CreateProviderRequest"
}
}
],
"responses": {
"201": {
"description": "Created",
"schema": {
"$ref": "#/definitions/email.ProviderResponse"
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
}
}
}
},
"/email-providers/meta": {
"get": {
"description": "List available email provider types and config schemas",
"tags": [
"email-providers"
],
"summary": "List email provider metadata",
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "array",
"items": {
"$ref": "#/definitions/email.ProviderMeta"
}
}
}
}
}
},
"/email-providers/{id}": {
"get": {
"produces": [
"application/json"
],
"tags": [
"email-providers"
],
"summary": "Get an email provider",
"parameters": [
{
"type": "string",
"description": "Provider ID",
"name": "id",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/email.ProviderResponse"
}
},
"404": {
"description": "Not Found",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
}
}
},
"put": {
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"email-providers"
],
"summary": "Update an email provider",
"parameters": [
{
"type": "string",
"description": "Provider ID",
"name": "id",
"in": "path",
"required": true
},
{
"description": "Updated configuration",
"name": "request",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/email.UpdateProviderRequest"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/email.ProviderResponse"
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
}
}
},
"delete": {
"tags": [
"email-providers"
],
"summary": "Delete an email provider",
"parameters": [
{
"type": "string",
"description": "Provider ID",
"name": "id",
"in": "path",
"required": true
}
],
"responses": {
"204": {
"description": "No Content"
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
}
}
}
},
"/email/mailgun/webhook/{config_id}": {
"post": {
"description": "Receives inbound emails from Mailgun",
"tags": [
"email-webhook"
],
"summary": "Mailgun inbound email webhook",
"parameters": [
{
"type": "string",
"description": "Email provider config ID",
"name": "config_id",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "object",
"additionalProperties": {
"type": "string"
}
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"403": {
"description": "Forbidden",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
}
}
}
},
"/embeddings": {
"post": {
"description": "Create text or multimodal embeddings",
"tags": [
"embeddings"
],
"summary": "Create embeddings",
"parameters": [
{
"description": "Embeddings request",
"name": "payload",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/handlers.EmbeddingsRequest"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/handlers.EmbeddingsResponse"
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"501": {
"description": "Not Implemented",
"schema": {
"$ref": "#/definitions/handlers.EmbeddingsResponse"
}
}
}
}
},
"/models": {
"get": {
"description": "Get a list of all configured models, optionally filtered by type or client type",
"tags": [
"models"
],
"summary": "List all models",
"parameters": [
{
"type": "string",
"description": "Model type (chat, embedding)",
"name": "type",
"in": "query"
},
{
"type": "string",
"description": "Client type (openai-responses, openai-completions, anthropic-messages, google-generative-ai)",
"name": "client_type",
"in": "query"
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "array",
"items": {
"$ref": "#/definitions/models.GetResponse"
}
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
}
}
},
"post": {
"description": "Create a new model configuration",
"tags": [
"models"
],
"summary": "Create a new model",
"parameters": [
{
"description": "Model configuration",
"name": "payload",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/models.AddRequest"
}
}
],
"responses": {
"201": {
"description": "Created",
"schema": {
"$ref": "#/definitions/models.AddResponse"
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
}
}
}
},
"/models/count": {
"get": {
"description": "Get the total count of models, optionally filtered by type",
"tags": [
"models"
],
"summary": "Get model count",
"parameters": [
{
"type": "string",
"description": "Model type (chat, embedding)",
"name": "type",
"in": "query"
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/models.CountResponse"
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
}
}
}
},
"/models/model/{modelId}": {
"get": {
"description": "Get a model configuration by its model_id field (e.g., gpt-4)",
"tags": [
"models"
],
"summary": "Get model by model ID",
"parameters": [
{
"type": "string",
"description": "Model ID (e.g., gpt-4)",
"name": "modelId",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/models.GetResponse"
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"404": {
"description": "Not Found",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
}
}
},
"put": {
"description": "Update a model configuration by its model_id field (e.g., gpt-4)",
"tags": [
"models"
],
"summary": "Update model by model ID",
"parameters": [
{
"type": "string",
"description": "Model ID (e.g., gpt-4)",
"name": "modelId",
"in": "path",
"required": true
},
{
"description": "Updated model configuration",
"name": "payload",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/models.UpdateRequest"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/models.GetResponse"
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"404": {
"description": "Not Found",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
}
}
},
"delete": {
"description": "Delete a model configuration by its model_id field (e.g., gpt-4)",
"tags": [
"models"
],
"summary": "Delete model by model ID",
"parameters": [
{
"type": "string",
"description": "Model ID (e.g., gpt-4)",
"name": "modelId",
"in": "path",
"required": true
}
],
"responses": {
"204": {
"description": "No Content"
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"404": {
"description": "Not Found",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
}
}
}
},
"/models/{id}": {
"get": {
"description": "Get a model configuration by its internal UUID",
"tags": [
"models"
],
"summary": "Get model by internal ID",
"parameters": [
{
"type": "string",
"description": "Model internal ID (UUID)",
"name": "id",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/models.GetResponse"
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"404": {
"description": "Not Found",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
}
}
},
"put": {
"description": "Update a model configuration by its internal UUID",
"tags": [
"models"
],
"summary": "Update model by internal ID",
"parameters": [
{
"type": "string",
"description": "Model internal ID (UUID)",
"name": "id",
"in": "path",
"required": true
},
{
"description": "Updated model configuration",
"name": "payload",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/models.UpdateRequest"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/models.GetResponse"
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"404": {
"description": "Not Found",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
}
}
},
"delete": {
"description": "Delete a model configuration by its internal UUID",
"tags": [
"models"
],
"summary": "Delete model by internal ID",
"parameters": [
{
"type": "string",
"description": "Model internal ID (UUID)",
"name": "id",
"in": "path",
"required": true
}
],
"responses": {
"204": {
"description": "No Content"
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"404": {
"description": "Not Found",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
}
}
}
},
"/ping": {
"get": {
"tags": [
"system"
],
"summary": "Health check with server capabilities",
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/handlers.PingResponse"
}
}
}
}
},
"/providers": {
"get": {
"description": "Get a list of all configured LLM providers",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"providers"
],
"summary": "List all LLM providers",
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "array",
"items": {
"$ref": "#/definitions/providers.GetResponse"
}
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
}
}
},
"post": {
"description": "Create a new LLM provider configuration",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"providers"
],
"summary": "Create a new LLM provider",
"parameters": [
{
"description": "Provider configuration",
"name": "request",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/providers.CreateRequest"
}
}
],
"responses": {
"201": {
"description": "Created",
"schema": {
"$ref": "#/definitions/providers.GetResponse"
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
}
}
}
},
"/providers/count": {
"get": {
"description": "Get the total count of providers",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"providers"
],
"summary": "Count providers",
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/providers.CountResponse"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
}
}
}
},
"/providers/name/{name}": {
"get": {
"description": "Get a provider configuration by its name",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"providers"
],
"summary": "Get provider by name",
"parameters": [
{
"type": "string",
"description": "Provider name",
"name": "name",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/providers.GetResponse"
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"404": {
"description": "Not Found",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
}
}
}
},
"/providers/{id}": {
"get": {
"description": "Get a provider configuration by its ID",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"providers"
],
"summary": "Get provider by ID",
"parameters": [
{
"type": "string",
"description": "Provider ID (UUID)",
"name": "id",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/providers.GetResponse"
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"404": {
"description": "Not Found",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
}
}
},
"put": {
"description": "Update an existing provider configuration",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"providers"
],
"summary": "Update provider",
"parameters": [
{
"type": "string",
"description": "Provider ID (UUID)",
"name": "id",
"in": "path",
"required": true
},
{
"description": "Updated provider configuration",
"name": "request",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/providers.UpdateRequest"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/providers.GetResponse"
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"404": {
"description": "Not Found",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
}
}
},
"delete": {
"description": "Delete a provider configuration",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"providers"
],
"summary": "Delete provider",
"parameters": [
{
"type": "string",
"description": "Provider ID (UUID)",
"name": "id",
"in": "path",
"required": true
}
],
"responses": {
"204": {
"description": "No Content"
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"404": {
"description": "Not Found",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
}
}
}
},
"/providers/{id}/models": {
"get": {
"description": "Get models for a provider by id, optionally filtered by type",
"tags": [
"providers"
],
"summary": "List provider models",
"parameters": [
{
"type": "string",
"description": "Provider ID (UUID)",
"name": "id",
"in": "path",
"required": true
},
{
"type": "string",
"description": "Model type (chat, embedding)",
"name": "type",
"in": "query"
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "array",
"items": {
"$ref": "#/definitions/models.GetResponse"
}
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"404": {
"description": "Not Found",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
}
}
}
},
"/providers/{id}/test": {
"post": {
"description": "Probe a provider's base URL to check reachability, supported client types, and embedding support",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"providers"
],
"summary": "Test provider connectivity",
"parameters": [
{
"type": "string",
"description": "Provider ID (UUID)",
"name": "id",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/providers.TestResponse"
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"404": {
"description": "Not Found",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
}
}
}
},
"/search-providers": {
"get": {
"description": "List configured search providers",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"search-providers"
],
"summary": "List search providers",
"parameters": [
{
"type": "string",
"description": "Provider filter (brave)",
"name": "provider",
"in": "query"
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "array",
"items": {
"$ref": "#/definitions/searchproviders.GetResponse"
}
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
}
}
},
"post": {
"description": "Create a search provider configuration",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"search-providers"
],
"summary": "Create a search provider",
"parameters": [
{
"description": "Search provider configuration",
"name": "request",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/searchproviders.CreateRequest"
}
}
],
"responses": {
"201": {
"description": "Created",
"schema": {
"$ref": "#/definitions/searchproviders.GetResponse"
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
}
}
}
},
"/search-providers/meta": {
"get": {
"description": "List available search provider types and config schemas",
"tags": [
"search-providers"
],
"summary": "List search provider metadata",
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "array",
"items": {
"$ref": "#/definitions/searchproviders.ProviderMeta"
}
}
}
}
}
},
"/search-providers/{id}": {
"get": {
"description": "Get search provider by ID",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"search-providers"
],
"summary": "Get a search provider",
"parameters": [
{
"type": "string",
"description": "Provider ID",
"name": "id",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/searchproviders.GetResponse"
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"404": {
"description": "Not Found",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
}
}
},
"put": {
"description": "Update search provider by ID",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"search-providers"
],
"summary": "Update a search provider",
"parameters": [
{
"type": "string",
"description": "Provider ID",
"name": "id",
"in": "path",
"required": true
},
{
"description": "Updated configuration",
"name": "request",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/searchproviders.UpdateRequest"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/searchproviders.GetResponse"
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
}
}
},
"delete": {
"description": "Delete search provider by ID",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"search-providers"
],
"summary": "Delete a search provider",
"parameters": [
{
"type": "string",
"description": "Provider ID",
"name": "id",
"in": "path",
"required": true
}
],
"responses": {
"204": {
"description": "No Content"
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
}
}
}
},
"/users": {
"get": {
"description": "List users",
"tags": [
"users"
],
"summary": "List users (admin only)",
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/accounts.ListAccountsResponse"
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"403": {
"description": "Forbidden",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
}
}
},
"post": {
"description": "Create a new human user account",
"tags": [
"users"
],
"summary": "Create human user (admin only)",
"parameters": [
{
"description": "User payload",
"name": "payload",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/accounts.CreateAccountRequest"
}
}
],
"responses": {
"201": {
"description": "Created",
"schema": {
"$ref": "#/definitions/accounts.Account"
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"403": {
"description": "Forbidden",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
}
}
}
},
"/users/me": {
"get": {
"description": "Get current user profile",
"tags": [
"users"
],
"summary": "Get current user",
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/accounts.Account"
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
}
}
},
"put": {
"description": "Update current user display name or avatar",
"tags": [
"users"
],
"summary": "Update current user profile",
"parameters": [
{
"description": "Profile payload",
"name": "payload",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/accounts.UpdateProfileRequest"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/accounts.Account"
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
}
}
}
},
"/users/me/channels/{platform}": {
"get": {
"description": "Get channel binding configuration for current user",
"tags": [
"channel"
],
"summary": "Get channel user config",
"parameters": [
{
"type": "string",
"description": "Channel platform",
"name": "platform",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/channel.ChannelIdentityBinding"
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"404": {
"description": "Not Found",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
}
}
},
"put": {
"description": "Update channel binding configuration for current user",
"tags": [
"channel"
],
"summary": "Update channel user config",
"parameters": [
{
"type": "string",
"description": "Channel platform",
"name": "platform",
"in": "path",
"required": true
},
{
"description": "Channel user config payload",
"name": "payload",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/channel.UpsertChannelIdentityConfigRequest"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/channel.ChannelIdentityBinding"
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
}
}
}
},
"/users/me/identities": {
"get": {
"description": "List all channel identities linked to current user",
"tags": [
"users"
],
"summary": "List current user's channel identities",
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/handlers.listMyIdentitiesResponse"
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"404": {
"description": "Not Found",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
}
}
}
},
"/users/me/password": {
"put": {
"description": "Update current user password with current password check",
"tags": [
"users"
],
"summary": "Update current user password",
"parameters": [
{
"description": "Password payload",
"name": "payload",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/accounts.UpdatePasswordRequest"
}
}
],
"responses": {
"204": {
"description": "No Content"
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
}
}
}
},
"/users/{id}": {
"get": {
"description": "Get user details (self or admin only)",
"tags": [
"users"
],
"summary": "Get user by ID",
"parameters": [
{
"type": "string",
"description": "User ID",
"name": "id",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/accounts.Account"
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"403": {
"description": "Forbidden",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"404": {
"description": "Not Found",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
}
}
},
"put": {
"description": "Update user profile and status",
"tags": [
"users"
],
"summary": "Update user (admin only)",
"parameters": [
{
"type": "string",
"description": "User ID",
"name": "id",
"in": "path",
"required": true
},
{
"description": "User update payload",
"name": "payload",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/accounts.UpdateAccountRequest"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/accounts.Account"
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"403": {
"description": "Forbidden",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"404": {
"description": "Not Found",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
}
}
}
},
"/users/{id}/password": {
"put": {
"description": "Reset a user password",
"tags": [
"users"
],
"summary": "Reset user password (admin only)",
"parameters": [
{
"type": "string",
"description": "User ID",
"name": "id",
"in": "path",
"required": true
},
{
"description": "Password payload",
"name": "payload",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/accounts.ResetPasswordRequest"
}
}
],
"responses": {
"204": {
"description": "No Content"
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"403": {
"description": "Forbidden",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"404": {
"description": "Not Found",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/handlers.ErrorResponse"
}
}
}
}
}
},
"definitions": {
"accounts.Account": {
"type": "object",
"properties": {
"avatar_url": {
"type": "string"
},
"created_at": {
"type": "string"
},
"display_name": {
"type": "string"
},
"email": {
"type": "string"
},
"id": {
"type": "string"
},
"is_active": {
"type": "boolean"
},
"last_login_at": {
"type": "string"
},
"role": {
"type": "string"
},
"updated_at": {
"type": "string"
},
"username": {
"type": "string"
}
}
},
"accounts.CreateAccountRequest": {
"type": "object",
"properties": {
"avatar_url": {
"type": "string"
},
"display_name": {
"type": "string"
},
"email": {
"type": "string"
},
"is_active": {
"type": "boolean"
},
"password": {
"type": "string"
},
"role": {
"type": "string"
},
"username": {
"type": "string"
}
}
},
"accounts.ListAccountsResponse": {
"type": "object",
"properties": {
"items": {
"type": "array",
"items": {
"$ref": "#/definitions/accounts.Account"
}
}
}
},
"accounts.ResetPasswordRequest": {
"type": "object",
"properties": {
"new_password": {
"type": "string"
}
}
},
"accounts.UpdateAccountRequest": {
"type": "object",
"properties": {
"avatar_url": {
"type": "string"
},
"display_name": {
"type": "string"
},
"is_active": {
"type": "boolean"
},
"role": {
"type": "string"
}
}
},
"accounts.UpdatePasswordRequest": {
"type": "object",
"properties": {
"current_password": {
"type": "string"
},
"new_password": {
"type": "string"
}
}
},
"accounts.UpdateProfileRequest": {
"type": "object",
"properties": {
"avatar_url": {
"type": "string"
},
"display_name": {
"type": "string"
}
}
},
"bots.Bot": {
"type": "object",
"properties": {
"allow_guest": {
"type": "boolean"
},
"avatar_url": {
"type": "string"
},
"check_issue_count": {
"type": "integer"
},
"check_state": {
"type": "string"
},
"created_at": {
"type": "string"
},
"display_name": {
"type": "string"
},
"id": {
"type": "string"
},
"is_active": {
"type": "boolean"
},
"metadata": {
"type": "object",
"additionalProperties": {}
},
"owner_user_id": {
"type": "string"
},
"status": {
"type": "string"
},
"type": {
"type": "string"
},
"updated_at": {
"type": "string"
}
}
},
"bots.BotCheck": {
"type": "object",
"properties": {
"detail": {
"type": "string"
},
"id": {
"type": "string"
},
"metadata": {
"type": "object",
"additionalProperties": {}
},
"status": {
"type": "string"
},
"subtitle": {
"type": "string"
},
"summary": {
"type": "string"
},
"title_key": {
"type": "string"
},
"type": {
"type": "string"
}
}
},
"bots.BotMember": {
"type": "object",
"properties": {
"bot_id": {
"type": "string"
},
"created_at": {
"type": "string"
},
"role": {
"type": "string"
},
"user_id": {
"type": "string"
}
}
},
"bots.CreateBotRequest": {
"type": "object",
"properties": {
"avatar_url": {
"type": "string"
},
"display_name": {
"type": "string"
},
"is_active": {
"type": "boolean"
},
"metadata": {
"type": "object",
"additionalProperties": {}
},
"type": {
"type": "string"
}
}
},
"bots.ListBotsResponse": {
"type": "object",
"properties": {
"items": {
"type": "array",
"items": {
"$ref": "#/definitions/bots.Bot"
}
}
}
},
"bots.ListChecksResponse": {
"type": "object",
"properties": {
"items": {
"type": "array",
"items": {
"$ref": "#/definitions/bots.BotCheck"
}
}
}
},
"bots.ListMembersResponse": {
"type": "object",
"properties": {
"items": {
"type": "array",
"items": {
"$ref": "#/definitions/bots.BotMember"
}
}
}
},
"bots.TransferBotRequest": {
"type": "object",
"properties": {
"owner_user_id": {
"type": "string"
}
}
},
"bots.UpdateBotRequest": {
"type": "object",
"properties": {
"avatar_url": {
"type": "string"
},
"display_name": {
"type": "string"
},
"is_active": {
"type": "boolean"
},
"metadata": {
"type": "object",
"additionalProperties": {}
}
}
},
"bots.UpsertMemberRequest": {
"type": "object",
"properties": {
"role": {
"type": "string"
},
"user_id": {
"type": "string"
}
}
},
"channel.Action": {
"type": "object",
"properties": {
"label": {
"type": "string"
},
"type": {
"type": "string"
},
"url": {
"type": "string"
},
"value": {
"type": "string"
}
}
},
"channel.Attachment": {
"type": "object",
"properties": {
"base64": {
"description": "data URL for agent delivery",
"type": "string"
},
"caption": {
"type": "string"
},
"content_hash": {
"type": "string"
},
"duration_ms": {
"type": "integer"
},
"height": {
"type": "integer"
},
"metadata": {
"type": "object",
"additionalProperties": {}
},
"mime": {
"type": "string"
},
"name": {
"type": "string"
},
"platform_key": {
"type": "string"
},
"size": {
"type": "integer"
},
"source_platform": {
"type": "string"
},
"thumbnail_url": {
"type": "string"
},
"type": {
"$ref": "#/definitions/channel.AttachmentType"
},
"url": {
"type": "string"
},
"width": {
"type": "integer"
}
}
},
"channel.AttachmentType": {
"type": "string",
"enum": [
"image",
"audio",
"video",
"voice",
"file",
"gif"
],
"x-enum-varnames": [
"AttachmentImage",
"AttachmentAudio",
"AttachmentVideo",
"AttachmentVoice",
"AttachmentFile",
"AttachmentGIF"
]
},
"channel.ChannelCapabilities": {
"type": "object",
"properties": {
"attachments": {
"type": "boolean"
},
"block_streaming": {
"type": "boolean"
},
"buttons": {
"type": "boolean"
},
"chat_types": {
"type": "array",
"items": {
"type": "string"
}
},
"edit": {
"type": "boolean"
},
"markdown": {
"type": "boolean"
},
"media": {
"type": "boolean"
},
"native_commands": {
"type": "boolean"
},
"polls": {
"type": "boolean"
},
"reactions": {
"type": "boolean"
},
"reply": {
"type": "boolean"
},
"rich_text": {
"type": "boolean"
},
"streaming": {
"type": "boolean"
},
"text": {
"type": "boolean"
},
"threads": {
"type": "boolean"
},
"unsend": {
"type": "boolean"
}
}
},
"channel.ChannelConfig": {
"type": "object",
"properties": {
"bot_id": {
"type": "string"
},
"channel_type": {
"type": "string"
},
"created_at": {
"type": "string"
},
"credentials": {
"type": "object",
"additionalProperties": {}
},
"disabled": {
"type": "boolean"
},
"external_identity": {
"type": "string"
},
"id": {
"type": "string"
},
"routing": {
"type": "object",
"additionalProperties": {}
},
"self_identity": {
"type": "object",
"additionalProperties": {}
},
"updated_at": {
"type": "string"
},
"verified_at": {
"type": "string"
}
}
},
"channel.ChannelIdentityBinding": {
"type": "object",
"properties": {
"channel_identity_id": {
"type": "string"
},
"channel_type": {
"type": "string"
},
"config": {
"type": "object",
"additionalProperties": {}
},
"created_at": {
"type": "string"
},
"id": {
"type": "string"
},
"updated_at": {
"type": "string"
}
}
},
"channel.ConfigSchema": {
"type": "object",
"properties": {
"fields": {
"type": "object",
"additionalProperties": {
"$ref": "#/definitions/channel.FieldSchema"
}
},
"version": {
"type": "integer"
}
}
},
"channel.FieldSchema": {
"type": "object",
"properties": {
"description": {
"type": "string"
},
"enum": {
"type": "array",
"items": {
"type": "string"
}
},
"example": {},
"required": {
"type": "boolean"
},
"title": {
"type": "string"
},
"type": {
"$ref": "#/definitions/channel.FieldType"
}
}
},
"channel.FieldType": {
"type": "string",
"enum": [
"string",
"secret",
"bool",
"number",
"enum"
],
"x-enum-varnames": [
"FieldString",
"FieldSecret",
"FieldBool",
"FieldNumber",
"FieldEnum"
]
},
"channel.Message": {
"type": "object",
"properties": {
"actions": {
"type": "array",
"items": {
"$ref": "#/definitions/channel.Action"
}
},
"attachments": {
"type": "array",
"items": {
"$ref": "#/definitions/channel.Attachment"
}
},
"format": {
"$ref": "#/definitions/channel.MessageFormat"
},
"id": {
"type": "string"
},
"metadata": {
"type": "object",
"additionalProperties": {}
},
"parts": {
"type": "array",
"items": {
"$ref": "#/definitions/channel.MessagePart"
}
},
"reply": {
"$ref": "#/definitions/channel.ReplyRef"
},
"text": {
"type": "string"
},
"thread": {
"$ref": "#/definitions/channel.ThreadRef"
}
}
},
"channel.MessageFormat": {
"type": "string",
"enum": [
"plain",
"markdown",
"rich"
],
"x-enum-varnames": [
"MessageFormatPlain",
"MessageFormatMarkdown",
"MessageFormatRich"
]
},
"channel.MessagePart": {
"type": "object",
"properties": {
"channel_identity_id": {
"type": "string"
},
"emoji": {
"type": "string"
},
"language": {
"type": "string"
},
"metadata": {
"type": "object",
"additionalProperties": {}
},
"styles": {
"type": "array",
"items": {
"$ref": "#/definitions/channel.MessageTextStyle"
}
},
"text": {
"type": "string"
},
"type": {
"$ref": "#/definitions/channel.MessagePartType"
},
"url": {
"type": "string"
}
}
},
"channel.MessagePartType": {
"type": "string",
"enum": [
"text",
"link",
"code_block",
"mention",
"emoji"
],
"x-enum-varnames": [
"MessagePartText",
"MessagePartLink",
"MessagePartCodeBlock",
"MessagePartMention",
"MessagePartEmoji"
]
},
"channel.MessageTextStyle": {
"type": "string",
"enum": [
"bold",
"italic",
"strikethrough",
"code"
],
"x-enum-varnames": [
"MessageStyleBold",
"MessageStyleItalic",
"MessageStyleStrikethrough",
"MessageStyleCode"
]
},
"channel.ReplyRef": {
"type": "object",
"properties": {
"message_id": {
"type": "string"
},
"target": {
"type": "string"
}
}
},
"channel.SendRequest": {
"type": "object",
"properties": {
"channel_identity_id": {
"type": "string"
},
"message": {
"$ref": "#/definitions/channel.Message"
},
"target": {
"type": "string"
}
}
},
"channel.TargetHint": {
"type": "object",
"properties": {
"example": {
"type": "string"
},
"label": {
"type": "string"
}
}
},
"channel.TargetSpec": {
"type": "object",
"properties": {
"format": {
"type": "string"
},
"hints": {
"type": "array",
"items": {
"$ref": "#/definitions/channel.TargetHint"
}
}
}
},
"channel.ThreadRef": {
"type": "object",
"properties": {
"id": {
"type": "string"
}
}
},
"channel.UpdateChannelStatusRequest": {
"type": "object",
"properties": {
"disabled": {
"type": "boolean"
}
}
},
"channel.UpsertChannelIdentityConfigRequest": {
"type": "object",
"properties": {
"config": {
"type": "object",
"additionalProperties": {}
}
}
},
"channel.UpsertConfigRequest": {
"type": "object",
"properties": {
"credentials": {
"type": "object",
"additionalProperties": {}
},
"disabled": {
"type": "boolean"
},
"external_identity": {
"type": "string"
},
"routing": {
"type": "object",
"additionalProperties": {}
},
"self_identity": {
"type": "object",
"additionalProperties": {}
},
"verified_at": {
"type": "string"
}
}
},
"email.BindingResponse": {
"type": "object",
"properties": {
"bot_id": {
"type": "string"
},
"can_delete": {
"type": "boolean"
},
"can_read": {
"type": "boolean"
},
"can_write": {
"type": "boolean"
},
"config": {
"type": "object",
"additionalProperties": {}
},
"created_at": {
"type": "string"
},
"email_address": {
"type": "string"
},
"email_provider_id": {
"type": "string"
},
"id": {
"type": "string"
},
"updated_at": {
"type": "string"
}
}
},
"email.ConfigSchema": {
"type": "object",
"properties": {
"fields": {
"type": "array",
"items": {
"$ref": "#/definitions/email.FieldSchema"
}
}
}
},
"email.CreateBindingRequest": {
"type": "object",
"properties": {
"can_delete": {
"type": "boolean"
},
"can_read": {
"type": "boolean"
},
"can_write": {
"type": "boolean"
},
"config": {
"type": "object",
"additionalProperties": {}
},
"email_address": {
"type": "string"
},
"email_provider_id": {
"type": "string"
}
}
},
"email.CreateProviderRequest": {
"type": "object",
"properties": {
"config": {
"type": "object",
"additionalProperties": {}
},
"name": {
"type": "string"
},
"provider": {
"type": "string"
}
}
},
"email.FieldSchema": {
"type": "object",
"properties": {
"description": {
"type": "string"
},
"enum": {
"type": "array",
"items": {
"type": "string"
}
},
"example": {},
"key": {
"type": "string"
},
"order": {
"type": "integer"
},
"required": {
"type": "boolean"
},
"title": {
"type": "string"
},
"type": {
"type": "string"
}
}
},
"email.OutboxItemResponse": {
"type": "object",
"properties": {
"attachments": {
"type": "array",
"items": {}
},
"body_html": {
"type": "string"
},
"body_text": {
"type": "string"
},
"bot_id": {
"type": "string"
},
"created_at": {
"type": "string"
},
"error": {
"type": "string"
},
"from": {
"type": "string"
},
"id": {
"type": "string"
},
"message_id": {
"type": "string"
},
"provider_id": {
"type": "string"
},
"sent_at": {
"type": "string"
},
"status": {
"type": "string"
},
"subject": {
"type": "string"
},
"to": {
"type": "array",
"items": {
"type": "string"
}
}
}
},
"email.ProviderMeta": {
"type": "object",
"properties": {
"config_schema": {
"$ref": "#/definitions/email.ConfigSchema"
},
"display_name": {
"type": "string"
},
"provider": {
"type": "string"
}
}
},
"email.ProviderResponse": {
"type": "object",
"properties": {
"config": {
"type": "object",
"additionalProperties": {}
},
"created_at": {
"type": "string"
},
"id": {
"type": "string"
},
"name": {
"type": "string"
},
"provider": {
"type": "string"
},
"updated_at": {
"type": "string"
}
}
},
"email.UpdateBindingRequest": {
"type": "object",
"properties": {
"can_delete": {
"type": "boolean"
},
"can_read": {
"type": "boolean"
},
"can_write": {
"type": "boolean"
},
"config": {
"type": "object",
"additionalProperties": {}
},
"email_address": {
"type": "string"
}
}
},
"email.UpdateProviderRequest": {
"type": "object",
"properties": {
"config": {
"type": "object",
"additionalProperties": {}
},
"name": {
"type": "string"
},
"provider": {
"type": "string"
}
}
},
"github_com_memohai_memoh_internal_mcp.Connection": {
"type": "object",
"properties": {
"bot_id": {
"type": "string"
},
"config": {
"type": "object",
"additionalProperties": {}
},
"created_at": {
"type": "string"
},
"id": {
"type": "string"
},
"is_active": {
"type": "boolean"
},
"name": {
"type": "string"
},
"type": {
"type": "string"
},
"updated_at": {
"type": "string"
}
}
},
"handlers.BatchDeleteRequest": {
"type": "object",
"properties": {
"ids": {
"type": "array",
"items": {
"type": "string"
}
}
}
},
"handlers.ChannelMeta": {
"type": "object",
"properties": {
"capabilities": {
"$ref": "#/definitions/channel.ChannelCapabilities"
},
"config_schema": {
"$ref": "#/definitions/channel.ConfigSchema"
},
"configless": {
"type": "boolean"
},
"display_name": {
"type": "string"
},
"target_spec": {
"$ref": "#/definitions/channel.TargetSpec"
},
"type": {
"type": "string"
},
"user_config_schema": {
"$ref": "#/definitions/channel.ConfigSchema"
}
}
},
"handlers.CreateContainerRequest": {
"type": "object",
"properties": {
"snapshotter": {
"type": "string"
}
}
},
"handlers.CreateContainerResponse": {
"type": "object",
"properties": {
"container_id": {
"type": "string"
},
"image": {
"type": "string"
},
"snapshotter": {
"type": "string"
},
"started": {
"type": "boolean"
}
}
},
"handlers.CreateSnapshotRequest": {
"type": "object",
"properties": {
"snapshot_name": {
"type": "string"
}
}
},
"handlers.CreateSnapshotResponse": {
"type": "object",
"properties": {
"container_id": {
"type": "string"
},
"snapshot_name": {
"type": "string"
},
"snapshotter": {
"type": "string"
},
"source": {
"type": "string"
},
"version": {
"type": "integer"
}
}
},
"handlers.EmbeddingsInput": {
"type": "object",
"properties": {
"image_url": {
"type": "string"
},
"text": {
"type": "string"
},
"video_url": {
"type": "string"
}
}
},
"handlers.EmbeddingsRequest": {
"type": "object",
"properties": {
"dimensions": {
"type": "integer"
},
"input": {
"$ref": "#/definitions/handlers.EmbeddingsInput"
},
"model": {
"type": "string"
},
"provider": {
"type": "string"
},
"type": {
"type": "string"
}
}
},
"handlers.EmbeddingsResponse": {
"type": "object",
"properties": {
"dimensions": {
"type": "integer"
},
"embedding": {
"type": "array",
"items": {
"type": "number"
}
},
"message": {
"type": "string"
},
"model": {
"type": "string"
},
"provider": {
"type": "string"
},
"type": {
"type": "string"
},
"usage": {
"$ref": "#/definitions/handlers.EmbeddingsUsage"
}
}
},
"handlers.EmbeddingsUsage": {
"type": "object",
"properties": {
"duration": {
"type": "integer"
},
"image_tokens": {
"type": "integer"
},
"input_tokens": {
"type": "integer"
}
}
},
"handlers.ErrorResponse": {
"type": "object",
"properties": {
"message": {
"type": "string"
}
}
},
"handlers.FSDeleteRequest": {
"type": "object",
"properties": {
"path": {
"type": "string"
},
"recursive": {
"type": "boolean"
}
}
},
"handlers.FSFileInfo": {
"type": "object",
"properties": {
"isDir": {
"type": "boolean"
},
"modTime": {
"type": "string"
},
"mode": {
"type": "string"
},
"name": {
"type": "string"
},
"path": {
"type": "string"
},
"size": {
"type": "integer"
}
}
},
"handlers.FSListResponse": {
"type": "object",
"properties": {
"entries": {
"type": "array",
"items": {
"$ref": "#/definitions/handlers.FSFileInfo"
}
},
"path": {
"type": "string"
}
}
},
"handlers.FSMkdirRequest": {
"type": "object",
"properties": {
"path": {
"type": "string"
}
}
},
"handlers.FSReadResponse": {
"type": "object",
"properties": {
"content": {
"type": "string"
},
"path": {
"type": "string"
},
"size": {
"type": "integer"
}
}
},
"handlers.FSRenameRequest": {
"type": "object",
"properties": {
"newPath": {
"type": "string"
},
"oldPath": {
"type": "string"
}
}
},
"handlers.FSUploadResponse": {
"type": "object",
"properties": {
"path": {
"type": "string"
},
"size": {
"type": "integer"
}
}
},
"handlers.FSWriteRequest": {
"type": "object",
"properties": {
"content": {
"type": "string"
},
"path": {
"type": "string"
}
}
},
"handlers.GetContainerResponse": {
"type": "object",
"properties": {
"container_id": {
"type": "string"
},
"container_path": {
"type": "string"
},
"created_at": {
"type": "string"
},
"host_path": {
"type": "string"
},
"image": {
"type": "string"
},
"namespace": {
"type": "string"
},
"status": {
"type": "string"
},
"task_running": {
"type": "boolean"
},
"updated_at": {
"type": "string"
}
}
},
"handlers.ListSnapshotsResponse": {
"type": "object",
"properties": {
"snapshots": {
"type": "array",
"items": {
"$ref": "#/definitions/handlers.SnapshotInfo"
}
},
"snapshotter": {
"type": "string"
}
}
},
"handlers.LocalChannelMessageRequest": {
"type": "object",
"properties": {
"message": {
"$ref": "#/definitions/channel.Message"
}
}
},
"handlers.LoginRequest": {
"type": "object",
"properties": {
"password": {
"type": "string"
},
"username": {
"type": "string"
}
}
},
"handlers.LoginResponse": {
"type": "object",
"properties": {
"access_token": {
"type": "string"
},
"display_name": {
"type": "string"
},
"expires_at": {
"type": "string"
},
"role": {
"type": "string"
},
"token_type": {
"type": "string"
},
"user_id": {
"type": "string"
},
"username": {
"type": "string"
}
}
},
"handlers.MCPStdioRequest": {
"type": "object",
"properties": {
"args": {
"type": "array",
"items": {
"type": "string"
}
},
"command": {
"type": "string"
},
"cwd": {
"type": "string"
},
"env": {
"type": "object",
"additionalProperties": {
"type": "string"
}
},
"name": {
"type": "string"
}
}
},
"handlers.MCPStdioResponse": {
"type": "object",
"properties": {
"connection_id": {
"type": "string"
},
"tools": {
"type": "array",
"items": {
"type": "string"
}
},
"url": {
"type": "string"
}
}
},
"handlers.PingResponse": {
"type": "object",
"properties": {
"container_backend": {
"type": "string"
},
"snapshot_supported": {
"type": "boolean"
},
"status": {
"type": "string"
}
}
},
"handlers.RefreshResponse": {
"type": "object",
"properties": {
"access_token": {
"type": "string"
},
"expires_at": {
"type": "string"
},
"token_type": {
"type": "string"
}
}
},
"handlers.SkillItem": {
"type": "object",
"properties": {
"content": {
"type": "string"
},
"description": {
"type": "string"
},
"metadata": {
"type": "object",
"additionalProperties": {}
},
"name": {
"type": "string"
}
}
},
"handlers.SkillsDeleteRequest": {
"type": "object",
"properties": {
"names": {
"type": "array",
"items": {
"type": "string"
}
}
}
},
"handlers.SkillsResponse": {
"type": "object",
"properties": {
"skills": {
"type": "array",
"items": {
"$ref": "#/definitions/handlers.SkillItem"
}
}
}
},
"handlers.SkillsUpsertRequest": {
"type": "object",
"properties": {
"skills": {
"type": "array",
"items": {
"$ref": "#/definitions/handlers.SkillItem"
}
}
}
},
"handlers.SnapshotInfo": {
"type": "object",
"properties": {
"created_at": {
"type": "string"
},
"kind": {
"type": "string"
},
"labels": {
"type": "object",
"additionalProperties": {
"type": "string"
}
},
"managed": {
"type": "boolean"
},
"name": {
"type": "string"
},
"parent": {
"type": "string"
},
"snapshotter": {
"type": "string"
},
"source": {
"type": "string"
},
"updated_at": {
"type": "string"
},
"version": {
"type": "integer"
}
}
},
"handlers.fsOpResponse": {
"type": "object",
"properties": {
"ok": {
"type": "boolean"
}
}
},
"handlers.listMyIdentitiesResponse": {
"type": "object",
"properties": {
"items": {
"type": "array",
"items": {
"$ref": "#/definitions/identities.ChannelIdentity"
}
},
"user_id": {
"type": "string"
}
}
},
"handlers.markReadRequest": {
"type": "object",
"properties": {
"ids": {
"type": "array",
"items": {
"type": "string"
}
}
}
},
"handlers.memoryAddPayload": {
"type": "object",
"properties": {
"embedding_enabled": {
"type": "boolean"
},
"filters": {
"type": "object",
"additionalProperties": {}
},
"infer": {
"type": "boolean"
},
"message": {
"type": "string"
},
"messages": {
"type": "array",
"items": {
"$ref": "#/definitions/memory.Message"
}
},
"metadata": {
"type": "object",
"additionalProperties": {}
},
"namespace": {
"type": "string"
},
"run_id": {
"type": "string"
}
}
},
"handlers.memoryCompactPayload": {
"type": "object",
"properties": {
"decay_days": {
"type": "integer"
},
"ratio": {
"type": "number"
}
}
},
"handlers.memoryDeletePayload": {
"type": "object",
"properties": {
"memory_ids": {
"type": "array",
"items": {
"type": "string"
}
}
}
},
"handlers.memorySearchPayload": {
"type": "object",
"properties": {
"embedding_enabled": {
"type": "boolean"
},
"filters": {
"type": "object",
"additionalProperties": {}
},
"limit": {
"type": "integer"
},
"no_stats": {
"type": "boolean"
},
"query": {
"type": "string"
},
"run_id": {
"type": "string"
},
"sources": {
"type": "array",
"items": {
"type": "string"
}
}
}
},
"handlers.skillsOpResponse": {
"type": "object",
"properties": {
"ok": {
"type": "boolean"
}
}
},
"heartbeat.ListLogsResponse": {
"type": "object",
"properties": {
"items": {
"type": "array",
"items": {
"$ref": "#/definitions/heartbeat.Log"
}
}
}
},
"heartbeat.Log": {
"type": "object",
"properties": {
"bot_id": {
"type": "string"
},
"completed_at": {
"type": "string"
},
"error_message": {
"type": "string"
},
"id": {
"type": "string"
},
"result_text": {
"type": "string"
},
"started_at": {
"type": "string"
},
"status": {
"type": "string"
},
"usage": {}
}
},
"identities.ChannelIdentity": {
"type": "object",
"properties": {
"avatar_url": {
"type": "string"
},
"channel": {
"type": "string"
},
"channel_subject_id": {
"type": "string"
},
"created_at": {
"type": "string"
},
"display_name": {
"type": "string"
},
"id": {
"type": "string"
},
"metadata": {
"type": "object",
"additionalProperties": {}
},
"updated_at": {
"type": "string"
},
"user_id": {
"type": "string"
}
}
},
"inbox.CountResult": {
"type": "object",
"properties": {
"total": {
"type": "integer"
},
"unread": {
"type": "integer"
}
}
},
"inbox.CreateRequest": {
"type": "object",
"properties": {
"action": {
"type": "string"
},
"bot_id": {
"type": "string"
},
"content": {
"type": "string"
},
"header": {
"type": "object",
"additionalProperties": {}
},
"source": {
"type": "string"
}
}
},
"inbox.Item": {
"type": "object",
"properties": {
"action": {
"type": "string"
},
"bot_id": {
"type": "string"
},
"content": {
"type": "string"
},
"created_at": {
"type": "string"
},
"header": {
"type": "object",
"additionalProperties": {}
},
"id": {
"type": "string"
},
"is_read": {
"type": "boolean"
},
"read_at": {
"type": "string"
},
"source": {
"type": "string"
}
}
},
"mcp.ExportResponse": {
"type": "object",
"properties": {
"mcpServers": {
"type": "object",
"additionalProperties": {
"$ref": "#/definitions/mcp.MCPServerEntry"
}
}
}
},
"mcp.ImportRequest": {
"type": "object",
"properties": {
"mcpServers": {
"type": "object",
"additionalProperties": {
"$ref": "#/definitions/mcp.MCPServerEntry"
}
}
}
},
"mcp.ListResponse": {
"type": "object",
"properties": {
"items": {
"type": "array",
"items": {
"$ref": "#/definitions/github_com_memohai_memoh_internal_mcp.Connection"
}
}
}
},
"mcp.MCPServerEntry": {
"type": "object",
"properties": {
"args": {
"type": "array",
"items": {
"type": "string"
}
},
"command": {
"type": "string"
},
"cwd": {
"type": "string"
},
"env": {
"type": "object",
"additionalProperties": {
"type": "string"
}
},
"headers": {
"type": "object",
"additionalProperties": {
"type": "string"
}
},
"transport": {
"type": "string"
},
"url": {
"type": "string"
}
}
},
"mcp.UpsertRequest": {
"type": "object",
"properties": {
"args": {
"type": "array",
"items": {
"type": "string"
}
},
"command": {
"type": "string"
},
"cwd": {
"type": "string"
},
"env": {
"type": "object",
"additionalProperties": {
"type": "string"
}
},
"headers": {
"type": "object",
"additionalProperties": {
"type": "string"
}
},
"is_active": {
"type": "boolean"
},
"name": {
"type": "string"
},
"transport": {
"type": "string"
},
"url": {
"type": "string"
}
}
},
"memory.CDFPoint": {
"type": "object",
"properties": {
"cumulative": {
"description": "cumulative weight fraction [0.0, 1.0]",
"type": "number"
},
"k": {
"description": "rank position (1-based, sorted by value desc)",
"type": "integer"
}
}
},
"memory.CompactResult": {
"type": "object",
"properties": {
"after_count": {
"type": "integer"
},
"before_count": {
"type": "integer"
},
"ratio": {
"type": "number"
},
"results": {
"type": "array",
"items": {
"$ref": "#/definitions/memory.MemoryItem"
}
}
}
},
"memory.DeleteResponse": {
"type": "object",
"properties": {
"message": {
"type": "string"
}
}
},
"memory.MemoryItem": {
"type": "object",
"properties": {
"agent_id": {
"type": "string"
},
"bot_id": {
"type": "string"
},
"cdf_curve": {
"type": "array",
"items": {
"$ref": "#/definitions/memory.CDFPoint"
}
},
"created_at": {
"type": "string"
},
"hash": {
"type": "string"
},
"id": {
"type": "string"
},
"memory": {
"type": "string"
},
"metadata": {
"type": "object",
"additionalProperties": {}
},
"run_id": {
"type": "string"
},
"score": {
"type": "number"
},
"top_k_buckets": {
"type": "array",
"items": {
"$ref": "#/definitions/memory.TopKBucket"
}
},
"updated_at": {
"type": "string"
}
}
},
"memory.Message": {
"type": "object",
"properties": {
"content": {
"type": "string"
},
"role": {
"type": "string"
}
}
},
"memory.RebuildResult": {
"type": "object",
"properties": {
"fs_count": {
"type": "integer"
},
"missing_count": {
"type": "integer"
},
"qdrant_count": {
"type": "integer"
},
"restored_count": {
"type": "integer"
}
}
},
"memory.SearchResponse": {
"type": "object",
"properties": {
"relations": {
"type": "array",
"items": {}
},
"results": {
"type": "array",
"items": {
"$ref": "#/definitions/memory.MemoryItem"
}
}
}
},
"memory.TopKBucket": {
"type": "object",
"properties": {
"index": {
"description": "sparse dimension index (term hash)",
"type": "integer"
},
"value": {
"description": "weight (term frequency)",
"type": "number"
}
}
},
"memory.UsageResponse": {
"type": "object",
"properties": {
"avg_text_bytes": {
"type": "integer"
},
"count": {
"type": "integer"
},
"estimated_storage_bytes": {
"type": "integer"
},
"total_text_bytes": {
"type": "integer"
}
}
},
"message.Message": {
"type": "object",
"properties": {
"assets": {
"type": "array",
"items": {
"$ref": "#/definitions/message.MessageAsset"
}
},
"bot_id": {
"type": "string"
},
"content": {
"type": "array",
"items": {
"type": "integer"
}
},
"created_at": {
"type": "string"
},
"external_message_id": {
"type": "string"
},
"id": {
"type": "string"
},
"metadata": {
"type": "object",
"additionalProperties": {}
},
"platform": {
"type": "string"
},
"role": {
"type": "string"
},
"route_id": {
"type": "string"
},
"sender_avatar_url": {
"type": "string"
},
"sender_channel_identity_id": {
"type": "string"
},
"sender_display_name": {
"type": "string"
},
"sender_user_id": {
"type": "string"
},
"source_reply_to_message_id": {
"type": "string"
},
"usage": {
"type": "array",
"items": {
"type": "integer"
}
}
}
},
"message.MessageAsset": {
"type": "object",
"properties": {
"content_hash": {
"type": "string"
},
"mime": {
"type": "string"
},
"ordinal": {
"type": "integer"
},
"role": {
"type": "string"
},
"size_bytes": {
"type": "integer"
},
"storage_key": {
"type": "string"
}
}
},
"models.AddRequest": {
"type": "object",
"properties": {
"client_type": {
"$ref": "#/definitions/models.ClientType"
},
"dimensions": {
"type": "integer"
},
"input_modalities": {
"type": "array",
"items": {
"type": "string"
}
},
"llm_provider_id": {
"type": "string"
},
"model_id": {
"type": "string"
},
"name": {
"type": "string"
},
"supports_reasoning": {
"type": "boolean"
},
"type": {
"$ref": "#/definitions/models.ModelType"
}
}
},
"models.AddResponse": {
"type": "object",
"properties": {
"id": {
"type": "string"
},
"model_id": {
"type": "string"
}
}
},
"models.ClientType": {
"type": "string",
"enum": [
"openai-responses",
"openai-completions",
"anthropic-messages",
"google-generative-ai"
],
"x-enum-varnames": [
"ClientTypeOpenAIResponses",
"ClientTypeOpenAICompletions",
"ClientTypeAnthropicMessages",
"ClientTypeGoogleGenerativeAI"
]
},
"models.CountResponse": {
"type": "object",
"properties": {
"count": {
"type": "integer"
}
}
},
"models.GetResponse": {
"type": "object",
"properties": {
"client_type": {
"$ref": "#/definitions/models.ClientType"
},
"dimensions": {
"type": "integer"
},
"id": {
"type": "string"
},
"input_modalities": {
"type": "array",
"items": {
"type": "string"
}
},
"llm_provider_id": {
"type": "string"
},
"model_id": {
"type": "string"
},
"name": {
"type": "string"
},
"supports_reasoning": {
"type": "boolean"
},
"type": {
"$ref": "#/definitions/models.ModelType"
}
}
},
"models.ModelType": {
"type": "string",
"enum": [
"chat",
"embedding"
],
"x-enum-varnames": [
"ModelTypeChat",
"ModelTypeEmbedding"
]
},
"models.UpdateRequest": {
"type": "object",
"properties": {
"client_type": {
"$ref": "#/definitions/models.ClientType"
},
"dimensions": {
"type": "integer"
},
"input_modalities": {
"type": "array",
"items": {
"type": "string"
}
},
"llm_provider_id": {
"type": "string"
},
"model_id": {
"type": "string"
},
"name": {
"type": "string"
},
"supports_reasoning": {
"type": "boolean"
},
"type": {
"$ref": "#/definitions/models.ModelType"
}
}
},
"providers.CheckResult": {
"type": "object",
"properties": {
"latency_ms": {
"type": "integer"
},
"message": {
"type": "string"
},
"status": {
"$ref": "#/definitions/providers.CheckStatus"
},
"status_code": {
"type": "integer"
}
}
},
"providers.CheckStatus": {
"type": "string",
"enum": [
"supported",
"auth_error",
"unsupported",
"error"
],
"x-enum-varnames": [
"CheckStatusSupported",
"CheckStatusAuthError",
"CheckStatusUnsupported",
"CheckStatusError"
]
},
"providers.CountResponse": {
"type": "object",
"properties": {
"count": {
"type": "integer"
}
}
},
"providers.CreateRequest": {
"type": "object",
"required": [
"base_url",
"name"
],
"properties": {
"api_key": {
"type": "string"
},
"base_url": {
"type": "string"
},
"metadata": {
"type": "object",
"additionalProperties": {}
},
"name": {
"type": "string"
}
}
},
"providers.GetResponse": {
"type": "object",
"properties": {
"api_key": {
"description": "masked in response",
"type": "string"
},
"base_url": {
"type": "string"
},
"created_at": {
"type": "string"
},
"id": {
"type": "string"
},
"metadata": {
"type": "object",
"additionalProperties": {}
},
"name": {
"type": "string"
},
"updated_at": {
"type": "string"
}
}
},
"providers.TestResponse": {
"type": "object",
"properties": {
"checks": {
"type": "object",
"additionalProperties": {
"$ref": "#/definitions/providers.CheckResult"
}
},
"latency_ms": {
"type": "integer"
},
"message": {
"type": "string"
},
"reachable": {
"type": "boolean"
}
}
},
"providers.UpdateRequest": {
"type": "object",
"properties": {
"api_key": {
"type": "string"
},
"base_url": {
"type": "string"
},
"metadata": {
"type": "object",
"additionalProperties": {}
},
"name": {
"type": "string"
}
}
},
"schedule.CreateRequest": {
"type": "object",
"properties": {
"command": {
"type": "string"
},
"description": {
"type": "string"
},
"enabled": {
"type": "boolean"
},
"max_calls": {
"$ref": "#/definitions/schedule.NullableInt"
},
"name": {
"type": "string"
},
"pattern": {
"type": "string"
}
}
},
"schedule.ListResponse": {
"type": "object",
"properties": {
"items": {
"type": "array",
"items": {
"$ref": "#/definitions/schedule.Schedule"
}
}
}
},
"schedule.NullableInt": {
"type": "object",
"properties": {
"set": {
"type": "boolean"
},
"value": {
"type": "integer"
}
}
},
"schedule.Schedule": {
"type": "object",
"properties": {
"bot_id": {
"type": "string"
},
"command": {
"type": "string"
},
"created_at": {
"type": "string"
},
"current_calls": {
"type": "integer"
},
"description": {
"type": "string"
},
"enabled": {
"type": "boolean"
},
"id": {
"type": "string"
},
"max_calls": {
"type": "integer"
},
"name": {
"type": "string"
},
"pattern": {
"type": "string"
},
"updated_at": {
"type": "string"
}
}
},
"schedule.UpdateRequest": {
"type": "object",
"properties": {
"command": {
"type": "string"
},
"description": {
"type": "string"
},
"enabled": {
"type": "boolean"
},
"max_calls": {
"$ref": "#/definitions/schedule.NullableInt"
},
"name": {
"type": "string"
},
"pattern": {
"type": "string"
}
}
},
"searchproviders.CreateRequest": {
"type": "object",
"properties": {
"config": {
"type": "object",
"additionalProperties": {}
},
"name": {
"type": "string"
},
"provider": {
"$ref": "#/definitions/searchproviders.ProviderName"
}
}
},
"searchproviders.GetResponse": {
"type": "object",
"properties": {
"config": {
"type": "object",
"additionalProperties": {}
},
"created_at": {
"type": "string"
},
"id": {
"type": "string"
},
"name": {
"type": "string"
},
"provider": {
"type": "string"
},
"updated_at": {
"type": "string"
}
}
},
"searchproviders.ProviderConfigSchema": {
"type": "object",
"properties": {
"fields": {
"type": "object",
"additionalProperties": {
"$ref": "#/definitions/searchproviders.ProviderFieldSchema"
}
}
}
},
"searchproviders.ProviderFieldSchema": {
"type": "object",
"properties": {
"description": {
"type": "string"
},
"enum": {
"type": "array",
"items": {
"type": "string"
}
},
"example": {},
"required": {
"type": "boolean"
},
"title": {
"type": "string"
},
"type": {
"type": "string"
}
}
},
"searchproviders.ProviderMeta": {
"type": "object",
"properties": {
"config_schema": {
"$ref": "#/definitions/searchproviders.ProviderConfigSchema"
},
"display_name": {
"type": "string"
},
"provider": {
"type": "string"
}
}
},
"searchproviders.ProviderName": {
"type": "string",
"enum": [
"brave",
"bing",
"google",
"tavily",
"sogou",
"serper",
"searxng",
"jina",
"exa",
"bocha",
"duckduckgo",
"yandex"
],
"x-enum-varnames": [
"ProviderBrave",
"ProviderBing",
"ProviderGoogle",
"ProviderTavily",
"ProviderSogou",
"ProviderSerper",
"ProviderSearXNG",
"ProviderJina",
"ProviderExa",
"ProviderBocha",
"ProviderDuckDuckGo",
"ProviderYandex"
]
},
"searchproviders.UpdateRequest": {
"type": "object",
"properties": {
"config": {
"type": "object",
"additionalProperties": {}
},
"name": {
"type": "string"
},
"provider": {
"$ref": "#/definitions/searchproviders.ProviderName"
}
}
},
"settings.Settings": {
"type": "object",
"properties": {
"allow_guest": {
"type": "boolean"
},
"chat_model_id": {
"type": "string"
},
"embedding_model_id": {
"type": "string"
},
"heartbeat_enabled": {
"type": "boolean"
},
"heartbeat_interval": {
"type": "integer"
},
"heartbeat_model_id": {
"type": "string"
},
"language": {
"type": "string"
},
"max_context_load_time": {
"type": "integer"
},
"max_context_tokens": {
"type": "integer"
},
"max_inbox_items": {
"type": "integer"
},
"memory_model_id": {
"type": "string"
},
"reasoning_effort": {
"type": "string"
},
"reasoning_enabled": {
"type": "boolean"
},
"search_provider_id": {
"type": "string"
}
}
},
"settings.UpsertRequest": {
"type": "object",
"properties": {
"allow_guest": {
"type": "boolean"
},
"chat_model_id": {
"type": "string"
},
"embedding_model_id": {
"type": "string"
},
"heartbeat_enabled": {
"type": "boolean"
},
"heartbeat_interval": {
"type": "integer"
},
"heartbeat_model_id": {
"type": "string"
},
"language": {
"type": "string"
},
"max_context_load_time": {
"type": "integer"
},
"max_context_tokens": {
"type": "integer"
},
"max_inbox_items": {
"type": "integer"
},
"memory_model_id": {
"type": "string"
},
"reasoning_effort": {
"type": "string"
},
"reasoning_enabled": {
"type": "boolean"
},
"search_provider_id": {
"type": "string"
}
}
},
"subagent.AddSkillsRequest": {
"type": "object",
"properties": {
"skills": {
"type": "array",
"items": {
"type": "string"
}
}
}
},
"subagent.ContextResponse": {
"type": "object",
"properties": {
"messages": {
"type": "array",
"items": {
"type": "object",
"additionalProperties": {}
}
},
"usage": {
"type": "object",
"additionalProperties": {}
}
}
},
"subagent.CreateRequest": {
"type": "object",
"properties": {
"description": {
"type": "string"
},
"messages": {
"type": "array",
"items": {
"type": "object",
"additionalProperties": {}
}
},
"metadata": {
"type": "object",
"additionalProperties": {}
},
"name": {
"type": "string"
},
"skills": {
"type": "array",
"items": {
"type": "string"
}
}
}
},
"subagent.ListResponse": {
"type": "object",
"properties": {
"items": {
"type": "array",
"items": {
"$ref": "#/definitions/subagent.Subagent"
}
}
}
},
"subagent.SkillsResponse": {
"type": "object",
"properties": {
"skills": {
"type": "array",
"items": {
"type": "string"
}
}
}
},
"subagent.Subagent": {
"type": "object",
"properties": {
"bot_id": {
"type": "string"
},
"created_at": {
"type": "string"
},
"deleted": {
"type": "boolean"
},
"deleted_at": {
"type": "string"
},
"description": {
"type": "string"
},
"id": {
"type": "string"
},
"messages": {
"type": "array",
"items": {
"type": "object",
"additionalProperties": {}
}
},
"metadata": {
"type": "object",
"additionalProperties": {}
},
"name": {
"type": "string"
},
"skills": {
"type": "array",
"items": {
"type": "string"
}
},
"updated_at": {
"type": "string"
},
"usage": {
"type": "object",
"additionalProperties": {}
}
}
},
"subagent.UpdateContextRequest": {
"type": "object",
"properties": {
"messages": {
"type": "array",
"items": {
"type": "object",
"additionalProperties": {}
}
},
"usage": {
"type": "object",
"additionalProperties": {}
}
}
},
"subagent.UpdateRequest": {
"type": "object",
"properties": {
"description": {
"type": "string"
},
"metadata": {
"type": "object",
"additionalProperties": {}
},
"name": {
"type": "string"
}
}
},
"subagent.UpdateSkillsRequest": {
"type": "object",
"properties": {
"skills": {
"type": "array",
"items": {
"type": "string"
}
}
}
}
}
}`
// SwaggerInfo holds exported Swagger Info so clients can modify it
var SwaggerInfo = &swag.Spec{
Version: "1.0.0",
Host: "",
BasePath: "",
Schemes: []string{},
Title: "Memoh API",
Description: "",
InfoInstanceName: "swagger",
SwaggerTemplate: docTemplate,
LeftDelim: "{{",
RightDelim: "}}",
}
func init() {
swag.Register(SwaggerInfo.InstanceName(), SwaggerInfo)
}