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

MethodEndpointDescription
GET/api/kbList KB entries
POST/api/kbCreate an entry
GET/api/kb/:idGet an entry
PATCH/api/kb/:idUpdate an entry
DELETE/api/kb/:idDelete an entry

List Entries

Retrieve knowledge base entries with optional filtering.

GET /api/kb

Query Parameters

ParameterTypeDefaultDescription
pageinteger1Page number
limitinteger20Items per page (max: 50)
categorystring-Filter by category
statusstringactiveFilter: active, archived, suggested
searchstring-Search in title and content
workspaceIdstring-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/kb

Request Body

FieldTypeRequiredDescription
titlestringYesEntry title
contentstringYesEntry content (Markdown supported)
categorystringNoCategory 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/:id

Example 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/:id

Request Body

FieldTypeDescription
titlestringNew title
contentstringNew content
categorystringNew category
statusstringactive 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/:id

Example 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:

SourceDescription
manualCreated via dashboard or API
importImported from external source
ticketGenerated from resolved ticket
suggestedAI-suggested entry awaiting review

Vector Embeddings

When you create or update an entry, Keva automatically:

  1. Generates vector embeddings for semantic search
  2. Indexes the content for the AI agent
  3. 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 information
  • billing - Billing and payments
  • account - Account management
  • technical - Technical support
  • product - Product-specific docs

Create custom categories by using any string value.