Skip to main content
DELETE

Overview

Permanently deletes a document. The id in the path is the document ID (Document._id), not an appointment ID. The document must be owned by the authenticated doctor; a document that does not exist or is owned by someone else returns 404.
This action is irreversible. The file is removed from storage and the record is removed from the database.
This endpoint is plan-gated by the documents.attach_additional feature. Accounts whose plan does not include it receive 403 FEATURE_NOT_AVAILABLE.

Authentication

string
required
Bearer token for authenticated access. The doctor’s ID is extracted from the JWT token and used to scope ownership.

Path Parameters

string
required
The document ID (Document._id, ObjectId) to delete. Must be owned by the authenticated doctor, otherwise a 404 is returned.

Response

boolean
Whether the deletion was successful
object
Empty object ({}) on successful deletion
string
Error message (only present when success is false)

Example Request

Example Response

Error Responses

Behavior

  • Two-phase deletion: the file is deleted from storage first, then the database record. If storage deletion fails, the database record is not removed and a 400 is returned.