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…
POST /v1/knowledge/reindex
| Address | https://api.hanzo.ai/v1/knowledge/reindex |
| Method | POST |
| Operation | post_knowledge_reindex |
| Auth | Authorization: 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
| Status | Body | Meaning |
|---|---|---|
200 | knowledge.reindexOut | ok |
default | problem-details | refused |
200 body — 4 fields.
| Field | In | Type | Always | Description |
|---|---|---|---|---|
failed | body | integer (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. |
lexical | body | integer (int64) | — | Lexical is how many rows the org's lexical index holds now; 0 in a deployment without the index app. |
removed | body | integer (int64) | — | Removed is how many rows the lexical index held for documents that no longer exist; 0 without the index app. |
vectors | body | integer (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… |
Failure carries the platform error shape — see Errors.
Examples
hanzo knowledge reindeximport { 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();The method above is the one at the current release of the document. [email protected] (npm) was generated from an earlier release, where this operation carried a different id, so it spells the method differently — regenerating the clients is what makes the two agree. SDKs →
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_kb_connectors"
}
}
}'How is this guide?