સીધા સામગ્રી પર જાઓ
Menu

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

  1. Take the sandbox key below — it reads the demo hospital, ninety days of data, nothing to sign.
  2. Call GET /api/v1/me with the key in X-Api-Key. You get the hospital, your scopes and the version.
  3. Read what you need: /patients, /invoices?from&to, /finance/daybook, /patients/{id}/results, /fhir/Bundle?patient=….
  4. For a hospital of your own, its administrator creates a key on Setup › Integration API with just the scopes you need — writes included.
  5. 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/daybook

Webhooks

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

GroupCallScopeWhat
ExportsGET /exports/patients.csvpatients:readPatients registered in a date range, as CSV (up to a year, 50,000 rows)
ExportsGET /exports/invoices.csvbilling:readInvoices issued in a date range, one row each with the totals, as CSV
ExportsGET /exports/ledger.csvfinance:readThe day book — every rupee in and out with its source — for a date range (max 3 months), as CSV
ExportsGET /exports/tally.xmlfinance:readTally 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
MetaGET /me—Who am I — the hospital, the client and the scopes behind this key
MastersGET /departmentsmasters:readActive departments
MastersGET /doctorsmasters:readActive doctors with department and consultation fee
MastersGET /tariffmasters:readTariff — every service with its rate and GST
MastersGET /wardsmasters:readWards with their beds and whether each is occupied
InventoryGET /stockinventory:readPharmacy items with quantity on hand by batch
PatientsGET /patientspatients:readPatients, newest first
PatientsGET /patients/{id}patients:readOne patient
PatientsPOST /patientspatients:writeRegister a patient (Idempotency-Key required)
PatientsPUT /patients/{id}patients:writeUpdate a patient's demographics (fields left out are kept)
PatientsGET /patients/{id}/visitspatients:readA patient's OPD visits
PatientsGET /patients/{id}/admissionspatients:readA patient's admissions
PatientsGET /patients/{id}/invoicespatients:readA patient's invoices with balances
AppointmentsGET /appointmentsappointments:readAppointments for a day, optionally one doctor
AppointmentsPOST /appointmentsappointments:writeBook an appointment (Idempotency-Key required)
AppointmentsPOST /appointments/{id}/cancelappointments:writeCancel an appointment (Idempotency-Key required)
AdmissionsGET /admissionsadmissions:readAdmissions — current by default, or discharged / all since a date
AdmissionsGET /admissions/{id}admissions:readOne admission with its charges and deposits
BillingGET /invoicesbilling:readInvoices in a date range (default: last 30 days)
BillingGET /invoices/{id}billing:readOne invoice with lines, receipts and refunds
BillingPOST /invoicesbilling:writeIssue an invoice from tariff lines (Idempotency-Key required)
BillingPOST /invoices/{id}/receiptsbilling:writePost a payment against an invoice (Idempotency-Key required)
BillingPOST /invoices/{id}/refundsbilling:writeRefund against an invoice (Idempotency-Key required)
BillingGET /receiptsbilling:readReceipts in a date range
BillingGET /depositsbilling:readIPD deposits and deposit refunds in a date range
FinanceGET /finance/daybookfinance:readThe day book — every rupee in and out, with its source — for a date range (max 3 months)
FinanceGET /finance/gstr1finance:readGSTR-1 B2B and HSN summaries for a month, as CSV text
FinanceGET /finance/supplier-billsfinance:readSupplier bills — open by default
FinanceGET /finance/supplier-paymentsfinance:readSupplier payments, latest 500
FinanceGET /finance/settlementsfinance:readPayment-gateway settlements by UTR
ClinicalGET /patients/{id}/resultsclinical:readReleased laboratory and radiology results for a patient
ClinicalGET /patients/{id}/prescriptionsclinical:readFinalised prescriptions for a patient
ClinicalGET /patients/{id}/discharge-summariesclinical:readFinalised discharge summaries for a patient
FHIRGET /fhir/Patient/{id}clinical:readThe patient as a FHIR R4 Patient resource
FHIRGET /fhir/Bundleclinical:readABDM-style FHIR R4 bundles for a patient — OPConsultation, Prescription, DiagnosticReport, DischargeSummary
LeadsPOST /leadsleads:writeSend 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
Header: X-Api-Key · base URL https://hmis.teliccognitive.com

Scopes

masters:readDepartments, doctors, tariff, wards and beds, drugs
patients:readPatient demographics, visits, admissions, invoices of a patient
patients:writeRegister and update patients
appointments:readAppointments by day and doctor
appointments:writeBook and cancel appointments
admissions:readCurrent admissions, charges, deposits, discharges
billing:readInvoices, receipts, refunds, deposits
billing:writeCreate invoices, post receipts and refunds
finance:readDay book, GSTR-1, supplier bills and payments, gateway settlements
inventory:readStock items and batches
clinical:readReleased lab and radiology results, prescriptions, discharge summaries, FHIR bundles
leads:writeSend 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; 429 with Retry-After beyond it.
  • A key short of the scope answers 403 naming the scope it lacks.
  • Lists are paginated: page, pageSize up to 200, updatedSince where 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.createda patient registered — at the desk, on the portal or through the API
appointment.bookedan appointment booked
appointment.cancelledan appointment cancelled
appointment.arrivedthe patient arrived and a token was issued
admission.createda patient admitted
admission.dischargeda patient discharged (any way — normal, LAMA, referred, deceased)
invoice.issuedan invoice issued
invoice.paidan invoice settled in full
invoice.cancelledan invoice cancelled
payment.receiveda receipt posted — cash, UPI, card, a gateway payment
payment.refundeda refund made
lab.result.releaseda lab report released to the patient
discharge-summary.finaliseda discharge summary finalised
pingthe test delivery from the setup page

Rejoining the server...

Rejoin failed... trying again in seconds.

Failed to rejoin.
Please retry or reload the page.

The session has been paused by the server.

Failed to resume the session.
Please retry or reload the page.