Luna SaludAPI ReferenceLuna Salud

Get patient charts data

GET/patient-charts

Retrieves a patient's clinical chart — the structured clinical notes and record entries documented for the patient. Read-only and scoped to your organization.

Code samples

Node.js

const fetch = require('node-fetch');

async function callApi() {
  const apiKey = 'YOUR_API_KEY';
  const patientId = 'your-patientId';

const queryString = new URLSearchParams({
    patientId: patientId
  }).toString();

  const url = `https://account.lunahealth.app/api/patient-charts` + (queryString ? `?${queryString}` : '');
  try {
    const response = await fetch(url, {
      method: 'GET',
      headers: {
        'Authorization': `Bearer ${apiKey}`,
        'Content-Type': 'application/json'
      }
    });
    
    if (!response.ok) {
      throw new Error(`API error: ${response.status}`);
    }
    
    const data = await response.json();
    console.log(data);
    return data;
  } catch (error) {
    console.error('Error calling API:', error);
    throw error;
  }
}

callApi();

Python

import requests

def call_api():
    api_key = 'YOUR_API_KEY'
    
    url = 'https://account.lunahealth.app/api/patient-charts'
    
    headers = {
        'Authorization': f'Bearer {api_key}',
        'Content-Type': 'application/json'
    }
    
    params = {
    'patientId': 'your-patientId'
    }
    
    try:
        response = requests.get(
            url,
            headers=headers,
            params=params
        )
        response.raise_for_status()
        
        data = response.json()
        print(data)
        return data
    except requests.exceptions.RequestException as e:
        print(f'Error calling API: {e}')
        raise

call_api()

Parameters

NameInTypeRequiredDescription
patientIdquerystringYes

Responses

StatusDescription
200Successful response
400Invalid input data
401Authorization not provided
403Insufficient access
404Not found
500Internal server error

200 — Successful response

Response fields

NameTypeRequiredDescription
idstringYes
typestringYes
statusstringYes
namestringYes
descriptionstring | nullYes
created_atstringYes
updated_atstringYes
service_datetimestringYes
signed_atstring | nullYes
completed_datestring | nullYes
itemsarray<object>Yes
userobject | nullYes
signed_byobject | nullYes
created_byobjectYes
templateobject | nullYes

Example response

[
  {
    "id": "string",
    "type": "CHART",
    "status": "CANCELED",
    "name": "string",
    "description": "string",
    "created_at": "string",
    "updated_at": "string",
    "service_datetime": "string",
    "signed_at": "string",
    "completed_date": "string",
    "items": [
      {
        "id": "string",
        "type": "CHIEF_COMPLAINT",
        "order": 0,
        "Note": {
          "id": "string",
          "label": null,
          "value": null
        },
        "NoteEditor": {
          "id": "string",
          "label": null,
          "value": null
        },
        "ShortText": {
          "id": "string",
          "label": null,
          "value": null
        },
        "TextBlock": {
          "id": "string",
          "label": null,
          "content": null
        },
        "SignaturePad": {
          "id": "string",
          "label": null
        },
        "ChiefComplaint": {
          "id": "string",
          "value": null
        },
        "Range": {
          "id": "string",
          "label": null,
          "value": null
        },
        "Dropdown": {
          "id": "string",
          "label": null,
          "value": null
        },
        "Heading": {
          "id": "string",
          "value": null
        },
        "FileEntity": {
          "id": "string"
        },
        "BodyChart": {
          "id": "string",
          "points": null,
          "signedUrl": null,
          "renderedSignedUrl": null
        },
        "FacialChart": {
          "id": "string",
          "points": null,
          "signedUrl": null,
          "renderedSignedUrl": null
        },
        "CheckBox": {
          "id": "string",
          "value": null
        },
        "Spine": {
          "id": "string",
          "value": null
        },
        "Sketch": {
          "id": "string"
        },
        "Vital": {
          "id": "string",
          "CustomVitals": []
        },
        "Allergy": {
          "id": "string",
          "name": "string",
          "status": "string",
          "reaction": null
        },
        "History": {
          "id": "string",
          "type": "string",
          "condition": "string"
        },
        "Problem": {
          "id": "string",
          "title": "string",
          "status": "string"
        },
        "Procedure": {
          "id": "string",
          "procedure_code": "string",
          "title": "string",
          "description": null,
          "date_performed": "string",
          "status": "string"
        },
        "SpeechToText": {
          "id": "string",
          "label": null,
          "value": null,
          "transcript": null,
          "summary": null,
          "language": null,
          "duration": null,
          "transcription_status": null
        },
        "ReviewOfSystems": {
          "id": "string",
          "type": "CARDIOVASCULAR",
          "findings": null,
          "is_normal": true
        },
        "PhysicalExamination": {
          "id": "string",
          "type": "GENERAL_APPEARANCE",
          "findings": null,
          "is_normal": true
        },
        "TreatmentPlan": {
          "id": "string",
          "therapeutic_indications": null,
          "indicated_procedures": null,
          "followup_plan": null,
          "status": "ACTIVE"
        },
        "Prognosis": {
          "id": "string",
          "expected_outcome": null,
          "potential_complications": null
        },
        "InsuranceHeader": {
          "id": "string",
          "report_number": null,
          "claim_number": null,
          "policy_number": null,
          "insured_name": null
        },
        "AccidentDetails": {
          "id": "string",
          "coverage_affected": null,
          "is_passenger": true,
          "is_driver": true,
          "vehicle_type": null,
          "trauma_type": null,
          "trauma_location": null,
          "trauma_mechanism": null
        },
        "HospitalizationInfo": {
          "id": "string",
          "hospital_name": null,
          "admission_date": null,
          "discharge_date": null,
          "stay_type": null,
          "stay_duration_days": null
        },
        "ReferralInfo": {
          "id": "string",
          "referred_by_physician": null,
          "referred_to_type": null,
          "referred_to_name": null,
          "recommends_transfer": null,
          "discharge_type": null,
          "treatment_status": null
        },
        "PhysicianSignatureBlock": {
          "id": "string",
          "physician_name": null,
          "specialty": null,
          "professional_license": null,
          "signed_at": null
        }
      }
    ],
    "user": {
      "id": "string",
      "first_name": "string",
      "last_name": "string",
      "email": "string",
      "type": "STAFF"
    },
    "signed_by": {
      "id": "string",
      "first_name": "string",
      "last_name": "string",
      "email": "string",
      "type": "STAFF"
    },
    "created_by": {
      "id": "string",
      "first_name": "string",
      "last_name": "string",
      "email": "string",
      "type": "STAFF"
    },
    "template": {
      "id": "string",
      "name": "string",
      "description": "string",
      "tags": [
        "string"
      ],
      "type": "CHART",
      "created_at": "string",
      "updated_at": "string"
    }
  }
]

400 — Invalid input data

Response fields

NameTypeRequiredDescription
messagestringYesThe error message
codestringYesThe error code
issuesarray<object>NoAn array of issues that were responsible for the error

Example response

{
  "code": "BAD_REQUEST",
  "message": "Invalid input data",
  "issues": []
}

401 — Authorization not provided

Response fields

NameTypeRequiredDescription
messagestringYesThe error message
codestringYesThe error code
issuesarray<object>NoAn array of issues that were responsible for the error

Example response

{
  "code": "UNAUTHORIZED",
  "message": "Authorization not provided",
  "issues": []
}

403 — Insufficient access

Response fields

NameTypeRequiredDescription
messagestringYesThe error message
codestringYesThe error code
issuesarray<object>NoAn array of issues that were responsible for the error

Example response

{
  "code": "FORBIDDEN",
  "message": "Insufficient access",
  "issues": []
}

404 — Not found

Response fields

NameTypeRequiredDescription
messagestringYesThe error message
codestringYesThe error code
issuesarray<object>NoAn array of issues that were responsible for the error

Example response

{
  "code": "NOT_FOUND",
  "message": "Not found",
  "issues": []
}

500 — Internal server error

Response fields

NameTypeRequiredDescription
messagestringYesThe error message
codestringYesThe error code
issuesarray<object>NoAn array of issues that were responsible for the error

Example response

{
  "code": "INTERNAL_SERVER_ERROR",
  "message": "Internal server error",
  "issues": []
}