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": "<string>",
  "description": "<string>"
}'
{
  "id": "<string>",
  "name": "<string>",
  "description": "<string>",
  "type": "managed",
  "organization_id": "<string>",
  "agent_id": "<string>",
  "total_documents": 0
}

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":"API Test KB","description":"Knowledge base for API testing"}' \
  https://api.xpander.ai/v1/knowledge

Example Response

{
  "id": "4be18afd-ccbd-4092-8686-75e9df2a1bec",
  "name": "API Test KB",
  "description": "Knowledge base for API testing",
  "type": "managed",
  "organization_id": "91fbe9bc-35b3-41e8-b59d-922fb5a0f031",
  "agent_id": null,
  "total_documents": 0
}

Authorizations

x-api-key
string
header
required

Body

application/json
name
string
required
description
string | null

Response

id
string
required
name
string
required
type
enum<string>
required
Available options:
managed,
external
organization_id
string
required
description
string | null
agent_id
string | null
total_documents
integer
default:0