Reindex Knowledge Base
Endpoint
POST /apiops/projects/{projectName}/knowledge-bases/{name}/reindex/
Authentication
Requires a Personal API Access Token.
Header
Authorization: Bearer YOUR_TOKEN
Request
Headers
| Header | Value | Required |
|---|---|---|
| Authorization | Bearer {token} | Yes |
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| projectName | string | Yes | Project name |
| name | string | Yes | Knowledge 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 INDEXING → ACTIVE) 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
PENDINGbefore re-chunking and re-embedding. Query results may be incomplete while the knowledge base status isINDEXING. - When To Use: Trigger a reindex after changing
vectorDbRef,embeddingProviderRef,collectionName,chunkSize,chunkOverlaporembeddingModelId, 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+MANAGEpermission in the project.
Related Documentation
- Update Knowledge Base - Change the embedding/chunking configuration before reindexing
- Get Knowledge Base - Poll
statusto observe reindex progress - List Documents - Poll document
statusvalues - Knowledge Bases API - Resource overview