> ## Documentation Index
> Fetch the complete documentation index at: https://morphik.ai/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Delete Document

> Remove a document and all its associated data

Delete a document and all its associated data including metadata, stored content, and vector embeddings.

> [tab] Python
>
> ```python theme={null}
> from morphik import Morphik
>
> db = Morphik("your-uri")
>
> # Delete by document ID
> result = db.delete_document("doc_abc123")
> print(result)  # {"status": "success", "message": "Document deleted"}
>
> # Delete by filename
> result = db.delete_document_by_filename("report.pdf")
> ```

> [tab] TypeScript
>
> ```typescript theme={null}
> import Morphik from 'morphik';
>
> // For Teams/Enterprise, use your dedicated host: https://companyname-api.morphik.ai
> const client = new Morphik({
>   apiKey: process.env.MORPHIK_API_KEY,
>   baseURL: 'https://api.morphik.ai'
> });
>
> // Delete by document ID
> const result = await client.documents.delete('doc_abc123');
> console.log(result);  // { status: 'success', message: 'Document deleted' }
> ```

> [tab] cURL
>
> ```bash theme={null}
> curl -X DELETE "https://api.morphik.ai/documents/doc_abc123" \
>   -H "Authorization: Bearer $MORPHIK_API_KEY"
> ```

## Parameters

| Parameter | Type | Description |
| - | - | - |
| `document_id` | string | The unique identifier of the document to delete |

## Response

```json theme={null}
{
  "status": "success",
  "message": "Document doc_abc123 and all associated data deleted successfully"
}
```

> [!WARNING]
>
> This action is irreversible. All document data including chunks and embeddings will be permanently removed.


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