Developers
One REST API over the whole hospital — for the ERP that wants the ledger, the call centre that books appointments, the LIS that returns results, the group that wants every bill in one warehouse. Per-hospital keys, scopes per module, an idempotency key on every write, and a sandbox you can call in the next minute.
Ten minutes to the first call
- Take the sandbox key below — it reads the demo hospital, ninety days of data, nothing to sign.
- Call
GET /api/v1/mewith the key inX-Api-Key. You get the hospital, your scopes and the version. - Read what you need:
/patients,/invoices?from&to,/finance/daybook,/patients/{id}/results,/fhir/Bundle?patient=…. - For a hospital of your own, its administrator creates a key on Setup › Integration API with just the scopes you need — writes included.
- Every write carries an
Idempotency-Key; retry as often as you like, nothing is created twice.
curl -H "X-Api-Key: mh_test_demoPatelHospitalReadOnlyKey01" https://hmis.teliccognitive.com/api/v1/me curl -H "X-Api-Key: mh_test_demoPatelHospitalReadOnlyKey01" "https://hmis.teliccognitive.com/api/v1/invoices?from=11/22/2026&to=11/29/2026" curl -H "X-Api-Key: mh_test_demoPatelHospitalReadOnlyKey01" https://hmis.teliccognitive.com/api/v1/finance/daybook?from=11/29/2026
OAuth2 client credentials
If your platform speaks OAuth2 rather than static keys: your client_id is shown beside the key on Setup › Integration API, your client_secret is the key itself. Exchange them at POST /oauth/token for a one-hour access token, optionally narrowed to fewer scopes than the key has, and send it as the Bearer. A revoked key kills its tokens.
curl -X POST https://hmis.teliccognitive.com/oauth/token \
-d grant_type=client_credentials -d client_id=mh_ci_… -d client_secret=mh_live_… -d "scope=finance:read billing:read"
# {"access_token":"eyJ…","token_type":"Bearer","expires_in":3600,"scope":"finance:read billing:read"}
curl -H "Authorization: Bearer eyJ…" https://hmis.teliccognitive.com/api/v1/finance/daybookWebhooks
Rather than polling, register a URL on Setup › Webhooks and choose events: patient.created, appointment.booked / cancelled / arrived, admission.created / discharged, invoice.issued / paid / cancelled, payment.received / refunded, lab.result.released, discharge-summary.finalised. Events are raised whether the thing was done at the desk, on the ward or through the API. Each delivery is a JSON POST — { id, event, createdAt, data } — with three headers; answer 2xx within ten seconds or it is retried after 1 and 5 minutes, 30 minutes, 2 and 12 hours.
X-Medspire-Event: invoice.issued
X-Medspire-Delivery: 4f1c… # keep it; a retry after a slow 200 repeats the same id
X-Medspire-Signature: t=1759230000,v1=9a3b… # v1 = hex HMAC-SHA256(secret, t + "." + raw body)
# Python
import hmac, hashlib, time
t, v1 = dict(p.split("=", 1) for p in sig.split(",")).values()
ok = hmac.compare_digest(hmac.new(secret.encode(), f"{t}.{body}".encode(), hashlib.sha256).hexdigest(), v1) and abs(time.time() - int(t)) < 300
# C#
var expected = Convert.ToHexString(HMACSHA256.HashData(Encoding.UTF8.GetBytes(secret), Encoding.UTF8.GetBytes($"{t}.{body}"))).ToLower();
var ok = CryptographicOperations.FixedTimeEquals(Encoding.UTF8.GetBytes(expected), Encoding.UTF8.GetBytes(v1));Not ready to receive yet? Point an endpoint at https://hmis.teliccognitive.com/api/webhooks/sink — it answers 200 and the last deliveries it saw appear below.
A first load into the ERP
Bulk exports by date range for the day the ERP goes live: /api/v1/exports/patients.csv, /exports/invoices.csv, /exports/ledger.csv (the day book) and /exports/tally.xml — Tally vouchers (a Sales voucher per invoice split by service category with CGST/SGST, a Receipt per receipt by payment mode, a Payment per refund) that Gateway of Tally › Import Data › Vouchers reads as it is.
curl -H "X-Api-Key: mh_test_demoPatelHospitalReadOnlyKey01" "https://hmis.teliccognitive.com/api/v1/exports/invoices.csv?from=10/30/2026&to=11/29/2026" -o invoices.csv curl -H "X-Api-Key: mh_test_demoPatelHospitalReadOnlyKey01" "https://hmis.teliccognitive.com/api/v1/exports/tally.xml?from=10/30/2026&to=11/29/2026" -o vouchers.xml
Every endpoint
| Group | Call | Scope | What |
|---|---|---|---|
| Exports | GET /exports/patients.csv | patients:read | Patients registered in a date range, as CSV (up to a year, 50,000 rows) |
| Exports | GET /exports/invoices.csv | billing:read | Invoices issued in a date range, one row each with the totals, as CSV |
| Exports | GET /exports/ledger.csv | finance:read | The day book — every rupee in and out with its source — for a date range (max 3 months), as CSV |
| Exports | GET /exports/tally.xml | finance:read | Tally XML vouchers for a date range — Sales per invoice (by service category, GST split), Receipt per receipt (by payment mode), Journal per refund; import through Gateway of Tally › Import Data |
| Meta | GET /me | — | Who am I — the hospital, the client and the scopes behind this key |
| Masters | GET /departments | masters:read | Active departments |
| Masters | GET /doctors | masters:read | Active doctors with department and consultation fee |
| Masters | GET /tariff | masters:read | Tariff — every service with its rate and GST |
| Masters | GET /wards | masters:read | Wards with their beds and whether each is occupied |
| Inventory | GET /stock | inventory:read | Pharmacy items with quantity on hand by batch |
| Patients | GET /patients | patients:read | Patients, newest first |
| Patients | GET /patients/{id} | patients:read | One patient |
| Patients | POST /patients | patients:write | Register a patient (Idempotency-Key required) |
| Patients | PUT /patients/{id} | patients:write | Update a patient's demographics (fields left out are kept) |
| Patients | GET /patients/{id}/visits | patients:read | A patient's OPD visits |
| Patients | GET /patients/{id}/admissions | patients:read | A patient's admissions |
| Patients | GET /patients/{id}/invoices | patients:read | A patient's invoices with balances |
| Appointments | GET /appointments | appointments:read | Appointments for a day, optionally one doctor |
| Appointments | POST /appointments | appointments:write | Book an appointment (Idempotency-Key required) |
| Appointments | POST /appointments/{id}/cancel | appointments:write | Cancel an appointment (Idempotency-Key required) |
| Admissions | GET /admissions | admissions:read | Admissions — current by default, or discharged / all since a date |
| Admissions | GET /admissions/{id} | admissions:read | One admission with its charges and deposits |
| Billing | GET /invoices | billing:read | Invoices in a date range (default: last 30 days) |
| Billing | GET /invoices/{id} | billing:read | One invoice with lines, receipts and refunds |
| Billing | POST /invoices | billing:write | Issue an invoice from tariff lines (Idempotency-Key required) |
| Billing | POST /invoices/{id}/receipts | billing:write | Post a payment against an invoice (Idempotency-Key required) |
| Billing | POST /invoices/{id}/refunds | billing:write | Refund against an invoice (Idempotency-Key required) |
| Billing | GET /receipts | billing:read | Receipts in a date range |
| Billing | GET /deposits | billing:read | IPD deposits and deposit refunds in a date range |
| Finance | GET /finance/daybook | finance:read | The day book — every rupee in and out, with its source — for a date range (max 3 months) |
| Finance | GET /finance/gstr1 | finance:read | GSTR-1 B2B and HSN summaries for a month, as CSV text |
| Finance | GET /finance/supplier-bills | finance:read | Supplier bills — open by default |
| Finance | GET /finance/supplier-payments | finance:read | Supplier payments, latest 500 |
| Finance | GET /finance/settlements | finance:read | Payment-gateway settlements by UTR |
| Clinical | GET /patients/{id}/results | clinical:read | Released laboratory and radiology results for a patient |
| Clinical | GET /patients/{id}/prescriptions | clinical:read | Finalised prescriptions for a patient |
| Clinical | GET /patients/{id}/discharge-summaries | clinical:read | Finalised discharge summaries for a patient |
| FHIR | GET /fhir/Patient/{id} | clinical:read | The patient as a FHIR R4 Patient resource |
| FHIR | GET /fhir/Bundle | clinical:read | ABDM-style FHIR R4 bundles for a patient — OPConsultation, Prescription, DiagnosticReport, DischargeSummary |
| Leads | POST /leads | leads:write | Send a website enquiry into the lead desk (Idempotency-Key required) |
The sandbox key
Reads the demo hospital. Rate-limited, read-only, reset with the demo. Public by design.
mh_test_demoPatelHospitalReadOnlyKey01
Scopes
masters:read | Departments, doctors, tariff, wards and beds, drugs |
patients:read | Patient demographics, visits, admissions, invoices of a patient |
patients:write | Register and update patients |
appointments:read | Appointments by day and doctor |
appointments:write | Book and cancel appointments |
admissions:read | Current admissions, charges, deposits, discharges |
billing:read | Invoices, receipts, refunds, deposits |
billing:write | Create invoices, post receipts and refunds |
finance:read | Day book, GSTR-1, supplier bills and payments, gateway settlements |
inventory:read | Stock items and batches |
clinical:read | Released lab and radiology results, prescriptions, discharge summaries, FHIR bundles |
leads:write | Send a website enquiry into the platform's lead desk — the marketing site's key |
The rules
- Keys are hashed at rest and shown once; rotation keeps the old key alive for an hour.
- 120 calls a minute per key by default;
429withRetry-Afterbeyond it. - A key short of the scope answers
403naming the scope it lacks. - Lists are paginated:
page,pageSizeup to 200,updatedSincewhere it makes sense. - Errors are
{ "error", "detail" }, in plain words. - Nothing about staff logins, passwords or gateway secrets is reachable. Clinical data is released records only.
Events
patient.created | a patient registered — at the desk, on the portal or through the API |
appointment.booked | an appointment booked |
appointment.cancelled | an appointment cancelled |
appointment.arrived | the patient arrived and a token was issued |
admission.created | a patient admitted |
admission.discharged | a patient discharged (any way — normal, LAMA, referred, deceased) |
invoice.issued | an invoice issued |
invoice.paid | an invoice settled in full |
invoice.cancelled | an invoice cancelled |
payment.received | a receipt posted — cash, UPI, card, a gateway payment |
payment.refunded | a refund made |
lab.result.released | a lab report released to the patient |
discharge-summary.finalised | a discharge summary finalised |
ping | the test delivery from the setup page |