Skip to main content
POST
/
v1
/
knowledge
Create Knowledge Base
curl --request POST \
  --url https://api.xpander.ai/v1/knowledge \
  --header 'Content-Type: application/json' \
  --header 'x-api-key: <api-key>' \
  --data '
{
  "name": "Product Documentation",
  "description": "Contains product guides and API documentation"
}
'
{
  "id": "73dc30ca-bdbf-42f7-a39f-93aff4f8522e",
  "name": "Product Documentation",
  "description": "Contains product guides and API documentation",
  "type": "managed",
  "organization_id": "91fbe9bc-35b3-41e8-b59d-922fb5a0f031",
  "agent_id": null,
  "total_documents": 0
}
Create a new knowledge base in your organization to store and manage documents.

Request Body

name
string
required
Display name for the knowledge base
description
string
Optional description of the knowledge base purpose

Response

id
string
Unique identifier for the knowledge base (UUID)
name
string
Display name of the knowledge base
description
string
Description of the knowledge base (nullable)
type
string
Knowledge base type: managed
organization_id
string
UUID of the organization that owns this knowledge base
agent_id
string
Associated agent ID (nullable)
total_documents
integer
Number of documents in the knowledge base (initially 0)

Example Request

curl -X POST -H "x-api-key: <your-api-key>" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Technical Documentation",
    "description": "Internal technical guides and API documentation"
  }' \
  https://api.xpander.ai/v1/knowledge

Example Response

{
  "id": "<kb-id>",
  "name": "Product Catalog",
  "description": "Product information and specifications for customer support",
  "type": "managed",
  "organization_id": "<org-id>",
  "agent_id": null,
  "total_documents": 0
}

Notes

  • New knowledge bases start with zero documents
  • Use the returned id to add documents via the Add Documents endpoint

Authorizations

x-api-key
string
header
required

API Key for authentication

Body

application/json
name
string
required

Display name for the knowledge base

description
string | null

Optional description of the knowledge base purpose

Response

Successful Response

Represents a Knowledge Base item.

Attributes: id (str): KB unique identifier. name (str): KB name specified by the user. description (str): KB description specified by the user. type (KnowledgeBaseType): KB type, either managed or external. organization_id (str): Organization ID associated with the KB. total_documents (int): Total count of embedded documents. Defaults to 0.

id
string

KB unique identifier

name
string

KB name specified by the user

description
string | null

KB description specified by the user

type
enum<string>

KB type, managed / external

Available options:
managed,
external
organization_id
string

Organization ID

agent_id
string | null

Agent ID

total_documents
integer
default:0

Total count of embedded documents