API ReferenceKnowledge bases

Create new Knowledge Base

POST
/api/knowledge-bases

Creates a new Knowledge Base for the authenticated user's organization.

Authorization

ApiKeyAuth
AuthorizationBearer <token>

Bearer token for API authentication

In: header

Request Body

application/json

name*string

Unique name for the Knowledge Base

description*string

Description of the Knowledge Base

schema*object

Required JSON schema for documents

indexingPreferences?object

Indexing preferences

Response Body

application/json

application/json

application/json

application/json

curl -X POST "https://app.docutray.com/api/knowledge-bases" \  -H "Content-Type: application/json" \  -d '{    "name": "User Manual",    "description": "System usage documentation",    "schema": {}  }'
{
  "data": {
    "id": "string",
    "name": "string",
    "description": "string",
    "schema": {},
    "isActive": true,
    "createdAt": "2019-08-24T14:15:22Z"
  }
}
{
  "message": "Validation error",
  "errors": [
    "string"
  ]
}
Empty
Empty
{
  "message": "A knowledge base with this name already exists"
}
Empty
{
  "message": "Internal server error"
}