---
title: "Delete document"
method: POST
path: "/v1/document/remove"
tags: ["File Commands"]
---

# Delete document

`POST /v1/document/remove`

## Request

- Base URL: `https://api.ocrolus.com`
- URL: `https://api.ocrolus.com/v1/document/remove`
- Auth: OAuth 2
  - Client credentials
  - Token URL: `https://auth.ocrolus.com/oauth/token`

Deletes a <<glossary:Document>> uploaded to a <<glossary:Book>>.

---
A <<glossary:Document>> can be deleted from any state except `QUEUED`, `PROCESSING`, `GROOMING`, `VERIFYING`, `DELETING`, or `DELETED`. This means Documents in the `COMPLETED`, `FAILED`, `VERIFICATION_COMPLETE`, and `REJECTED` states can all be deleted.
> 🚧 No turning back!
> Deleted <<glossary:Document>>s and their associated data, such as transactions, cannot be recovered. Make sure you want to proceed before deleting.

## Request body

- object
  - `doc_uuid` string: The unique identifier of the <<glossary:Document>> that will be deleted. Mutually exclusive with `doc_id`.
  - `doc_id` integer: The <<glossary:PK>> of the <<glossary:Document>> that will be deleted. Mutually exclusive with `doc_uuid`.

## Response `200`

Success

- object
  - `status` integer: A numerical code that indicates the status of the request.
  - `message` string: A textual description that indicates details about this response's status.
  - `response` object: Details of the deleted <<glossary:Document>>. The response does not include the Document's UUID, only `pk` and `id`, even if the request identified the Document by `doc_uuid`.
    - `pk` integer: Primary key of the deleted <<glossary:Document>>.
    - `id` integer: Unique identifier of the deleted <<glossary:Document>>. Same as `pk`.
    - `checksum` string: MD5 checksum of the <<glossary:Document>>.
    - `created_ts` string: Timestamp when the <<glossary:Document>> was originally created, in ISO 8601 format.
    - `book_pk` integer: Primary key of the <<glossary:Book>> the Document belonged to.
    - `name` string: Name of the <<glossary:Document>>.
    - `page_count` integer: Number of pages in the <<glossary:Document>>.
    - `document_status` string: Status of the <<glossary:Document>>.

## Other responses

- `400`: Client Errors
- `500`: Internal Server Error

---

[API](https://skmtc.dev/ocrolus/apis/file-commands.md) - [All operations](https://skmtc.dev/ocrolus/apis/file-commands/llms.txt) - [OpenAPI document](https://skmtc.dev/ocrolus/apis/file-commands/revisions/387371d96db7?raw)
