Reference

API Reference

Complete reference for all CognitionDesk REST API endpoints. The base URL for all requests is https://api.cognitiondesk.com.

🟒 Health & Diagnostics

Public health endpoints β€” no authentication required.

MethodEndpointDescription
GET/healthBasic server health check
GET/health/pingFast ping/pong
GET/health/statusDetailed status: memory, Node version
GET/health/qdrantQdrant vector DB diagnostics
GET/health/servicesAll critical services status
GET/diagnostics/qdrantFull Qdrant diagnostic with recommendations

πŸ‘€ Users

MethodEndpointDescription
POST/users/setupUserInitialize a new user account

πŸ”‘ API Keys

MethodEndpointDescription
POST/apikeys/generate-api-keyGenerate a new API key for the user

πŸ’¬ Chat

Two base paths: /chat-apiKeyAuth (API Key) and /chat-tokenAuth (Firebase Token). Both expose the same endpoints.

MethodEndpointDescription
POST/chat-apiKeyAuth/chatSend a message and receive a complete response
POST/chat-apiKeyAuth/streamSend a message and stream the response (SSE)
POST/chat-tokenAuth/chatChat with Firebase Token auth
POST/chat-tokenAuth/streamStream with Firebase Token auth

πŸ“„ Documents & Files

MethodEndpointDescription
POST/uploadUpload a document and generate embeddings
GET/documentsList all user documents
GET/documents/:id/vector-metadataGet Qdrant vector metadata for a document
GET/filesList user files
DELETE/files/:fileIdDelete a file
GET/files/statsStorage usage statistics

πŸ—„οΈ Storage

MethodEndpointDescription
POST/storage-tokenAuth/getPresignedUrlGet pre-signed S3 URL for direct upload
POST/storage-tokenAuth/getDownloadUrlGet pre-signed S3 URL for download
POST/vectorStorage-tokenAuth/storeEmbeddingsStore embeddings in Qdrant
DELETE/vectorStorage-tokenAuth/deleteEmbeddingsDelete embeddings from Qdrant
POST/firebase-storage/generate-upload-urlGet signed Firebase Storage upload URL

🧠 Knowledge Base

MethodEndpointDescription
GET/knowledge-base/statsKnowledge base statistics
GET/knowledge-base/entriesList entries with filters
GET/knowledge-base/entries/:idGet entry by ID
PATCH/knowledge-base/entries/:idUpdate an entry
DELETE/knowledge-base/entries/:idDelete from Firestore + Qdrant
POST/knowledge-base/ingest/urlIngest content from URL(s)
POST/knowledge-base/ingest/githubIngest from GitHub repository
POST/knowledge-base/ingest/textIngest plain text
POST/knowledge-base/ingest/imageIngest an image
POST/knowledge-base/ingest/documentIngest an uploaded document
GET/knowledge-base/chunksExplore vector chunks
POST/knowledge-base/searchSemantic search in the KB

πŸ€– AI Model Provider

MethodEndpointDescription
GET/model-provider/configGet current AI provider configuration
POST/model-provider/configUpdate provider configuration
POST/model-provider/testTest connection to AI provider
GET/model-provider/local/modelsList available local models
POST/model-provider/test-embeddingTest embedding generation
GET/model-provider/defaultsGet provider defaults and dimensions

πŸ“Š Usage & Billing

MethodEndpointDescription
GET/usage/currentCurrent usage for the user
GET/usage/analyticsUsage analytics
GET/usage/summaryDashboard usage summary
GET/usage/plansAvailable subscription plans
POST/usage/upgrade/initiateStart a plan upgrade
GET/billing/statusBilling status and token usage
GET/billing/invoicesUser invoices
GET/billing/payment-methodsPayment methods on file
POST/billing/checkoutCreate checkout for upgrade (LemonSqueezy)
POST/billing/recharge-tokensCreate checkout to recharge tokens
POST/billing/voucher/validateValidate a voucher code
POST/billing/webhook/lemonsqueezyLemonSqueezy webhook (direct)

🏒 Organizations

Base path: /firestore-tokenAuth/organizations

MethodEndpointDescription
POST/.../organizationsCreate organization
GET/.../organizationsList all organizations
GET/.../organizations/:orgIdGet organization by ID
PUT/.../organizations/:orgIdUpdate organization
DELETE/.../organizations/:orgIdDelete organization
POST/.../organizations/:orgId/membersAdd member
PUT/.../organizations/:orgId/members/:memberId/roleChange member role

πŸ€– Assistants & Workflows

Commands-first API. Use /assistants/commands for external integrations and automation.

MethodEndpointDescription
GET/assistants/List user's assistants
POST/assistants/Create assistant (legacy path, still supported)
PUT/assistants/:assistantIdUpdate assistant (legacy path)
PATCH/assistants/:assistantIdPatch assistant (legacy path)
PUT/assistants/:assistantId/workflowAssign workflow to assistant
DELETE/assistants/:assistantId/workflowRemove workflow from assistant
POST/assistants/commandsUnified commands endpoint for assistants/workflows/tasks
GET/assistants/commands/auditRead command execution audit logs
GET/workflows/List workflows
POST/workflows/Create workflow
PUT/workflows/:workflowIdUpdate workflow
DELETE/workflows/:workflowIdDelete workflow
POST/workflows/test-draftTest workflow draft
POST/workflows/:workflowId/duplicateDuplicate workflow
GET/workflows/:workflowId/analyticsWorkflow analytics

🚦 Plan Limits & 429 Behavior

Assistant, workflow, and task creation now passes through usage tracking and enforces plan limits on both commands and legacy create endpoints.

MethodEndpointDescription
POST/assistants/commandsReturns 429 when assistants/workflows/tasks plan limit is reached
POST/assistants/Legacy assistant create also enforces plan limits
POST/workflows/Legacy workflow create also enforces plan limits
POST/tasks/Legacy task create also enforces plan limits
GET/usage/currentInspect current counters and limits for your plan

πŸ› οΈ Tools

MethodEndpointDescription
GET/tools/List all registered tools
GET/tools/categoriesTools by category
GET/tools/availableTools available in user context
POST/tools/resultSubmit tool execution result (from frontend)
GET/tools/pending/:threadIdPending tool executions for a thread
PATCH/tools/:name/toggleEnable/disable a tool

πŸ“± Messaging Platforms

MethodEndpointDescription
POST/platforms/connectConnect a platform
POST/platforms/disconnectDisconnect a platform
GET/platforms/statusHealth status of connected platforms
GET/platforms/listList connected platforms
POST/platforms/send-messageSend a message via a platform
POST/platforms/broadcastBroadcast to all contacts
POST/platforms/web-widget/createCreate web chat widget
GET/platforms/web-widget/listList web widgets

πŸ’¬ WhatsApp Business

Base path: /platforms/whatsapp

MethodEndpointDescription
POST/.../connectConnect WhatsApp Business account
GET/.../listList WhatsApp connections
DELETE.../:connectionIdDisconnect account
GET.../:connectionId/conversationsList conversations
GET.../:connectionId/conversations/:convId/messagesGet messages in a conversation
POST.../:connectionId/sendSend a WhatsApp message
GET.../:connectionId/contactsView contacts

πŸ”Œ REST API Connections

MethodEndpointDescription
POST/rest-api-connections/Create a connection
GET/rest-api-connections/List connections
PUT/rest-api-connections/:idUpdate connection
POST/rest-api-connections/:id/executeExecute outgoing API call
POST/rest-api-connections/:id/testTest the connection
GET/rest-api-connections/:id/logsView execution logs
ALL/api/gateway/:slugInbound API gateway β€” routes by slug
API Reference β€” CognitionDesk Docs