CareScribe Software Integration API (v3.6.4)

Download OpenAPI specification:Download

API for integrating patient, doctor, and vitals data. Note:hospital_id is used in API requests and maps to an internal organization_id.

API Gateway URL

https://carescribe-app-api-8to2squd.wl.gateway.dev

Click here : CareScribe Inpatients API

Click here : IPD HMS Integration Documentation

Click here : API Documentation More Details

Click here : HMS Integration Guide

Click here : WebSocket Integration Guide

Click here : HMS Integration without Callback url (GET CALL)

Authentication Required, Method: API Key

All API requests must include the following header:

X-API-Key: AIzaSyC7wLQx3-JDf29hYpTgQb8n9kV5uXyZkVo
  

WebSocket APIs: See the WebSocket Integration Guide, including the multi-source audio protocol.

Get organization by hospital ID

Retrieves an organization by its hospital ID.

Authorizations:
X-API-Key
query Parameters
hospital_id
required
string

Responses

Response samples

Content type
application/json
{
  • "message": "Organization fetched successfully",
  • "organization": {
    }
}

Update an organization

Updates an existing organization.

Authorizations:
X-API-Key
Request Body schema: application/json
hospital_id
required
string
name
required
string
type
required
string
state
string
city
required
string
country
required
string
pin_code
string
phone_number
string
email
string
website
string
fax_no
string
tax_id_no
string
address1
string
description
string
time_zone
string
api_url
string

Responses

Request samples

Content type
application/json
{
  • "hospital_id": "9",
  • "name": "General Hospital",
  • "type": "Private",
  • "state": "California",
  • "city": "Medcity",
  • "country": "USA",
  • "pin_code": "90210",
  • "phone_number": "+1122334455",
  • "email": "contact@generalhospital.com",
  • "fax_no": "+1122334466",
  • "tax_id_no": "TAX-123456789",
  • "address1": "789 Health St, Medcity",
  • "description": "A leading hospital providing a wide range of medical services.",
  • "time_zone": "America/Los_Angeles",
}

Response samples

Content type
application/json
{
  • "message": "Organization updated successfully",
  • "organization": {
    }
}

Upload medication master data (JSON) and store as CSV

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.
  • Each medication must contain 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 CODE
  • UOM DESCRIPTION (if provided, UOM CODE is required).
  • ACTIVE FROM (DD/MM/YYYY)
  • ACTIVE TO (DD/MM/YYYY)
  • MEDICATION TYPE

Validation:

  • Duplicate BRAND ID values in the request are marked invalid.
  • Duplicate 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.

Authorizations:
X-API-Key
Request Body schema: application/json
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):

  • BRAND NAME (required)
  • GENERIC NAME (required)
  • BRAND ID (conditionally required if present in any item)
  • UOM CODE (optional)
  • UOM DESCRIPTION (optional; if provided, UOM CODE is required)
  • ACTIVE FROM (optional; DD/MM/YYYY)
  • ACTIVE TO (optional; DD/MM/YYYY)
  • MEDICATION TYPE (optional)

Responses

Request samples

Content type
application/json
{
  • "hospital_id": "9",
  • "medications": [
    ]
}

Response samples

Content type
application/json
{}

Integrate patient software data

Accepts patient, doctor, hospital, and vitals data for integration.

Authorizations:
X-API-Key
Request Body schema: application/json
hospital_id
required
string
required
object
required
object
required
object

Responses

Request samples

Content type
application/json
{
  • "hospital_id": "HOS789",
  • "doctor": {
    },
  • "patient": {
    },
  • "vitals": {
    }
}

Response samples

Content type
application/json
{}

Create a new patient

Creates a new patient record.

Authorizations:
X-API-Key
Request Body schema: application/json
hospital_id
required
string
practitioner_id
required
string
speciality_id
string
patient_id
required
string
first_name
required
string
last_name
required
string
date_of_birth
required
string <date>
phone_number
string
age
integer
gender
required
string
interaction_status
integer
interaction_date
string
token_number
string
address1
string

Responses

Request samples

Content type
application/json
{
  • "hospital_id": "ORG123",
  • "practitioner_id": "DOC456",
  • "speciality_id": "SPEC789",
  • "patient_id": "HOSPAT001",
  • "first_name": "Jane",
  • "last_name": "Doe",
  • "date_of_birth": "1990-05-20",
  • "phone_number": "+1987654321",
  • "age": 34,
  • "gender": "Female",
  • "interaction_status": 1,
  • "interaction_date": "2024-07-29",
  • "token_number": "TKN456",
  • "address1": "456 Oak Ave, Othertown, USA"
}

Response samples

Content type
application/json
{
  • "message": "Patient created successfully",
  • "patient": {
    }
}

Create a new doctor

Creates a doctor record and associates it with an organization.

Authorizations:
X-API-Key
Request Body schema: application/json

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
email
string
practitioner_id
required
string

Responses

Request samples

Content type
application/json
{
  • "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"
}

Response samples

Content type
application/json
{
  • "message": "Doctor created successfully",
  • "doctor": {
    }
}

Update doctor by practitioner_id

Updates a doctor's profile and organization details using practitioner_id and hospital_id.

Authorizations:
X-API-Key
Request Body schema: application/json

Doctor update payload

practitioner_id
required
string
hospital_id
required
integer
first_name
string
last_name
string
speciality_id
integer
salutation
string
license_no
string
phone_number
string
email
string

Responses

Request samples

Content type
application/json
{
  • "practitioner_id": "PRAC-001",
  • "hospital_id": 101,
  • "first_name": "John",
  • "last_name": "Doe",
  • "speciality_id": 5,
  • "salutation": "Dr.",
  • "license_no": "ABC12345",
  • "phone_number": "+91-9876543210",
  • "email": "johndoe@example.com"
}

Response samples

Content type
application/json
{
  • "message": "Doctor updated successfully",
  • "doctor": {
    }
}

Get doctor by practitioner_id

Fetches a doctor's details using practitioner_id.

Authorizations:
X-API-Key
query Parameters
practitioner_id
required
string

The practitioner's unique identifier.(example) PRAC-001

hospital_id
required
string

Hospital identifier that scopes the doctor data.

Responses

Response samples

Content type
application/json
{
  • "message": "Doctor fetched successfully",
  • "doctor": {
    }
}

Update doctor settings

Updates a doctor's opdassessment, opdsheet, and advanced_settings based on provided practitioner_id.

Authorizations:
X-API-Key
Request Body schema: application/json

Doctor settings update payload

practitioner_id
required
string
hospital_id
required
string

Hospital identifier to scope the settings update.

plan
boolean
follow_up
boolean
investigations
boolean
patient_history
boolean
recommendations
boolean
chief_complaints
boolean
personal_history
boolean
examination_findings
boolean
history_of_presenting_illness
boolean
vital
boolean
medicine
boolean
diagnosis
boolean
assessment
boolean
investigation
boolean
brand
boolean
generic
boolean
TNMCRegNo
boolean
genericFront
boolean
FrequencyEvng
boolean
preferredLang
string
prioritize_accuracy
boolean
counsellingMode
boolean

Responses

Request samples

Content type
application/json
{
  • "practitioner_id": "PRAC-001",
  • "hospital_id": "9",
  • "plan": true,
  • "follow_up": false,
  • "investigations": true,
  • "patient_history": false,
  • "recommendations": true,
  • "chief_complaints": true,
  • "personal_history": false,
  • "examination_findings": true,
  • "history_of_presenting_illness": false,
  • "vital": true,
  • "medicine": false,
  • "diagnosis": true,
  • "assessment": false,
  • "investigation": true,
  • "brand": true,
  • "generic": false,
  • "TNMCRegNo": true,
  • "genericFront": false,
  • "FrequencyEvng": true,
  • "preferredLang": "English",
  • "prioritize_accuracy": true,
  • "counsellingMode": true
}

Response samples

Content type
application/json
{
  • "message": "Doctor settings updated successfully",
  • "doctor": {
    }
}

Get patient by hospital ID

Fetches a patient's record using their hospital-specific ID and organization ID.

Authorizations:
X-API-Key
query Parameters
patient_id
required
string
hospital_id
required
string

Responses

Response samples

Content type
application/json
{
  • "message": "Patient fetch Successful",
  • "patient": {
    }
}

Get patient by ID

Retrieves patient details, including inpatient status, by their primary ID.

Authorizations:
X-API-Key
query Parameters
id
required
string

Responses

Response samples

Content type
application/json
{
  • "message": "Patient fetched successfully",
  • "patient": {
    }
}

Get vitals by patient ID

Retrieves all vital sign details for a specific patient.

Authorizations:
X-API-Key
query Parameters
patient_id
required
string
hospital_id
required
string

ID of the hospital where the patient is registered

Responses

Response samples

Content type
application/json
{
  • "patient": {
    },
  • "Interactions": [
    ]
}

Get all languages

Retrieves a list of all available languages.

Authorizations:
X-API-Key

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Get OPD Form and Organization Data

Retrieves the OPD form configuration and related organization data for a given hospital ID.
The API returns base64-encoded images (left and right), processed URLs for medication and investigation data, and other key organization settings like inpatient setup, lab model, and upload configurations.

Authorizations:
X-API-Key
query Parameters
hospital_id
required
string
Example: hospital_id=9

Unique hospital identifier (maps to organization)

Responses

Response samples

Content type
application/json
{
  • "message": "Organization data fetched successfully",
  • "data": {
    }
}

Update OPD Interaction Details

This endpoint uploads edited OPD (Outpatient Department) interaction data, stores it in cloud storage, and triggers ingestion for updated patient records.
It handles both new and previously edited OPD interactions.
If no previous edited OPD record exists, it falls back to using the last audio interaction.

Authorizations:
X-API-Key
Request Body schema: application/json
interaction_id
required
string
required
object

Edited OPD fields for the interaction

hospital_id
required
string

Hospital identifier for scoping the edited OPD ingestion.

Responses

Request samples

Content type
application/json
{
  • "interaction_id": "82706",
  • "data": {
    },
  • "hospital_id": "9"
}

Response samples

Content type
application/json
{
  • "status": true,
  • "message": "Edited opd interaction details created and ingested successfully",
  • "interaction_id": "82706",
  • "uploadedUrls": "gs://carescribe-editedOpd/82706_9e8c9b.txt",
  • "pdfingestIntraction": { }
}

Update OPD form

Updates the OPD form configuration for a hospital, including optional image uploads for left and right logos via multipart/form-data.

Authorizations:
X-API-Key
Request Body schema: multipart/form-data
hospital_id
required
string

The ID of the hospital example "ORG123"

unit
string

Unit name for the OPD form

footer
string

Footer text for the OPD form

contact
string

Contact information for the OPD form

marginTop
string

Top margin for the OPD form example, "40"

marginLeft
string

Left margin for the OPD form example, "71"

marginRight
string

Right margin for the OPD form example. "40"

show_footer
string

Whether to show the footer example "false"

show_header
string

Whether to show the header example, "false"

marginBottom
string

Bottom margin for the OPD form example, "40"

hospital_name
string

Name of the hospital

outpatient_title
string

Title for the outpatient form

patientDetailsshow
string

Whether to show patient details example, "true"

left_image
string <binary>

Left logo image file for the OPD form

right_image
string <binary>

Right logo image file for the OPD form

Responses

Response samples

Content type
application/json
{
  • "message": "OPD form updated successfully",
  • "opdform": {
    }
}

Chatbot Response

Sends chatbot interaction data for a hospital session to the CareScribe Simmer API. This endpoint forwards the request to the upstream chatbot engine and returns its response. Accepts a dynamic payload containing user, patient, and session context.

Authorizations:
X-API-Key
query Parameters
key
required
string

API authentication key

hospital_id
required
string

Unique identifier of the hospital.

practitioner_id
required
string

Practitioner identifier used to resolve the doctor in the hospital.

session_id
required
string

Unique chatbot session identifier.

Request Body schema: application/json

Chatbot interaction payload.

user_id
string
user_country
string
question_text
string
patient_id
string
interaction_id
string
stored_signal
boolean
assessment
boolean
doctor_id
string
nurse_id
string
inpatient_id
string
patient_type
string
opd_question
string
specialty_name
string
gender
string
med_url
string
time_zone
string
preferred_language
string

Responses

Request samples

Content type
application/json
{
  • "user_id": "9",
  • "user_country": "India",
  • "question_text": "Generate an outpatient datasheet based on Diagnosis",
  • "patient_id": "GEN9-202511-00091",
  • "interaction_id": "85695",
  • "stored_signal": true,
  • "assessment": true,
  • "doctor_id": "186",
  • "nurse_id": null,
  • "inpatient_id": null,
  • "patient_type": "opd",
  • "opd_question": "gs://medscribe-dev/doctor_186_20250422_104249.json",
  • "specialty_name": "GENERAL MEDICINE",
  • "gender": null,
  • "med_url": "gs://testcase-audio/csv_uploads/9_2025_11_06_07_39_26_filtered.csv",
  • "time_zone": "Asia/Kolkata",
  • "preferred_language": "Patient Language"
}

Response samples

Content type
application/json
{
  • "reply": "Generated outpatient datasheet based on Diagnosis",
  • "status": "success"
}

Create patient and interaction token

Creates a new patient record if not found or adds an interaction if the patient exists.

Authorizations:
X-API-Key
Request Body schema: application/json
organization_id
required
integer
speciality_id
required
integer
patient_id
required
string
date_of_birth
string <date>
phone_number
string
age
integer
gender
string
Enum: "M" "F" "O"
interaction_date
required
string <date-time>
token_number
required
string
address1
string
first_name
string
last_name
string
hospital_id
string

Responses

Request samples

Content type
application/json
{
  • "organization_id": 101,
  • "speciality_id": 5,
  • "patient_id": "HOSP-123",
  • "date_of_birth": "1985-06-15",
  • "phone_number": "919876543210",
  • "age": 40,
  • "gender": "Male",
  • "interaction_date": "2025-08-13T09:30:00Z",
  • "token_number": "T-101",
  • "address1": "123, Main Street, City",
  • "first_name": "John",
  • "last_name": "Doe",
  • "hospital_id": "9"
}

Response samples

Content type
application/json
{
  • "message": "New patient and interaction created successfully.",
  • "patient": {
    },
  • "interactions": {
    }
}

Search for patients

Searches for patients by name, phone number, or patient ID within an organization.

Authorizations:
X-API-Key
query Parameters
hospital_id
required
string
query
required
string

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Create a speciality

Creates a new speciality.

Authorizations:
X-API-Key
Request Body schema: application/json
specialty_name
required
string
description
string
short_prompt_id
integer
long_prompt_id
integer

Responses

Request samples

Content type
application/json
{
  • "specialty_name": "Cardiology",
  • "description": "Specializes in diagnosing and treating heart conditions.",
  • "short_prompt_id": 1,
  • "long_prompt_id": 1
}

Response samples

Content type
application/json
{
  • "message": "Speciality created successfully",
  • "speciality": {
    }
}

Get speciality by ID

Retrieves a single speciality by its ID.

Authorizations:
X-API-Key
query Parameters
id
required
integer

Responses

Response samples

Content type
application/json
{
  • "message": "Speciality retrieved successfully",
  • "speciality": {
    }
}

Get all specialities

Retrieves a list of all specialities.

Authorizations:
X-API-Key

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Update a speciality

Updates an existing speciality.

Authorizations:
X-API-Key
query Parameters
id
required
integer
Request Body schema: application/json
specialty_name
required
string
description
string
short_prompt_id
integer
long_prompt_id
integer

Responses

Request samples

Content type
application/json
{
  • "specialty_name": "Cardiology",
  • "description": "Specializes in diagnosing and treating heart conditions.",
  • "short_prompt_id": 1,
  • "long_prompt_id": 1
}

Response samples

Content type
application/json
{
  • "message": "Speciality updated successfully",
  • "speciality": {
    }
}

Create a new assessment template

Creates a new assessment template for a given practitioner.

Authorizations:
X-API-Key
Request Body schema: application/json

Assessment template creation details

practitioner_id
required
string
assessment_template
required
string
template_tests
required
string
hospital_id
required
string

Hospital identifier for the assessment template.

Responses

Request samples

Content type
application/json
{
  • "practitioner_id": "PRAC-123",
  • "assessment_template": "General Health Checkup",
  • "template_tests": "Blood Test, X-Ray",
  • "hospital_id": "9"
}

Response samples

Content type
application/json
{
  • "message": "Assessment template created successfully",
  • "assessment": {
    }
}

Check if an assessment template name exists for the doctor

Authorizations:
X-API-Key
query Parameters
practitioner_id
required
string
hospital_id
required
string

Hospital identifier to scope the assessment list.

assessment_template
required
string

Responses

Response samples

Content type
application/json
{
  • "exists": true,
  • "message": "The template name already exists."
}

Get all assessment templates for a doctor

Retrieves all assessment templates for a given practitioner.

Authorizations:
X-API-Key
query Parameters
practitioner_id
required
string

Responses

Response samples

Content type
application/json
{
  • "status": "success",
  • "assessments": [
    ]
}

Update an assessment

Updates an existing assessment by assessment_id for a given practitioner.

Authorizations:
X-API-Key
Request Body schema: application/json

Assessment update details

assessment_id
required
string
practitioner_id
required
string
assessment_template
string
template_tests
string
hospital_id
required
string

Hospital identifier for scoping the assessment update.

Responses

Request samples

Content type
application/json
{
  • "assessment_id": "ASMT-12345",
  • "practitioner_id": "PRAC-123",
  • "assessment_template": "General Health Checkup",
  • "template_tests": "Blood Test, X-Ray",
  • "hospital_id": "9"
}

Response samples

Content type
application/json
{
  • "assessment": {
    }
}

Delete an assessment template

Delete an existing assessment by assessment_id for a given practitioner.

Authorizations:
X-API-Key
query Parameters
assessment_id
required
integer
practitioner_id
required
string
hospital_id
required
string

Hospital identifier associated with the assessment.

Responses

Response samples

Content type
application/json
{
  • "message": "Assessment deleted successfully.",
  • "assessment": 101
}

Create medication template

Creates a new medication template for a given practitioner.

Authorizations:
X-API-Key
Request Body schema: application/json
template_name
required
string
practitioner_id
required
string
hospital_id
required
string

Unique identifier for the hospital/organization.

Responses

Request samples

Content type
application/json
{
  • "template_name": "Hypertension A",
  • "practitioner_id": "PRAC-123",
  • "hospital_id": "9"
}

Response samples

Content type
application/json
{
  • "message": "Medication template created successfully.",
  • "data": {
    }
}

Update medication template

Update medication template for a given practitioner template_id.

Authorizations:
X-API-Key
Request Body schema: application/json
template_id
required
integer
template_name
required
string
practitioner_id
required
string
hospital_id
required
string

Unique identifier for the hospital/organization.

Responses

Request samples

Content type
application/json
{
  • "template_id": 9001,
  • "template_name": "Hypertension A (v2)",
  • "practitioner_id": "PRAC-123",
  • "hospital_id": "9"
}

Response samples

Content type
application/json
{
  • "message": "Medication template updated successfully.",
  • "data": {
    }
}

List medication templates by practitioner

List medication templates by practitioner

Authorizations:
X-API-Key
query Parameters
practitioner_id
required
string

Responses

Response samples

Content type
application/json
{
  • "data": [
    ]
}

Get medication template by ID

Get medication template by ID & practitioner_id

Authorizations:
X-API-Key
query Parameters
template_id
required
integer
practitioner_id
required
string
hospital_id
required
string

Hospital identifier for template scoping.

Responses

Response samples

Content type
application/json
{
  • "data": {
    }
}

Create a new medication

Create a new medication entry for a template. Required fields: medication_name, route, practitioner_id, template_id, hospital_id Conditional required fields: frequency_morning, frequency_afternoon, frequency_night are required only when is_sos, is_stat, and is_once_only are all false. When any of is_sos, is_stat, or is_once_only is true, frequency fields are optional and will default to "0" if not provided.

Authorizations:
X-API-Key
Request Body schema: application/json
template_id
required
string

Template ID for the medication

medication_name
required
string

Name of the medication

generic_name
string

Generic name of the medication

brand_name
string

Brand name of the medication

medication_type
string

Type of medication (e.g., Tablet, Syrup)

dosage
string

Dosage of the medication

brand_id
string

Brand ID

frequency_morning
integer

Frequency in the morning (required when not is_sos/is_stat/is_once_only)

frequency_afternoon
integer

Frequency in the afternoon (required when not is_sos/is_stat/is_once_only)

frequency_evening
integer

Frequency in the evening

frequency_night
integer

Frequency at night (required when not is_sos/is_stat/is_once_only)

route
required
string

Route of administration

frequency_code
string

Frequency code (e.g., BD1)

frequency_description
string

Description of frequency

route_code
string

Route code

route_description
string

Description of route

uom_code
string

Unit of measure code

uom_description
string

Unit of measure description

is_sos
boolean
Default: false

Whether medication is SOS (as needed)

is_stat
boolean
Default: false

Whether medication is STAT (immediate)

is_once_only
boolean
Default: false

Whether medication is once only

duration
string

Duration of medication course

instructions
string

Additional instructions for medication

practitioner_id
required
string

Practitioner/Doctor ID

hospital_id
required
string

Hospital identifier for scoping the medication

Responses

Request samples

Content type
application/json
{
  • "template_id": "150",
  • "medication_name": "Paracetamol (Crocin)",
  • "generic_name": "Paracetamol",
  • "brand_name": "Crocin",
  • "medication_type": "Tablet",
  • "dosage": "500 mg",
  • "brand_id": "1",
  • "frequency_morning": 1,
  • "frequency_afternoon": 0,
  • "frequency_evening": 0,
  • "frequency_night": 0,
  • "route": "Oral",
  • "frequency_code": "BD1",
  • "frequency_description": "Twice daily",
  • "route_code": "24",
  • "route_description": "Oral",
  • "uom_code": "mg",
  • "uom_description": "Milligram",
  • "is_sos": true,
  • "is_stat": true,
  • "is_once_only": true,
  • "duration": "7 days",
  • "instructions": "Take after food",
  • "practitioner_id": "0123",
  • "hospital_id": "9"
}

Response samples

Content type
application/json
{
  • "message": "Medication successfully created",
  • "data": {
    }
}

Update medication

Update medication by medication_id. All fields are optional except medication_id and hospital_id. When is_sos, is_stat, or is_once_only is true, frequency fields will be set to "0" automatically. Only fields provided in the request will be updated; others will retain their existing values.

Authorizations:
X-API-Key
Request Body schema: application/json
medication_id
required
integer

ID of the medication to update

hospital_id
required
string

Hospital identifier to ensure the medication belongs to the right organization

practitioner_id
string

Practitioner/Doctor ID (used for permission validation)

template_id
integer

Template ID

medication_name
string

Name of the medication

generic_name
string

Generic name of the medication

brand_name
string

Brand name of the medication

medication_type
string

Type of medication (e.g., Tablet, Syrup)

dosage
string

Dosage of the medication

brand_id
string

Brand ID

frequency_morning
integer

Frequency in the morning (set to 0 if is_sos/is_stat/is_once_only is true)

frequency_afternoon
integer

Frequency in the afternoon (set to 0 if is_sos/is_stat/is_once_only is true)

frequency_evening
integer

Frequency in the evening (set to 0 if is_sos/is_stat/is_once_only is true)

frequency_night
integer

Frequency at night (set to 0 if is_sos/is_stat/is_once_only is true)

route
string

Route of administration

frequency_code
string

Frequency code (e.g., BD1)

frequency_description
string

Description of frequency

route_code
string

Route code

route_description
string

Description of route

uom_code
string

Unit of measure code

uom_description
string

Unit of measure description

is_sos
boolean

Whether medication is SOS (as needed)

is_stat
boolean

Whether medication is STAT (immediate)

is_once_only
boolean

Whether medication is once only

duration
string

Duration of medication course

instructions
string

Additional instructions for medication

Responses

Request samples

Content type
application/json
{
  • "medication_id": 438,
  • "hospital_id": "9",
  • "practitioner_id": "0123",
  • "template_id": 150,
  • "medication_name": "Paracetamol (Crocin)",
  • "generic_name": "Paracetamol",
  • "brand_name": "Crocin",
  • "medication_type": "Tablet",
  • "dosage": "650 mg",
  • "brand_id": "1",
  • "frequency_morning": 1,
  • "frequency_afternoon": 0,
  • "frequency_evening": 1,
  • "frequency_night": 0,
  • "route": "Oral",
  • "frequency_code": "BD1",
  • "frequency_description": "Twice daily",
  • "route_code": "24",
  • "route_description": "Oral",
  • "uom_code": "mg",
  • "uom_description": "Milligram",
  • "is_sos": false,
  • "is_stat": false,
  • "is_once_only": false,
  • "duration": "5 days",
  • "instructions": "Take after food"
}

Response samples

Content type
application/json
{
  • "message": "Medication successfully updated",
  • "data": {
    }
}

Delete medication

Delete medication template by ID & practitioner_id

Authorizations:
X-API-Key
query Parameters
medication_id
required
integer
practitioner_id
required
string
hospital_id
required
string

Hospital identifier to scope the deletion.

Responses

Response samples

Content type
application/json
{
  • "message": "Medication successfully deleted"
}

Upload medication CSV

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 NAME
  • BRAND ID, BRAND NAME, GENERIC NAME
  • BRAND NAME, GENERIC NAME, UOM CODE, UOM DESCRIPTION
  • BRAND ID, BRAND NAME, GENERIC NAME, UOM CODE, UOM DESCRIPTION
  • Any format above may continue with optional ACTIVE 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.
  • If UOM DESCRIPTION is provided, UOM CODE must also be provided.
  • ACTIVE FROM and ACTIVE TO, when present, must use DD/MM/YYYY.
  • Duplicate BRAND ID values are rejected.
  • Duplicate BRAND NAME + GENERIC NAME combinations are rejected.
  • Empty values or values containing only , or . are rejected.

Invalid rows are returned in the invalid field of the response.

Authorizations:
X-API-Key
query Parameters
hospital_id
required
string

Hospital/organization identifier.

Request Body schema: multipart/form-data
csvFile
required
string <binary>

Medication CSV file to upload.

Responses

Response samples

Content type
application/json
{}

Update medication CSV data

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):

  1. BRAND NAME, GENERIC NAME
  2. BRAND ID, BRAND NAME, GENERIC NAME
  3. BRAND NAME, GENERIC NAME, UOM CODE, UOM DESCRIPTION
  4. BRAND ID, BRAND NAME, GENERIC NAME, UOM CODE, UOM DESCRIPTION
  5. Any format above may continue with optional ACTIVE 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.
  • Empty values or values containing only , or . are rejected.
  • Duplicate BRAND ID values (when BRAND ID exists) are rejected.
  • Duplicate BRAND NAME + GENERIC NAME combinations are rejected.
  • If UOM DESCRIPTION is provided, UOM CODE is required.
  • ACTIVE FROM and ACTIVE TO, when present, must use DD/MM/YYYY.
  • If an existing medication CSV is present, BRAND ID presence must match; otherwise the API returns 400 with Header mismatch between existing and new CSV.

Merge behavior:

  • If the uploaded header includes BRAND ID, the merge key is BRAND ID.
  • Otherwise, the merge key is BRAND NAME + GENERIC NAME.
  • Uploaded rows overwrite matching existing rows.
Authorizations:
X-API-Key
query Parameters
hospital_id
required
string

Hospital identifier for the organization.

Request Body schema: multipart/form-data
csvFile
required
string <binary>

Medication CSV file to upload (must end with .csv).

Responses

Response samples

Content type
application/json
{}

Remove a medication CSV file

Deletes the medication CSV associated with hospital_id and clears its organization reference. The operation is idempotent and returns 200 even when no file is currently stored.

Authorizations:
X-API-Key
query Parameters
hospital_id
required
string

The ID of the hospital associated with the organization.

Responses

Response samples

Content type
application/json
{
  • "message": "Medication CSV removed successfully"
}

Update medication data (merge into existing CSV)

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.
  • Each item must contain 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.
  • If an existing CSV is present, BRAND ID presence must match incoming data.
  • The body may use medications, rows, data, or items; hospital_id may be supplied in query or body.
  • Final merged data is stored back as a CSV file.
Authorizations:
X-API-Key
Request Body schema: application/json
hospital_id
required
string

Hospital/organization identifier.

required
Array of objects non-empty

Array of medication objects to merge into existing data.

Responses

Request samples

Content type
application/json
{
  • "hospital_id": "9",
  • "medications": [
    ]
}

Response samples

Content type
application/json
{
  • "message": "Medication data updated successfully (merged, duplicates removed)",
  • "url": "gs://bucket/csv_uploads/organization_20260916120000.csv",
  • "invalid": [ ]
}

Get medications by template

Get medications by template

Authorizations:
X-API-Key
query Parameters
template_id
required
integer
practitioner_id
required
string
hospital_id
required
string

Hospital identifier to scope the template medications.

Responses

Response samples

Content type
application/json
{
  • "data": [
    ]
}

Get medication by ID

Get medication by ID

Authorizations:
X-API-Key
query Parameters
medication_id
required
integer
practitioner_id
required
string
hospital_id
required
string

Hospital identifier to scope the medication.

Responses

Response samples

Content type
application/json
{
  • "message": "Medication",
  • "data": {
    }
}

Organization User Login

Authenticates an organization user (e.g., doctor, admin, or staff) based on username and password. Supports MFA verification, multiple organization access, and trusted device recognition. Returns a JWT token upon successful authentication.

Authorizations:
X-API-Key
Request Body schema: application/json
username
required
string
password_hash
required
string

Responses

Request samples

Content type
application/json
{
  • "username": "dr.lakshmi",
  • "password_hash": "lakshmi"
}

Response samples

Content type
application/json
{
  • "message": "Organization Login successful",
  • "status": true,
  • "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
  • "role": "doctor",
  • "activeRole": true,
  • "time_zone": "Asia/Kolkata",
  • "country": "India",
  • "salutation": "Dr.",
  • "user_apikey": "AIzaSyBzkIUgnM8mUdHyaBb-DCgCWiX1eX6X"
}

Fetch all interaction details by patient ID

Retrieves paginated interaction data for a patient. Includes all interactions with valid statuses (1, 0, "", 3, 4, 5, 2), and falls back to 99 if none found. Each interaction includes its related interaction details, and attachments (audio/drawing) are processed.

Authorizations:
X-API-Key
query Parameters
patient_id
required
string

Unique ID of the patient.

page
integer
Default: 1

Page number for pagination (default as 1).

limit
integer
Default: 10

Number of interactions per page (default as 10).

Responses

Response samples

Content type
application/json
{
  • "patient_id": "PAT-001122",
  • "first_name": "Ragul",
  • "last_name": "Raj",
  • "date_of_birth": "2004-02-15",
  • "Interactions": [
    ],
  • "totalPages": 5,
  • "currentPage": 2
}

Fetch appointments by doctor

Retrieves a list of appointments (interactions) for a specific doctor within an optional date range.

Authorizations:
X-API-Key
query Parameters
practitioner_id
required
string
Example: practitioner_id=PRAC-001

Public practitioner identifier used to resolve the doctor.

hospital_id
required
string
Example: hospital_id=9

Hospital identifier to scope the appointments.

start_date
string <date>
Example: start_date=2025-10-01

Filter appointments starting from this date (inclusive).

end_date
string <date>
Example: end_date=2025-10-08

Filter appointments up to this date (inclusive).

Responses

Response samples

Content type
application/json
{
  • "count": 3,
  • "appointments": [
    ]
}

Create a new organization and admin user

Creates a new organization record along with an associated admin user account. Validates required fields and ensures unique hospital_id.

Authorizations:
X-API-Key
Request Body schema: application/json
name
required
string
type
string
state
string
city
string
country
required
string
pin_code
string
phone_number
string
email
string
website
string
fax_no
string
tax_id_no
string
address1
string
description
string
role
string
first_name
string
last_name
string
username
string
adminemail
string
password_hash
string
time_zone
required
string
hospital_id
required
string
api_url
required
string

Responses

Request samples

Content type
application/json
{
  • "name": "Sunrise Hospital",
  • "type": "hospital",
  • "state": "California",
  • "city": "Los Angeles",
  • "country": "USA",
  • "pin_code": "90001",
  • "phone_number": "+1-310-555-1234",
  • "email": "info@sunrisehospital.com",
  • "fax_no": "+1-310-555-5678",
  • "tax_id_no": "TAX123456789",
  • "address1": "1234 Sunset Blvd",
  • "description": "A state-of-the-art healthcare facility providing top-quality services.",
  • "role": "admin",
  • "first_name": "John",
  • "last_name": "Doe",
  • "username": "johndoe_admin",
  • "adminemail": "john.doe@sunrisehospital.com",
  • "password_hash": "lakshmi",
  • "time_zone": "America/Los_Angeles",
  • "hospital_id": "HOSP123",
}

Response samples

Content type
application/json
{
  • "message": "Organization and User created successfully",
  • "organization": {
    },
  • "user": {
    }
}

Create Outpatient Token

Creates a new outpatient token for a hospital patient. If the patient already exists, a new interaction record is created. If the patient is new, both a patient record and an interaction record are created.

Authorizations:
X-API-Key
Request Body schema: application/json
hospital_id
required
string
practitioner_id
required
string
speciality_id
required
string
hospital_patient_id
string
date_of_birth
string <date>
phone_number
string
first_name
required
string
last_name
required
string
age
integer
gender
required
string
Enum: "Male" "Female" "Other"
interaction_status
string
interaction_date
required
string <date-time>
token_number
required
string
address1
string
patientCategory
required
string
org_name
required
string
timeZone
required
string
email
string <email>
marital_status
string
Enum: "Single" "Married" "Divorced" "Widowed"
aadhar_number
string

Responses

Request samples

Content type
application/json
{
  • "hospital_id": "HOSP123",
  • "practitioner_id": "PRAC12345",
  • "speciality_id": "3",
  • "hospital_patient_id": "GEN9-202510-07148",
  • "date_of_birth": "1990-05-15",
  • "phone_number": "+919876543210",
  • "first_name": "apitesting",
  • "last_name": "1",
  • "age": 35,
  • "gender": "Male",
  • "interaction_status": "99",
  • "interaction_date": "2025-10-07T10:30:00Z",
  • "token_number": "121",
  • "address1": "123 Main Street, City, State, PIN",
  • "patientCategory": "Outpatient",
  • "org_name": "Sunrise Hospital",
  • "timeZone": "Asia/Kolkata",
  • "email": "john.doe@example.com",
  • "marital_status": "Married",
  • "aadhar_number": "123456789012"
}

Response samples

Content type
application/json
{
  • "message": "New patient and interaction created successfully.",
  • "patient": {
    },
  • "interactions": {
    }
}

Check Drug Interaction

Sends clinical data, diagnoses, and prescribed medications to the Drug Interaction API to check for potential drug interactions and related insights.

Authorizations:
X-API-Key
Request Body schema: application/json
answer
required
string

Stringified JSON containing diagnosis, vitals, assessments, and medication templates. (Sent as a single string to preserve formatting.)

patientAge
integer
patientDob
string
patientGender
required
string
Enum: "M" "F" "O"
patientId
required
string
hospital_id
required
string

Hospital identifier used for the interaction.

Responses

Request samples

Content type
application/json
{
  • "answer": "{\n \"response\": \"**Diagnosis:** **Fever**, **? Malaria**, **? Dengue fever**, **? Rabies**\",\n \"vitals\": [],\n \"assessment\": [\n {\"template_tests\": \"Complete blood count\", \"template_id\": \"57021-8\"},\n {\"template_tests\": \"Hepatitis B surface antigen\", \"template_id\": \"5196-1\"}\n ],\n \"medication_templates\": [\n {\n \"medication_id\": 148,\n \"medication_name\": \"((DOLOFORCE 2ML INJECTION) PIROXICAM 20 MG /ML)\",\n \"dosage\": \"2ml\",\n \"frequency_morning\": \"1\",\n \"frequency_afternoon\": \"2\",\n \"frequency_evening\": \"1\",\n \"frequency_night\": \"1\",\n \"route\": \"oral\",\n \"medication_type\": \"injection\",\n \"duration\": \"7\",\n \"instructions\": \"take this\",\n \"actual_medication_name\": \"(DOLOFORCE 2ML Injection) PIROXICAM 20 MG /ML\",\n \"brand_name\": \"(doloforce 2ml injection) piroxicam 20 mg /ml\"\n },\n {\n \"medication_id\": 79,\n \"medication_name\": \"PARACETAMOL (250MG) (P-250 MG TABLETS)\",\n \"dosage\": \"250mg\",\n \"frequency_morning\": \"1\",\n \"frequency_afternoon\": \"1\",\n \"frequency_evening\": \"0\",\n \"frequency_night\": \"1\",\n \"route\": \"Oral\",\n \"medication_type\": \"tablet\",\n \"duration\": \"7 days\",\n \"instructions\": \"take after meals\",\n \"brand_name\": \"p-250 mg tablets\",\n \"generic_name\": \"paracetamol (250mg)\"\n }\n ],\n \"additional_response\": \"**Chief Complaints:** Fever for 3 days...\",\n \"lab_data\": {\"lab_abnormal_data\": \"\"}\n}\n",
  • "patientAge": 45,
  • "patientDob": "",
  • "patientGender": "F",
  • "patientId": "GEN9-202510-00186",
  • "hospital_id": "9"
}

Response samples

Content type
application/json
{
  • "response": "**Drug Interaction Result:** No significant interactions found.",
  • "drug_interactions": [
    ]
}

Fetch Speciality Dashboard Data

Fetches clinical dashboard data (diagnosis, investigations, medications, etc.) for a specific patient and doctor.

Authorizations:
X-API-Key
Request Body schema: application/json
patient_id
required
string

Unique identifier for the patient.

specialty
required
string

The medical specialty to retrieve dashboard data for.

practitioner_id
required
string

Practitioner identifier used to resolve the doctor.

list_headings
required
Array of strings

List of data categories to fetch for the dashboard view.

combine_dr_status
boolean

Whether to combine data from multiple doctors.

combine_dr_id
Array of integers

List of doctor IDs to include when combining data.

interaction_id
string

Unique identifier for the clinical interaction.

stored_signal
boolean

Whether the dashboard data was retrieved from cached storage.

hospital_id
required
string

Hospital identifier used to scope the dashboard.

Responses

Request samples

Content type
application/json
{
  • "patient_id": "GEN9-202510-00186",
  • "specialty": "GENERAL MEDICINE",
  • "practitioner_id": "PRAC-186",
  • "list_headings": [
    ],
  • "combine_dr_status": true,
  • "combine_dr_id": [
    ],
  • "interaction_id": "80519",
  • "stored_signal": false,
  • "hospital_id": "9"
}

Response samples

Content type
application/json
{
  • "status": true,
  • "specialty": "GENERAL MEDICINE",
  • "patient_id": "GEN9-202510-00186",
  • "data": {
    }
}

Generate PDF from HTML

Generates a PDF file from the given HTML content. The API uses Puppeteer to render the HTML and returns the generated PDF as a downloadable file.

Authorizations:
X-API-Key
Request Body schema: application/json
html
required
string

HTML content to convert into a PDF.

header
string

Optional header HTML to include on each page.

footer
string

Optional footer HTML to include on each page.

marginT
string

Top margin (e.g., "20mm", "50px").

marginB
string

Bottom margin (minimum 22mm enforced).

marginL
string

Left margin.

marginR
string

Right margin.

hospital_id
required
string

Hospital identifier used to validate access before PDF creation.

practitioner_id
required
string

Practitioner identifier APT for the requesting doctor.

Responses

Request samples

Content type
application/json
{
  • "html": "string",
  • "header": "string",
  • "footer": "string",
  • "marginT": "20mm",
  • "marginB": "25mm",
  • "marginL": "10mm",
  • "marginR": "10mm",
  • "hospital_id": "9",
  • "practitioner_id": "PRAC-186"
}

Fetch doctor's patients for a specific date

Retrieves the list of unique patients (interactions) for a specific practitioner and date. Supports combined doctor logic via the advanced_settings field. Requires practitioner_id, hospital_id, date, and zone.

Authorizations:
X-API-Key
query Parameters
practitioner_id
required
string

Unique practitioner identifier tied to the organization.

hospital_id
required
string

Hospital identifier used to resolve organization and doctor scopes.

date
required
string <date>

The target date (YYYY-MM-DD) for fetching patients.

zone
required
string

Time zone (e.g., Asia/Kolkata). Use underscore _ instead of / if needed.

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Send WhatsApp Message

Sends a WhatsApp message using the WhatsApp Business API via Facebook Graph API. Supports sending text, template, and document messages. The API validates phone numbers and message payloads before sending to WhatsApp.

Authorizations:
X-API-Key
Request Body schema: application/json
to
required
string

Recipient phone number in E.164 format (must be +91XXXXXXXXXX for India)

type
required
string
Enum: "text" "template" "document"

Type of WhatsApp message

body
string

Text body for simple text messages

messageType
string

Optional flag for message mode (e.g. 'template')

templateName
string

Template name (required if type is 'template')

languageCode
string

Template language code (required if type is 'template')

object

Document details for sending PDF or file messages

messaging_product
string

Always 'whatsapp'

recipient_type
string

Recipient type (default 'individual')

object

Template data for advanced messageType = 'template'

Responses

Request samples

Content type
application/json
{
  • "to": "+919876543210",
  • "type": "text",
  • "body": "Your appointment is confirmed for tomorrow at 10 AM.",
  • "messageType": "template",
  • "templateName": "appointment_confirmation",
  • "languageCode": "en_US",
  • "document": {},
  • "messaging_product": "whatsapp",
  • "recipient_type": "individual",
  • "template": {
    }
}

Response samples

Content type
application/json
{
  • "success": true,
  • "message": "Message sent successfully",
  • "data": {
    }
}

Fetch WhatsApp Message Templates

Retrieves all approved WhatsApp message templates for the organization. These templates can be used with the WhatsApp Business API to send standardized messages. Templates include various components like headers (text/document), body text with parameters, and footers.

Authorizations:
X-API-Key

Responses

Response samples

Content type
application/json
{
  • "data": [
    ]
}

Get Medication CSV Data

Retrieves the medication data CSV file for a given hospital ID.
The API reads the CSV from Google Cloud Storage (GCS), validates the headers, and returns it as a JSON array of rows.

Authorizations:
X-API-Key
query Parameters
hospital_id
required
string
Example: hospital_id=9

Unique hospital identifier (maps to organization)

Responses

Response samples

Content type
application/json
[
  • {
    },
  • {
    }
]

Fetch Investigation CSV for a Hospital

Retrieves the investigation CSV data for a given hospital. Returns a JSON array of investigations with "SERVICE ID", "STANDARD LAB TEST NAME", and "ALIAS NAME".

Authorizations:
X-API-Key
query Parameters
hospital_id
required
string

The unique hospital ID to fetch investigation CSV for

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Upload an investigation CSV file

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.

Authorizations:
X-API-Key
query Parameters
hospital_id
required
string

The ID of the hospital associated with the organization.

Request Body schema: multipart/form-data
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.

Responses

Response samples

Content type
application/json
{}

Update an investigation CSV file

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.

Authorizations:
X-API-Key
query Parameters
hospital_id
required
string

The ID of the hospital associated with the organization.

Request Body schema: multipart/form-data
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.

Responses

Response samples

Content type
application/json
{}

Upload investigation data as JSON

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.

Authorizations:
X-API-Key
query Parameters
hospital_id
required
string

The ID of the hospital associated with the organization.

Request Body schema: application/json

Investigation rows wrapped in data; the controller also accepts a direct array.

required
Array of objects

Responses

Request samples

Content type
application/json
{
  • "data": [
    ]
}

Response samples

Content type
application/json
{}

Update investigation data as JSON

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.

Authorizations:
X-API-Key
query Parameters
hospital_id
required
string

The ID of the hospital associated with the organization.

Request Body schema: application/json

Array of investigation objects to merge with existing data

required
Array of objects

Responses

Request samples

Content type
application/json
{
  • "data": [
    ]
}

Response samples

Content type
application/json
{}

Ingest Edited OPD Interaction Data

Creates and ingests edited OPD interaction details. The API uploads a text file to cloud storage (GCS) and triggers an ingestion process to update the interaction record.

Authorizations:
X-API-Key
Request Body schema: application/json
interaction_id
required
string

Unique interaction ID for the patient encounter.

required
object

Edited OPD details to be ingested.

hospital_id
required
string

Hospital identifier for scoping the interaction.

Responses

Request samples

Content type
application/json
{
  • "interaction_id": "80519",
  • "senddataingest": {
    },
  • "hospital_id": "9"
}

Response samples

Content type
application/json
{
  • "status": true,
  • "message": "Edited opd interaction details created and ingested successfully",
  • "interaction_id": "80519",
  • "uploadedUrls": "gs://medscribe-dev/editedOpd/80519_a4ac98c8-e3f3-448e-b774-85064ed3a96a.txt",
  • "pdfingestIntraction": {
    }
}

Save patient vitals data

Accepts vitals data for a patient, stores it, uploads the file to cloud storage, creates related interaction records, and triggers the ingestion pipeline.

Authorizations:
X-API-Key
Request Body schema: application/json

Patient details and vitals data payload.

patient_id
required
string
hospital_id
required
string
interaction_date
string <date-time>
first_name
string
last_name
string
date_of_birth
string
gender
string
Enum: "M" "F" "O"
age
integer
required
object

Responses

Request samples

Content type
application/json
{
  • "patient_id": "e53aed9ae",
  • "hospital_id": "9",
  • "interaction_date": "2024-01-02T10:00:00Z",
  • "first_name": "ragul",
  • "last_name": "raj",
  • "date_of_birth": null,
  • "gender": "M",
  • "age": 21,
  • "vitalsData": {
    }
}

Fetch token details by doctor

Retrieves interaction tokens based on doctor and specialization configuration. Determines whether to fetch tokens by doctor or by specialty based on organization and speciality settings.

Authorizations:
X-API-Key
query Parameters
key
required
string

API authentication key

practitioner_id
required
string

Unique identifier for the practitioner.

created_at
required
string <date>

Date (YYYY-MM-DD) for which interactions should be fetched.

zone
required
string

Time zone offset (e.g. +05:30 or Asia/Kolkata). Used to convert interaction timestamps to UTC.

hospital_id
required
string

Hospital identifier associated with the practitioner.

Responses

Response samples

Content type
application/json
{
  • "message": "Interaction get successfull",
  • "interaction": [
    ]
}

Get Doctor List by Hospital ID

Retrieves a list of doctors associated with a hospital. The hospital ID is used to locate the corresponding organization, and all doctors under that organization are returned.

Authorizations:
X-API-Key
query Parameters
key
required
string

API authentication key

hospital_id
required
string

Unique identifier for the hospital.

Responses

Response samples

Content type
application/json
{
  • "message": "Doctor list fetched successfully",
  • "doctor": [
    ]
}

Get Speciality Doctor-Based Token Settings

Retrieves the list of specialities for a given hospital that have doctor-based token configuration enabled. Returns all active (is_active = 1) specialities associated with the hospital’s organization.

Authorizations:
X-API-Key
query Parameters
key
required
string

API authentication key

hospital_id
required
string

Unique identifier for the hospital.

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Get Inpatient List by Hospital ID

Returns a list of active inpatients for the given hospital_id. hospital_id is first mapped to an organization_id, and then all inpatients under that organization are fetched along with: - Patient details - Assigned doctors - Assigned nurses - Bed details - Primary doctor info

Authorizations:
X-API-Key
query Parameters
hospital_id
required
string
Example: hospital_id=9
header Parameters
x-api-key
required
string
Example: your-api-key-here

Responses

Response samples

Content type
application/json
{
  • "hospital_id": "9",
  • "data": [
    ]
}

Get Total Doctors by Hospital ID

Returns the total number of doctors for a given hospital_id.

Authorizations:
X-API-Key
query Parameters
hospital_id
required
integer
Example: hospital_id=9
header Parameters
x-api-key
required
string
Example: your-api-key-here

Responses

Response samples

Content type
application/json
{
  • "message": "Doctors list fetched successfully",
  • "data": {
    }
}

Start Interaction with File Upload

Starts a new interaction for a patient by uploading one or more files ( PDFs, documents, or text files). The endpoint accepts multipart/form-data requests with patient and file details.

Authorizations:
X-API-Key
query Parameters
hospital_id
required
string

Hospital ID where the interaction is being created

Request Body schema: multipart/form-data
patient_id
required
string

Patient identifier

practitioner_id
string

Practitioner identifier

caregiver_id
string

Caregiver identifier

files
required
string <binary>

Upload one or more files (send multiple fields named 'files'). Allowed types: jpg, jpeg, png, gif, avif, heic, pdf, docx, txt Max size: 15MB per file.

Responses

Response samples

Content type
application/json
{
  • "status": true,
  • "message": "Interaction started",
  • "interaction": {
    },
  • "details": [],
  • "pubsubPayload": {}
}

Upload Patient Document

Upload a patient document file and patient details using multipart/form-data.

Authorizations:
X-API-Key
query Parameters
hospital_id
required
string
Example: hospital_id=9

Hospital ID used to resolve the organization.

Request Body schema: multipart/form-data
patient_id
required
string

Patient identifier.

name
required
string

Patient name.

age
required
integer

Patient age.

gender
required
string

Patient gender.

language
required
string

Patient preferred language.

practitioner_id
required
string

Practitioner identifier.

caregiver_id
required
string

Caregiver identifier.

patient_type
required
string
Enum: "opd" "ipd"

Patient type for the upload flow.

hospital_inpatient_id
required
string

Inpatient identifier from the HMS.

file
required
string

File(s) to upload. Send up to 10 document files using the file field. The total upload size must not exceed 30MB. Supported file types include PDF, DOC, DOCX, TXT, JPG, JPEG, PNG, GIF, AVIF, and HEIC.

Responses

Response samples

Content type
application/json
{
  • "message": "Document uploaded successfully."
}

Update OPD Order for a Hospital

Updates the OPD section display order for a hospital. The endpoint expects the hospital_id and a valid opd_order object in the request body.

Authorizations:
X-API-Key
Request Body schema: application/json

Opd order update payload

hospital_id
required
string
opd_order
required
object

Responses

Request samples

Content type
application/json
{
  • "hospital_id": "9",
  • "opd_order": {
    }
}

Response samples

Content type
application/json
{
  • "message": "OPD order updated successfully",
  • "opd_order": {
    }
}

Update patient details

Updates patient demographic details, contact info, category changes (Outpatient/Inpatient),
and automatically handles inpatient record activation/deactivation.

Authorizations:
X-API-Key
query Parameters
patient_id
required
string

Unique patient ID

hospital_id
required
string

Hospital ID to validate organization

Request Body schema: application/json
first_name
string
last_name
string
date_of_birth
string <date>
phone_number
string
email
string
age
integer
gender
string
patient_category
string
address1
string
address2
string
city
string
state
string
zip_code
string
language
string
marital_status
string
occupation
string
aadhar_number
string
insurance_no
string
provider_id
string
emergency_contact_name
string
emergency_contact_phone_no
string
hospital_patient_id
string
Referred_by_doctor
string
primarydoctor
integer
timeZone
string
org_name
string
hospital_inpatient_id
string

Responses

Request samples

Content type
application/json
{
  • "first_name": "John",
  • "last_name": "Doe",
  • "date_of_birth": "1990-01-15",
  • "phone_number": "+919876543210",
  • "email": "john.doe@example.com",
  • "age": 34,
  • "gender": "Male",
  • "patient_category": "Outpatient",
  • "address1": "123 Main Street",
  • "address2": "Apt 4B",
  • "city": "Mumbai",
  • "state": "Maharashtra",
  • "zip_code": "400001",
  • "language": "English",
  • "marital_status": "Single",
  • "occupation": "Engineer",
  • "aadhar_number": "123456789012",
  • "insurance_no": "INS123456",
  • "provider_id": "PROV001",
  • "emergency_contact_name": "Jane Doe",
  • "emergency_contact_phone_no": "+919876543211",
  • "hospital_patient_id": "HOSP-001",
  • "Referred_by_doctor": "Dr. Smith",
  • "primarydoctor": 151,
  • "timeZone": "Asia/Kolkata",
  • "org_name": "GEN",
  • "hospital_inpatient_id": "INPAT-001"
}

Response samples

Content type
application/json
{
  • "message": "Patient updated successfully",
  • "patient": { }
}

Send OTP to Email for Password Reset

Sends a 6-digit OTP to the user's registered email address for password reset flow. Requires a valid user's email in the request body.

Authorizations:
X-API-Key
Request Body schema: application/json
mailid
required
string <email>

Responses

Request samples

Content type
application/json
{
  • "mailid": "example@gmail.com"
}

Response samples

Content type
application/json
{
  • "message": "OTP sent successfully to example@gmail.com"
}

Verify OTP for Password Reset

Verifies the 6-digit OTP sent to the user's email address during the password reset process. If the OTP is valid, a temporary password reset token (JWT) will be generated with a 15-minute expiry.

Authorizations:
X-API-Key
Request Body schema: application/json
mailid
required
string <email>
enteredOtp
required
string

Responses

Request samples

Content type
application/json
{
  • "mailid": "example@gmail.com",
  • "enteredOtp": "333598"
}

Response samples

Content type
application/json
{
  • "message": "OTP verified successfully!",
  • "verifycode": true,
  • "password_reset_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
  • "status": true
}

Reset User Password

Resets the user's password using a valid password reset access token. The access token must be generated from the OTP verification flow and must contain the purpose password_reset. The email provided in the request must match the email inside the token.

Authorizations:
X-API-Key
Request Body schema: application/json
email
required
string <email>
password_hash
required
string

New password (will be hashed on the server)

access_token
required
string

Password reset JWT token obtained after OTP verification

Responses

Request samples

Content type
application/json
{
  • "email": "example@gmail.com",
  • "password_hash": "987",
  • "access_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..."
}

Response samples

Content type
application/json
{
  • "message": "Password updated successfully",
  • "verifycode": true,
  • "status": true
}

Get All Release Notes

Fetches all release notes stored in the system. Results are ordered by release_date (DESC) and created_at (DESC). Requires a valid API Key for authentication.

Authorizations:
X-API-Key

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Fetch Appointments Summary for a Doctor

Returns today's appointments OR appointments within a date range for a given doctor (practitioner_id) in a specific hospital.

Authorizations:
X-API-Key
query Parameters
practitioner_id
required
string

Practitioner ID of the doctor.

hospital_id
required
string

Hospital ID.

start_date
string <date-time>

Start date for filtering appointments (ISO date format).

end_date
string <date-time>

End date for filtering appointments (ISO date format).

Responses

Response samples

Content type
application/json
{
  • "pending_count": 5,
  • "visited_count": 12,
  • "appointed": [
    ],
  • "visited": [
    ]
}

Update Nurse Settings

Updates the settings of a nurse and the linked user record.

Authorizations:
X-API-Key
query Parameters
caregiver_id
required
string

Unique identifier of the nurse

hospital_id
required
string

Hospital ID is required to validate organization access

Request Body schema: application/json
first_name
string

Optional - Nurse's first name

last_name
string

Optional - Nurse's last name

email
string <email>

Optional - User email

phone_number
string

Optional - Nurse contact number

floor_id
integer

Optional - Floor assignment

object

Optional - Advanced user settings. Restricted fields are ignored.

Responses

Request samples

Content type
application/json
{
  • "first_name": "bala",
  • "last_name": "bala",
  • "email": "bala@adshi5.com",
  • "phone_number": "+919788612345",
  • "floor_id": 2,
  • "advancedSettings": {
    }
}

Response samples

Content type
application/json
{
  • "message": "Nurse settings updated successfully",
  • "nurse": { },
  • "user": {
    }
}

Update doctor settings

Updates doctor OPD sheet, assessment, and advanced settings. Requires practitioner_id and hospital_id as query parameters.

Authorizations:
X-API-Key
query Parameters
practitioner_id
required
string
hospital_id
required
string
Request Body schema: application/json
plan
boolean
follow_up
boolean
investigations
boolean
patient_history
boolean
recommendations
boolean
chief_complaints
boolean
personal_history
boolean
examination_findings
boolean
history_of_presenting_illness
boolean
vital
boolean
medicine
boolean
diagnosis
boolean
assessment
boolean
investigation
boolean
brand
boolean
generic
boolean
TNMCRegNo
boolean
genericFront
boolean
FrequencyEvng
boolean
preferredLang
string
counsellingMode
boolean

Responses

Request samples

Content type
application/json
{
  • "plan": true,
  • "follow_up": true,
  • "investigations": true,
  • "patient_history": true,
  • "recommendations": true,
  • "chief_complaints": true,
  • "personal_history": true,
  • "examination_findings": true,
  • "history_of_presenting_illness": true,
  • "vital": true,
  • "medicine": true,
  • "diagnosis": true,
  • "assessment": true,
  • "investigation": true,
  • "brand": true,
  • "generic": true,
  • "TNMCRegNo": true,
  • "genericFront": true,
  • "FrequencyEvng": true,
  • "preferredLang": "string",
  • "counsellingMode": true
}

Update Doctor OPD Assessment Settings

Updates OPD assessment configuration using practitioner_id and hospital_id as query parameters.

Authorizations:
X-API-Key
query Parameters
practitioner_id
required
string
hospital_id
required
string
Request Body schema: application/json
chief_complaints
required
boolean
history_of_presenting_illness
required
boolean
patient_history
required
boolean
personal_history
required
boolean
examination_findings
required
boolean
investigations
required
boolean
recommendations
required
boolean
medications
required
boolean
follow_up
required
boolean
plan
required
boolean
required
object

Responses

Request samples

Content type
application/json
{
  • "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,
  • "patient": {
    }
}

Update Doctor OPD Settings

Updates OPD-related configuration for a doctor using practitioner_id and hospital_id as query parameters.

Authorizations:
X-API-Key
query Parameters
practitioner_id
required
string

Practitioner ID of the doctor

hospital_id
required
string

Hospital ID associated with the doctor

Request Body schema: application/json
medicine
required
boolean
vital
required
boolean
investigation
required
boolean
assessment
required
boolean
datasheetimage
required
boolean
diagnosis
required
boolean
drawImage
required
boolean
sign
required
boolean
summary
required
boolean
required
object

Responses

Request samples

Content type
application/json
{
  • "medicine": true,
  • "vital": true,
  • "investigation": true,
  • "assessment": true,
  • "datasheetimage": true,
  • "diagnosis": true,
  • "drawImage": true,
  • "sign": true,
  • "summary": false,
  • "patient": {
    }
}

Update Dashboard Setup Values

Updates dashboard setup using practitioner_id and hospital_id as query parameters.Example values:investigation,diagnosis

Authorizations:
X-API-Key
query Parameters
practitioner_id
required
string
hospital_id
required
string
Request Body schema: application/json
dashboard_setup_values
Array of strings

Responses

Request samples

Content type
application/json
{
  • "dashboard_setup_values": [
    ]
}

Generate OPD Sheet PDF

Generates a PDF OPD (Outpatient Department) sheet for a patient interaction. The endpoint accepts either interaction_id or patient_id to find the interaction. Accepts WSS (WebSocket Service) processed data in the request body to include assessment, diagnosis, medications, and other clinical data in the PDF

Authorizations:
X-API-Key
query Parameters
interaction_id
integer
Example: interaction_id=98860

Interaction ID to generate PDF for. Either interaction_id or patient_id is required.

patient_id
string
Example: patient_id=GEN9-202511-00465

Patient ID as fallback if interaction_id not found. Either interaction_id or patient_id is required.

hospital_id
required
string
Example: hospital_id=9

Hospital ID for the interaction (mandatory)

practitioner_id
string
Example: practitioner_id=0123

Practitioner ID of the doctor. If provided, uses ONLY this doctor's OPD settings, ignoring interaction doctor.

data
string
Example: data={"diagnosis":"Fever","medication_templates":[]}

WSS data as JSON string (for GET requests)

Request Body schema: application/json

Optional WSS processed data. Supports multiple formats - allData.processedText (new format), processedText, answer, or direct fields.

status
string
object

New WSS response format with processedText

processedText
object

Alternative format - processedText directly in body

answer
object

Alternative format - answer field (common in session/chat responses)

data
object

Alternative format - nested data structure

response
string

Old format - diagnosis response text

additional_response
string

Old format - additional assessment response

medication_templates
Array of objects

Medication prescriptions (old format)

assessment
Array of objects

Assessment templates (old format)

vitals
Array of objects

Vitals data (old format)

diagnosis
string

Direct diagnosis field

chief_complaints
string

Direct chief complaints field

history_of_presenting_illness
string

Direct history of presenting illness field

past_medical_history
string

Direct past medical history field

personal_history
string

Direct personal history field

examination_findings
string

Direct examination findings field

recommendations
string

Direct recommendations field

diet
string

Direct diet field

follow_up
string

Direct follow-up field

plan
string

Direct plan field

Responses

Request samples

Content type
application/json
{
  • "status": "processed",
  • "allData": {
    },
  • "processedText": { },
  • "answer": { },
  • "data": { },
  • "response": "**Diagnosis:** **Fever**, **? Malaria**",
  • "additional_response": "string",
  • "medication_templates": [
    ],
  • "assessment": [
    ],
  • "vitals": [
    ],
  • "diagnosis": "Fever, Cough",
  • "chief_complaints": "string",
  • "history_of_presenting_illness": "string",
  • "past_medical_history": "string",
  • "personal_history": "string",
  • "examination_findings": "string",
  • "recommendations": "string",
  • "diet": "string",
  • "follow_up": "string",
  • "plan": "string"
}

Response samples

Toggle Inpatient Setup

Enables or disables the inpatient setup configuration for a hospital. The hospital is identified using the hospital_id query parameter.

Authorizations:
X-API-Key
query Parameters
hospital_id
required
string
Example: hospital_id=9

Hospital ID for which inpatient setup needs to be toggled

Request Body schema: application/json
inpatientSetup
required
boolean

Responses

Request samples

Content type
application/json
{
  • "inpatientSetup": true
}

Response samples

Content type
application/json
{
  • "success": true,
  • "message": "Inpatient setup has been turned ON",
  • "inpatientSetup": true
}

Update Floor Variable

Updates the floor variable configuration for a hospital. The floor variable determines how inpatient areas are categorized, such as Floors, Blocks, or Buckets.

Authorizations:
X-API-Key
query Parameters
hospital_id
required
string
Example: hospital_id=9

Hospital ID for which floor variable needs to be updated

Request Body schema: application/json
floor_variable
required
string
Enum: "Floors" "Blocks" "Buckets"

Floor classification type

Responses

Request samples

Content type
application/json
{
  • "floor_variable": "Floors"
}

Response samples

Content type
application/json
{
  • "message": "floor_variable updated successfully.",
  • "data": "Floors"
}

Get All Floors

Retrieves all floors for a given hospital. The hospital_id is used to identify the organization.

Authorizations:
X-API-Key
query Parameters
hospital_id
required
string
Example: hospital_id=9

Hospital ID to validate the organization

Responses

Response samples

Content type
application/json
{
  • "message": "Floors fetched successfully.",
  • "data": [
    ]
}

Create Floor

Creates a new floor for a given hospital. The hospital_id is used to identify the organization. Floor name must be unique within the organization.

Authorizations:
X-API-Key
Request Body schema: application/json
floor_name
required
string
hospital_id
required
string

Responses

Request samples

Content type
application/json
{
  • "floor_name": "First Floor",
  • "hospital_id": "9"
}

Response samples

Content type
application/json
{
  • "message": "Floor created successfully.",
  • "data": {
    }
}

Update Floor

Updates an existing floor for a given hospital. The hospital_id is used to identify the organization. Prevents duplicate floor names within the same organization.

Authorizations:
X-API-Key
query Parameters
hospital_id
required
string
Example: hospital_id=9

Hospital ID to validate the organization

Request Body schema: application/json
floor_id
required
integer
floor_name
string

Responses

Request samples

Content type
application/json
{
  • "floor_id": 2,
  • "floor_name": "New Floor"
}

Response samples

Content type
application/json
{
  • "message": "Floor updated successfully.",
  • "data": {
    }
}

Delete Floor

Deletes an existing floor for a given hospital. The hospital_id is used to identify the organization and ensures the floor belongs to the organization before deletion.

Authorizations:
X-API-Key
query Parameters
hospital_id
required
string
Example: hospital_id=9

Hospital ID to validate the organization

floor_id
required
integer
Example: floor_id=2

Floor ID to be deleted

Responses

Response samples

Content type
application/json
{
  • "message": "Floor deleted successfully."
}

Get All Beds List

Fetches the complete list of beds for a given hospital. The API validates the hospital_id, retrieves the associated organization, and returns all beds linked to that organization, including floor details.

Authorizations:
X-API-Key
query Parameters
hospital_id
required
string
Example: hospital_id=9

Responses

Response samples

Content type
application/json
{
  • "message": "Beds fetched successfully.",
  • "beds": [
    ]
}

Create a new inpatient bed

Creates a new bed record for the specified hospital. Fields like status, need_maintenance, last_cleaned_at, patient_id, inpatient_id, and admitted_at are optional.

Authorizations:
X-API-Key
Request Body schema: application/json
hospital_id
required
integer
bed_no
required
string
bed_type
required
string
ward
required
string
floor
required
string

Floor number or floor ID

is_occupied
boolean
status
string
need_maintenance
boolean
last_cleaned_at
string <date>
patient_id
string
inpatient_id
string
admitted_at
string <date-time>

Responses

Request samples

Content type
application/json
{
  • "hospital_id": 9,
  • "bed_no": "3",
  • "bed_type": "general",
  • "ward": "general",
  • "floor": "2",
  • "is_occupied": false,
  • "status": "available",
  • "need_maintenance": false,
  • "last_cleaned_at": "2025-11-26",
  • "patient_id": null,
  • "inpatient_id": null,
  • "admitted_at": "2026-01-15T10:30:00Z"
}

Response samples

Content type
application/json
{
  • "message": "Bed created successfully.",
  • "bed": { }
}

Update an existing inpatient bed

Updates the details of a bed such as ward, bed number, status, floor, etc.

Authorizations:
X-API-Key
query Parameters
bed_id
required
string
Example: bed_id=d21e4d69-c3b9-4eed-a7eb-2d402daaaa42

UUID of the bed to update

Request Body schema: application/json
hospital_id
required
integer
bed_no
required
string
ward
required
string
bed_type
string
is_occupied
boolean
status
required
string
floor
required
string

Floor name from Floor table

need_maintenance
boolean
last_cleaned_at
string <date>

Responses

Request samples

Content type
application/json
{
  • "hospital_id": 9,
  • "bed_no": "3",
  • "ward": "general",
  • "bed_type": "ICU",
  • "is_occupied": false,
  • "status": "occupied",
  • "floor": "floor-2",
  • "need_maintenance": false,
  • "last_cleaned_at": "2025-11-26"
}

Response samples

Content type
application/json
{
  • "message": "Bed updated successfully.",
  • "bed": { }
}

Add ward to organization

Adds a new ward to the organization based on hospital_id.

Authorizations:
X-API-Key
query Parameters
hospital_id
required
string

Hospital identifier used to find the organization.

Request Body schema: application/json
ward
required
string

Name of the ward to be added.

Responses

Request samples

Content type
application/json
{
  • "ward": "Ward 15"
}

Response samples

Content type
application/json
{
  • "message": "Ward added successfully.",
  • "data": {
    }
}

Update ward name

Updates an existing ward name for an organization using hospital_id.

Authorizations:
X-API-Key
query Parameters
hospital_id
required
string

Hospital identifier used to find the organization.

Request Body schema: application/json
old_ward
required
string

Existing ward name to be updated.

new_ward
required
string

New ward name.

Responses

Request samples

Content type
application/json
{
  • "old_ward": "ward 15",
  • "new_ward": "ward 17"
}

Response samples

Content type
application/json
{
  • "message": "Ward updated successfully.",
  • "data": {
    }
}

Remove ward

Removes an existing ward from the organization using hospital_id.

Authorizations:
X-API-Key
query Parameters
hospital_id
required
string

Hospital identifier used to find the organization.

Request Body schema: application/json
ward
required
string

Name of the ward to be removed.

Responses

Request samples

Content type
application/json
{
  • "ward": "ward 17"
}

Response samples

Content type
application/json
{
  • "message": "Ward removed successfully.",
  • "data": {
    }
}

Upload CSV for floor, bed type, and ward setup

Uploads a CSV file (Base64 encoded) to configure floors, bed types, and wards for a hospital.

  • CSV must contain at least one of the following headers:
    • Floor Name
    • Bed Type
    • Ward
  • Rows with all empty values are treated as invalid.
  • Existing values in the database are skipped automatically.
  • The CSV file must be Base64 encoded before sending.
Authorizations:
X-API-Key
query Parameters
hospital_id
required
string

Hospital identifier used to find the organization.

Request Body schema: application/json
fileName
required
string

Original CSV file name.

csvBase64
required
string

Base64 encoded CSV file content.

Responses

Request samples

Content type
application/json
{
  • "fileName": "partition_setup.csv",
  • "csvBase64": "Rmxvb3IgTmFtZSxCZ..."
}

Response samples

Content type
application/json
{
  • "message": "CSV uploaded and processed successfully.",
  • "data": {
    },
  • "invalidRows": [
    ],
  • "duplicateRows": [
    ],
  • "skippedRows": [
    ]
}

Get bed types and wards

Retrieves bed types and wards configured for a hospital. Data is returned as arrays even if stored as JSON strings.

Authorizations:
X-API-Key
query Parameters
hospital_id
required
string
Example: hospital_id=9

Hospital identifier

Responses

Response samples

Content type
application/json
{
  • "bedtypes": [
    ],
  • "wards": [
    ]
}

Create Inpatient

Creates a new inpatient record for a given hospital. Validates hospital, practitioner, floor, and organization details. Generates unique patient_id and inpatient_id automatically.

Authorizations:
X-API-Key
query Parameters
hospital_id
required
string
Example: hospital_id=9

Hospital ID to validate the organization

Request Body schema: application/json
first_name
string
last_name
string
hospital_inpatient_id
required
string
practitioner_id
required
string
patient_category
required
string
floor_id
required
integer
speciality_id
integer
hospital_patient_id
string
date_of_birth
string <date>
phone_number
string
age
integer
gender
string
address1
string
email
string <email>
marital_status
string
aadhar_number
string
Referred_by_doctor
string
in_date
string <date>
bed_id
integer
ward
string
timeZone
string

Responses

Request samples

Content type
application/json
{
  • "first_name": "Ravi",
  • "last_name": "Kumar",
  • "hospital_inpatient_id": "IN-GEN9-202601-00025",
  • "practitioner_id": "0123",
  • "patient_category": "Inpatient",
  • "floor_id": 29,
  • "speciality_id": 5,
  • "hospital_patient_id": "HSP123",
  • "date_of_birth": "1995-06-15",
  • "phone_number": "9876543210",
  • "age": 30,
  • "gender": "Male",
  • "address1": "Chennai",
  • "email": "ravi@gmail.com",
  • "marital_status": "Single",
  • "aadhar_number": "123412341234",
  • "Referred_by_doctor": "Dr. Suresh",
  • "in_date": "2026-01-05",
  • "bed_id": 12,
  • "ward": "Ward-A",
  • "timeZone": "Asia/Kolkata"
}

Response samples

Content type
application/json
{
  • "message": "Inpatient created successfully.",
  • "patient": { },
  • "inpatient": { }
}

Get Inpatients List by Hospital

Retrieves all active inpatients for a given hospital. The hospital_id is used to identify the organization and fetch associated patient, doctor, bed, and floor details.

Authorizations:
X-API-Key
query Parameters
hospital_id
required
string
Example: hospital_id=9

Hospital ID to validate the organization

Responses

Response samples

Content type
application/json
{
  • "inpatients": [
    ]
}

Assign Doctor / Update Inpatient by Hospital

Updates an inpatient record using hospital_inpatient_id for a given hospital. Supports assigning a doctor via practitioner_id, updating floor, bed, ward, admission date, and handling bed and doctor linkage. Patient category is always stored as Inpatient by the server.

Authorizations:
X-API-Key
query Parameters
hospital_id
required
string
Example: hospital_id=9

Hospital ID to validate the organization

Request Body schema: application/json
hospital_inpatient_id
required
string
practitioner_id
required
string

Practitioner ID to resolve doctor assignment

floor_id
required
integer
bed_no
string or null

An empty or null value clears the bed assignment

ward
string or null

An empty or null value clears the ward

patient_id
required
string
in_date
string or null <date-time>

Omitted, empty, or null defaults to the current date and time

Responses

Request samples

Content type
application/json
{
  • "hospital_inpatient_id": "IN-GEN9-202601-00025",
  • "practitioner_id": "108",
  • "floor_id": 29,
  • "bed_no": "B123",
  • "ward": "General",
  • "patient_id": "GEN9-202601-00025",
  • "in_date": "2025-01-06T10:00:00Z"
}

Response samples

Content type
application/json
{
  • "message": "Inpatient updated successfully",
  • "inpatient": {
    }
}

Get Inpatient Handover Notes

Resolves hospital-facing patient and inpatient identifiers to internal IDs and resolves caregiver_id to the hospital nurse's internal nurse_id before calling get_handover. The upstream time zone is read from the hospital organization and defaults to Asia/Kolkata.

Authorizations:
X-API-Key
query Parameters
hospital_id
required
string
Example: hospital_id=9
patient_id
required
string
Example: patient_id=HOSP-PAT-007

Hospital patient identifier resolved through Patient.hospital_patient_id

hospital_inpatient_id
required
string
Example: hospital_inpatient_id=INP-HOSP-PAT-007

Hospital inpatient identifier resolved through Inpatients.hospital_inpatient_id

caregiver_id
required
string
Example: caregiver_id=CG-001

Caregiver identifier resolved to the hospital nurse's internal nurse_id

type
string
Default: "all"

Responses

Response samples

Content type
application/json
{ }

Get Inpatient Summary

Returns the speciality dashboard, laboratory data, and inpatient vitals generated by the patient-summary service. The patient and inpatient admission are validated against the hospital. When practitioner_id is supplied, the doctor is resolved from it; otherwise the inpatient admission's primary doctor is used.

Authorizations:
X-API-Key
query Parameters
hospital_id
required
string
Example: hospital_id=9

Hospital identifier used for tenant validation

patient_id
required
string
Example: patient_id=HOSP-PAT-007

Hospital patient identifier resolved through Patient.hospital_patient_id

hospital_inpatient_id
required
string
Example: hospital_inpatient_id=INP-HOSP-PAT-007

Hospital inpatient identifier resolved through Inpatients.hospital_inpatient_id

practitioner_id
string
Example: practitioner_id=1001

Optional practitioner identifier; overrides the inpatient primary doctor

Request Body schema: application/json
list_headings
Array of strings

Optional dashboard headings to include in the generated summary

Responses

Request samples

Content type
application/json
{
  • "list_headings": [
    ]
}

Response samples

Content type
application/json
{
  • "speciality_dashboard": { },
  • "lab_data": { },
  • "ipd_vitals": [
    ]
}

Assign Primary Doctor / Update Inpatient by Hospital

Updates an inpatient record using hospital_inpatient_id for a given hospital, or creates the inpatient admission when it does not exist. This endpoint can assign or change the primary doctor using practitioner_id, and can also update floor, bed, ward, admission date, attender details, and insurance details. When bed_no changes, bed occupancy linkage is updated as part of the same request. Patient category is always stored as Inpatient by the server.

Authorizations:
X-API-Key
query Parameters
hospital_id
required
string
Example: hospital_id=9

Hospital ID used to resolve and validate the organization

Request Body schema: application/json
hospital_inpatient_id
required
string

HMS inpatient identifier used to locate the inpatient record

practitioner_id
required
string

Practitioner ID of the doctor to assign as the inpatient's primary doctor

floor_id
required
integer

Floor to assign to the inpatient

bed_no
string or null

Bed number to assign; an empty or null value clears the bed assignment

ward
string or null

Ward name to assign; an empty or null value clears the ward

patient_id
required
string

Hospital patient identifier; an existing Patient is reused or a new Patient is created

in_date
string or null <date-time>

Admission date/time; omitted, empty, or null defaults to the current date and time

attender_mobile_no
string or null

Optional attender mobile number; empty or null clears the value

insurance_type
string or null

Optional insurance type; empty or null clears the value

attender_name
string or null

Optional attender name; empty or null clears the value

attender_relation
string or null

Optional relation of the attender to the patient; empty or null clears the value

Responses

Request samples

Content type
application/json
{
  • "hospital_inpatient_id": "IN-GEN9-202601-00025",
  • "practitioner_id": "108",
  • "floor_id": 29,
  • "bed_no": "B123",
  • "ward": "General",
  • "patient_id": "HOSP-PAT-007",
  • "in_date": "2025-01-06T10:00:00Z",
  • "attender_mobile_no": "+919876543210",
  • "insurance_type": "Cash",
  • "attender_name": "Suresh Kumar",
  • "attender_relation": "Brother"
}

Response samples

Content type
application/json
{
  • "message": "Inpatient updated successfully",
  • "patient_created": false,
  • "inpatient_created": false,
  • "inpatient": {
    }
}

Fetch Inpatients by Doctor

Retrieves all active inpatients assigned to a specific doctor. The doctor is resolved using practitioner_id and filtered by hospital_id. Returns patient, doctor, nurse, and bed details.

Authorizations:
X-API-Key
Request Body schema: application/json
practitioner_id
required
string
hospital_id
required
string

Responses

Request samples

Content type
application/json
{
  • "practitioner_id": "0123",
  • "hospital_id": "9"
}

Response samples

Content type
application/json
[
  • {
    }
]

Get Nurse List by Hospital ID

Returns the list of nurses associated with the given hospital_id. The hospital_id is used to fetch the corresponding organization, and then all nurses under that organization are returned.

Authorizations:
X-API-Key
query Parameters
hospital_id
required
string
Example: hospital_id=9
header Parameters
x-api-key
required
string
Example: your-api-key-here

Responses

Response samples

Content type
application/json
{
  • "message": "Nurse list fetched successfully",
  • "count": 3,
  • "data": [
    ]
}

Create Nurse

Creates a new nurse for the specified hospital_id. The hospital_id is mapped to an organization and the nurse is created under that organization. Email is optional—if not provided, a unique email is auto-generated based on the nurse name and organization.

Authorizations:
X-API-Key
query Parameters
hospital_id
required
string
Example: hospital_id=9
header Parameters
x-api-key
required
string
Example: your-api-key-here
Request Body schema: application/json
firstname
required
string
lastname
required
string
email
string <email>
phone
string
floor_id
required
integer
caregiver_id
required
string
nurse_category
string
Enum: "Ward Nurse" "ICU Nurse" "ER Nurse"

Optional nurse category. A blank value is stored as null.

Responses

Request samples

Content type
application/json
{
  • "firstname": "Sarah",
  • "lastname": "John",
  • "email": "",
  • "phone": "994056789",
  • "floor_id": 2,
  • "caregiver_id": "LI7897",
  • "nurse_category": "Ward Nurse"
}

Response samples

Content type
application/json
{
  • "message": "Nurse created successfully",
  • "data": {
    }
}

Assign an inpatient using caregiver_id (nurse) and practitioner_id (doctor)

This API assigns nurses (via caregiver_id) and doctors (via practitioner_id)
to an inpatient.
It accepts single or multiple IDs for both caregivers and practitioners.

Authorizations:
X-API-Key
query Parameters
hospital_id
required
string

Hospital ID

Request Body schema: application/json
inpatient_id
required
string
caregiver_id
string

Caregiver ID (nurse) - can be a single string or array of strings

practitioner_id
string

Practitioner ID (doctor) - can be a single string or array of strings

Responses

Request samples

Content type
application/json
{
  • "inpatient_id": "IN-GEN9-202508-00004",
  • "caregiver_id": "carescribe-nurse001",
  • "practitioner_id": "123"
}

Response samples

Content type
application/json
{
  • "message": "Inpatient assignment processed",
  • "data": {
    }
}

Fetch Inpatients Assigned to a Nurse

Returns the list of inpatients assigned to a nurse (caregiver_id) in a given hospital. - Verifies caregiver_id and hospital_id. - Finds nurse using caregiver_id. - Finds organization using hospital_id. - Fetches all inpatient_ids assigned to that nurse. - Applies optional date filter to fetch inpatients active on that date. - Includes details of patient, assigned doctors, assigned nurses, and bed information.

Authorizations:
X-API-Key
header Parameters
x-api-key
required
string
Example: your-api-key-here
Request Body schema: application/json
caregiver_id
string
date
string
timeZone
string
hospital_id
string

Responses

Request samples

Content type
application/json
{
  • "caregiver_id": "carescribe-nurse001",
  • "date": "2025-11-19",
  • "timeZone": "Asia/Kolkata",
  • "hospital_id": "9"
}

Response samples

Content type
application/json
{
  • "caregiver_id": "carescribe-nurse001",
  • "hospital_id": 9,
  • "data": [
    ]
}

Get nurse details using caregiver_id

Fetch nurse details by caregiver_id. Requires hospital_id and caregiver_id as query parameters.

Authorizations:
X-API-Key
query Parameters
hospital_id
required
string

Hospital ID

caregiver_id
required
string

Caregiver ID linked to nurse

Responses

Response samples

Content type
application/json
{
  • "message": "Nurse fetched successfully",
  • "data": { }
}

Get Doctor Todo List

Fetches the To-Do details for a doctor using hospital_inpatient_id and hospital_id. The API first attempts to retrieve data from the chatbot service. If the chatbot fails, it falls back to fetching interaction records from the database.

Authorizations:
X-API-Key
query Parameters
hospital_inpatient_id
required
string
Example: hospital_inpatient_id=IN-GEN9-202601-00008

Hospital inpatient identifier

hospital_id
required
string
Example: hospital_id=9

Hospital ID

Responses

Response samples

Content type
application/json
{
  • "patient_id": "GEN9-202601-00048",
  • "inpatient_id": "IN-GEN9-202601-00008",
  • "todo_data": [
    ]
}

Approve Doctor Todo

Approves a doctor's todo item using hospital_inpatient_id. Fetches patient_id and inpatient_id from the database. Calls chatbot service (doc_approved) if available, otherwise uses fallback.

Authorizations:
X-API-Key
query Parameters
hospital_id
required
string
Example: hospital_id=9

Hospital ID

hospital_inpatient_id
required
string
Example: hospital_inpatient_id=IN-GEN9-202601-00008

Hospital inpatient identifier

interaction_id
required
string
Example: interaction_id=102463

Interaction ID to approve

Request Body schema: application/json

Todo data to be approved

patient_id
string
inpatient_id
string
Array of objects

Responses

Request samples

Content type
application/json
{
  • "patient_id": "GEN9-202601-00048",
  • "inpatient_id": "IN-GEN9-202601-00008",
  • "todo_data": [
    ]
}

Response samples

Content type
application/json
{
  • "message": "Doctor approved for this interaction_id=102474 and patient_id=GEN9-202601-00048."
}

Get Nurse Todo List

Fetches the approved todo list for a nurse using hospital_inpatient_id. The API first queries the chatbot service (approved-todo-list). If the chatbot is unreachable or fails, the system returns an empty fallback response.

Authorizations:
X-API-Key
query Parameters
hospital_id
required
string
Example: hospital_id=9

Hospital ID

hospital_inpatient_id
required
string
Example: hospital_inpatient_id=IN-GEN9-202601-00008

Hospital inpatient identifier

Responses

Response samples

Content type
application/json
{
  • "patient_id": "GEN9-202601-00048",
  • "inpatient_id": "IN-GEN9-202601-00008",
  • "todo_data": [
    ]
}

Update Nurse Todo Status

Updates the status of a nurse's todo item using hospital_inpatient_id. The API first attempts to update status using the chatbot (nurse-status-update). If the chatbot fails, a fallback success response is returned.

Authorizations:
X-API-Key
query Parameters
hospital_id
required
string
Example: hospital_id=9

Hospital ID

hospital_inpatient_id
required
string
Example: hospital_inpatient_id=IN-GEN9-202601-00008

Hospital inpatient identifier

Request Body schema: application/json

Todo update payload with interaction_id, gcs_uri, and todos array

interaction_id
string
gcs_uri
string
Array of objects

Responses

Request samples

Content type
application/json
{
  • "interaction_id": "102456",
  • "gcs_uri": "gs://duckdb-carescribe/duckdb/database/patient/GEN9-202601-00048/GEN9-202601-00048-102456_todos-lab_data.parquet",
  • "todos": [
    ]
}

Response samples

Content type
application/json
{
  • "message": "Successfully updated"
}

MHC Software Integration

Creates or updates a Master Health Checkup (MHC) patient, assigns doctor, and optionally uploads vitals.

Authorizations:
X-API-Key
Request Body schema: application/json

MHC integration payload

hospital_id
required
string
package_name
required
string
required
object
required
object
Array of objects

Responses

Request samples

Content type
application/json
{
  • "hospital_id": "9",
  • "package_name": "Executive Health Checkup",
  • "doctor": {
    },
  • "patient": {
    },
  • "vitals": [
    ]
}

Response samples

Content type
application/json
{}

Get MHC form data

Retrieves generated Master Health Checkup (MHC) form data for a patient by calling the OPD chatbot upstream service.

Use this GET endpoint after creating or updating an MHC patient via POST /patient/softwareintegrationmhc. The API resolves the patient (by internal patient_id or hospital_patient_id), locates the active MHC record, and returns the generated form payload for the requested form_name.

Response form_name uses internal keys (eye_checkup, dental_checkup, gynaec_checkup, history_physical_examination, ent_checkup). The matching question_text field echoes the requested label.

Authorizations:
X-API-Key
query Parameters
hospital_id
required
string
Example: hospital_id=9

Unique hospital identifier (maps to organization)

patient_id
required
string
Example: patient_id=ragulID1002

Patient identifier (internal patient_id or hospital_patient_id)

form_name
required
string
Enum: "Generate Eye Checkup" "Generate Dental Checkup" "Generate Gynecology checkup Report" "Generate History and Physical Examination" "Generate ENT Checkup"
Example: form_name=Generate ENT Checkup

MHC form to generate.

mhc_id
string
Example: mhc_id=MHC-GEN9-202606-00002

Optional MHC record identifier. When omitted, the most recently updated active MHC record is used.

Responses

Response samples

Content type
application/json
{
  • "status": true,
  • "hospital_id": "9",
  • "patient_id": "ragulID1002",
  • "internal_patient_id": "GEN9-202606-00221",
  • "hospital_patient_id": "ragulID1002",
  • "mhc_id": "MHC-GEN9-202606-00002",
  • "form_name": "eye_checkup",
  • "question_text": "Generate Eye Checkup",
  • "interaction_id": 119880,
  • "force_regenerate": 119880,
  • "data": {
    }
}

Inpatient software integration

Creates or updates a patient and inpatient record. Generates a secure session URL for clinician access.

  • Provide EITHER doctor.practitioner_id OR nurse.caregiver_id - If both are provided → request will be rejected - Empty caregiver_id or practitioner_id is treated as NOT provided
Authorizations:
X-API-Key
Request Body schema: application/json
hospital_id
required
string
object
object
required
object
required
object

Responses

Request samples

Content type
application/json
{
  • "hospital_id": "9",
  • "doctor": {
    },
  • "nurse": {
    },
  • "patient": {
    },
  • "inpatient": {
    }
}

Response samples

Content type
application/json
{
  • "message": "Patient already exists. Inpatient record updated.",
  • "path": "Doctor flow: /session_id?...&practitioner_id=1001\nNurse flow: /session_id?...&caregiver_id=LI7987\n",
  • "patient_id": "4435c603-a0b8-48a6-9766-4ca911770fac",
  • "inpatient_id": "INP-HOSP-PAT-001",
  • "interaction_id": 105574
}

Get Patient Interactions by Hospital Patient ID

Retrieves the latest patient interactions for a given hospital and hospital_patient_id.

The API fetches interaction details (Edited OPD or Audio URL), reads the associated file from Google Cloud Storage (if available), and returns parsed interaction notes.

If data is not yet generated, the API returns a retry message.

Authorizations:
X-API-Key
query Parameters
hospital_id
required
string
Example: hospital_id=9

Unique hospital identifier (maps to organization)

patient_id
required
string
Example: patient_id=GEN9-202602-00133

Hospital patient identifier (hospital_patient_id)

limit
integer
Example: limit=3

Number of latest interactions to return (min 1, max 3)

Responses

Response samples

Content type
application/json
{
  • "count": 1,
  • "data": [
    ]
}

Get Patient Visit by Hospital Patient ID

Retrieves the latest visit data for a patient in a single organization. The organization is resolved from hospital_id and the patient is resolved from patient_id (the hospital_patient_id).

If generated visit data is not yet available, the response indicates that processing is pending and can include a retry interval.

Authorizations:
X-API-Key
query Parameters
hospital_id
required
string
Example: hospital_id=9

Unique hospital identifier used to resolve the organization

patient_id
required
string
Example: patient_id=GEN9-202602-00133

Hospital patient identifier (hospital_patient_id)

limit
integer [ 1 .. 3 ]
Default: 1

Number of latest visits to return (min 1, max 3; defaults to 1)

Responses

Response samples

Content type
application/json
{
  • "count": 0,
  • "data": [ ],
  • "message": "Response not yet generated. Please wait 30 seconds and try again.",
  • "code": "RESPONSE_NOT_GENERATED",
  • "retry_after_seconds": 30
}

Get Route CSV Data

Retrieves route master data for the given hospital_id.

This API:

  • Maps the provided hospital_id to the organization
  • Reads the stored route CSV data from the organization.

If the organization is not found, or route data is unavailable, the API returns an error.

Authorizations:
X-API-Key
query Parameters
hospital_id
required
string
Example: hospital_id=9

Unique hospital identifier used to find the organization

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Upload Route CSV

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.

Authorizations:
X-API-Key
query Parameters
hospital_id
required
string

Hospital ID used to resolve organization

Request Body schema: multipart/form-data
csvFile
required
string <binary>

CSV file containing route data (ROUTE CODE, ROUTE DESCRIPTION)

Responses

Response samples

Content type
application/json
{}

Update (merge) Route CSV

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.

  • New ROUTE CODE entries are added to the dataset. The final merged dataset is stored as a CSV file and linked to the organization.
Authorizations:
X-API-Key
query Parameters
hospital_id
required
string

Hospital ID used to resolve organization

Request Body schema: multipart/form-data
csvFile
required
string <binary>

CSV file containing route data (ROUTE CODE, ROUTE DESCRIPTION)

Responses

Response samples

Content type
application/json
{}

Upload route data

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.

Authorizations:
X-API-Key
query Parameters
hospital_id
required
string

The ID of the hospital/organization

Request Body schema: application/json
Array of objects

Array of route objects

Responses

Request samples

Content type
application/json
{
  • "data": [
    ]
}

Response samples

Content type
application/json
{}

Update Route Data using JSON

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.

Authorizations:
X-API-Key
query Parameters
hospital_id
required
string

Hospital ID used to identify the organization

Request Body schema: application/json
Array of objects

Responses

Request samples

Content type
application/json
{
  • "data": [
    ]
}

Response samples

Content type
application/json
{}

Delete Route CSV Data

Deletes the route CSV file associated with the given hospital_id.

This API:

  • Finds the organization using hospital_id
  • Deletes the route CSV file from Google Cloud Storage
  • Returns success message after deletion.
Authorizations:
X-API-Key
query Parameters
hospital_id
required
string
Example: hospital_id=9

Unique hospital identifier used to find the organization

Responses

Response samples

Content type
application/json
{
  • "message": "Route CSV removed successfully"
}

Get Frequency CSV Data

Retrieves frequency master data for the given hospital_id.

This API:

  • Maps the provided hospital_id to the organization
  • Reads the stored frequency CSV data from the organization.

If the organization is not found, or frequency data is unavailable, the API returns an error.

Authorizations:
X-API-Key
query Parameters
hospital_id
required
string
Example: hospital_id=9

Unique hospital identifier used to find the organization

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Upload Frequency CSV

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:

  • If FREQUENCY CODE is empty, the row is reported in invalid.
  • If FREQUENCY DESCRIPTION is empty, the row is reported in invalid.
  • This API should be used only for the initial upload of Frequency data.
  • If this API is called again, the existing Frequency list will completely deleted and replaced with the newly uploaded data. For any modifications or additions to the existing Frequency list, please use the updateFrequencyCsvs API.
Authorizations:
X-API-Key
query Parameters
hospital_id
required
string

Hospital ID used to resolve organization

Request Body schema: multipart/form-data
csvFile
required
string <binary>

CSV file with headers FREQUENCY CODE and FREQUENCY DESCRIPTION

Responses

Response samples

Content type
application/json
{}

Upload frequency data

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:

  • The body may be a direct array or an object containing frequencies, rows, data, or items.
  • Each object must contain the fields "FREQUENCY CODE" and "FREQUENCY DESCRIPTION".
  • Each FREQUENCY CODE must be unique within the request payload.

Validation:

  • Missing/empty required values and invalid dates are reported in invalid.
  • If duplicate FREQUENCY CODE values are found within the request payload, those items will be reported in the invalid field. A 400 is returned when no valid rows remain.

Behavior:

  • FREQUENCY CODE is treated as the unique identifier for frequency records.
  • During updates, if a FREQUENCY CODE already exists in the stored frequency data, the uploaded value overwrites the existing one.
  • New FREQUENCY CODE entries will be added to the dataset.

The final dataset is stored as a CSV file and linked to the organization.

Authorizations:
X-API-Key
query Parameters
hospital_id
required
string

The ID of the hospital/organization

Request Body schema: application/json
Array of objects

Array of frequency objects

Responses

Request samples

Content type
application/json
{
  • "data": [
    ]
}

Response samples

Content type
application/json
{}

Update (merge) Frequency data using JSON

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:

  • The body may be a direct array or an object containing frequencies, rows, data, or items.
  • Each object must contain: "FREQUENCY CODE" and "FREQUENCY DESCRIPTION".
  • Each FREQUENCY CODE must be unique within the request payload.

Validation:

  • Missing/empty required values and invalid dates are reported in invalid.
  • If duplicate FREQUENCY CODE values are found within the request payload, the duplicates will be reported in invalid. A 400 is returned when no valid rows remain.

Merge Behavior:

  • FREQUENCY CODE is used as the unique key.
  • If a FREQUENCY CODE already exists in the stored frequency data, the uploaded value overwrites it.
  • New FREQUENCY CODE entries are added to the dataset.

The final merged dataset is stored as a CSV file and linked to the organization.

Authorizations:
X-API-Key
query Parameters
hospital_id
required
string

Hospital ID used to resolve organization

Request Body schema: application/json
Array of objects

Array of frequency objects. Can be sent directly as an array or wrapped as an object with a data property.

Responses

Request samples

Content type
application/json
{
  • "data": [
    ]
}

Response samples

Content type
application/json
{}

Update (merge) Frequency CSV

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:

  • FREQUENCY CODE and FREQUENCY 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 FREQUENCY CODE values are found in the uploaded CSV, those rows will be reported in the invalid field of the response.
  • If FREQUENCY CODE is empty, the row will be reported in invalid.
  • If FREQUENCY DESCRIPTION is empty, the row will be reported in invalid.

Merge Behavior:

  • FREQUENCY CODE is used as the unique key.
  • If a FREQUENCY CODE already exists in the stored frequency data, the uploaded value overwrites the existing one.
  • New FREQUENCY CODE entries will be added to the dataset.

The final merged dataset will be stored as a CSV file and linked to the organization.

Authorizations:
X-API-Key
query Parameters
hospital_id
required
string

Hospital ID used to resolve organization

Request Body schema: multipart/form-data
csvFile
required
string <binary>

CSV file containing frequency data (FREQUENCY CODE, FREQUENCY DESCRIPTION)

Responses

Response samples

Content type
application/json
{}

Delete Frequency CSV Data

Deletes the frequency CSV file associated with the given hospital_id.

This API:

  • Finds the organization using hospital_id
  • Deletes the frequency CSV file from Google Cloud Storage
  • Removes the frequency_data reference from the organization
  • Saves the organization record

Returns success message after deletion.

Authorizations:
X-API-Key
query Parameters
hospital_id
required
string
Example: hospital_id=9

Unique hospital identifier used to find the organization

Responses

Response samples

Content type
application/json
{
  • "message": "Frequency CSV removed successfully"
}

Update Medication CSV Rows by Brand ID

Updates medication records in the CSV file using BRAND ID as the identifier. Required Query Parameters: - hospital_id Request Body: - medications (array of medication objects with BRAND ID and fields to update) Notes: - Validates hospital_id and organization existence. - Ensures medication CSV exists and contains BRAND ID column. - Updates rows matching BRAND ID. - Prevents duplicate BRAND NAME and GENERIC NAME combinations. - Returns invalid and not found entries if any issues occur.

Authorizations:
X-API-Key
query Parameters
hospital_id
required
string
Example: hospital_id=9

Unique hospital identifier.

Request Body schema: application/json
required
Array of objects

List of medication records to update.

Responses

Request samples

Content type
application/json
{
  • "medications": [
    ]
}

Response samples

Content type
application/json
{
  • "message": "Medication rows updated successfully",
  • "updated": [
    ],
  • "url": "gs://bucket/medication/updated_file.csv"
}

Delete Medication CSV Rows by Brand ID

Deletes medication records from the CSV file using BRAND ID as the identifier. Required Query Parameters: - hospital_id Request Body: - medications (array containing BRAND ID values to delete) Notes: - Validates hospital_id and organization existence. - Ensures medication CSV exists and contains BRAND ID column. - Deletes rows matching provided BRAND IDs. - Returns deleted rows and not_found entries if any IDs do not exist. - If all rows are deleted, the CSV file is removed from storage.

Authorizations:
X-API-Key
query Parameters
hospital_id
required
string
Example: hospital_id=9

Unique hospital identifier.

Request Body schema: application/json
required
Array of objects

List of medication entries to delete.

Responses

Request samples

Content type
application/json
{
  • "medications": [
    ]
}

Response samples

Content type
application/json
{
  • "message": "Medication rows deleted successfully",
  • "deleted": [
    ],
  • "url": "gs://bucket/medication/updated_file.csv",
  • "data": [
    ]
}

Get Drug Allergy CSV Data

Fetches all Drug Allergy CSV records stored for a hospital. Required Query Parameters: - hospital_id Notes: - Returns all drug allergy rows from the stored CSV - If no CSV exists for the hospital, API returns 404

Authorizations:
X-API-Key
query Parameters
hospital_id
required
string
Example: hospital_id=9

Unique hospital identifier

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Upload Drug Allergy CSV

Uploads a CSV file containing drug allergy data for a hospital. Required Query Parameters: - hospital_id Request: - Multipart form-data with a CSV file field named csvFile CSV headers: - The CSV must contain the following required column names:

  • DRUGALLERGY CODE
  • DRUGALLERGY NAME
  • DRUGALLERGY DESCRIPTION
  • ACTIVE FROM and ACTIVE TO are optional and use DD/MM/YYYY - Column names are normalized case-insensitively - Unknown or duplicate columns result in a 400 error Example CSV Format: DRUGALLERGY CODE,DRUGALLERGY NAME,DRUGALLERGY DESCRIPTION A001,Penicillin Allergy,Rash and swelling reaction A002,Sulfa Allergy,Skin reaction to sulfa drugs A003,Aspirin Allergy,Breathing difficulty after aspirin Notes: - Only .csv files are accepted - Duplicate DRUGALLERGY CODE values are not allowed - Invalid rows will be returned in the response
Authorizations:
X-API-Key
query Parameters
hospital_id
required
string
Example: hospital_id=9

Unique hospital identifier

Request Body schema: multipart/form-data
csvFile
required
string <binary>

CSV file containing drug allergy data

Responses

Response samples

Content type
application/json
{}

Update Drug Allergy CSV

Updates existing Drug Allergy CSV data for a hospital. The uploaded CSV will be merged with the existing stored CSV data using DRUGALLERGY CODE as the unique identifier. Behavior: - Existing rows with matching DRUGALLERGY CODE will be updated - New DRUGALLERGY CODE rows will be added - Duplicate DRUGALLERGY CODE values inside the uploaded CSV are not allowed Required Query Parameters: - hospital_id Request: - Multipart form-data with a CSV file field named csvFile CSV headers: - The CSV must contain the following required column names:

  • DRUGALLERGY CODE
  • DRUGALLERGY NAME
  • DRUGALLERGY DESCRIPTION
  • ACTIVE FROM and ACTIVE TO are optional and use DD/MM/YYYY - Column names are normalized case-insensitively - Unknown or duplicate columns result in a 400 error Example CSV Format: DRUGALLERGY CODE,DRUGALLERGY NAME,DRUGALLERGY DESCRIPTION A001,Penicillin Allergy,Rash and swelling reaction A002,Sulfa Allergy,Skin reaction to sulfa drugs A003,Aspirin Allergy,Breathing difficulty after aspirin Notes: - Only .csv files are accepted - Duplicate DRUGALLERGY CODE values are not allowed within upload file - Invalid rows will be returned in the response - Existing CSV data will be preserved and merged
Authorizations:
X-API-Key
query Parameters
hospital_id
required
string
Example: hospital_id=9

Unique hospital identifier

Request Body schema: multipart/form-data
csvFile
required
string <binary>

CSV file containing updated drug allergy data

Responses

Response samples

Content type
application/json
{}

Upload Drug Allergy JSON

Uploads Drug Allergy master data in JSON format for a hospital. Required Query Parameters: - hospital_id Request Body: - JSON payload containing an allergies array Accepted alternatives: - Direct array, or drugAllergies, drug_allergies, rows, data, or items Validation Rules: - Each allergy object requires DRUGALLERGY CODE and DRUGALLERGY NAME - DRUGALLERGY DESCRIPTION, ACTIVE FROM, and ACTIVE TO are optional - DRUGALLERGY CODE values must be unique within the request - Required values cannot be empty - Duplicate DRUGALLERGY CODE entries will result in validation errors Notes: - hospital_id can be passed either in query params or request body - Invalid rows will be returned separately in the response - Data is stored and converted internally into CSV format

Authorizations:
X-API-Key
query Parameters
hospital_id
required
string
Example: hospital_id=9

Unique hospital identifier

Request Body schema: application/json
hospital_id
string
required
Array of objects

Responses

Request samples

Content type
application/json
{
  • "hospital_id": "9",
  • "allergies": [
    ]
}

Response samples

Content type
application/json
{}

Update Drug Allergy JSON

Updates existing Drug Allergy master data using JSON payload. The uploaded allergy records are merged with existing stored data using DRUGALLERGY CODE as the unique identifier. Behavior: - Existing allergy rows with matching DRUGALLERGY CODE will be updated - New DRUGALLERGY CODE rows will be added - Duplicate DRUGALLERGY CODE values inside request payload are not allowed Required Query Parameters: - hospital_id Request Body: - JSON payload containing an allergies array Accepted alternatives: - Direct array, or drugAllergies, drug_allergies, rows, data, or items Validation Rules: - Each allergy object requires DRUGALLERGY CODE and DRUGALLERGY NAME - DRUGALLERGY DESCRIPTION, ACTIVE FROM, and ACTIVE TO are optional - Required values cannot be empty - Duplicate DRUGALLERGY CODE values are not allowed within request payload Notes: - hospital_id can be passed either in query params or request body - Existing allergy data will be preserved and merged - Invalid rows will be returned separately in the response

Authorizations:
X-API-Key
query Parameters
hospital_id
required
string
Example: hospital_id=9

Unique hospital identifier

Request Body schema: application/json
hospital_id
string
required
Array of objects

Responses

Request samples

Content type
application/json
{
  • "hospital_id": "9",
  • "allergies": [
    ]
}

Response samples

Content type
application/json
{}

Update Drug Allergy Rows By Code

Updates specific Drug Allergy rows in the existing CSV data using DRUGALLERGY CODE as the unique identifier. Behavior: - Only rows with matching DRUGALLERGY CODE values will be updated - DRUGALLERGY CODE itself cannot be modified - Partial updates are supported for other fields - Duplicate DRUGALLERGY CODE values within request payload are not allowed Required Query Parameters: - hospital_id Validation Rules: - Each allergy object must contain:

  • DRUGALLERGY CODE
  • Supported updatable fields:
    • DRUGALLERGY NAME
    • DRUGALLERGY DESCRIPTION
  • ACTIVE FROM - ACTIVE TO - DRUGALLERGY CODE must already exist in stored CSV - Required values cannot be empty after applying the partial update Notes: - Existing CSV data must already be available - Invalid or missing DRUGALLERGY CODE values will return validation errors - Updates are performed directly on existing CSV rows - The body may be a direct array or use drugAllergies, drug_allergies, allergies, rows, data, or items - A single row may instead use code in query/body or DRUGALLERGY CODE in the body
Authorizations:
X-API-Key
query Parameters
hospital_id
required
string
Example: hospital_id=9

Unique hospital identifier

Request Body schema: application/json
hospital_id
string
required
Array of objects

Responses

Request samples

Content type
application/json
{
  • "hospital_id": "9",
  • "allergies": [
    ]
}

Response samples

Content type
application/json
{}

Delete Drug Allergy CSV Rows By Code

Deletes specific drug allergy rows from the existing Drug Allergy CSV using DRUGALLERGY CODE values. Required Query Parameters: - hospital_id Request Body: - allergies array containing DRUGALLERGY CODE values The body may contain one code or use drugAllergies, drug_allergies, allergies, rows, data, or items. A single code may also be supplied with the code query parameter. Notes: - Matching is case-insensitive - DRUGALLERGY CODE is mandatory - If any code is not found, API returns 404 - If all rows are deleted, the CSV file will be removed from storage

Authorizations:
X-API-Key
query Parameters
hospital_id
required
string
Example: hospital_id=9

Unique hospital identifier

Request Body schema: application/json
hospital_id
string
required
Array of objects

List of allergy rows to delete

Responses

Request samples

Content type
application/json
{
  • "hospital_id": "9",
  • "allergies": [
    ]
}

Response samples

Content type
application/json
{}

Get Food Allergy CSV Data

Fetches all Food Allergy CSV records stored for a hospital. Required Query Parameters: - hospital_id Notes: - Returns all food allergy rows from the stored CSV - If no CSV exists for the hospital, API returns 404

Authorizations:
X-API-Key
query Parameters
hospital_id
required
string
Example: hospital_id=9

Unique hospital identifier

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Upload Food Allergy CSV

Uploads a CSV file containing food allergy data for a hospital. Required Query Parameters: - hospital_id Request: - Multipart form-data with a CSV file field named csvFile CSV headers: - The CSV must contain the following required column names:

  • FOODALLERGY CODE
  • FOODALLERGY NAME
  • FOODALLERGY DESCRIPTION
  • ACTIVE FROM and ACTIVE TO are optional and use DD/MM/YYYY - Column names are normalized case-insensitively - Unknown or duplicate columns result in a 400 error
Authorizations:
X-API-Key
query Parameters
hospital_id
required
string
Example: hospital_id=9

Unique hospital identifier

Request Body schema: multipart/form-data
csvFile
required
string <binary>

CSV file containing food allergy data

Responses

Response samples

Content type
application/json
{}

Update Food Allergy CSV

Updates the existing Food Allergy CSV data for a hospital by merging uploaded CSV rows with existing records using FOODALLERGY CODE. Required Query Parameters: - hospital_id Request: - Multipart form-data with a CSV file field named csvFile CSV headers: - The CSV must contain the following required column names:

  • FOODALLERGY CODE
  • FOODALLERGY NAME
  • FOODALLERGY DESCRIPTION
  • ACTIVE FROM and ACTIVE TO are optional and use DD/MM/YYYY - Column names are normalized case-insensitively - Unknown or duplicate columns result in a 400 error Notes: - Only .csv files are accepted - Existing rows are updated using FOODALLERGY CODE - New FOODALLERGY CODE rows are added - Duplicate FOODALLERGY CODE values are not allowed - Invalid rows will be returned in the response
Authorizations:
X-API-Key
query Parameters
hospital_id
required
string
Example: hospital_id=9

Unique hospital identifier

Request Body schema: multipart/form-data
csvFile
required
string <binary>

CSV file containing updated food allergy data

Responses

Response samples

Content type
application/json
{}

Upload Food Allergy JSON

Uploads Food Allergy data in JSON format for a hospital. Required Query Parameters: - hospital_id Request Body: - JSON object containing a data array of food allergy records Accepted body: - A direct array or foodAllergies, food_allergies, allergies, rows, data, or items - Each row requires:

  • FOODALLERGY CODE
  • FOODALLERGY NAME
  • FOODALLERGY DESCRIPTION, ACTIVE FROM, and ACTIVE TO are optional - Field names are normalized case-insensitively Notes: - FOODALLERGY CODE must be unique - Duplicate codes will be rejected - Invalid rows are returned in response
Authorizations:
X-API-Key
query Parameters
hospital_id
required
string
Example: hospital_id=9

Unique hospital identifier

Request Body schema: application/json
hospital_id
string
required
Array of objects

List of food allergy records

Responses

Request samples

Content type
application/json
{
  • "hospital_id": "9",
  • "data": [
    ]
}

Response samples

Content type
application/json
{}

Update Food Allergy JSON

Updates existing Food Allergy records using JSON payload for a hospital. New records are added and existing ones are updated. Required Query Parameters: - hospital_id Request Body: - JSON object containing a data array of food allergy records Accepted body: - A direct array or foodAllergies, food_allergies, allergies, rows, data, or items - Each row requires:

  • FOODALLERGY CODE
  • FOODALLERGY NAME
  • FOODALLERGY DESCRIPTION, ACTIVE FROM, and ACTIVE TO are optional - Field names are normalized case-insensitively - FOODALLERGY CODE is used as the primary key for update - Duplicate FOODALLERGY CODE values are not allowed in request Notes: - Existing records are updated based on FOODALLERGY CODE - New codes are inserted - Invalid rows are returned in response - Duplicate codes in request will be rejected
Authorizations:
X-API-Key
query Parameters
hospital_id
required
string
Example: hospital_id=9

Unique hospital identifier

Request Body schema: application/json
hospital_id
string
required
Array of objects

List of food allergy records to update

Responses

Request samples

Content type
application/json
{
  • "hospital_id": "9",
  • "data": [
    ]
}

Response samples

Content type
application/json
{}

Update Food Allergy CSV Rows By Code

Updates existing food allergy rows in the Food Allergy CSV using FOODALLERGY CODE as the unique identifier. Required Query Parameters: - hospital_id Request Body: - JSON payload containing a data array Notes: - FOODALLERGY CODE must already exist in the CSV - Duplicate FOODALLERGY CODE values in request are not allowed - Only provided fields will be updated - FOODALLERGY CODE cannot be modified - Invalid or missing rows will be returned in the response Required JSON Fields: - FOODALLERGY CODE The body may be a direct array or use foodAllergies, food_allergies, allergies, rows, data, or items. A single row may instead use the code query/body field. Updatable fields include FOODALLERGY NAME, FOODALLERGY DESCRIPTION, ACTIVE FROM, and ACTIVE TO. A single row may instead use the code query/body field.

Authorizations:
X-API-Key
query Parameters
hospital_id
required
string
Example: hospital_id=9

Unique hospital identifier

Request Body schema: application/json
hospital_id
string
required
Array of objects

Responses

Request samples

Content type
application/json
{
  • "hospital_id": "9",
  • "data": [
    ]
}

Response samples

Content type
application/json
{}

Delete Food Allergy CSV Rows By Code

Deletes food allergy rows from the Food Allergy CSV using FOODALLERGY CODE as the unique identifier. Required Query Parameters: - hospital_id Request Body: - JSON payload containing a data array Notes: - FOODALLERGY CODE must already exist in the CSV - Duplicate FOODALLERGY CODE values are ignored internally - If all rows are deleted, the CSV file will be removed - Missing or invalid codes will be returned in not_found Required JSON Fields: - FOODALLERGY CODE The body may be a direct array or use foodAllergies, food_allergies, allergies, rows, data, or items. A single row may instead use the code query/body field.

Authorizations:
X-API-Key
query Parameters
hospital_id
required
string
Example: hospital_id=9

Unique hospital identifier

Request Body schema: application/json
hospital_id
string
required
Array of objects

Responses

Request samples

Content type
application/json
{
  • "hospital_id": "9",
  • "data": [
    ]
}

Response samples

Content type
application/json
{}

Get Other Allergy CSV Data

Fetches all Other Allergy CSV records configured for a hospital. Required Query Parameters: - hospital_id Notes: - Returns all rows from the stored Other Allergy CSV - If no CSV data exists for the hospital, a 404 response is returned

Authorizations:
X-API-Key
query Parameters
hospital_id
required
string
Example: hospital_id=9

Unique hospital identifier

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Upload Other Allergy CSV

Uploads a CSV file containing Other Allergy data for a hospital. Required Query Parameters: - hospital_id Request: - Multipart form-data with a CSV file field named csvFile CSV headers: - The CSV must contain the following required column names:

  • OTHERALLERGY CODE
  • OTHERALLERGY NAME
  • OTHERALLERGY DESCRIPTION
  • ACTIVE FROM and ACTIVE TO are optional and use DD/MM/YYYY - Column names are normalized case-insensitively - Unknown or duplicate columns result in a 400 error

Notes: - Only .csv files are accepted - Duplicate OTHERALLERGY CODE values are not allowed - Invalid rows will be returned in the response

Authorizations:
X-API-Key
query Parameters
hospital_id
required
string
Example: hospital_id=9

Unique hospital identifier

Request Body schema: multipart/form-data
csvFile
required
string <binary>

CSV file containing Other Allergy data

Responses

Response samples

Content type
application/json
{}

Update Other Allergy CSV

Updates the existing Other Allergy CSV data for a hospital by merging records from the uploaded CSV file using OTHERALLERGY CODE as the unique identifier. Required Query Parameters: - hospital_id Request: - Multipart form-data with a CSV file field named csvFile CSV headers: - The CSV must contain the following required column names:

  • OTHERALLERGY CODE
  • OTHERALLERGY NAME
  • OTHERALLERGY DESCRIPTION
  • ACTIVE FROM and ACTIVE TO are optional and use DD/MM/YYYY - Column names are normalized case-insensitively - Unknown or duplicate columns result in a 400 error

Notes: - Only .csv files are accepted - Existing rows with matching OTHERALLERGY CODE will be updated - New OTHERALLERGY CODE values will be added - Duplicate OTHERALLERGY CODE values in request are not allowed - Invalid rows will be returned in the response

Authorizations:
X-API-Key
query Parameters
hospital_id
required
string
Example: hospital_id=9

Unique hospital identifier

Request Body schema: multipart/form-data
csvFile
required
string <binary>

CSV file containing Other Allergy data

Responses

Response samples

Content type
application/json
{}

Upload Other Allergy JSON

Uploads Other Allergy data in JSON format for a hospital. Required Query Parameters: - hospital_id Request Body: - JSON payload containing a data array JSON fields: - OTHERALLERGY CODE - OTHERALLERGY NAME - OTHERALLERGY DESCRIPTION, ACTIVE FROM, and ACTIVE TO are optional The body may be a direct array or use otherAllergies, other_allergies, allergies, rows, data, or items. Field names are normalized case-insensitively. Notes: - Duplicate OTHERALLERGY CODE values are not allowed - Invalid rows will be returned in the response - If all rows are invalid, the API returns 400

Authorizations:
X-API-Key
query Parameters
hospital_id
required
string
Example: hospital_id=9

Unique hospital identifier

Request Body schema: application/json
hospital_id
string
required
Array of objects

Responses

Request samples

Content type
application/json
{
  • "hospital_id": "9",
  • "data": [
    ]
}

Response samples

Content type
application/json
{}

Update Other Allergy JSON

Updates existing Other Allergy records using JSON payload data. Existing rows are matched and updated using OTHERALLERGY CODE as the unique identifier. New codes will be added if they do not already exist. Required Query Parameters: - hospital_id Request Body: - JSON payload containing a data array JSON fields: - OTHERALLERGY CODE - OTHERALLERGY NAME - OTHERALLERGY DESCRIPTION, ACTIVE FROM, and ACTIVE TO are optional The body may be a direct array or use otherAllergies, other_allergies, allergies, rows, data, or items. Field names are normalized case-insensitively. Notes: - Duplicate OTHERALLERGY CODE values in request are not allowed - Invalid rows will be returned in the response

Authorizations:
X-API-Key
query Parameters
hospital_id
required
string
Example: hospital_id=9

Unique hospital identifier

Request Body schema: application/json
hospital_id
string
required
Array of objects

Responses

Request samples

Content type
application/json
{
  • "hospital_id": "9",
  • "data": [
    ]
}

Response samples

Content type
application/json
{}

Update Other Allergy CSV Rows By Code

Updates existing Other Allergy rows in the Other Allergy CSV using OTHERALLERGY CODE as the unique identifier. Required Query Parameters: - hospital_id Request Body: - JSON payload containing a data array Notes: - OTHERALLERGY CODE must already exist in the CSV - Duplicate OTHERALLERGY CODE values in request are not allowed - Only provided fields will be updated - OTHERALLERGY CODE cannot be modified - Invalid or missing rows will be returned in the response Required JSON Fields: - OTHERALLERGY CODE Updatable fields include OTHERALLERGY NAME, OTHERALLERGY DESCRIPTION, ACTIVE FROM, and ACTIVE TO. A single row may instead use the code query/body field.

Authorizations:
X-API-Key
query Parameters
hospital_id
required
string
Example: hospital_id=9

Unique hospital identifier

Request Body schema: application/json
hospital_id
string
required
Array of objects

Responses

Request samples

Content type
application/json
{
  • "hospital_id": "9",
  • "data": [
    ]
}

Response samples

Content type
application/json
{
  • "message": "Other Allergy rows updated successfully",
  • "updated": [
    ],
}

Delete Other Allergy CSV Rows By Code

Deletes Other Allergy rows from the Other Allergy CSV using OTHERALLERGY CODE as the unique identifier. Required Query Parameters: - hospital_id Request Body: - JSON payload containing a data array Notes: - OTHERALLERGY CODE must already exist in the CSV - Missing or invalid codes will be returned in not_found - If all rows are deleted, the CSV file will be removed Required JSON Fields: - OTHERALLERGY CODE The body may be a direct array or use otherAllergies, other_allergies, allergies, rows, data, or items. A single row may instead use the code query/body field.

Authorizations:
X-API-Key
query Parameters
hospital_id
required
string
Example: hospital_id=9

Unique hospital identifier

Request Body schema: application/json
hospital_id
string
required
Array of objects

Responses

Request samples

Content type
application/json
{
  • "hospital_id": "9",
  • "data": [
    ]
}

Response samples

Content type
application/json
{}

Update Investigation CSV Rows By Service ID

Updates existing Investigation CSV rows using Service ID and, when supplied, Service Type as a case-insensitive composite identifier. Required Query Parameters: - hospital_id Request Body: - JSON payload containing an investigations, rows, data, or items array; one row may instead use service_id in query/body or Service ID in the body Notes: - Service ID must already exist in the CSV - Duplicate Service ID and Service Type pairs in the request are not allowed - Service Type is required when multiple stored rows share the Service ID - Only provided fields will be updated - Service ID cannot be modified - Invalid or missing rows will be returned in the response Required JSON Fields: - Service ID Supported optional fields are Standard Lab Test Name, Alias Name, Service Type, Hospital ID, ACTIVE FROM, and ACTIVE TO. Dates use DD/MM/YYYY.

Authorizations:
X-API-Key
query Parameters
hospital_id
required
string
Example: hospital_id=9

Unique hospital identifier

service_id
string

Service ID for a single-row update.

service_type
string

Service Type used with service_id to select one row when the Service ID is shared.

Request Body schema: application/json
hospital_id
string
service_id
string
service_type
string
Array of objects

Responses

Request samples

Content type
application/json
{
  • "hospital_id": "9",
  • "service_id": "ITC9492",
  • "service_type": "Laboratory",
  • "investigations": [
    ]
}

Response samples

Content type
application/json
{}

Delete Investigation CSV Rows By Service ID

Deletes investigation rows using Service ID and, when supplied, Service Type as a case-insensitive composite identifier. Required Query Parameters: - hospital_id Request Body: - investigations, rows, data, or items array containing Service ID values; one row may instead use service_id in query/body or Service ID in the body Notes: - SERVICE ID is mandatory for deletion - Service Type is required when multiple stored rows share the Service ID - Matching is case-insensitive - If all rows are deleted, the CSV file will be removed - If any SERVICE ID is not found, the API returns 404 - Multiple investigation rows can be deleted in a single request

Authorizations:
X-API-Key
query Parameters
hospital_id
required
string
Example: hospital_id=9

Unique hospital identifier

service_id
string

Service ID for a single-row deletion.

service_type
string

Service Type used with service_id to select one row when the Service ID is shared.

Request Body schema: application/json
hospital_id
string
service_id
string
service_type
string
Array of objects

List of investigation rows to delete

Responses

Request samples

Content type
application/json
{
  • "hospital_id": "9",
  • "service_id": "ITC9492",
  • "service_type": "Laboratory",
  • "investigations": [
    ]
}

Response samples

Content type
application/json
{}

Update Route CSV Rows By Route Code

Updates existing route rows in the Route CSV using ROUTE CODE. Required Query Parameters: - hospital_id Request Body: - routes array containing ROUTE CODE and fields to update Notes: - ROUTE CODE is mandatory - Matching is case-insensitive - Only provided fields will be updated - Multiple route rows can be updated in a single request - Duplicate ROUTE CODE values in the request are not allowed Header Restrictions: - ROUTE CODE - ROUTE DESCRIPTION - ACTIVE FROM (optional; DD/MM/YYYY) - ACTIVE TO (optional; DD/MM/YYYY) A single row may alternatively be selected with code in the query/body or ROUTE CODE in the body.

Authorizations:
X-API-Key
query Parameters
hospital_id
required
string
Example: hospital_id=9

Unique hospital identifier

Request Body schema: application/json
hospital_id
string
required
Array of objects

List of route rows to update

Responses

Request samples

Content type
application/json
{
  • "hospital_id": "9",
  • "routes": [
    ]
}

Response samples

Content type
application/json
{}

Delete Route CSV Rows By Route Code

Deletes route rows from the Route CSV using ROUTE CODE. Required Query Parameters: - hospital_id Request Body: - routes array containing ROUTE CODE values, or one code/ROUTE CODE Notes: - ROUTE CODE is mandatory for deletion - Matching is case-insensitive - Multiple route rows can be deleted in a single request - If all rows are deleted, the CSV file will be removed - If any ROUTE CODE is not found, the API returns 404

Authorizations:
X-API-Key
query Parameters
hospital_id
required
string
Example: hospital_id=9

Unique hospital identifier

Request Body schema: application/json
hospital_id
string
required
Array of objects

List of route rows to delete

Responses

Request samples

Content type
application/json
{
  • "hospital_id": "9",
  • "routes": [
    ]
}

Response samples

Content type
application/json
{}

Update Frequency CSV Rows By Frequency Code

Updates existing frequency rows in the Frequency CSV using FREQUENCY CODE. Required Query Parameters: - hospital_id Request Body: - frequencies array containing FREQUENCY CODE and fields to update Notes: - FREQUENCY CODE is mandatory - Matching is case-insensitive - Only provided fields will be updated - Multiple frequency rows can be updated in a single request - Duplicate FREQUENCY CODE values in the request are not allowed Header Restrictions: - FREQUENCY CODE - FREQUENCY DESCRIPTION - ACTIVE FROM (optional; DD/MM/YYYY) - ACTIVE TO (optional; DD/MM/YYYY) A single row may alternatively be selected with code in the query/body or FREQUENCY CODE in the body.

Authorizations:
X-API-Key
query Parameters
hospital_id
required
string
Example: hospital_id=9

Unique hospital identifier

Request Body schema: application/json
hospital_id
string
required
Array of objects

List of frequency rows to update

Responses

Request samples

Content type
application/json
{
  • "hospital_id": "9",
  • "frequencies": [
    ]
}

Response samples

Content type
application/json
{}

Delete Frequency CSV Rows By Frequency Code

Deletes frequency rows from the Frequency CSV using FREQUENCY CODE. Required Query Parameters: - hospital_id Request Body: - frequencies array containing FREQUENCY CODE values, or one code/FREQUENCY CODE Notes: - FREQUENCY CODE is mandatory for deletion - Matching is case-insensitive - Multiple frequency rows can be deleted in a single request - If all rows are deleted, the CSV file will be removed - If any FREQUENCY CODE is not found, the API returns 404 Header Restrictions: - FREQUENCY CODE - FREQUENCY DESCRIPTION

Authorizations:
X-API-Key
query Parameters
hospital_id
required
string
Example: hospital_id=9

Unique hospital identifier

Request Body schema: application/json
hospital_id
string
required
Array of objects

List of frequency rows to delete

Responses

Request samples

Content type
application/json
{
  • "hospital_id": "9",
  • "frequencies": [
    ]
}

Response samples

Content type
application/json
{}

Add Medication Autocorrect Data

Updates the medication autocorrect CSV file in cloud storage for a given hospital_id. The API validates the hospital, reads the existing CSV from storage, merges new mismatched medication items, increments weight for matching actual medications, rewrites the CSV, and uploads the updated file back to cloud storage.

Authorizations:
X-API-Key
query Parameters
hospital_id
required
string
Example: hospital_id=9

Unique hospital identifier (maps to organization)

Request Body schema: application/json
required
Array of objects

List of mismatched medication items to add into autocorrect mapping.

path
required
string

GCS file path of the medication autocorrect CSV.

Responses

Request samples

Content type
application/json
{
  • "mismatchedItems": [
    ],
  • "path": "9/UROLOGY/404/medication_autocorrect.csv"
}

Response samples

Content type
application/json
{
  • "mismatches": [
    ],
  • "message": "All rows updated - same actual_medication_name now share the same, incremented weight"
}

Update Referred By Doctor for Patient

Updates the Referred_by_doctor field for a specific patient using patient_id.

Authorizations:
X-API-Key
Request Body schema: application/json
patient_id
required
string

Unique patient ID.

Referred_by_doctor
required
string

Name or ID of the referring doctor.

Responses

Request samples

Content type
application/json
{
  • "patient_id": "GEN9-202603-00450",
  • "Referred_by_doctor": "Dr. Kumar"
}

Response samples

Content type
application/json
{
  • "message": "Referred_by_doctor updated successfully.",
  • "data": { }
}

Update Vitals Data for Patient Interaction

Updates vitals data for a patient interaction, uploads vitals file, updates interaction record, and triggers cloud ingestion.

Authorizations:
X-API-Key
query Parameters
interaction_id
required
string
Example: interaction_id=INT-12345

Interaction ID for which vitals are updated

Request Body schema: application/json
patient_id
required
string

Unique patient ID

practitioner_id
required
string

Doctor / Practitioner ID

vitalsData
required
object

Vitals information object

Responses

Request samples

Content type
application/json
{
  • "patient_id": "GEN9-202603-00450",
  • "practitioner_id": "853",
  • "vitalsData": {
    }
}

Response samples

Content type
application/json
{
  • "status": true,
  • "message": "Vitals updated successfully",
  • "interaction": { }
}

Generate IPD Document

Generates IPD documents such as initial assessment, progress notes, surgery notes, nurse notes, and nursing care plan based on patient, inpatient, and clinician details. This API supports the following document types: - initial_assessment - progress_notes - surgery_notes - nurse_notes - nurse_care_plan For Doctor Forms: - practitioner_id is required - document_type (form name) - patient_id - inpatient_id For Nurse Forms: - caregiver_id is required - document_type (form name) - patient_id - inpatient_id For doctor forms, practitioner_id must be provided, and for nurse forms, caregiver_id must be provided. Only one of these fields should be passed based on the selected document type.

Authorizations:
X-API-Key
query Parameters
hospital_id
required
string
Example: hospital_id=9

Unique hospital identifier.

Request Body schema: application/json
hospital_id
integer
patient_id
required
string

Unique patient ID.

inpatient_id
required
string

Unique inpatient ID.

practitioner_id
string

Doctor ID (required for doctor documents).

document_type
required
string
Enum: "initial_assessment" "progress_notes" "surgery_notes" "nurse_notes" "nurse_care_plan"

Type of document to generate.

Responses

Request samples

Content type
application/json
{
  • "hospital_id": 9,
  • "patient_id": "string",
  • "inpatient_id": "IN-GEN9-202509-00034",
  • "practitioner_id": "9871",
  • "document_type": "initial_assessment"
}

Response samples

Content type
application/json
{
  • "success": true,
  • "message": "Document generated successfully",
  • "data": { }
}

Get All IPD Notes Grouped By Date

Fetches IPD notes grouped by date for a given patient and inpatient record. Query Parameters: - patient_id - inpatient_id - hospital_id - categories This API supports the following categories: - IPD_PERIPHERAL_CHART (I/O Chart / Vascular Checklist) - IPD_INTAKE_OUTTAKE (Intake Output Chart) - IPD_VITALS (TPR Chart) Important: - Categories must be passed exactly as listed above. - If an incorrect category is provided, the API will return an empty response.

Authorizations:
X-API-Key
query Parameters
hospital_id
required
string
Example: hospital_id=9

Unique hospital identifier.

patient_id
string
Example: patient_id=GEN9-202509-00435

Unique patient ID.

inpatient_id
required
string
Example: inpatient_id=IN-GEN9-202509-00034

Unique inpatient ID.

categories
string
Example: categories=IPD_VITALS

Category of IPD notes. Must be one of: IPD_PERIPHERAL_CHART, IPD_INTAKE_OUTTAKE, IPD_VITALS.

Responses

Response samples

Content type
application/json
{
  • "patient_id": "GEN9-202509-00435",
  • "inpatient_id": "IN-GEN9-202509-00034",
  • "structured_data": {
    }
}

Generate IPD Discharge Summary

Generates a discharge summary for an IPD patient based on patient, inpatient, and clinician details. Required Fields: - hospital_id - patient_id - hospital_inpatient_id - practitioner_id

Authorizations:
X-API-Key
Request Body schema: application/json
hospital_id
required
string

Unique hospital identifier.

patient_id
required
string

Unique patient ID.

hospital_inpatient_id
required
string

Inpatient identifier from the hospital system.

practitioner_id
required
string

Doctor ID (required for doctor flow).

Responses

Request samples

Content type
application/json
{
  • "hospital_id": "9",
  • "patient_id": "GEN9-202509-00299",
  • "hospital_inpatient_id": "IN-GEN9-202509-00025",
  • "practitioner_id": "9871"
}

Response samples

Content type
application/json
{
  • "success": true,
  • "message": "Discharge summary generated successfully",
  • "data": { }
}

Get IPD Case Sheet

Fetches the case sheet for a given IPD patient using patient and inpatient details. Required Query Parameters: - hospital_id - patient_id - inpatient_id Optional: - practitioner_id (for doctor access) - caregiver_id (for nurse access)

Either practitioner_id or caregiver_id can be passed to fetch role-based data.

Authorizations:
X-API-Key
query Parameters
hospital_id
required
string
Example: hospital_id=9

Unique hospital identifier.

patient_id
required
string
Example: patient_id=c7f71411-fe49-4c43-852d-61db953fa0c4

Unique patient ID.

inpatient_id
required
string
Example: inpatient_id=INP-newmereal-PAT-0011

Unique inpatient ID.

practitioner_id
string

Doctor ID (used to resolve doctor context).

caregiver_id
string

Nurse ID (used to resolve nurse context).

Responses

Response samples

Content type
application/json
{ }

Get Drug Chart

Fetches the drug chart details for a given IPD patient using patient and inpatient IDs. Required Query Parameters: - hospital_id - inpatient_id Optional: - patient_id Note: - This API retrieves medication/drug administration data associated with the inpatient stay.

Authorizations:
X-API-Key
query Parameters
hospital_id
required
string
Example: hospital_id=9

Unique hospital identifier.

inpatient_id
required
string
Example: inpatient_id=IN-GEN9-202601-00013

Unique inpatient ID.

patient_id
string
Example: patient_id=GEN9-202601-00106

Unique patient ID.

Responses

Response samples

Content type
application/json
{ }

Get Blood Glucose Monitoring Chart

Fetches blood glucose monitoring chart data for a given IPD patient using patient and inpatient details. Required Query Parameters: - hospital_id - inpatient_id - patient_id Note: - This API retrieves blood glucose readings and monitoring data recorded during the inpatient stay.

Authorizations:
X-API-Key
query Parameters
hospital_id
required
string
Example: hospital_id=9

Unique hospital identifier.

inpatient_id
required
string
Example: inpatient_id=IN-GEN9-202602-00038

Unique inpatient ID.

patient_id
required
string
Example: patient_id=GEN9-202602-00090

Unique patient ID.

Responses

Response samples

Content type
application/json
{ }

Update Bot Response and Trigger Ingestion

Updates interaction detail content (edited bot response), uploads it to storage, and triggers ingestion processing. Required Query Parameters: - hospital_id Required Body Fields: - interaction_id - interaction_detail_type - ingestionType - content Notes: - Validates hospital_id and interaction existence. - Stores edited content as a new file in cloud storage. - Updates or creates interaction detail records. - Calls ingestion API to process updated data.

Authorizations:
X-API-Key
query Parameters
hospital_id
required
string
Example: hospital_id=9

Unique hospital identifier.

Request Body schema: application/json
interaction_id
required
integer

Unique interaction ID.

interaction_detail_type
required
string

Type of interaction detail.

ingestionType
required
string

Type used for ingestion processing.

content
required
object

Edited content to be uploaded and ingested.

attachment_url
string

Optional attachment URL.

role
string

Role of the user submitting the data.

Responses

Request samples

Content type
application/json
{
  • "interaction_id": 112174,
  • "interaction_detail_type": "initial_assessment",
  • "ingestionType": "initial_assessment",
  • "content": {
    },
  • "attachment_url": "",
  • "role": "nurse"
}

Response samples

Content type
application/json
{
  • "status": true,
  • "message": "Interaction details created and ingested successfully",
  • "interaction_id": 112174,
  • "uploadedUrls": "gs://bucket/webm_files/edited_initial_assessment/file.txt",
  • "pdfingestIntraction": { }
}

Update IPD Nurse Notes / Chat Data

Updates IPD nurse notes or doctor notes for a specific patient interaction. Required Query Parameters: - hospital_id - patient_id - inpatient_id - interaction_id Request Body: - data (string or object) Notes: - Validates hospital_id and maps to organization. - Ensures org_id (if provided) matches hospital_id. - Forwards normalized data to downstream chat service.

Authorizations:
X-API-Key
query Parameters
hospital_id
required
string
Example: hospital_id=9

Unique hospital identifier.

patient_id
required
string
Example: patient_id=GEN9-202602-00009

Unique patient ID.

inpatient_id
required
string
Example: inpatient_id=IN-GEN9-202602-00004

Unique inpatient ID.

interaction_id
required
string
Example: interaction_id=104865

Unique interaction ID.

Request Body schema: application/json
data
required
string

Nurse notes or chart data (string or JSON object).

Responses

Request samples

Content type
application/json
{
  • "data": "**Assessment:** Patient is experiencing severe pain, described as somewhat unbearable.\n**Medical Administration:** **Paracetamol:** \n"
}

Response samples

Content type
application/json
{ }

Get Lab Data

Fetches lab data for a given patient based on patient ID and category (e.g., Outpatient or Inpatient). Required Query Parameters: - hospital_id - patient_id - patient_category Notes: - Validates hospital_id and maps it to organization. - Fetches lab data from downstream chat service.

Authorizations:
X-API-Key
query Parameters
hospital_id
required
string
Example: hospital_id=9

Unique hospital identifier.

patient_id
required
string
Example: patient_id=GEN9-202604-00337

Unique patient ID.

patient_category
required
string
Example: patient_category=Outpatient

Patient category (e.g., Outpatient or Inpatient).

Responses

Response samples

Content type
application/json
{ }

Dynamic IPD Forms API

Unified API to handle multiple IPD form operations such as: - initial_assessment - progress_notes - doctor_notes - raw_doctor_notes - surgery_notes - nurse_notes - raw_nurse_notes - nurse_care_plan - discharge_summary - case_sheet - cauti_bundle - clabsi_bundle - drug_chart - blood_glucose_monitoring_chart - IPD_VITALS - IPD_INTAKE_OUTTAKE - IPD_CAUTI_BUNDLE - IPD_CLABSI_BUNDLE - IPD_VASCULAR_BUNDLE Required Body Fields: - hospital_id - hospital_inpatient_id - form_name - Either practitioner_id OR caregiver_id is required Clinician Validation: - Either practitioner_id OR caregiver_id is required - surgery_notes requires practitioner_id - nurse_notes and nurse_care_plan require caregiver_id Special Notes: - IPD_VITALS and IPD_INTAKE_OUTTAKE support:

  • start_date
  • end_date
  • cauti_bundle returns structured_data.IPD_CAUTI_BUNDLE - clabsi_bundle returns structured_data.IPD_CLABSI_BUNDLE - IPD_VASCULAR_BUNDLE returns structured_data.IPD_VASCULAR_BUNDLE Example: - IPD_VITALS generation for an inpatient
Authorizations:
X-API-Key
query Parameters
hospital_id
required
string
Example: hospital_id=9

Hospital identifier

Request Body schema: application/json
hospital_id
required
string
hospital_inpatient_id
required
string
form_name
required
string
Enum: "initial_assessment" "progress_notes" "doctor_notes" "raw_doctor_notes" "surgery_notes" "nurse_notes" "raw_nurse_notes" "nurse_care_plan" "discharge_summary" "case_sheet" "cauti_bundle" "cautiBundle" "clabsi_bundle" "clabsiBundle" "get_all_ipd_notes_grouped_by_date" "get_drug_chart" "blood_glucose_monitoring_chart" "update_ipd_data" "ingest_chart_data" "IPD_VITALS" "IPD_INTAKE_OUTTAKE" "IPD_CAUTI_BUNDLE" "IPD_CLABSI_BUNDLE" "IPD_VASCULAR_BUNDLE"

Name of the IPD form/action to process

practitioner_id
string

Practitioner identifier

caregiver_id
string

Caregiver or nurse identifier

category
string

Optional category filter

start_date
string

Supported only for IPD_VITALS and IPD_INTAKE_OUTTAKE

end_date
string

Supported only for IPD_VITALS and IPD_INTAKE_OUTTAKE

Responses

Request samples

Content type
application/json
{
  • "hospital_id": "9",
  • "hospital_inpatient_id": "IN-GEN9-202602-00038",
  • "form_name": "IPD_VITALS",
  • "practitioner_id": "98857",
  • "caregiver_id": "CG-72",
  • "category": "Vitals",
  • "start_date": "05/05/2026",
  • "end_date": "10/05/2026"
}

Response samples

Content type
application/json
Example
{
  • "patient_id": "GUN8-202605-00039",
  • "inpatient_id": "IN-GUN8-202605-00014",
  • "structured_data": {
    }
}

Save Patient and Medical Data

This endpoint saves patient, diagnosis, medication, and vitals data. The patient's outpatient data is sent to the client's system using the URL specified in the organization.api_url field. The data transmission includes both the initial and final payloads as part of the client response.

Dermatology specialty: For dermatology users, the payload sent to the client follows this response format: a wrapped object with top-level status (e.g. "complete") and data. The data object contains SessionId, hospitalId, patientId, OpId, IpId, PractitionerId (nullable), type (e.g. "opd"), response, additional_response, medication_templates, vitals, assessment, dermatology_notes (specialty-specific object), and status (e.g. "initial payload" or "end payload").

IPD bundle forms: For IPD client API URL callbacks (for example an organization's configured ipd_api_url), the payload is a wrapped object with top-level status (e.g. "complete") and data. The data object includes SessionId, hospitalId, patientId, OpId, IpId, PractitionerId, type: "ipd", formName, process, structured_data, and inner status ("initial payload" or "end payload"). Supported bundle structures include IPD_CAUTI_BUNDLE, IPD_CLABSI_BUNDLE, and IPD_VASCULAR_BUNDLE.

Authorizations:
X-API-Key
Request Body schema: application/json
One of
SessionId
string
patientId
string
hospitalId
string
OpId
string
IpId
string
PractitionerId
string or null
type
string

Visit type (e.g. opd). Included when specialty is dermatology.

response
string
Array of objects
Array of objects
Array of objects
additional_response
string
status
string

Responses

Request samples

Content type
application/json
Example
{
  • "status": "complete",
  • "data": {
    }
}

Response samples

Content type
application/json
{
  • "AcknowledgeId": 102,
  • "Message": "Data Posted Successfully (Initial Payload)"
}

Remove investigation CSV data

Deletes the stored investigation CSV and clears the organization's investigation data reference.

Authorizations:
X-API-Key
query Parameters
hospital_id
required
string
Example: hospital_id=9

Hospital identifier used to resolve the organization.

Responses

Response samples

Content type
application/json
{
  • "message": "CSV removed successfully"
}

Update an investigation CSV file

Alias of /software/updateInvestigationCsvs. Merges rows into the stored investigation CSV using the case-insensitive Service ID and Service Type pair as the key. The same Service ID may be stored for different Service Types.

Authorizations:
X-API-Key
query Parameters
hospital_id
required
string
Example: hospital_id=9

Hospital identifier used to resolve the organization.

Request Body schema: multipart/form-data
csvFile
required
string <binary>

CSV with required columns Service ID and Standard Lab Test Name; optional columns are Alias Name, Service Type, Hospital ID, ACTIVE FROM, and ACTIVE TO.

Responses

Response samples

Content type
application/json
{
  • "status": "success",
  • "message": "CSV updated",
  • "data": "gs://bucket/csv_uploads/example.csv",
  • "url": "gs://bucket/csv_uploads/example.csv",
  • "invalid": [
    ]
}

Remove route CSV data

Deletes the stored route CSV and clears the organization's route data reference.

Authorizations:
X-API-Key
query Parameters
hospital_id
required
string
Example: hospital_id=9

Hospital identifier used to resolve the organization.

Responses

Response samples

Content type
application/json
{
  • "message": "CSV removed successfully"
}

Remove frequency CSV data

Deletes the stored frequency CSV and clears the organization's frequency data reference.

Authorizations:
X-API-Key
query Parameters
hospital_id
required
string
Example: hospital_id=9

Hospital identifier used to resolve the organization.

Responses

Response samples

Content type
application/json
{
  • "message": "CSV removed successfully"
}

Remove drug allergy CSV data

Deletes the stored drug allergy CSV and clears the organization's drug allergy data reference.

Authorizations:
X-API-Key
query Parameters
hospital_id
required
string
Example: hospital_id=9

Hospital identifier used to resolve the organization.

Responses

Response samples

Content type
application/json
{
  • "message": "CSV removed successfully"
}

Remove food allergy CSV data

Deletes the stored food allergy CSV and clears the organization's food allergy data reference.

Authorizations:
X-API-Key
query Parameters
hospital_id
required
string
Example: hospital_id=9

Hospital identifier used to resolve the organization.

Responses

Response samples

Content type
application/json
{
  • "message": "CSV removed successfully"
}

Get ICD master data

Returns the rows stored for the selected ICD type.

Authorizations:
X-API-Key
query Parameters
hospital_id
required
string
Example: hospital_id=9

Hospital identifier used to resolve the organization.

type
required
string
Enum: "icd_10" "icd_11" "icd_snomed" "icd_9" "icd_8"
Example: type=icd_10

ICD dataset to operate on.

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Upload ICD master data as CSV

Replaces the selected ICD dataset with valid rows from a CSV. Required columns are ICD_CODE and ICD_NAME; ACTIVE FROM and ACTIVE TO are optional.

Authorizations:
X-API-Key
query Parameters
hospital_id
required
string
Example: hospital_id=9

Hospital identifier used to resolve the organization.

type
required
string
Enum: "icd_10" "icd_11" "icd_snomed" "icd_9" "icd_8"
Example: type=icd_10

ICD dataset to operate on.

Request Body schema: multipart/form-data
csvFile
required
string <binary>

ICD CSV file.

Responses

Response samples

Content type
application/json
{
  • "status": "success",
  • "message": "CSV updated",
  • "data": "gs://bucket/csv_uploads/example.csv",
  • "url": "gs://bucket/csv_uploads/example.csv",
  • "invalid": [
    ]
}

Remove ICD CSV data

Deletes the stored CSV for the selected ICD type without removing the other ICD datasets.

Authorizations:
X-API-Key
query Parameters
hospital_id
required
string
Example: hospital_id=9

Hospital identifier used to resolve the organization.

type
required
string
Enum: "icd_10" "icd_11" "icd_snomed" "icd_9" "icd_8"
Example: type=icd_10

ICD dataset to operate on.

Responses

Response samples

Content type
application/json
{
  • "message": "CSV removed successfully"
}

Update ICD master data from CSV

Merges CSV rows into the selected ICD dataset using ICD_CODE as the unique key.

Authorizations:
X-API-Key
query Parameters
hospital_id
required
string
Example: hospital_id=9

Hospital identifier used to resolve the organization.

type
required
string
Enum: "icd_10" "icd_11" "icd_snomed" "icd_9" "icd_8"
Example: type=icd_10

ICD dataset to operate on.

Request Body schema: multipart/form-data
csvFile
required
string <binary>

ICD CSV file to merge.

Responses

Response samples

Content type
application/json
{
  • "status": "success",
  • "message": "CSV updated",
  • "data": "gs://bucket/csv_uploads/example.csv",
  • "url": "gs://bucket/csv_uploads/example.csv",
  • "invalid": [
    ]
}

Upload ICD master data as JSON

Replaces the selected ICD dataset. The body may be a direct array or an object containing icdRows, icd_rows, icds, diagnoses, rows, data, or items.

Authorizations:
X-API-Key
query Parameters
hospital_id
required
string
Example: hospital_id=9

Hospital identifier used to resolve the organization.

type
required
string
Enum: "icd_10" "icd_11" "icd_snomed" "icd_9" "icd_8"
Example: type=icd_10

ICD dataset to operate on.

Request Body schema: application/json

ICD rows, shown using the preferred icds wrapper.

type
string
Enum: "icd_10" "icd_11" "icd_snomed" "icd_9" "icd_8"

May be supplied in the body instead of the type query parameter at runtime.

hospital_id
string

May be supplied in the body instead of the query parameter at runtime.

Array of objects (IcdRow) non-empty

Responses

Request samples

Content type
application/json
{
  • "hospital_id": "9",
  • "type": "icd_10",
  • "icds": [
    ]
}

Response samples

Content type
application/json
{
  • "status": "success",
  • "message": "CSV updated",
  • "data": "gs://bucket/csv_uploads/example.csv",
  • "url": "gs://bucket/csv_uploads/example.csv",
  • "invalid": [
    ]
}

Update ICD master data as JSON

Merges JSON rows into the selected ICD dataset using ICD_CODE as the unique key. The accepted wrapper keys are the same as for uploadIcdJson.

Authorizations:
X-API-Key
query Parameters
hospital_id
required
string
Example: hospital_id=9

Hospital identifier used to resolve the organization.

type
required
string
Enum: "icd_10" "icd_11" "icd_snomed" "icd_9" "icd_8"
Example: type=icd_10

ICD dataset to operate on.

Request Body schema: application/json
type
string
Enum: "icd_10" "icd_11" "icd_snomed" "icd_9" "icd_8"

May be supplied in the body instead of the type query parameter at runtime.

hospital_id
string

May be supplied in the body instead of the query parameter at runtime.

Array of objects (IcdRow) non-empty

Responses

Request samples

Content type
application/json
{
  • "hospital_id": "9",
  • "type": "icd_10",
  • "icds": [
    ]
}

Response samples

Content type
application/json
{
  • "status": "success",
  • "message": "CSV updated",
  • "data": "gs://bucket/csv_uploads/example.csv",
  • "url": "gs://bucket/csv_uploads/example.csv",
  • "invalid": [
    ]
}

Update ICD rows by code

Partially updates existing rows in the selected ICD dataset. Supply code for one row or an accepted ICD array wrapper for multiple rows. ICD_CODE cannot be changed.

Authorizations:
X-API-Key
query Parameters
hospital_id
required
string
Example: hospital_id=9

Hospital identifier used to resolve the organization.

type
required
string
Enum: "icd_10" "icd_11" "icd_snomed" "icd_9" "icd_8"
Example: type=icd_10

ICD dataset to operate on.

code
string

ICD code for a single-row update. May instead be supplied as code or ICD_CODE in the body.

Request Body schema: application/json
type
string
Enum: "icd_10" "icd_11" "icd_snomed" "icd_9" "icd_8"

May be supplied in the body instead of the type query parameter at runtime.

hospital_id
string

May be supplied in the body instead of the query parameter at runtime.

Array of objects (IcdRow) non-empty

Responses

Request samples

Content type
application/json
{
  • "hospital_id": "9",
  • "type": "icd_10",
  • "icds": [
    ]
}

Response samples

Content type
application/json
{
  • "message": "Rows updated successfully",
  • "updated": [
    ],
  • "url": "gs://bucket/csv_uploads/example.csv"
}

Delete ICD rows by code

Deletes rows from the selected ICD dataset. Supply code for one row or an accepted ICD array wrapper for multiple rows. If no rows remain, the selected ICD CSV is removed.

Authorizations:
X-API-Key
query Parameters
hospital_id
required
string
Example: hospital_id=9

Hospital identifier used to resolve the organization.

type
required
string
Enum: "icd_10" "icd_11" "icd_snomed" "icd_9" "icd_8"
Example: type=icd_10

ICD dataset to operate on.

code
string

ICD code for a single-row deletion. May instead be supplied as code or ICD_CODE in the body.

Request Body schema: application/json
type
string
Enum: "icd_10" "icd_11" "icd_snomed" "icd_9" "icd_8"

May be supplied in the body instead of the type query parameter at runtime.

hospital_id
string

May be supplied in the body instead of the query parameter at runtime.

Array of objects (IcdRow) non-empty

Responses

Request samples

Content type
application/json
{
  • "hospital_id": "9",
  • "type": "icd_10",
  • "icds": [
    ]
}

Response samples

Content type
application/json
{
  • "message": "Rows deleted successfully",
  • "deleted": [
    ],
  • "url": "gs://bucket/csv_uploads/example.csv",
  • "data": [
    ]
}

Remove other allergy CSV data

Deletes the stored other-allergy CSV and clears the organization's other-allergy data reference.

Authorizations:
X-API-Key
query Parameters
hospital_id
required
string
Example: hospital_id=9

Hospital identifier used to resolve the organization.

Responses

Response samples

Content type
application/json
{
  • "message": "CSV removed successfully"
}

Upload medication master data as JSON

Replaces the stored medication dataset with a JSON array converted to CSV. Every item requires BRAND NAME and GENERIC NAME; BRAND ID is optional but must be non-empty and unique when present.

Authorizations:
X-API-Key
query Parameters
hospital_id
required
string
Example: hospital_id=9

Hospital identifier used to resolve the organization.

Request Body schema: application/json
Array (non-empty)
BRAND ID
string
BRAND NAME
required
string
GENERIC NAME
required
string

Responses

Request samples

Content type
application/json
[
  • {
    }
]

Response samples

Content type
application/json
{
  • "message": "JSON uploaded and saved as CSV",
  • "data": "string",
  • "invalid": [
    ],
  • "totalItems": 1,
  • "invalidItemsCount": 0
}

Update medication master data as JSON

Merges a JSON array into the stored medication dataset. New values overwrite matching rows by BRAND ID, or by the BRAND NAME and GENERIC NAME pair when no brand ID is supplied.

Authorizations:
X-API-Key
query Parameters
hospital_id
required
string
Example: hospital_id=9

Hospital identifier used to resolve the organization.

Request Body schema: application/json
Array
BRAND ID
string
BRAND NAME
required
string
GENERIC NAME
required
string

Responses

Request samples

Content type
application/json
[
  • {
    }
]

Response samples

Content type
application/json
{
  • "status": "success",
  • "message": "CSV updated",
  • "data": "gs://bucket/csv_uploads/example.csv",
  • "url": "gs://bucket/csv_uploads/example.csv",
  • "invalid": [
    ]
}

Interactions

Create new interaction without ingestion

Upload one or more PDF files and create a new interaction record without ingestion.

Authorizations:
X-API-Key
Request Body schema: multipart/form-data
hospital_id
required
string

Unique hospital identifier to scope the interaction.

patient_id
required
string

Patient identifier

practitioner_id
required
string

Practitioner identifier used to resolve the internal doctor_id.

nurse_id
string

Nurse identifier (optional)

inpatient_id
string

Inpatient identifier (optional)

interaction_date
string

Interaction date-time in ISO 8601

interaction_type
string
interaction_status
string
interaction_notes
string
interaction_detail_type
string

Type of interaction detail

file
required
string <binary>

Upload one or more PDF files (send multiple fields named 'file')

file_name
string

Target filename/path

Responses

Response samples

Content type
application/json
{}

Authentication

Set organization login role

This endpoint verifies a given token, assigns a specific role (e.g., doctor, nurse), and returns a new JWT with updated role information. It is typically used after initial login to define or switch roles.

Authorizations:
X-API-Key
Request Body schema: application/json
token
required
string

JWT token obtained from initial login.

role
required
string
Enum: "doctor" "nurse" "admin" "organization"

The role to assign to the user.

Responses

Request samples

Content type
application/json
{
  • "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VybmFtZSI6InRlc3QiLCJmaXJzdF9uYW1lIjoiSm9obiIsImxhc3RfbmFtZSI6IkRvZSIsImVtYWlsIjoidGVzdEBleGFtcGxlLmNvbSIsIm9yZ2FuaXphdGlvbl9pZCI6IjEyMyIsInNhbHV0YXRpb24iOiJNci4iLCJkb2N0b3JfaWQiOiI0NTYiLCJ1c2VyX2lkIjoiNzg5IiwiY29udGFjdF9udW1iZXIiOiIrMTIzNDU2Nzg5MCIsImNvdW50cnkiOiJJbmRpYSIsImhvc3BpdGFsX2lkIjoiMTIzIiwiUHJhY3RpdGlvbmVyX2lkIjoiNDU2IiwidG9rZW5fYnlfZG9jdG9yIjp0cnVlfQ.example_signature",
  • "role": "doctor"
}

Response samples

Content type
application/json
{
  • "message": "Organization Login successful",
  • "status": true,
  • "token": "string",
  • "role": "doctor",
  • "activeRole": true
}

Verify Email OTP

Verifies the 6-digit OTP sent to the user's email for MFA (Multi-Factor Authentication) or account verification.

Authorizations:
X-API-Key
Request Body schema: application/json
user_id
integer

Unique ID of the user verifying OTP.

doctor_id
integer

Optional. Doctor ID if verifying OTP for a doctor instead of a user.

otp
required
string

The 6-digit OTP received by email.

Responses

Request samples

Content type
application/json
{
  • "user_id": 308,
  • "doctor_id": 102,
  • "otp": "928583"
}

Response samples

Content type
application/json
{
  • "success": true,
  • "message": "Email OTP verified",
  • "user": {
    }
}

Send Email OTP

Sends a 6-digit One-Time Password (OTP) to the user's registered email for MFA (Multi-Factor Authentication) verification.

Authorizations:
X-API-Key
Request Body schema: application/json
user_id
required
integer

Unique ID of the user requesting OTP.

doctor_id
integer

Optional. Doctor ID if sending OTP for a doctor instead of a user.

Responses

Request samples

Content type
application/json
{
  • "user_id": 308,
  • "doctor_id": 102
}

Response samples

Content type
application/json
{
  • "success": true,
  • "message": "OTP sent to email",
  • "user": {
    }
}

WhatsApp

Get WhatsApp Business Phone Number Details

Retrieves the WhatsApp Business phone number details for a specific WhatsApp Business Account. Requires a valid Bearer token in the Authorization header.

Authorizations:
X-API-Key
header Parameters
Authorization
required
string

Bearer token for authentication (format: Bearer )

Responses

Response samples

Content type
application/json
{
  • "data": [
    ]
}