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

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

Deletes the specified encrypted items stored in the index, including all its associated fields (`vector`, `contents`, `metadata`).

```python theme={null}
def delete(self,
           ids: List[str],
           *,
           index_key: bytes = None,
           user_id: bytes = None)
```

### Parameters

| Parameter   | Type        | Description                                                                                                                     |
| ----------- | ----------- | ------------------------------------------------------------------------------------------------------------------------------- |
| `ids`       | `List[str]` | IDs to delete.                                                                                                                  |
| `index_key` | `bytes`     | *(Optional, keyword-only)* Override the per-operation index key. See [Per-operation key override](#per-operation-key-override). |
| `user_id`   | `bytes`     | *(Optional, keyword-only)* 16-byte RBAC user identifier. See [Per-operation key override](#per-operation-key-override).         |

### Exceptions

<AccordionGroup>
  <Accordion title="RuntimeError">
    * Throws if the items could not be deleted.
  </Accordion>
</AccordionGroup>

### Example Usage

```python theme={null}
# Load index
index = client.load_index(
    index_name=index_name, 
    index_key=index_key
)

# Delete "item_1" and "item_2"
index.delete(["item_1", "item_2"])
```

### Per-operation key override

The call above reuses the key supplied at [`create_index()`](../client/create-index) / [`load_index()`](../client/load-index). You may instead pass `index_key=` (and `user_id=` for an [RBAC user](./manage-users)) to override the per-operation key. This is required in stateless/service deployments that reload the index per request:

```python theme={null}
index.delete(["item_1", "item_2"], index_key=index_key)
```

<Note>Deleting items requires write permission. An [RBAC user](./manage-users) without a write wrap cannot delete items.</Note>
