API Documentation

Complete reference for integrating MedGrid with government portals, HMIS systems, and pharmacy ERPs.

Authentication

All requests require Bearer token in Authorization header

Authorization: Bearer YOUR_API_KEY

Base URL

All endpoints are relative to

https://api.medgrid.india/v1

Rate Limit

API requests are rate-limited

1000 requests/hour

Endpoints

POST/api/integrations/government/sync

Sync shortage data with government health portals

Parameters

timestamp(ISO8601)Data collection timestamp
hospitalId(string)Unique hospital identifier
shortages(array)Array of shortage records

Response (200)

{ "success": true, "synced": 15, "timestamp": "2026-01-11T10:30:00Z" }
POST/api/integrations/hmis/ingest

Ingest patient demand and bed occupancy data from HMIS

Parameters

hmisSystemId(string)HMIS system identifier
patientData(object)Patient demographics and treatments
bedOccupancy(object)Current bed utilization

Response (200)

{ "success": true, "processed": 342, "predictions": "updated" }
POST/api/integrations/pharmacy-erp/update

Update inventory from pharmacy ERP systems

Parameters

erpSystem(string)ERP system name (e.g., SAP, Oracle)
inventory(array)Inventory batch records
transactions(array)Recent stock movements

Response (200)

{ "success": true, "updated": 284, "conflicts": 0 }
GET/api/integrations/status

Check integration connection status

Parameters

integrationId(string)Integration identifier

Response (200)

{ "connected": true, "lastSync": "2026-01-11T10:15:00Z", "nextSync": "2026-01-11T10:30:00Z" }

Error Handling

400 Bad Request

Invalid parameters or malformed request body

401 Unauthorized

Missing or invalid API key

429 Too Many Requests

Rate limit exceeded. Implement exponential backoff retry strategy

500 Server Error

Contact support with request ID from response headers

Need help?

Contact our integration support team for custom requirements

integrations@medgrid.india