> ## 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>Deleting an index is irreversible.</Warning>

Deletes the index and all of its data from the CyborgDB service.

```go theme={null}
func (e *EncryptedIndex) DeleteIndex(ctx context.Context) error
```

### Returns

`error` only; `nil` on success.

### Errors

<AccordionGroup>
  <Accordion title="*NotFoundError">
    The index doesn't exist, for example because it was already deleted (HTTP `404`).
  </Accordion>

  <Accordion title="*AuthenticationError">
    The `apiKey` is invalid (HTTP `401`), or the client is using a per-user key: deleting an index requires the root key (HTTP `403`).
  </Accordion>

  <Accordion title="*ServiceError / *TransportError">
    The service returns `5xx` or can't be reached.
  </Accordion>
</AccordionGroup>

See [Errors](../errors).

### Example Usage

```go theme={null}
if err := index.DeleteIndex(ctx); err != nil {
    log.Fatal(err)
}

names, err := client.ListIndexes(ctx)
if err != nil {
    log.Fatal(err)
}
fmt.Println(slices.Contains(names, index.GetIndexName()))
// Output: false
```


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