API endpoints used with the WebSocket integration flow.
Complete Integration Guide: WebSocket Integration Documentation
Creates a doctor record and associates it with an organization.
Doctor creation payload
| first_name required | string |
| last_name required | string |
| speciality_id required | integer |
| salutation | string |
| hospital_id required | integer |
| license_no | string |
| phone_number | string |
string | |
| practitioner_id required | string |
{- "first_name": "John",
- "last_name": "Doe",
- "speciality_id": 5,
- "salutation": "Dr.",
- "hospital_id": 101,
- "license_no": "ABC12345",
- "phone_number": "+91-9876543210",
- "email": "johndoe@example.com",
- "practitioner_id": "PRAC-001"
}{- "message": "Doctor created successfully",
- "doctor": {
- "doctor_id": 1,
- "first_name": "John",
- "last_name": "Doe",
- "speciality_id": 5,
- "salutation": "Dr.",
- "organization_id": 101,
- "active_organization_id": 101,
- "license_no": "ABC12345",
- "phone_number": "+91-9876543210",
- "email": "johndoeABC1015@gmail.com",
- "practitioner_id": "PRAC-001",
- "opdassessment": {
- "chief_complaints": true,
- "history_of_presenting_illness": true,
- "patient_history": true,
- "personal_history": true,
- "examination_findings": true,
- "investigations": true,
- "recommendations": true,
- "medications": true,
- "follow_up": true,
- "plan": true
}, - "opdsheet": {
- "sign": true,
- "vital": true,
- "summary": false,
- "medicine": true,
- "diagnosis": true,
- "drawImage": true,
- "assessment": true,
- "investigation": true,
- "datasheetimage": true
}, - "stream": true,
- "debug_mode": false,
- "advanced_settings": {
- "brand": true,
- "generic": true,
- "TNMCRegNo": true,
- "genericFront": true,
- "FrequencyEvng": false,
- "preferredLang": "English",
- "prioritize_accuracy": true
}
}
}Accepts patient, doctor, hospital, and vitals data for integration.
| hospital_id required | string |
required | object |
required | object |
required | object |
{- "hospital_id": "HOS789",
- "doctor": {
- "practitioner_id": "PRACT789"
}, - "patient": {
- "patient_id": "PAT123",
- "name": "John Doe",
- "age": 30,
- "gender": "Male",
- "language": "English",
- "past_history": [
- {
- "condition": "Hypertension",
- "diagnosed_on": "2023-01-15",
- "status": "Active"
}
], - "family_history": [
- {
- "relation": "Father",
- "condition": "Diabetes"
}
]
}, - "vitals": {
- "height_cm": 170,
- "weight_kg": 70,
- "bmi": 24.2,
- "chest_circumference": null,
- "head_circumference": null,
- "blood_pressure": "120/80",
- "pulse_rate": 72,
- "respiratory_rate": 16,
- "temperature_celsius": 36.6,
- "oxygen_saturation": 98,
- "glucose_mg_dl": 90,
- "spo2": 98,
- "ecg_status": "Normal",
- "abnormal_conditions": [
- {
- "condition": "Arrhythmia",
- "severity": "Mild",
- "note": "Observed during routine checkup"
}
]
}
}{- "message": "New patient created successfully. Vitals uploaded.",
}Uploads medication master data for a hospital in JSON format and stores it as a CSV file.
Requirements:
hospital_id and a non-empty medications array are required.BRAND NAME and GENERIC NAME.BRAND ID is optional, but if provided in any item, it must be present in all items.Optional Fields:
UOM CODEUOM DESCRIPTION (if provided, UOM CODE is required).ACTIVE FROM (DD/MM/YYYY)ACTIVE TO (DD/MM/YYYY)MEDICATION TYPEValidation:
BRAND ID values in the request are marked invalid.BRAND NAME and GENERIC NAME combinations are marked invalid.The API stores the valid data as a CSV file and returns the processed file URL along with any invalid rows.
| hospital_id required | string Hospital/organization identifier. |
required | Array of objects non-empty Array of medication objects. Supported fields (case-sensitive as shown in examples):
|
{- "hospital_id": "9",
- "medications": [
- {
- "BRAND ID": "13752",
- "BRAND NAME": "OLVANCE 40MG TAB",
- "GENERIC NAME": "OLMESARTAN MEDOXOMIL 40MG",
- "UOM CODE": "mg",
- "UOM DESCRIPTION": "Milligram",
- "ACTIVE FROM": "01/01/2026",
- "ACTIVE TO": "31/12/2026",
- "MEDICATION TYPE": "Tablet"
}
]
}{- "message": "Medication data uploaded successfully",
- "invalid": [
- {
- "BRAND ID": "13752",
- "BRAND NAME": "MERSILK 5062",
- "GENERIC NAME": "MERSILK",
- "UOM CODE": "",
- "UOM DESCRIPTION": "Milligram",
- "error": "BRAND NAME and GENERIC NAME combination already exists"
}
]
}Updates the medication master data for a hospital by merging the given JSON medications with the existing stored CSV.
hospital_id and non-empty medications are required.BRAND NAME and GENERIC NAME.BRAND ID is optional, but if used in any item, it must be present in all items.UOM CODE and UOM DESCRIPTION are optional (if UOM DESCRIPTION is provided, UOM CODE is required).ACTIVE FROM, ACTIVE TO, and MEDICATION TYPE are optional; dates use DD/MM/YYYY.medications, rows, data, or items; hospital_id may be supplied in query or body.| hospital_id required | string Hospital/organization identifier. |
required | Array of objects non-empty Array of medication objects to merge into existing data. |
{- "hospital_id": "9",
- "medications": [
- {
- "BRAND ID": "13752",
- "BRAND NAME": "OLVANCE 40MG TAB",
- "GENERIC NAME": "OLMESARTAN MEDOXOMIL 40MG",
- "UOM CODE": "mg",
- "UOM DESCRIPTION": "Milligram",
- "ACTIVE FROM": "01/01/2026",
- "ACTIVE TO": "31/12/2026",
- "MEDICATION TYPE": "Tablet"
}
]
}{- "message": "Medication data updated successfully (merged, duplicates removed)",
- "url": "gs://bucket/csv_uploads/organization_20260916120000.csv",
- "invalid": [ ]
}Uploads a medication master CSV for a hospital and replaces the existing stored file (if any). The API validates the CSV, stores only valid rows, and returns the processed file URL.
Supported CSV headers (normalized case-insensitively and kept in this order):
BRAND NAME, GENERIC NAMEBRAND ID, BRAND NAME, GENERIC NAMEBRAND NAME, GENERIC NAME, UOM CODE, UOM DESCRIPTIONBRAND ID, BRAND NAME, GENERIC NAME, UOM CODE, UOM DESCRIPTIONACTIVE FROM, ACTIVE TO, and MEDICATION TYPE columns in that order.Validation rules:
BRAND NAME and GENERIC NAME are required.BRAND ID is required only if the header contains BRAND ID.UOM CODE and UOM DESCRIPTION are optional.UOM DESCRIPTION is provided, UOM CODE must also be provided.ACTIVE FROM and ACTIVE TO, when present, must use DD/MM/YYYY.BRAND ID values are rejected.BRAND NAME + GENERIC NAME combinations are rejected., or . are rejected.Invalid rows are returned in the invalid field of the response.
| hospital_id required | string Hospital/organization identifier. |
| csvFile required | string <binary> Medication CSV file to upload. |
{- "message": "CSV uploaded and saved",
- "invalid": [ ]
}Uploads a medication CSV for the given hospital_id and merges it with the existing medication CSV stored in Google Cloud Storage (GCS).
CSV headers (normalized case-insensitively and kept in this order):
BRAND NAME, GENERIC NAMEBRAND ID, BRAND NAME, GENERIC NAMEBRAND NAME, GENERIC NAME, UOM CODE, UOM DESCRIPTIONBRAND ID, BRAND NAME, GENERIC NAME, UOM CODE, UOM DESCRIPTIONACTIVE FROM, ACTIVE TO, and MEDICATION TYPE columns in that order.Validation rules (applies to both existing CSV and uploaded CSV):
BRAND NAME and GENERIC NAME are required in every row., or . are rejected.BRAND ID values (when BRAND ID exists) are rejected.BRAND NAME + GENERIC NAME combinations are rejected.UOM DESCRIPTION is provided, UOM CODE is required.ACTIVE FROM and ACTIVE TO, when present, must use DD/MM/YYYY.Header mismatch between existing and new CSV.Merge behavior:
BRAND ID, the merge key is BRAND ID.BRAND NAME + GENERIC NAME.| hospital_id required | string Hospital identifier for the organization. |
| csvFile required | string <binary> Medication CSV file to upload (must end with |
{- "message": "Medication data updated successfully (merged, duplicates removed)",
- "invalid": [ ]
}Uploads and replaces the organization's investigation CSV. Required headers are Service ID and Standard Lab Test Name. Optional headers are Alias Name, Service Type, Hospital ID, ACTIVE FROM, and ACTIVE TO. Headers are matched case-insensitively. Dates, when supplied, must use DD/MM/YYYY. Invalid rows are returned while valid rows are stored; an empty Alias Name is populated from Standard Lab Test Name.
| hospital_id required | string The ID of the hospital associated with the organization. |
| csvFile required | string <binary> CSV with required columns Service ID and Standard Lab Test Name, and optional Alias Name, Service Type, Hospital ID, ACTIVE FROM, and ACTIVE TO. |
{- "message": "CSV updated and saved",
- "invalid": [
- {
- "Service ID": "INV001",
- "Standard Lab Test Name": "Complete Blood Count",
- "Alias Name": "CBC",
- "error": "Service ID is required"
}
]
}Merges the uploaded CSV with stored investigation data using the case-insensitive Service ID and Service Type pair as the key. The same Service ID may therefore be stored in multiple rows when Service Type differs, while duplicate Service ID and Service Type pairs are rejected. Required headers are Service ID and Standard Lab Test Name; optional headers are Alias Name, Service Type, Hospital ID, ACTIVE FROM, and ACTIVE TO. Dates must use DD/MM/YYYY.
| hospital_id required | string The ID of the hospital associated with the organization. |
| csvFile required | string <binary> Investigation CSV to merge. Service ID and Standard Lab Test Name are required; Alias Name, Service Type, Hospital ID, ACTIVE FROM, and ACTIVE TO are optional. |
{- "message": "CSV uploaded and saved",
- "invalid": [
- {
- "Service ID": "INV001",
- "Standard Lab Test Name": "Complete Blood Count",
- "Alias Name": "CBC",
- "error": "Service ID is required"
}
]
}Replaces stored investigation data using either a direct JSON array or { data: [...] }. Service ID and Standard Lab Test Name are required. Alias Name, Service Type, Hospital ID, ACTIVE FROM, and ACTIVE TO are optional. Field names are normalized case-insensitively and dates must use DD/MM/YYYY.
| hospital_id required | string The ID of the hospital associated with the organization. |
Investigation rows wrapped in data; the controller also accepts a direct array.
required | Array of objects |
{- "data": [
- {
- "Service ID": "INV001",
- "Standard Lab Test Name": "Complete Blood Count",
- "Alias Name": "CBC",
- "Service Type": "Laboratory",
- "Hospital ID": "HOSP123",
- "ACTIVE FROM": "01/01/2026",
- "ACTIVE TO": "31/12/2026"
}
]
}{- "message": "Investigation data uploaded successfully",
- "invalid": [
- {
- "Service ID": "INV001",
- "error": "Service ID is required"
}
]
}Merges a direct JSON array or { data: [...] } into stored investigation data using the case-insensitive Service ID and Service Type pair as the key. The same Service ID may be used for different Service Types. Service ID and Standard Lab Test Name are required; all other supported columns are optional. Dates must use DD/MM/YYYY.
| hospital_id required | string The ID of the hospital associated with the organization. |
Array of investigation objects to merge with existing data
required | Array of objects |
{- "data": [
- {
- "Service ID": "INV001",
- "Standard Lab Test Name": "Complete Blood Count",
- "Alias Name": "CBC",
- "Service Type": "Laboratory",
- "Hospital ID": "HOSP123",
- "ACTIVE FROM": "01/01/2026",
- "ACTIVE TO": "31/12/2026"
}
]
}{- "message": "Investigation data updated successfully",
- "invalid": [
- {
- "Service ID": "INV001",
- "error": "Service ID is required"
}
]
}Uploads a Route master CSV for the specified hospital_id (query parameter). The CSV requires ROUTE CODE and ROUTE DESCRIPTION. ACTIVE FROM and ACTIVE TO are optional and must use DD/MM/YYYY. Header matching is case-insensitive; unknown or duplicate headers are rejected. Use the uploadRouteCsv API only for the initial upload of Route master data. If this API is called again for appending data, the existing Route list will be completely deleted and replaced with the newly uploaded CSV data. For any modifications, additions, or updates to the existing Route list, please use the updateRouteCsvs API.
| hospital_id required | string Hospital ID used to resolve organization |
| csvFile required | string <binary> CSV file containing route data (ROUTE CODE, ROUTE DESCRIPTION) |
{- "message": "CSV uploaded and saved",
- "invalid": [
- {
- "ROUTE CODE": "",
- "ROUTE DESCRIPTION": "Oral",
- "error": "ROUTE CODE is empty"
}
]
}Uploads a Route CSV file for the specified hospital_id and merges it with the existing Route data (if available) stored for the organization.
Requirements: - ROUTE CODE and ROUTE DESCRIPTION are required headers. - ACTIVE FROM and ACTIVE TO are optional headers using DD/MM/YYYY. - Header matching is case-insensitive; unknown or duplicate headers are rejected.
Validation: - If duplicate ROUTE CODE values are found in the uploaded CSV, those rows will be
reported in the invalid field of the response.
Merge Behavior: - ROUTE CODE is used as the unique key. - If a ROUTE CODE already exists in the stored Route data, the uploaded value overwrites the existing one.
| hospital_id required | string Hospital ID used to resolve organization |
| csvFile required | string <binary> CSV file containing route data (ROUTE CODE, ROUTE DESCRIPTION) |
{- "message": "Route data updated successfully (merged, duplicates removed)",
- "invalid": [
- {
- "ROUTE CODE": "24",
- "ROUTE DESCRIPTION": "Oral",
- "error": "ROUTE CODE already exists"
}
]
}Uploads Route master data from a direct array or an object containing routes, rows, data, or items, then stores it as CSV. ROUTE CODE and ROUTE DESCRIPTION are required; ACTIVE FROM and ACTIVE TO are optional dates in DD/MM/YYYY format. This API should be used only for the initial upload of Route data. If this API is called again, the existing Route list will be completely deleted and replaced with the newly uploaded data. For any modifications or additions to the existing Route list, please use the updateRouteJson API.
| hospital_id required | string The ID of the hospital/organization |
Array of objects Array of route objects |
{- "data": [
- {
- "ROUTE CODE": "string",
- "ROUTE DESCRIPTION": "string"
}
]
}{- "message": "JSON uploaded and saved as CSV",
- "invalid": [
- {
- "index": 1,
- "error": "ROUTE DESCRIPTION is empty"
}
], - "totalItems": 2,
- "invalidItemsCount": 0
}Merges a direct JSON array, or an object containing routes, rows, data, or items, into stored route data using ROUTE CODE as the key. ACTIVE FROM and ACTIVE TO are optional dates in DD/MM/YYYY format.
The uploaded Route json will be merged with the existing route data (if available) stored for the organization and saved as a CSV file.
| hospital_id required | string Hospital ID used to identify the organization |
Array of objects |
{- "data": [
- {
- "ROUTE CODE": "string",
- "ROUTE DESCRIPTION": "string"
}
]
}{- "status": "success",
- "message": "Route data updated successfully (merged, stored as CSV)",
- "invalid": [
- {
- "ROUTE CODE": "24",
- "ROUTE DESCRIPTION": "Oral",
- "error": "ROUTE CODE already exists"
}
]
}Uploads a Frequency master CSV for the given hospital_id (query param) and stores it for the organization. The CSV requires FREQUENCY CODE and FREQUENCY DESCRIPTION. ACTIVE FROM and ACTIVE TO are optional and must use DD/MM/YYYY. Header matching is case-insensitive; unknown or duplicate headers are rejected.
Validation:
invalid.invalid.| hospital_id required | string Hospital ID used to resolve organization |
| csvFile required | string <binary> CSV file with headers FREQUENCY CODE and FREQUENCY DESCRIPTION |
{- "message": "CSV uploaded and saved",
- "invalid": [
- {
- "FREQUENCY CODE": "",
- "FREQUENCY DESCRIPTION": "Once daily",
- "error": "FREQUENCY CODE is empty"
}
]
}This API uploads or updates Frequency master data for a hospital using JSON input and stores it as a CSV file.
For the initial setup, this API can be used to upload the complete Frequency master list for the organization. If this API is called again, the existing Frequency list will be completely deleted and replaced with the newly uploaded data.
For any modifications or incremental updates to the existing Frequency list, please use the updateFrequencyJson API.
Requirements:
Validation:
invalid.invalid field. A 400 is returned when no valid rows remain.Behavior:
The final dataset is stored as a CSV file and linked to the organization.
| hospital_id required | string The ID of the hospital/organization |
Array of objects Array of frequency objects |
{- "data": [
- {
- "FREQUENCY CODE": "string",
- "FREQUENCY DESCRIPTION": "string"
}
]
}{- "message": "JSON uploaded and saved as CSV",
- "invalid": [
- {
- "index": 1,
- "error": "FREQUENCY DESCRIPTION is empty"
}
], - "totalItems": 2,
- "invalidItemsCount": 0
}This API updates frequency master data for a hospital using JSON input.
The provided Frequency list will be merged with the existing frequency data (if available) stored for the organization and saved as a CSV file.
Requirements:
Validation:
invalid.invalid. A 400 is returned when no valid rows remain.Merge Behavior:
The final merged dataset is stored as a CSV file and linked to the organization.
| hospital_id required | string Hospital ID used to resolve organization |
Array of objects Array of frequency objects. Can be sent directly as an array or wrapped as an object with a data property. |
{- "data": [
- {
- "FREQUENCY CODE": "string",
- "FREQUENCY DESCRIPTION": "string"
}
]
}{- "status": "success",
- "message": "Frequency data updated successfully (merged, stored as CSV)",
- "invalid": [
- {
- "FREQUENCY CODE": "OD",
- "FREQUENCY DESCRIPTION": "Once daily",
- "error": "FREQUENCY CODE already exists"
}
]
}This API updates frequency data for a hospital.
The uploaded Frequency CSV will be merged with the existing frequency data (if available) stored for the organization and saved as a CSV file.
Requirements:
Validation:
invalid field of the response.invalid.invalid.Merge Behavior:
The final merged dataset will be stored as a CSV file and linked to the organization.
| hospital_id required | string Hospital ID used to resolve organization |
| csvFile required | string <binary> CSV file containing frequency data (FREQUENCY CODE, FREQUENCY DESCRIPTION) |
{- "message": "Frequency data updated successfully (merged, duplicates removed)",
- "invalid": [
- {
- "FREQUENCY CODE": "OD",
- "FREQUENCY DESCRIPTION": "Once daily",
- "error": "FREQUENCY CODE already exists"
}
]
}