Skip to main content
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": "https://storage.medisync.me/665e0b9d3f2a1c4d8e7f0a12_1719920400000_lab_results.pdf",
      "document_key": "665e0b9d3f2a1c4d8e7f0a12_1719920400000_lab_results.pdf",
      "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: the id 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

Authorization
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

id
string
required
Must equal the authenticated user’s own ID (ObjectId). Any other value returns 403 Forbidden.

Response

success
boolean
Whether the request was successful
data
array
Array of all document records owned by the authenticated doctor. Empty when the doctor has no documents.
error
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": "https://storage.medisync.me/665e0b9d3f2a1c4d8e7f0a12_1719920400000_lab_results.pdf",
      "document_key": "665e0b9d3f2a1c4d8e7f0a12_1719920400000_lab_results.pdf",
      "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"
}