Update Knowledge Base
Endpoint
PUT /apiops/projects/{projectName}/knowledge-bases/{name}/
Authentication
Requires a Personal API Access Token.
Header
Authorization: Bearer YOUR_TOKEN
Request
Headers
| Header | Value | Required |
|---|---|---|
| Authorization | Bearer {token} | Yes |
| Content-Type | application/json | Yes |
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| projectName | string | Yes | Project name |
| name | string | Yes | Knowledge base name (must already exist) |
Query Parameters
None
Request Body
Full JSON Body Example
{
"name": "product-docs",
"description": "Updated product documentation knowledge base",
"vectorDbRef": "qdrant-main",
"embeddingProviderRef": "openai-embeddings",
"collectionName": "product_docs",
"chunkSize": 800,
"chunkOverlap": 150,
"embeddingModelId": "text-embedding-3-large"
}
Request Body Fields
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
| name | string | No | path name | Knowledge base name. May be omitted (falls back to the path variable). If provided, it must match the path name (case-insensitive). |
| description | string | No | - | Free-text description |
| vectorDbRef | string | No | - | Name reference to the VectorDB connection backing this knowledge base |
| embeddingProviderRef | string | No | - | Name reference to the LLM provider used for embeddings |
| collectionName | string | No | - | Vector store collection/index name |
| chunkSize | integer | No | 1000 | Token count per chunk. An omitted/zero value keeps the default. |
| chunkOverlap | integer | No | 200 | Overlap tokens between consecutive chunks. An omitted/zero value keeps the default. |
| embeddingModelId | string | No | - | Embedding model identifier |
Notes
projectIdin the body is ignored — the project is always taken from the URL path.id,status,docCount,chunkCount,createdAtandupdatedAtare server-controlled. Counter and status fields are preserved and are not overwritten by the request body.- The knowledge base must already exist; otherwise a
400 Bad Requestis returned. To create-or-update in one call, use the upsert POST.
Response
Success Response (200 OK)
{
"status": "SUCCESS",
"deploymentResult": {
"success": true
}
}
Error Response (400 Bad Request)
{
"status": "FAILURE",
"resultMessage": "Knowledge base (name: product-docs) was not found!"
}
or
{
"status": "FAILURE",
"resultMessage": "Knowledge base name in path (product-docs) does not match name in body (other-name)!"
}
Error Response (401 Unauthorized)
{
"status": "FAILURE",
"resultMessage": "Token is not valid!"
}
cURL Example
curl -X PUT \
"https://demo.apinizer.com/apiops/projects/MyProject/knowledge-bases/product-docs/" \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"name": "product-docs",
"description": "Updated product documentation knowledge base",
"vectorDbRef": "qdrant-main",
"embeddingProviderRef": "openai-embeddings",
"collectionName": "product_docs",
"chunkSize": 800,
"chunkOverlap": 150,
"embeddingModelId": "text-embedding-3-large"
}'
Notes and Warnings
- Must Exist:
PUTonly updates an existing knowledge base. A non-existent name returns400 Bad Request. Use the upsert POST to create-or-update. - Name Match: If the body contains a
name, it must match the pathname(case-insensitive). - Project From Path Only: The body
projectIdis never trusted. - Server-Controlled Fields:
status,docCountandchunkCountremain server-maintained and are not affected by the request body. - Changing Embedding Settings: Changing
vectorDbRef,embeddingProviderRef,collectionNameor chunking settings does not automatically re-embed existing documents. Trigger a reindex to rebuild the vector index against the new configuration. - Permissions: Requires
AI_DEVELOPMENT+MANAGEpermission in the project.
Related Documentation
- Create Knowledge Base - Create or update a knowledge base (upsert)
- Reindex Knowledge Base - Rebuild the vector index
- Get Knowledge Base - Get a single knowledge base by name
- Knowledge Bases API - Resource overview