# Remove a document filed in error

`DELETE /lokta-lms/api/v1/sourcing-partners/{partnerId}/documents/{documentId}`

Removes a document that was filed in error.

Deletes the record **and the stored file**. For the "wrong file, just uploaded" case, which is the only case it accepts.

**A `verified` or `rejected` document is refused** with `409 sourcing/document_not_removable`. Those are the evidence behind a decision somebody recorded; erasing one would leave the verification in the audit trail with nothing behind it. Upload the correct file as a new document instead; the checklist reads the newest of each type, so a replacement supersedes without anything being destroyed.

**A document standing as a terms agreement is refused** whatever its status, naming the terms version that holds it. Fee lines computed under those terms have to stay explainable against the agreement they were agreed on.

No `reason` is required. Every other reason field here has a reader; nobody will read the justification for deleting an unverified file that was replaced a minute later.

## Parameters
- `partnerId` (path, string, required)
- `documentId` (path, string, required)
- `Idempotency-Key` (header, string): Per-intent key

## Responses
- `default`: default response

## Example request (cURL)
```bash
curl -X DELETE \
  'https://default.lokta.tech/lokta-lms/api/v1/sourcing-partners/{partnerId}/documents/{documentId}' \
  -u '{username}:{password}' \
  -H 'Tenant-Identifier: default'
```

Interactive: https://developer.lokta.ai/reference#operation/remove
