Skip to main content
This action is irreversible. Proceed with caution.
To delete an existing encrypted index, you can connect to it and then call the delete_index() method.
from cyborgdb import Client

# Create a client
client = Client(
    base_url='http://localhost:8000', 
    api_key='your-api-key'
)

# Provide the same index key and config used when creating the index
index_key = your_existing_32_byte_key  # Must be the same key used originally

# Connect to the existing index
index = client.load_index(
    index_name="my_index", 
    index_key=index_key
)

# Delete the index
index.delete_index()
import { Client } from 'cyborgdb';

// Create a client
const client = new Client({ 
    baseUrl: 'http://localhost:8000', 
    apiKey: 'your-api-key' 
});

// Provide the same index key and config used when creating the index
const indexKey = yourExisting32ByteKey;  // Must be the same key used originally

// Connect to the existing index
const index = await client.loadIndex({ 
    indexName: "my_index", 
    indexKey
});

// Delete the index
await index.deleteIndex();
import { Client } from 'cyborgdb';

// Create a client
const client = new Client({ 
    baseUrl: 'http://localhost:8000', 
    apiKey: 'your-api-key' 
});

// Provide the same index key and config used when creating the index
const indexKey = yourExisting32ByteKey;  // Must be the same key used originally

// Connect to the existing index
const index = await client.loadIndex({ 
    indexName: "my_index", 
    indexKey
});

// Delete the index
await index.deleteIndex();
package main

import (
    "context"
    "log"
    
    "github.com/cyborginc/cyborgdb-go"
)

// Create client
client, err := cyborgdb.NewClient("http://localhost:8000", "your-api-key")
if err != nil {
    log.Fatal(err)
}

// Provide the same index key used when creating the index
indexKey := []byte("your-existing-32-byte-key") // Must be the same key used originally

// Connect to the existing index
index, err := client.LoadIndex(context.Background(), "my_index", indexKey)
if err != nil {
    log.Fatal(err)
}

// Delete the index
err = index.DeleteIndex(context.Background())
if err != nil {
    log.Fatal(err)
}
curl -X POST "http://localhost:8000/v1/indexes/delete" \
     -H "X-API-Key: your-api-key" \
     -H "Content-Type: application/json" \
     -d '{
       "index_name": "my_index",
       "index_key": "your_64_character_hex_key_here"
     }'

API Reference

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

REST API Reference

REST API reference for /v1/indexes/delete

Python SDK Reference

API reference for delete_index() in Python

JS/TS SDK Reference

API reference for deleteIndex() in JavaScript/TypeScript

Go SDK Reference

API reference for DeleteIndex() in Go