API Reference : Embed AI Chat Widget | CollowAI
Skip to content
API Reference

API Reference

Build custom integrations, automate workflows, and manage assistants programmatically.

Note: CollowAI's application API runs on Railway. REST endpoints are available for widget chat, webhooks, and programmatic access. See the sections below for details.

HTTP Endpoints

These HTTP endpoints are available for widget embedding and webhook handling:

POST/api/chat

Send a message to an assistant and receive an AI-generated response. Used by the embeddable widget. Accepts assistant ID, user message, and optional conversation context.

POST/api/webhooks/polar

Webhook receiver for Polar.sh payment events (subscriptions, invoices, etc.). Configure this in your Polar.sh organization settings.

Backend API

The CollowAI application API runs on Railway. All endpoints are accessible via the REST API. Common resource groups include:

Assistants

Create, update, delete, and query assistants. Manage their configurations, models, and status.

Conversations

List conversations, send messages, and retrieve message history for any assistant.

Knowledge Sources

Upload documents, manage database connections, and configure knowledge bases for each assistant.

Integrations

Connect and manage third-party integrations, view sync status, and trigger manual syncs.

Widget Config

Configure and retrieve widget settings including branding, positioning, and custom CSS for embedded chat.

Second Brain

Query structured knowledge: entities, facts, topics, relationships, and conflicts extracted from your documents.

Billing & Subscriptions

Query subscription status, list invoices, and manage billing information.

Client SDK Usage

For custom integrations, use the REST API directly:

# List assistants
curl -H "Authorization: Bearer assai_*" \
  https://api.collowai.com/api/v1/assistants

# Create an assistant
curl -X POST \
  -H "Authorization: Bearer assai_*" \
  -H "Content-Type: application/json" \
  -d '{"name": "My Assistant"}' \
  https://api.collowai.com/api/v1/assistants

# Get Second Brain stats
curl -H "Authorization: Bearer assai_*" \
  https://api.collowai.com/api/v1/assistants/{assistantId}/brain/stats

# List brain entities
curl -H "Authorization: Bearer assai_*" \
  https://api.collowai.com/api/v1/assistants/{assistantId}/brain/entities

# List brain facts
curl -H "Authorization: Bearer assai_*" \
  https://api.collowai.com/api/v1/assistants/{assistantId}/brain/facts

# List brain topics
curl -H "Authorization: Bearer assai_*" \
  https://api.collowai.com/api/v1/assistants/{assistantId}/brain/topics

# List brain relationships
curl -H "Authorization: Bearer assai_*" \
  https://api.collowai.com/api/v1/assistants/{assistantId}/brain/relationships

# List brain conflicts
curl -H "Authorization: Bearer assai_*" \
  https://api.collowai.com/api/v1/assistants/{assistantId}/brain/conflicts

# Get brain extractions history
curl -H "Authorization: Bearer assai_*" \
  https://api.collowai.com/api/v1/assistants/{assistantId}/brain/extractions

Authentication

API requests are authenticated using API keys generated from your dashboard (Settings → API Keys). Include your key in the Authorization header:

Authorization: Bearer YOUR_API_KEY

अपडेट रहें

नई सुविधाओं, सुझावों और अपडेट के बारे में सूचनाएं प्राप्त करें। कोई स्पैम नहीं। बस अच्छी सामग्री।

हमारे न्यूज़लेटर से जुड़ें। कभी भी अनसब्सक्राइब करें।