Skip to main content
PATCH
/
v1
/
knowledge
/
{kb_id}
Update Knowledge Base
curl --request PATCH \
  --url https://api.xpander.ai/v1/knowledge/{kb_id} \
  --header 'Content-Type: application/json' \
  --header 'x-api-key: <api-key>' \
  --data '
{
  "name": "Updated Knowledge Base",
  "description": "Updated description"
}
'
{
  "id": "73dc30ca-bdbf-42f7-a39f-93aff4f8522e",
  "name": "Updated Knowledge Base",
  "description": "Updated description",
  "type": "managed",
  "organization_id": "91fbe9bc-35b3-41e8-b59d-922fb5a0f031",
  "agent_id": null,
  "total_documents": 5
}
Modify a knowledge base’s configuration. Only provided fields will be updated.

Path Parameters

kb_id
string
required
Unique identifier of the knowledge base to update (UUID format)

Request Body

name
string
Display name for the knowledge base
description
string
Optional description of the knowledge base purpose
agent_id
string
UUID of the agent to attach this knowledge base to

Response

Returns the updated knowledge base object with the structure matching Get Knowledge Base.

Example Request

curl -X PATCH -H "x-api-key: <your-api-key>" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Updated Product Catalog",
    "description": "Revised product information and specifications"
  }' \
  https://api.xpander.ai/v1/knowledge/<kb-id>

Example Response

{
  "id": "<kb-id>",
  "name": "Product Catalog v2",
  "description": "Updated product information and pricing details",
  "type": "managed",
  "organization_id": "<org-id>",
  "agent_id": null,
  "total_documents": 0
}

Notes

  • All fields in the request body are optional
  • Fields not provided in the request will retain their existing values
  • Returns 404 if the knowledge base is not found

Authorizations

x-api-key
string
header
required

API Key for authentication

Path Parameters

kb_id
string
required

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