---
title: "Delete Knowledge Base Document"
method: DELETE
path: "/knowledge-bases/{kbId}/documents/{docId}"
tags: ["Knowledge Base"]
---

# Delete Knowledge Base Document

`DELETE /knowledge-bases/{kbId}/documents/{docId}`

## Request

- Base URL: `https://api.speakai.co/v1`
- URL: `https://api.speakai.co/v1/knowledge-bases/{kbId}/documents/{docId}`
- Auth: API key in header `x-speakai-key` and API key in header `x-access-token`

### Delete Document

Requires the OWNER or ADMIN role. Deletes the document and its embeddings. Looked up by documentId and your company alone -- the kbId in the path is not cross-checked against the document's own collection, so this succeeds even if docId actually belongs to a different one of your collections.

## Path parameters

- `kbId` string, required
- `docId` string, required

## Response `200`

OK

- object
  - `status` 'success'
  - `data` object
    - `documentId` string
    - `deleted` true

## Other responses

- `403`: Forbidden
- `404`: Not Found

---

[API](https://skmtc.dev/speakai/apis/speak-ai-api.md) · [All operations](https://skmtc.dev/speakai/apis/speak-ai-api/llms.txt) · [OpenAPI document](https://skmtc.dev/speakai/apis/speak-ai-api/revisions/52d777e6d46e?raw)
