KrosAI Docs
DashboardGet Started
  • Getting Started
    • Introduction
    • Quickstart Guide
    • Authentication
  • OpenAI SDK Compatability
  • Endpoints
    • Completions API
      • Create Chat Completion
    • Translation API
    • Text Summarization API
    • Audio Transcription API
    • Sentiment Analysis API
  • AGENT
    • Agents API
      • Create Agent
      • List Agents
      • Get Agent
      • Update Agent
      • Delete Agent
      • Start Voice Session
    • Conversations API
      • Create Conversation
      • List Conversations
      • Get Conversation
      • Get Conversation Messages
    • Knowledge Base API
      • Create Knowledge Base
      • List Knowledge Base
      • Upload Document
      • List Document
  • Resources
    • AI Voice Agents
    • In-App Voice Assistants
    • Virtual Health Assistants
    • EdTech Language Tutors
  • SDKS
    • Node.JS SDK
    • React Native SDK
    • Flutter
Powered by GitBook
On this page
  • Endpoint
  • Authentication
  • Request Body
  • Response
  • Example Request
  • Example Response
  • Error Responses
  • Notes
  1. AGENT
  2. Knowledge Base API

Create Knowledge Base

Creates a new knowledge base for storing documents and reference materials.

Endpoint

POST /v1/knowledge-bases

Authentication

Requires a valid API key or user authentication token.

Request Body

{
  "name": "string",
  "description": "string"
}

Request Fields

Field
Type
Required
Description

name

string

Yes

Name of the knowledge base

description

string

No

Description of the knowledge base's purpose and contents

Response

Returns the created knowledge base object.

Response Format

{
  "id": "string",
  "name": "string",
  "description": "string",
  "created_at": "datetime",
  "updated_at": "datetime",
  "created_by": "string",
  "document_count": 0
}

Response Fields

Field
Type
Description

id

string

Unique identifier for the knowledge base

name

string

Name of the knowledge base

description

string

Description of the knowledge base

created_at

datetime

When the knowledge base was created

updated_at

datetime

When the knowledge base was last updated

created_by

string

ID of the user who created the knowledge base

document_count

integer

Number of documents in the knowledge base

Example Request

curl -X POST "https://api.krosai.com/v1/knowledge-bases" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Product Documentation",
    "description": "Technical documentation and user guides for KrosAI products"
  }'

Example Response

{
  "id": "kb-a1b2c3d4-e5f6-7890-abcd-ef1234567890",
  "name": "Product Documentation",
  "description": "Technical documentation and user guides for KrosAI products",
  "created_at": "2023-07-10T15:30:00Z",
  "updated_at": "2023-07-10T15:30:00Z",
  "created_by": "user-12345",
  "document_count": 0
}

Error Responses

Status Code
Description

400

Bad Request - Invalid input data

401

Unauthorized - Invalid or missing API key

500

Internal Server Error

Notes

  • A new knowledge base starts with zero documents

  • Knowledge bases can be immediately linked to agents

  • Names should be descriptive and unique within your account

  • The description helps users understand the knowledge base's purpose

  • Document count updates automatically as files are added or removed

PreviousKnowledge Base APINextList Knowledge Base

Last updated 2 months ago