Notes
Delete Notes
Permanently delete a notes document by its ID
DELETE
Overview
Delete a notes document by its own ID. This performs a permanent (hard) deletion of the notes record.The path parameter is the notes document ID, not the appointment ID. Ownership is verified through the note’s appointment: if the note belongs to an appointment owned by another doctor, the request returns
403 Forbidden and nothing is deleted.Authentication
Bearer token for authenticated access. The doctor (user) identity is taken from the JWT.
401 with a message field. See Error Responses.
Path Parameters
Notes document ID (MongoDB ObjectId, 24 hex characters) to delete — not the appointment ID.
Response
Indicates whether the operation succeeded.
Error message (only present when
success is false).Example Request
Example Response
Error Responses
Behavior Notes
- Idempotent: Deleting a notes document that does not exist (already gone) returns
200 { "success": true }. There is no404for delete. - Ownership check: If the note is found and its appointment is owned by a different doctor, the request returns
403 Forbiddenwithout deleting. - Hard delete: Records are removed permanently. There is no soft delete and no cascade to associated appointments or other records.
- 400 responses: Generic failures — such as a malformed ObjectId — are returned as
400with the underlying error message in theerrorfield.
Status Codes
- 200 — Notes deleted, or already absent (idempotent).
- 400 — Invalid ID or server error.
- 401 — Missing, invalid, or revoked authentication token.
- 403 — Note belongs to an appointment owned by another doctor.