# Delete a document

Canonical page: https://docs.ovok.com/api/document/delete-a-document

`DELETE /document/{id}`

Deletes a document and its stored file. This cannot be undone.

**Auth:** bearer token. The document is read and deleted with your token, so you need read and delete access to the DocumentReference.

## Behaviour

- The stored file is deleted first, then the DocumentReference.
- If deleting the stored file fails, the DocumentReference is still deleted.
- Public links to the document stop working.

## Example

```bash
curl -X DELETE 'https://api.sandbox.ovok.com/document/c3499c27-2973-0a7f-807e-fb8676a92dcb' \
  -H 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpYXQiOjE3NjcyNjg4MDAsImV4cCI6MTc2NzI3MjQwMH0.Ql3B_ztDvctlyZ2z0vp4sl3ExXRQGkzmxdmTAqxNzZk'
```

```json
{ "message": "Document deleted successfully" }
```
