Skip to main content
This action is irreversible. Proceed with caution.
Deletes the current index and all its associated data.
def delete_index(self,
                 *,
                 index_key: bytes = None,
                 user_id: bytes = None)
Deletes the current index and its associated data. This action is irreversible, so proceed with caution.

Parameters

ParameterTypeDescription
index_keybytes(Optional, keyword-only) Override the per-operation index key. See Per-operation key override. Must be the root index KEK.
user_idbytes(Optional, keyword-only) 16-byte RBAC user identifier.
Deleting an index is an admin operation gated on the root index KEK. It rejects RBAC user contexts — a per-user key cannot delete the index.

Exceptions

  • Throws if the index could not be deleted.

Example Usage

# Load index
index = client.load_index(
    index_name=index_name, 
    index_key=index_key
)

# Delete the index
index.delete_index()

Per-operation key override

The call above reuses the key supplied at create_index() / load_index(). You may instead pass index_key= (the root index KEK) to override the per-operation key, which is required in stateless/service deployments that reload the index per request:
index.delete_index(index_key=index_key)