> ## 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,
           user_id: bytes = None)
```

### Parameters

| Parameter | Type | Description |
| - | - | - |
| `ids` | `List[str]` | IDs to delete. |
| `index_key` | `bytes` | *(Required, keyword-only)* 32-byte index KEK. See [Index key](#index-key). |
| `user_id` | `bytes` | *(Optional, keyword-only)* 16-byte RBAC user identifier. See [Index key](#index-key). |

### Exceptions

<AccordionGroup>
  <Accordion title="ValueError">
    * 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"], index_key=index_key)
```

### Index key

`index_key` is required on every call. Pass the same 32-byte index KEK you used with [`create_index()`](../client/create-index) / [`load_index()`](../client/load-index). For an [RBAC user](./manage-users), pass the user's KEK as `index_key=` together with their `user_id=`:

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

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


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