One API key covers every clinic in your organization. Send patient visits, pharmacy stock, diet plans and lab results — they land in the same records MEDHAS clinicians work with, and flow straight into the Organization dashboard, trend charts and AI assistant. No separate reporting path to keep in sync.
Base URLhttps://medhas.co.in/api/external/v1/organizations
Authentication
Every request carries your organization’s API key as a bearer token. There is no separate login step and no token exchange.
Header on every request
Authorization: Bearer <YOUR_API_KEY>
Use your key on this pageFills every code sample below and unlocks the live console.
Kept in this browser tab only (session storage) and sent nowhere except the MEDHAS endpoint you invoke. It is cleared when you close the tab.
!
Treat the key like a password.
It authorizes writes to every clinic in your organization and is shown only once when generated. Keep it in a server-side secret store, never in client code or version control. If it leaks, ask your MEDHAS contact to revoke it — revocation takes effect immediately.
Status
Meaning
200Accepted
Check the per-record status field — a batch can succeed overall and still contain individual record errors.
400Bad request
Malformed JSON, an empty array, or a batch over the 500-record limit.
401Unauthorized
Authorization header missing, key unrecognized, or key revoked.
500Server error
Something failed on our side. Safe to retry — idempotency keys prevent duplicates.
Quickstart
The shortest path from a fresh API key to data appearing in MEDHAS.
1
Get your API keyMEDHAS provisions one per organization and shares it with you out of band.
2
Choose a stable clinic codeYour own identifier per clinic — a branch code works well. That value becomes externalClinicId; the format is entirely yours.
3
Send your first visitInclude clinicName the first time a new code appears and the clinic is created for you. After that the code alone is enough.
4
Give every record an external idWith externalVisitId set, resending is safe — you get updated back instead of a duplicate.
5
Read results per recordBatches return one result per item. Inspect each status rather than assuming the whole batch shared one outcome.
i
Clinics create themselves.
There is no setup call and no clinic registry to sync first. The first record you send for an unknown externalClinicId creates the clinic from the clinicName on that record. If an unknown code arrives with no name, that single record is rejected with a clear message — it never guesses which clinic you meant.
Severity scale
MEDHAS scores symptom severity on a fixed 0–10 scale internally. Send ratings on whatever scale your system already uses and declare it — the conversion is linear and lossless.
12345
→
Stored severity7.5/10
normalized = (ratingRaw − 1) ÷ (ratingScale − 1) × 10Your raw value is stored alongside it, so nothing about your original scale is lost.
Try itAdd your API key at the top of the page to enable this
/api/external/v1/organizations/diet-plans
Lab results
Lab report values — blood work, vitals, any metric you track — for trend charts and research.
POST/api/external/v1/organizations/lab-results
Send a lab report
Records one report’s worth of lab values for a patient — the same destination as a doctor typing results into the app, so they show up in trend charts, research and the AI assistant immediately.
idempotent on clinic + patient + reportDate
Routing
Field
Type
Description
externalClinicIdrequired
string
Your own clinic code. You choose the format — just keep it stable.
clinicName
string
Required only the first time a code appears. Auto-creates the clinic.
clinicCity
string
Used only when auto-creating.
clinicState
string
Used only when auto-creating.
Report
Field
Type
Description
reportDaterequired
date
YYYY-MM-DD. Resending this date merges into the same report instead of creating a duplicate.
patient
The identity key is externalId — sending it again updates the same patient rather than creating a second one.
Field
Type
Description
patient.externalIdrequired
string
Your patient id.
patient.name
string
—
patient.sex
string
M / F / O.
patient.ageYears
number
—
patient.dob
date
YYYY-MM-DD.
patient.mobile
string
—
values
An object keyed by metric name — letters, digits and underscore only. Recognized keys (hba1c, glucose_fasting, systolic_bp, diastolic_bp, hemoglobin, and more) get a friendly label and unit automatically; any other key is stored and labeled as sent. Each value is a number or short text (under 200 characters). 1–100 entries per report.
Field
Type
Description
values.<metricKey>required
number | string
One entry per lab value on this report, e.g. values.hba1c, values.systolic_bp.
Try itAdd your API key at the top of the page to enable this
/api/external/v1/organizations/lab-results/batch
Dravyas
Ayurvedic drugs and the classical combinations built from them — shared across your whole organization, optionally dispensed straight into a clinic’s inventory.
POST/api/external/v1/organizations/moolikas
Create or update a herb (Dravya)
Registers one raw herb into your organization’s shared Dravya catalog — the ingredient list combinations are built from. Unlike visits/inventory/diet/lab-results, this is organization-scoped, not per-clinic: no externalClinicId routing is needed, and every clinic in the org sees and can edit the same catalog.
idempotent on externalHerbId (falls back to name)
Herb
Field
Type
Description
externalHerbId
string
Your herb id. Re-sending the same id updates that herb. Omit it and re-sending the same name updates instead.
Builds a formulation (Kashayam, Choornam, Rasayana, ...) from named herbs in your organization’s shared Dravya catalog — an herb name not already in it is auto-registered first. Also organization-scoped, not per-clinic. Set autoDispense (plus externalClinicId/clinicName) to also push the result into that clinic’s medicine inventory in the same call.
idempotent on externalCombinationId
Combination
Field
Type
Description
externalCombinationId
string
Your combination id. Re-sending the same id updates that combination.
Ingestion endpoints report an outcome per record, never a single pass/fail for a whole batch.
Record status
Meaning
created
A new record was inserted.
updated
An existing record with the same external id was found and updated in place.
error
This one record was rejected — read its error string. Other records in the batch are unaffected.
Retrying safely
Every endpoint is idempotent when you supply an external id — externalVisitId,externalItemId or externalPlanId. If a request times out or you cannot tell whether it landed, send it again unchanged: you will get updated rather than a duplicate. Records sent without an external id are always inserted as new, so set one wherever you can. Lab results have no separate id to set — the report date itself is the key, so resending the same clinic/patient/date always merges into that one report rather than duplicating it.
What happens to your data
Symptom severity is normalized to 0–10 and feeds trend charts and the AI assistant exactly like an assessment typed in at the clinic.
Medicine names are matched against your organization’s product catalog for adoption reporting. Matching is exact on name, so consistent naming between your visit and inventory records improves accuracy.
Doctors identified by externalDoctorId get an attribution record — not a login — so per-prescriber reporting includes your data without provisioning accounts.
Auto-created clinics can be renamed or remapped later by your organization admin without affecting data already ingested.
Lab values land in the same place a doctor typing results into the app writes to, so they appear on the patient’s report history and trend charts immediately — recognized metric keys (e.g. hba1c, systolic_bp) get a proper label and unit; unrecognized ones are still stored, labeled as sent.