curl -X GET \
'https://app.medisync.me/api/documents/665e0b9d3f2a1c4d8e7f0a12' \
-H 'Authorization: Bearer your_jwt_token_here'
const response = await fetch(
'https://app.medisync.me/api/documents/665e0b9d3f2a1c4d8e7f0a12',
{
method: 'GET',
headers: { Authorization: 'Bearer your_jwt_token_here' },
}
);
const result = await response.json();
import requests
response = requests.get(
'https://app.medisync.me/api/documents/665e0b9d3f2a1c4d8e7f0a12',
headers={'Authorization': 'Bearer your_jwt_token_here'},
)
result = response.json()
{
"success": true,
"data": [
{
"_id": "66a3f1c2b8e4d21f9c0a7b31",
"appointment_id": "665e0b9d3f2a1c4d8e7f0a12",
"document_url": "<internal storage reference>",
"document_key": "<internal storage reference>",
"doctor_id": "6512a7c9e4b0a1f2d3c45678",
"file_name": "lab_results.pdf",
"title": "lab_results.pdf",
"file_type": "pdf",
"mime_type": "application/pdf",
"source": "upload",
"extraction_status": "done",
"include_in_context": true,
"createdAt": "2026-07-02T14:30:00.000Z",
"updatedAt": "2026-07-02T14:31:12.000Z",
"__v": 0
}
]
}
{
"success": true,
"data": []
}
Documents
Get Documents by Appointment
List the documents you own on a given appointment
GET
/
documents
/
{id}
curl -X GET \
'https://app.medisync.me/api/documents/665e0b9d3f2a1c4d8e7f0a12' \
-H 'Authorization: Bearer your_jwt_token_here'
const response = await fetch(
'https://app.medisync.me/api/documents/665e0b9d3f2a1c4d8e7f0a12',
{
method: 'GET',
headers: { Authorization: 'Bearer your_jwt_token_here' },
}
);
const result = await response.json();
import requests
response = requests.get(
'https://app.medisync.me/api/documents/665e0b9d3f2a1c4d8e7f0a12',
headers={'Authorization': 'Bearer your_jwt_token_here'},
)
result = response.json()
{
"success": true,
"data": [
{
"_id": "66a3f1c2b8e4d21f9c0a7b31",
"appointment_id": "665e0b9d3f2a1c4d8e7f0a12",
"document_url": "<internal storage reference>",
"document_key": "<internal storage reference>",
"doctor_id": "6512a7c9e4b0a1f2d3c45678",
"file_name": "lab_results.pdf",
"title": "lab_results.pdf",
"file_type": "pdf",
"mime_type": "application/pdf",
"source": "upload",
"extraction_status": "done",
"include_in_context": true,
"createdAt": "2026-07-02T14:30:00.000Z",
"updatedAt": "2026-07-02T14:31:12.000Z",
"__v": 0
}
]
}
{
"success": true,
"data": []
}
Overview
Returns the documents attached to a specific appointment that are owned by the authenticated doctor. The query is scoped to both the appointment ID and the calling doctor, so documents attached by another doctor are not returned. The response is always an array. If nothing matches, it returns200 with an empty data array.
This is a read endpoint and is not plan-gated: it keeps working even for accounts that do not have the
documents.attach_additional feature, so previously attached documents remain accessible.Authentication
string
required
Bearer token for authenticated access. The doctor’s ID is extracted from the JWT token and used to scope results.
Authorization: Bearer your_jwt_token_here
Path Parameters
string
required
The appointment ID (ObjectId) whose documents should be listed. Only documents owned by the authenticated doctor are returned.
Response
boolean
Whether the request was successful
array
Array of document records owned by the authenticated doctor on this appointment. Empty when none match.
Show Document Object
Show Document Object
string
Unique document identifier (ObjectId)
string
The appointment this document is attached to
string
Internal storage reference. Not a fetchable link — retrieve the file with
GET /documents/get/{appointmentId}, which enforces ownership. Treat as opaque.string
Internal storage reference. Opaque — its format is not part of the API contract and may change without notice. Do not parse or construct it.
string
ObjectId of the owning doctor
string
Original filename of the document
string
Display title (defaults to the original filename)
string
Inferred short file type (e.g.
pdf, png, jpeg, webp)string
MIME type of the stored file
string
Origin of the document (e.g.
upload)string
Text-extraction state (e.g.
pending, done)boolean
Whether the document is included when building context
string
Creation timestamp (ISO 8601)
string
Last-update timestamp (ISO 8601)
number
Internal record version
string
Error message (only present when
success is false)Additional fields may be present on each document object and should be treated as opaque. There is no pagination and no guaranteed sort order.
Example Request
curl -X GET \
'https://app.medisync.me/api/documents/665e0b9d3f2a1c4d8e7f0a12' \
-H 'Authorization: Bearer your_jwt_token_here'
const response = await fetch(
'https://app.medisync.me/api/documents/665e0b9d3f2a1c4d8e7f0a12',
{
method: 'GET',
headers: { Authorization: 'Bearer your_jwt_token_here' },
}
);
const result = await response.json();
import requests
response = requests.get(
'https://app.medisync.me/api/documents/665e0b9d3f2a1c4d8e7f0a12',
headers={'Authorization': 'Bearer your_jwt_token_here'},
)
result = response.json()
Example Response
{
"success": true,
"data": [
{
"_id": "66a3f1c2b8e4d21f9c0a7b31",
"appointment_id": "665e0b9d3f2a1c4d8e7f0a12",
"document_url": "<internal storage reference>",
"document_key": "<internal storage reference>",
"doctor_id": "6512a7c9e4b0a1f2d3c45678",
"file_name": "lab_results.pdf",
"title": "lab_results.pdf",
"file_type": "pdf",
"mime_type": "application/pdf",
"source": "upload",
"extraction_status": "done",
"include_in_context": true,
"createdAt": "2026-07-02T14:30:00.000Z",
"updatedAt": "2026-07-02T14:31:12.000Z",
"__v": 0
}
]
}
{
"success": true,
"data": []
}
Error Responses
{
"success": false,
"error": "Error fetching documents by appointment ID"
}
{
"success": false,
"message": "Unauthorized"
}