Ana içeriğe geç

Update Knowledge Base

Endpoint

PUT /apiops/projects/{projectName}/knowledge-bases/{name}/

Authentication

Requires a Personal API Access Token.

Authorization: Bearer YOUR_TOKEN

Request

Headers

HeaderValueRequired
AuthorizationBearer {token}Yes
Content-Typeapplication/jsonYes

Path Parameters

ParameterTypeRequiredDescription
projectNamestringYesProject name
namestringYesKnowledge 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

FieldTypeRequiredDefaultDescription
namestringNopath nameKnowledge base name. May be omitted (falls back to the path variable). If provided, it must match the path name (case-insensitive).
descriptionstringNo-Free-text description
vectorDbRefstringNo-Name reference to the VectorDB connection backing this knowledge base
embeddingProviderRefstringNo-Name reference to the LLM provider used for embeddings
collectionNamestringNo-Vector store collection/index name
chunkSizeintegerNo1000Token count per chunk. An omitted/zero value keeps the default.
chunkOverlapintegerNo200Overlap tokens between consecutive chunks. An omitted/zero value keeps the default.
embeddingModelIdstringNo-Embedding model identifier

Notes

  • projectId in the body is ignored — the project is always taken from the URL path.
  • id, status, docCount, chunkCount, createdAt and updatedAt are 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 Request is 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: PUT only updates an existing knowledge base. A non-existent name returns 400 Bad Request. Use the upsert POST to create-or-update.
  • Name Match: If the body contains a name, it must match the path name (case-insensitive).
  • Project From Path Only: The body projectId is never trusted.
  • Server-Controlled Fields: status, docCount and chunkCount remain server-maintained and are not affected by the request body.
  • Changing Embedding Settings: Changing vectorDbRef, embeddingProviderRef, collectionName or 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 + MANAGE permission in the project.