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

Permanently removes items from the index by ID, along with their contents and metadata.

```go theme={null}
func (e *EncryptedIndex) Delete(ctx context.Context, ids []string) error
```

### Parameters

| Parameter | Type | Description |
| - | - | - |
| `ctx` | `context.Context` | Context for cancellation and deadlines. |
| `ids` | `[]string` | IDs of the items to delete. An empty slice is a no-op. |

### Returns

`error` only; `nil` on success.

### Errors

<AccordionGroup>
  <Accordion title="*AuthenticationError">
    The `apiKey` is invalid, or a read-only user key is used (HTTP `401`/`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.Delete(ctx, []string{"doc1", "doc2"}); err != nil {
    log.Fatal(err)
}

ids, err := index.ListIDs(ctx)
if err != nil {
    log.Fatal(err)
}
fmt.Println(ids.Ids)
// Output: [doc3]
```


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