Knowledge Base
Overview
The Knowledge Base API lets you manage your help center's content programmatically - assemble categories, publish entries, and change portal settings. A typical scenario: an AI agent creates a document, shares it, and publishes it to the base right away.
ℹ️ Info: Knowledge Base is a Business plan feature. The API is available on Pro and Business - on Pro, calls to Knowledge Base endpoints return a PLAN_LIMIT_REACHED error.
Creating and deleting a base itself happens in the dashboard - the API manages the settings and content of existing bases.
Scopes
| Scope | Grants |
|---|---|
| kb:read | Read bases, categories, and entries |
| kb:write | Change base settings, manage categories and entries |
Endpoints
| Method | Endpoint | Description | Scope |
|---|---|---|---|
| GET | /kb | List your bases | kb:read |
| GET | /kb/{id} | Base with categories and entries | kb:read |
| PATCH | /kb/{id} | Update base settings | kb:write |
| POST | /kb/{id}/categories | Create a category | kb:write |
| PATCH | /kb/{id}/categories/{categoryId} | Update a category | kb:write |
| DELETE | /kb/{id}/categories/{categoryId} | Delete a category | kb:write |
| POST | /kb/{id}/entries | Add an entry | kb:write |
| PATCH | /kb/{id}/entries/{entryId} | Update an entry | kb:write |
| DELETE | /kb/{id}/entries/{entryId} | Delete an entry | kb:write |
Publishing a document to a base
An entry points to a share link, so the full workflow has three steps:
Step 1 - Create a document
POST /documents - see the documents API.
Step 2 - Create a share link
POST /shares with a document_id - see the shares API.
Step 3 - Add an entry to the base
curl -X POST "https://my.clarife.app/api/v1/kb/{id}/entries" \
-H "Authorization: Bearer clrf_xxxxx" \
-H "Content-Type: application/json" \
-d '{
"share_id": "share-uuid",
"title": "Getting started",
"description": "Account setup step by step",
"category_id": "category-uuid",
"slug": "getting-started"
}'Entry fields: share_id (required), title (required, up to 200 characters), description (up to 1000 characters - feeds search results), category_id, slug (generated from the title when omitted), visibility (external/internal), sort_order.
Categories
curl -X POST "https://my.clarife.app/api/v1/kb/{id}/categories" \
-H "Authorization: Bearer clrf_xxxxx" \
-H "Content-Type: application/json" \
-d '{
"name": "Getting started",
"icon": "rocket",
"color": "#6366F1",
"sort_order": 0
}'- Tree up to 3 levels - create a subcategory by passing
parent_id. iconis a Lucide icon name,coloris a hex color.- Deleting a category removes its subcategories; entries stay (uncategorized).
Base settings
PATCH /kb/{id} accepts: name, slug, description, locale, branding_id, visibility (external/internal), allowed_emails, allowed_domains, is_active, is_indexable, home_entry_id (the home entry).
curl -X PATCH "https://my.clarife.app/api/v1/kb/{id}" \
-H "Authorization: Bearer clrf_xxxxx" \
-H "Content-Type: application/json" \
-d '{ "is_active": true, "home_entry_id": "entry-uuid" }'Limits and errors
| Code | Meaning |
|---|---|
| 409 + PLAN_LIMIT_REACHED | Category (20) or entry (200) limit reached |
| 409 + CONFLICT | Slug taken in this base, or the share is already attached |
| 403 + PLAN_LIMIT_REACHED | Account without the Business plan |
| 404 + NOT_FOUND | Base, category, or entry doesn't exist (or no access) |
MCP tools
All operations are also available as MCP server tools: list_knowledge_bases, get_knowledge_base, update_knowledge_base, create_kb_category, update_kb_category, delete_kb_category, create_kb_entry, update_kb_entry, delete_kb_entry.
💡 Tip: AI agents can read the clarife://guides/knowledge-base MCP resource - it describes the full publishing workflow (document → share → entry), categories, and limits.
Workspace context
With the X-Workspace-Id header, a workspace member with the Manage Knowledge Base permission operates on the workspace owner's bases - the same as in the dashboard.