Notes
Regenerate Notes
Regenerate an appointment’s notes from its transcription
POST
Overview
Regenerate the clinical notes for an appointment from its existing transcription. MediSync generates fresh notes and a summary using the requested template and language, updates the stored notes document, and records the chosen template and language on the appointment. The appointment must already have a transcription; if none exists the request returns404 Transcription not found.
This operation is scoped to the owning doctor. The appointment identified by
{id} must belong to the authenticated user. A request for an appointment you do not own returns 403 Forbidden, and an unknown appointment returns 404 Appointment not found.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
Appointment ID (MongoDB ObjectId, 24 hex characters) to regenerate notes for. Must be owned by the authenticated doctor and have an existing transcription.
Body Parameters
Identifier of the template to generate against — the ID of a Template document. Omitting it returns
400. A value that is not a valid template ID returns 500 with Template not found in database.ISO language code for generation (for example
de or en). Falls back to the appointment’s stored language when omitted.Response
Indicates whether the operation succeeded.
The regenerated notes content.
Error message (only present when
success is false).Additional fields may be present in the response and should be treated as opaque.
Example Request
Example Response
Error Responses
Behavior Notes
- Order of checks: The request is validated (
400ifnotes_template_typeis missing), then the appointment is loaded (404/403), then its transcription is loaded (404), then notes are generated. - Language fallback: When
languageis omitted, the appointment’s stored language is used. - Appointment update: On success the appointment’s stored template and language are updated to match the request.
- Real-time updates: A real-time note update is emitted to connected clients on success.
Status Codes
- 200 — Notes regenerated successfully.
- 400 — Missing
notes_template_type. - 401 — Missing, invalid, or revoked authentication token.
- 403 — Authenticated user does not own the appointment.
- 404 — Appointment or transcription not found.
- 500 — Generation failure, database update failure, or an invalid template ID.