Ana içeriğe geç

Reindex Knowledge Base

Endpoint

POST /apiops/projects/{projectName}/knowledge-bases/{name}/reindex/

Authentication

Requires a Personal API Access Token.

Authorization: Bearer YOUR_TOKEN

Request

Headers

HeaderValueRequired
AuthorizationBearer {token}Yes

Path Parameters

ParameterTypeRequiredDescription
projectNamestringYesProject name
namestringYesKnowledge base name

Query Parameters

None

Request Body

None. This endpoint does not require a request body.

Response

Success Response (200 OK)

{
"status": "SUCCESS",
"deploymentResult": {
"success": true
}
}

The reindex runs asynchronously. A success response means the job was accepted and started, not that indexing has completed. Poll the knowledge base (status transitions INDEXINGACTIVE) or its documents (status transitions to INDEXED) to observe progress.

Error Response (400 Bad Request)

{
"status": "FAILURE",
"resultMessage": "Knowledge base (name: product-docs) was not found!"
}

or

{
"status": "FAILURE",
"resultMessage": "Knowledge base name can not be empty!"
}

Error Response (401 Unauthorized)

{
"status": "FAILURE",
"resultMessage": "Token is not valid!"
}

cURL Example

curl -X POST \
"https://demo.apinizer.com/apiops/projects/MyProject/knowledge-bases/product-docs/reindex/" \
-H "Authorization: Bearer YOUR_TOKEN"

Notes and Warnings

  • Asynchronous: The endpoint returns immediately once the job is accepted. Indexing continues in the background.
  • Destructive Rebuild: Reindex drops the VectorDB collection and resets every document to PENDING before re-chunking and re-embedding. Query results may be incomplete while the knowledge base status is INDEXING.
  • When To Use: Trigger a reindex after changing vectorDbRef, embeddingProviderRef, collectionName, chunkSize, chunkOverlap or embeddingModelId, since those changes do not automatically re-embed existing documents.
  • Concurrency Guard: The service re-checks knowledge base ownership and guards against concurrent index jobs.
  • Permissions: Requires AI_DEVELOPMENT + MANAGE permission in the project.