Documents
Update Medical Document
Replace or add a document on an appointment
PUT
Overview
Uploads a new document file for an appointment. Depending on what is already attached, the endpoint either replaces an existing document or adds a new one:- If the appointment has a consent document, that consent document is replaced.
- Otherwise, if the appointment has exactly one document, that document is replaced.
- Otherwise (multiple documents and none is a consent document), the new file is simply added.
_id is created on every call. Accepted file types are PDF, PNG, JPEG, JPG and WEBP.
This endpoint is plan-gated by the
documents.attach_additional feature. Accounts whose plan does not include it receive 403 FEATURE_NOT_AVAILABLE.Authentication
Bearer token for authenticated access. The doctor’s ID is extracted from the JWT token.
Path Parameters
The appointment ID (ObjectId) whose document should be replaced or created. The appointment must belong to the authenticated doctor, otherwise a
403 Forbidden is returned.Body Parameters
The request must be sent asmultipart/form-data.
The replacement document file. Allowed types:
application/pdf, image/png, image/jpeg, image/jpg, image/webp.Optional display title for the document. If omitted, the uploaded file’s original filename is used.
Response
Whether the operation was successful
The newly stored document record
Error message (only present when
success is false)Additional fields may be present on the document object and should be treated as opaque.