> ## 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 Index

<Warning>This action is irreversible. All items, vectors and metadata will be permanently lost.</Warning>

Permanently delete an index and all its data.

## Authentication

Required - **admin (root) API key** via `X-API-Key` header. Per-user (`cdbk_`) keys are rejected with `403` — a per-user credential operates on data, not index lifecycle:

```http theme={null}
X-API-Key: cyborg_your_api_key_here
```

When RBAC is not enabled (`CYBORGDB_SERVICE_ROOT_KEY` unset), no header is required.

## Request Body

```json theme={null}
{
  "index_name": "my_index",
  "index_key": "64_character_hex_string_representing_32_bytes"
}
```

<Expandable title="parameters">
  <ParamField body="index_name" type="string" required="true">
    Name of the index to delete
  </ParamField>

  <ParamField body="index_key" type="string">
    32-byte encryption key as a hex string. Required for indexes created with the SDK-supplied KEK path; omit for KMS-backed indexes (the service resolves the key from the index's stored key envelope).
  </ParamField>
</Expandable>

## Response

```json theme={null}
{
  "status": "success",
  "message": "Index 'my_index' deleted successfully"
}
```

## Exceptions

<AccordionGroup>
  <Accordion title="401 Unauthorized">
    Authentication failed (invalid API key) **or** wrong `index_key` on SDK-supplied indexes — see [error model](../introduction#error-model-api-keys-index-keys-and-kms)
  </Accordion>

  <Accordion title="403 Forbidden">
    Authenticated with a per-user (`cdbk_`) key — this operation requires the admin (root) API key
  </Accordion>

  <Accordion title="404 Not Found">
    Index not found
  </Accordion>

  <Accordion title="422 Unprocessable Entity">
    Invalid request parameters
  </Accordion>

  <Accordion title="500 Internal Server Error">
    Internal server error
  </Accordion>
</AccordionGroup>

## Example Usage

```bash theme={null}
curl -X POST "http://localhost:8000/v1/indexes/delete" \
     -H "X-API-Key: cyborg_your_api_key_here" \
     -H "Content-Type: application/json" \
     -d '{
       "index_name": "my_index",
       "index_key": "your_64_character_hex_key_here"
     }'
```

## Confirmation Example

```bash theme={null}
# First, list indexes to confirm the target index exists
curl -X GET "http://localhost:8000/v1/indexes/list" \
     -H "X-API-Key: cyborg_your_api_key_here"

# Then delete the specific index
curl -X POST "http://localhost:8000/v1/indexes/delete" \
     -H "X-API-Key: cyborg_your_api_key_here" \
     -H "Content-Type: application/json" \
     -d '{
       "index_name": "old_index",
       "index_key": "your_64_character_hex_key_here"
     }'

# Verify deletion by listing indexes again
curl -X GET "http://localhost:8000/v1/indexes/list" \
     -H "X-API-Key: cyborg_your_api_key_here"
```

## Data Removal

When an index is deleted, the following data is permanently removed:

* **Index structure**: All index files and metadata
* **Vector embeddings**: All stored vector data
* **Item contents**: All associated content data
* **Metadata**: All key-value metadata pairs
* **Training data**: Any cached training information

## Use Cases

* **Cleanup**: Remove outdated or test indexes
* **Resource management**: Free up storage and memory
* **Development lifecycle**: Clean up development environments
* **Data governance**: Remove indexes containing deprecated data


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.