API Reference
Knowledge Base API
Manage knowledge base entries via the API
The Knowledge Base API allows you to create, retrieve, update, and manage knowledge base entries that power Keva's AI responses.
Endpoints
| Method | Endpoint | Description |
|---|---|---|
| GET | /api/kb | List KB entries |
| POST | /api/kb | Create an entry |
| GET | /api/kb/:id | Get an entry |
| PATCH | /api/kb/:id | Update an entry |
| DELETE | /api/kb/:id | Delete an entry |
List Entries
Retrieve knowledge base entries with optional filtering.
GET /api/kbQuery Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
page | integer | 1 | Page number |
limit | integer | 20 | Items per page (max: 50) |
category | string | - | Filter by category |
status | string | active | Filter: active, archived, suggested |
search | string | - | Search in title and content |
workspaceId | string | - | Filter by workspace |
Example Request
curl "https://app.keva.support/api/kb?category=billing&limit=10" \
-H "Authorization: Bearer keva_live_your_api_key"Example Response
{
"entries": [
{
"id": "kb_abc123",
"title": "How to request a refund",
"content": "To request a refund, follow these steps:\n\n1. Go to Orders...",
"category": "billing",
"status": "active",
"source": "manual",
"createdBy": "user_xyz",
"createdAt": "2024-01-10T09:00:00Z",
"updatedAt": "2024-01-12T14:30:00Z"
}
],
"total": 45,
"page": 1,
"totalPages": 5
}Create Entry
Add a new knowledge base entry.
POST /api/kbRequest Body
| Field | Type | Required | Description |
|---|---|---|---|
title | string | Yes | Entry title |
content | string | Yes | Entry content (Markdown supported) |
category | string | No | Category for organization |
Example Request
curl -X POST https://app.keva.support/api/kb \
-H "Authorization: Bearer keva_live_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"title": "Password reset process",
"content": "## How to reset your password\n\n1. Click **Forgot Password** on the login page\n2. Enter your email address\n3. Check your inbox for the reset link\n4. Click the link and create a new password\n\nThe link expires after 24 hours.",
"category": "account"
}'Example Response
{
"id": "kb_new123",
"title": "Password reset process",
"content": "## How to reset your password...",
"category": "account",
"status": "active",
"source": "manual",
"createdBy": "user_abc",
"createdAt": "2024-01-15T16:00:00Z",
"updatedAt": "2024-01-15T16:00:00Z"
}Get Entry
Retrieve a single knowledge base entry.
GET /api/kb/:idExample Request
curl https://app.keva.support/api/kb/kb_abc123 \
-H "Authorization: Bearer keva_live_your_api_key"Update Entry
Update an existing knowledge base entry.
PATCH /api/kb/:idRequest Body
| Field | Type | Description |
|---|---|---|
title | string | New title |
content | string | New content |
category | string | New category |
status | string | active or archived |
Example Request
curl -X PATCH https://app.keva.support/api/kb/kb_abc123 \
-H "Authorization: Bearer keva_live_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"content": "Updated content with new instructions...",
"category": "getting-started"
}'Delete Entry
Delete a knowledge base entry.
DELETE /api/kb/:idExample Request
curl -X DELETE https://app.keva.support/api/kb/kb_abc123 \
-H "Authorization: Bearer keva_live_your_api_key"Response
Returns 204 No Content on success.
Entry Sources
Entries can have different sources:
| Source | Description |
|---|---|
manual | Created via dashboard or API |
import | Imported from external source |
ticket | Generated from resolved ticket |
suggested | AI-suggested entry awaiting review |
Vector Embeddings
When you create or update an entry, Keva automatically:
- Generates vector embeddings for semantic search
- Indexes the content for the AI agent
- Makes the entry available for response generation
This process is asynchronous and typically completes within seconds.
Categories
Categories help organize entries and can be used to scope AI responses. Common categories:
general- General informationbilling- Billing and paymentsaccount- Account managementtechnical- Technical supportproduct- Product-specific docs
Create custom categories by using any string value.