# Delete file from knowledge base (/docs/api-reference/knowledge-base/deleteKnowledgeBaseFile)

> Permanently delete a file. Removes it from any attached agents. Cannot be undone.



**POST** `/knowledge_base/delete`

Permanently delete a file. Removes it from any attached agents. Cannot be undone.

```yaml
operationId: deleteKnowledgeBaseFile
requestBody:
  required: true
  content:
    application/json:
      schema:
        type: object
        required:
          - file_id
        properties:
          file_id:
            type: integer
            description: ID of the file to delete.
            example: 17686
responses:
  '200':
    description: File deleted.
    content:
      application/json:
        schema:
          type: object
          properties:
            success:
              type: boolean
            message:
              type: string
        example:
          success: true
          message: File deleted successfully
```

**Python SDK**

```python
# Delete a file from the knowledge base
file_id = 123  # Replace with your file ID

response = client.knowledge_base.delete(file_id)
print(response)
```

**curl**

```bash
curl -X POST "https://backend.omnidim.io/api/v1/knowledge_base/delete" \
  -H "Authorization: Bearer $OMNIDIM_API_KEY"
```
