curl -X GET \
'https://app.medisync.me/api/documents/doctor/6512a7c9e4b0a1f2d3c45678' \
-H 'Authorization: Bearer your_jwt_token_here'
const response = await fetch(
'https://app.medisync.me/api/documents/doctor/6512a7c9e4b0a1f2d3c45678',
{
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/doctor/6512a7c9e4b0a1f2d3c45678',
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 Doctor
List all documents owned by your own account
GET
/
documents
/
doctor
/
{id}
curl -X GET \
'https://app.medisync.me/api/documents/doctor/6512a7c9e4b0a1f2d3c45678' \
-H 'Authorization: Bearer your_jwt_token_here'
const response = await fetch(
'https://app.medisync.me/api/documents/doctor/6512a7c9e4b0a1f2d3c45678',
{
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/doctor/6512a7c9e4b0a1f2d3c45678',
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 every document owned by the authenticated doctor, across all appointments. This is effectively a “list all my documents” endpoint. Access is self-only: theid in the path must equal the authenticated user’s own ID. Any other value returns 403 Forbidden — you cannot view another doctor’s documents.
This is a read endpoint and is not plan-gated. The result is a single array with no pagination and no guaranteed sort order.
Authentication
string
required
Bearer token for authenticated access. The doctor’s ID is extracted from the JWT token and must match the path
id.Authorization: Bearer your_jwt_token_here
Path Parameters
string
required
Must equal the authenticated user’s own ID (ObjectId). Any other value returns
403 Forbidden.Response
boolean
Whether the request was successful
array
Array of all document records owned by the authenticated doctor. Empty when the doctor has no documents.
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 (equal to your own ID)
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.
Example Request
curl -X GET \
'https://app.medisync.me/api/documents/doctor/6512a7c9e4b0a1f2d3c45678' \
-H 'Authorization: Bearer your_jwt_token_here'
const response = await fetch(
'https://app.medisync.me/api/documents/doctor/6512a7c9e4b0a1f2d3c45678',
{
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/doctor/6512a7c9e4b0a1f2d3c45678',
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": "Forbidden"
}
{
"success": false,
"error": "Error fetching documents by doctor ID"
}
{
"success": false,
"message": "Unauthorized"
}