> ## Documentation Index
> Fetch the complete documentation index at: https://docs.cyborg.co/llms.txt
> Use this file to discover all available pages before exploring further.

# Delete an Encrypted Index

<Warning>This action is irreversible. Proceed with caution.</Warning>

To delete an existing encrypted index, you can [load it](./load-index) and then call the `delete_index()` method.

<CodeGroup>
  ```python Python icon="python" theme={null}
  import cyborgdb_core as cyborgdb

  # Get your API key
  api_key = "your_api_key_here"  # Replace with your CyborgDB API key

  # Create a client (use the same backing store the index was created with)
  client = cyborgdb.Client(api_key, cyborgdb.StorageConfig.disk("/tmp/cyborgdb"))

  # Provide the SAME 32-byte key used when the index was created.
  # Retrieve it from your KMS/secret store — a fresh random key here would fail the load.
  index_key = bytes.fromhex("...")  # the 64-char hex of your existing 32-byte index key

  # Load the encrypted index
  index = client.load_index("my_index", index_key)

  # Delete the index
  index.delete_index()
  ```

  ```cpp C++ icon="brackets-curly" theme={null}
  #include "cyborgdb_core/client.hpp"
  #include "cyborgdb_core/encrypted_index.hpp"
  #include <array>

  // Get your API key
  std::string api_key = "your_api_key_here";  // Replace with your CyborgDB API key

  // Create a client (use the same backing store the index was created with)
  cyborg::Client client(api_key, cyborg::StorageConfig::Disk("/tmp/cyborgdb"), 0, cyborg::kNone);

  // Provide the index key used when creating the index
  // Example key (32 bytes)
  std::array<uint8_t, 32> index_key;

  // Load the encrypted index
  auto index = client.LoadIndex("my_index", index_key);

  // Delete the index
  index->DeleteIndex(index_key);
  ```
</CodeGroup>

## API Reference

For more information on deleting an encrypted index, refer to the API reference:

<CardGroup cols={2}>
  <Card title="Python API Reference" href="../../python/encrypted-index/delete-index" icon="python">
    API reference for `delete_index()` in Python
  </Card>

  <Card title="C++ API Reference" href="../../cpp/encrypted-index/delete-index" icon="brackets-curly">
    API reference for `DeleteIndex()` in C++
  </Card>
</CardGroup>
