Create reindex

Rebuilds the caller org's retrieval from its documents: every passage is removed, and every page, memory and source is cut into passages and embedded again with the configured model; the lexical index is reconciled to the same documents.

POST /v1/knowledge/reindex

Addresshttps://api.hanzo.ai/v1/knowledge/reindex
MethodPOST
Operationpost_knowledge_reindex
AuthAuthorization: Bearer $HANZO_API_KEY

Rebuilds the caller org's retrieval from its documents: every passage is removed, and every page, memory and source is cut into passages and embedded again with the configured model; the lexical index is reconciled to the same documents. It is what an operator runs after the embedding model changes — passages of another model are never compared with the query, so until then they are unread — and what puts an org's retrieval right after an outage of the ai plane. It requires ORG ADMIN and runs inline: an org's knowledge is a few thousand documents, and the answer is the count.

The request has no body. Response: {"vectors": 412, "lexical": 412, "removed": 3, "failed": 0}

Request

The document declares no body for POST /v1/knowledge/reindex. The handler is typed in cloud but its shape is not yet emitted, so the fields are not listed here — ask MCP's describe for post_knowledge_reindex, which answers from the running route.

Response

StatusBodyMeaning
200knowledge.reindexOutok
defaultproblem-detailsrefused

200 body — 4 fields.

FieldInTypeAlwaysDescription
failedbodyinteger (int64)—Failed is how many documents could not be indexed; each is logged with its name and has no passages — the rest of the rebuild went on without it.
lexicalbodyinteger (int64)—Lexical is how many rows the org's lexical index holds now; 0 in a deployment without the index app.
removedbodyinteger (int64)—Removed is how many rows the lexical index held for documents that no longer exist; 0 without the index app.
vectorsbodyinteger (int64)—Vectors is how many documents were read back, cut into passages, embedded and written to the org's passage store, which was emptied first — so it now holds these documents' passages and nothing else.

Failure carries the platform error shape — see Errors.

Examples

hanzo knowledge reindex
import { Configuration, KnowledgeApi } from 'hanzoai';

const api = new KnowledgeApi(new Configuration({ accessToken: process.env.HANZO_API_KEY }));
const { data } = await api.postKnowledgeReindex();
from hanzoai.cloud import ApiClient, Configuration
from hanzoai.cloud.api import KnowledgeApi

client = ApiClient(Configuration(access_token=os.environ["HANZO_API_KEY"]))
result = KnowledgeApi(client).post_knowledge_reindex()
cfg := hanzoai.NewConfiguration()
cfg.AddDefaultHeader("Authorization", "Bearer "+os.Getenv("HANZO_API_KEY"))
client := hanzoai.NewAPIClient(cfg)

resp, _, err := client.KnowledgeAPI.PostKnowledgeReindex(context.Background()).Execute()
if err != nil {
	return err
}
use hanzo_client::apis::{configuration::Configuration, knowledge_api};

let mut cfg = Configuration::new();
cfg.bearer_access_token = std::env::var("HANZO_API_KEY").ok();

let result = knowledge_api::post_knowledge_reindex(&cfg, Default::default()).await?;
import ai.hanzo.cloud.ApiClient;
import ai.hanzo.cloud.api.KnowledgeApi;

ApiClient client = new ApiClient();
client.setBearerToken(System.getenv("HANZO_API_KEY"));

var result = new KnowledgeApi(client).postKnowledgeReindex();
curl -X POST https://api.hanzo.ai/v1/knowledge/reindex \
  -H "Authorization: Bearer $HANZO_API_KEY"

MCP reaches knowledge through the knowledge tool, which names its 9 operations with its own verbs — this one among them, under a name only MCP declares. describe explains any of them:

curl -X POST https://api.hanzo.ai/v1/mcp \
  -H "Content-Type: application/json" \
  -d '{
       "jsonrpc": "2.0",
       "id": 1,
       "method": "tools/call",
       "params": {
         "name": "describe",
         "arguments": {
           "op": "list_knowledge_connectors"
         }
       }
     }'

Knowledge API · All Hanzo APIs · Interactive reference

Was this page useful?