> ## Documentation Index
> Fetch the complete documentation index at: https://mintlify.com/open-webui/open-webui/llms.txt
> Use this file to discover all available pages before exploring further.

# Delete File

Delete a file by its ID. This removes the file from storage and cleans up associated embeddings and knowledge base references.

## Request

### Path Parameters

<ParamField path="id" type="string" required>
  The unique identifier of the file to delete
</ParamField>

### Headers

<ParamField header="Authorization" type="string" required>
  Bearer token for authentication
</ParamField>

## Response

<ResponseField name="message" type="string">
  Confirmation message: `"File deleted successfully"`
</ResponseField>

## Example

```bash theme={null}
curl -X DELETE https://your-domain.com/api/files/550e8400-e29b-41d4-a716-446655440000 \
  -H "Authorization: Bearer YOUR_TOKEN"
```

```json Response theme={null}
{
  "message": "File deleted successfully"
}
```

## Permissions

You can delete a file if:

* You are the owner of the file (`user_id` matches)
* You are an admin user
* You have write access to the file through access grants

## Cleanup Operations

When a file is deleted, the following cleanup operations are performed:

1. **Storage**: Physical file is removed from storage
2. **Vector embeddings**: File embeddings are removed from the vector database
3. **Knowledge bases**: File is removed from any associated knowledge bases
4. **References**: All database references to the file are cleaned up

## Error Responses

<ResponseField name="404">
  File not found or you don't have access to it
</ResponseField>

<ResponseField name="400">
  Error occurred while deleting the file
</ResponseField>

## Related Endpoints

* `DELETE /api/files/all` - Delete all files (admin only)
* `GET /api/files/{id}` - Get file details before deletion
