Skip to main content

Delete document

MethodPath
DELETE/document/:id

Authentication · Access policies · Files and documents

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

Auth: Bearer token. The document is read and deleted with your token, so the access policy must allow DocumentReference:read and DocumentReference:delete. Scope: The document must be visible to you in your project (from the token).

Request​

Path parameters​

NameTypeRequiredDescription
idstring (uuid)YesDocument id.

Behaviour​

  • The route reads the document, deletes the stored file, then deletes the DocumentReference.
  • If deleting the stored file fails, the DocumentReference is still deleted.
  • The stored file is deleted before your delete access is checked. If your access policy allows reading the document but not deleting it, the call answers 403 and the file is already gone.
  • The Binary resource that was created for the file is not deleted.
  • Public links to the document stop working and answer 401.
  • Deleting a document that is already deleted answers 410.

Example​

curl -X DELETE 'https://api.sandbox.ovok.com/document/3f1c2b7e-8d4a-4c1e-9b2f-6a7d5e4c3b21' \
-H "Authorization: Bearer ${OVOK_TOKEN}"

Successful response​

200 — The document is deleted.

{ "message": "Document deleted successfully" }
FieldTypeDescription
messagestringAlways Document deleted successfully.

Errors​

StatusMeaning
400id is not a UUID.
401Bearer token is missing, invalid or revoked.
403Your access policy does not allow reading or deleting the DocumentReference. The stored file may already be deleted.
404No document with this id is visible to you.
410The document was already deleted.
429You exceeded the rate limit for your user type.