Deletes an index and everything in it.
Deletes an index and everything in it. Drops the index and every document in it from the caller's own org, and answers the dialect's EnqueuedTask.
DELETE /v1/index/indexes/{uid}
| Address | https://api.hanzo.ai/v1/index/indexes/{uid} |
| Method | DELETE |
| Operation | delete_index_indexes_by_uid |
| Auth | Authorization: Bearer $HANZO_API_KEY |
Deletes an index and everything in it.
Drops the index and every document in it from the caller's own org, and answers the dialect's EnqueuedTask. This is the only way to retire an index; without it a mistaken uid is permanent. Deleting an index that is not there succeeds, so a cleanup pass is safe to re-run.
The 202 and its enqueued task are DIALECT COMPATIBILITY, not a promise of
later work: the documents are already gone when this answers.
Request
1 field.
| Field | In | Type | Required | Description |
|---|---|---|---|---|
uid | path | string | yes |
Response
| Status | Body | Meaning |
|---|---|---|
202 | indexEnqueued | accepted |
202 body — 5 fields.
| Field | In | Type | Always | Description |
|---|---|---|---|---|
enqueuedAt | body | string | — | EnqueuedAt is when the task was recorded, RFC 3339 — which is also when it completed. |
indexUid | body | string | — | IndexUID names the index the write landed in. |
status | body | string | — | Status is always enqueued, for dialect compatibility. |
taskUid | body | integer | — | TaskUID identifies the task for a client that polls it. |
type | body | string | — | Type is the dialect's name for the kind of write: indexCreation, indexDeletion, settingsUpdate, documentAdditionOrUpdate, documentDeletion. |
Failure carries the platform error shape — see Errors.
Examples
hanzo index indexes rm <uid>import { Configuration, IndexApi } from 'hanzoai';
const api = new IndexApi(new Configuration({ accessToken: process.env.HANZO_API_KEY }));
const { data } = await api.deleteIndexIndexesByUid({ uid: 'uid' });from hanzoai.cloud import ApiClient, Configuration
from hanzoai.cloud.api import IndexApi
client = ApiClient(Configuration(access_token=os.environ["HANZO_API_KEY"]))
result = IndexApi(client).delete_index_indexes_by_uid(uid='uid')cfg := cloud.NewConfiguration()
cfg.AddDefaultHeader("Authorization", "Bearer "+os.Getenv("HANZO_API_KEY"))
client := cloud.NewAPIClient(cfg)
resp, _, err := client.IndexAPI.DeleteIndexIndexesByUid(context.Background()).Execute()
if err != nil {
return err
}use hanzo_cloud::apis::{configuration::Configuration, index_api};
let mut cfg = Configuration::new();
cfg.bearer_access_token = std::env::var("HANZO_API_KEY").ok();
let result = index_api::delete_index_indexes_by_uid(&cfg, Default::default()).await?;import ai.hanzo.cloud.ApiClient;
import ai.hanzo.cloud.api.IndexApi;
ApiClient client = new ApiClient();
client.setRequestInterceptor(b -> b.header("Authorization", "Bearer " + System.getenv("HANZO_API_KEY")));
var result = new IndexApi(client).deleteIndexIndexesByUid();curl -X DELETE https://api.hanzo.ai/v1/index/indexes/<uid> \
-H "Authorization: Bearer $HANZO_API_KEY"The door reaches index through the index tool, which names its 17 operations with its own verbs — this one among them, under a name only the door 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": "get_index_health"
}
}
}'How is this guide?