diff --git a/API_REFERENCE.md b/API_REFERENCE.md
new file mode 100644
index 0000000..20fc387
--- /dev/null
+++ b/API_REFERENCE.md
@@ -0,0 +1,720 @@
+# API Reference
+
+Complete API reference for the FreeScout Knowledge Base API module.
+
+## Base URL
+
+All API endpoints are relative to your FreeScout installation:
+```
+https://your-freescout.com/api/kb
+```
+
+## Authentication
+
+### Public Endpoints
+Public endpoints do not require authentication:
+```
+GET /api/kb/public/*
+```
+
+### Protected Endpoints
+Protected endpoints require the FreeScout API key in the request header:
+```
+X-FreeScout-API-Key: your_api_key_here
+```
+
+Example with curl:
+```bash
+curl -H "X-FreeScout-API-Key: YOUR_KEY" \
+ https://your-freescout.com/api/kb/articles
+```
+
+## Response Format
+
+All endpoints return JSON with a consistent structure:
+
+### Success Response
+```json
+{
+ "success": true,
+ "data": { /* response data */ }
+}
+```
+
+### Error Response
+```json
+{
+ "success": false,
+ "error": "Error message",
+ "message": "Detailed error description"
+}
+```
+
+---
+
+## Endpoints
+
+### 1. Health Check
+
+Check if the API is operational.
+
+**Endpoint:** `GET /api/kb/health`
+
+**Authentication:** None required
+
+**Response:**
+```json
+{
+ "status": "ok",
+ "module": "KnowledgeBaseAPI",
+ "version": "1.0.0"
+}
+```
+
+**Example:**
+```bash
+curl https://your-freescout.com/api/kb/health
+```
+
+---
+
+### 2. List Categories
+
+Get all knowledge base categories with hierarchical structure.
+
+**Endpoint:**
+- Public: `GET /api/kb/public/categories`
+- Protected: `GET /api/kb/categories`
+
+**Authentication:**
+- Public: None
+- Protected: API key required
+
+**Response:**
+```json
+{
+ "success": true,
+ "data": [
+ {
+ "id": 1,
+ "name": "Getting Started",
+ "description": "New user guides",
+ "slug": "getting-started",
+ "parent_id": null,
+ "order": 1,
+ "created_at": "2025-01-01 10:00:00",
+ "updated_at": "2025-01-15 14:30:00",
+ "children": [
+ {
+ "id": 3,
+ "name": "First Steps",
+ "description": "Your first steps",
+ "slug": "first-steps",
+ "parent_id": 1,
+ "order": 1,
+ "created_at": "2025-01-02 10:00:00",
+ "updated_at": "2025-01-16 14:30:00",
+ "children": []
+ }
+ ]
+ }
+ ],
+ "count": 1
+}
+```
+
+**Example:**
+```bash
+# Public
+curl https://your-freescout.com/api/kb/public/categories
+
+# Protected
+curl -H "X-FreeScout-API-Key: YOUR_KEY" \
+ https://your-freescout.com/api/kb/categories
+```
+
+---
+
+### 3. Get Category
+
+Get a specific category with its articles.
+
+**Endpoint:**
+- Public: `GET /api/kb/public/categories/{id}`
+- Protected: `GET /api/kb/categories/{id}`
+
+**Authentication:**
+- Public: None
+- Protected: API key required
+
+**Parameters:**
+- `id` (integer, required): Category ID
+
+**Response:**
+```json
+{
+ "success": true,
+ "data": {
+ "category": {
+ "id": 1,
+ "name": "Getting Started",
+ "description": "New user guides",
+ "slug": "getting-started",
+ "parent_id": null,
+ "order": 1,
+ "created_at": "2025-01-01 10:00:00",
+ "updated_at": "2025-01-15 14:30:00"
+ },
+ "articles": [
+ {
+ "id": 1,
+ "title": "Welcome to Our Platform",
+ "slug": "welcome",
+ "excerpt": "Learn the basics...",
+ "views": 150,
+ "created_at": "2025-01-01 10:00:00",
+ "updated_at": "2025-01-15 14:30:00"
+ }
+ ],
+ "article_count": 1
+ }
+}
+```
+
+**Example:**
+```bash
+# Public
+curl https://your-freescout.com/api/kb/public/categories/1
+
+# Protected
+curl -H "X-FreeScout-API-Key: YOUR_KEY" \
+ https://your-freescout.com/api/kb/categories/1
+```
+
+---
+
+### 4. List Articles
+
+Get all knowledge base articles with pagination.
+
+**Endpoint:**
+- Public: `GET /api/kb/public/articles`
+- Protected: `GET /api/kb/articles`
+
+**Authentication:**
+- Public: None
+- Protected: API key required
+
+**Query Parameters:**
+- `category_id` (integer, optional): Filter by category ID
+- `page` (integer, optional): Page number (default: 1)
+- `per_page` (integer, optional): Items per page (default: 20)
+
+**Response:**
+```json
+{
+ "success": true,
+ "data": [
+ {
+ "id": 1,
+ "category_id": 1,
+ "title": "Welcome to Our Platform",
+ "slug": "welcome",
+ "excerpt": "Learn the basics of our platform...",
+ "views": 150,
+ "created_at": "2025-01-01 10:00:00",
+ "updated_at": "2025-01-15 14:30:00",
+ "category": {
+ "id": 1,
+ "name": "Getting Started",
+ "description": "New user guides",
+ "slug": "getting-started"
+ }
+ }
+ ],
+ "pagination": {
+ "total": 45,
+ "per_page": 20,
+ "current_page": 1,
+ "total_pages": 3
+ }
+}
+```
+
+**Examples:**
+```bash
+# Public - all articles
+curl https://your-freescout.com/api/kb/public/articles
+
+# Public - articles in category 1
+curl https://your-freescout.com/api/kb/public/articles?category_id=1
+
+# Public - page 2 with 10 items per page
+curl "https://your-freescout.com/api/kb/public/articles?page=2&per_page=10"
+
+# Protected
+curl -H "X-FreeScout-API-Key: YOUR_KEY" \
+ https://your-freescout.com/api/kb/articles
+```
+
+---
+
+### 5. Get Article
+
+Get a specific article with full content.
+
+**Endpoint:**
+- Public: `GET /api/kb/public/articles/{id}`
+- Protected: `GET /api/kb/articles/{id}`
+
+**Authentication:**
+- Public: None
+- Protected: API key required
+
+**Parameters:**
+- `id` (integer, required): Article ID
+
+**Response:**
+```json
+{
+ "success": true,
+ "data": {
+ "article": {
+ "id": 1,
+ "category_id": 1,
+ "title": "Welcome to Our Platform",
+ "slug": "welcome",
+ "content": "
Welcome!
This is the full article content...
",
+ "excerpt": "Learn the basics of our platform...",
+ "status": "published",
+ "visibility": "public",
+ "order": 1,
+ "views": 151,
+ "created_at": "2025-01-01 10:00:00",
+ "updated_at": "2025-01-15 14:30:00"
+ },
+ "category": {
+ "id": 1,
+ "name": "Getting Started",
+ "description": "New user guides",
+ "slug": "getting-started"
+ }
+ }
+}
+```
+
+**Note:** Requesting an article automatically increments its view count.
+
+**Examples:**
+```bash
+# Public
+curl https://your-freescout.com/api/kb/public/articles/1
+
+# Protected
+curl -H "X-FreeScout-API-Key: YOUR_KEY" \
+ https://your-freescout.com/api/kb/articles/1
+```
+
+---
+
+### 6. Search Articles
+
+Search for articles by query string.
+
+**Endpoint:**
+- Public: `GET /api/kb/public/search`
+- Protected: `GET /api/kb/search`
+
+**Authentication:**
+- Public: None
+- Protected: API key required
+
+**Query Parameters:**
+- `q` (string, required): Search query
+
+**Search Fields:**
+The search looks for the query in:
+- Article title
+- Article content
+- Article excerpt
+
+**Response:**
+```json
+{
+ "success": true,
+ "query": "password reset",
+ "data": [
+ {
+ "id": 5,
+ "category_id": 2,
+ "title": "How to Reset Your Password",
+ "slug": "reset-password",
+ "excerpt": "Follow these steps to reset your password...",
+ "views": 450,
+ "created_at": "2025-01-03 10:00:00",
+ "updated_at": "2025-01-20 14:30:00",
+ "category": {
+ "id": 2,
+ "name": "Account Management",
+ "description": "Managing your account",
+ "slug": "account-management"
+ }
+ }
+ ],
+ "count": 1
+}
+```
+
+**Examples:**
+```bash
+# Public
+curl "https://your-freescout.com/api/kb/public/search?q=password"
+
+# Protected
+curl -H "X-FreeScout-API-Key: YOUR_KEY" \
+ "https://your-freescout.com/api/kb/search?q=password%20reset"
+```
+
+---
+
+## JavaScript Client Reference
+
+### FreeScoutKBClient Class
+
+#### Constructor
+```javascript
+new FreeScoutKBClient(baseUrl, apiKey)
+```
+
+**Parameters:**
+- `baseUrl` (string, required): FreeScout installation URL
+- `apiKey` (string, optional): API key for protected endpoints
+
+**Example:**
+```javascript
+// Public endpoints only
+const client = new FreeScoutKBClient('https://your-freescout.com');
+
+// With API key for protected endpoints
+const client = new FreeScoutKBClient('https://your-freescout.com', 'YOUR_API_KEY');
+```
+
+#### Methods
+
+##### getCategories()
+```javascript
+async getCategories()
+```
+
+Returns all public categories with hierarchical structure.
+
+**Returns:** `Promise`
+
+**Example:**
+```javascript
+const categories = await client.getCategories();
+console.log(categories);
+```
+
+##### getCategory(categoryId)
+```javascript
+async getCategory(categoryId)
+```
+
+Get a specific category with its articles.
+
+**Parameters:**
+- `categoryId` (number): Category ID
+
+**Returns:** `Promise