API Overview

RESTful API reference for Glide HIMS

Base URL & Versioning
# Production
https://your-domain.com/api/v1

# Development  
http://localhost:3000/api/v1

# Demo Server
https://hmisdemo.itsolutionsuganda.com/api/v1

All API endpoints are prefixed with /api/v1. The API uses semantic versioning - breaking changes will increment the major version.

Authentication

Most endpoints require JWT authentication. Include the token in the Authorization header:

# Login to get a token
curl -X POST https://api.example.com/api/v1/auth/login \
  -H "Content-Type: application/json" \
  -d '{"email": "[email protected]", "password": "password123"}'

# Response
{
  "accessToken": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
  "refreshToken": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
  "expiresIn": 3600,
  "user": {
    "id": "uuid",
    "email": "[email protected]",
    "role": "doctor"
  }
}

# Use the token in subsequent requests
curl https://api.example.com/api/v1/patients \
  -H "Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..."
Public Endpoints (No Auth Required)
  • POST /api/v1/auth/login - User login
  • POST /api/v1/auth/register - User registration (if enabled)
  • GET /api/v1/health - Health check
  • GET /api/v1/updates/check - Check for updates
  • POST /api/v1/license/validate - Validate license
  • POST /api/v1/phone-home - Phone home heartbeat
Response Format

All API responses follow a consistent format:

// Success Response
{
  "statusCode": 200,
  "data": { ... },
  "timestamp": "2026-04-10T00:00:00.000Z"
}

// Error Response
{
  "statusCode": 400,
  "error": "Bad Request",
  "message": "Validation failed: email is required",
  "timestamp": "2026-04-10T00:00:00.000Z",
  "path": "/api/v1/patients"
}

// Paginated Response
{
  "statusCode": 200,
  "data": [...],
  "pagination": {
    "page": 1,
    "limit": 20,
    "total": 150,
    "totalPages": 8
  },
  "timestamp": "2026-04-10T00:00:00.000Z"
}

API Modules

Authentication
User authentication and session management
POST /auth/login - Authenticate user
POST /auth/register - Register new user
POST /auth/refresh - Refresh access token
POST /auth/logout - End session
GET /auth/me - Get current user profile
View Full Documentation →
Patients
Patient registration and management
GET /patients - List all patients
POST /patients - Register new patient
GET /patients/:id - Get patient details
PUT /patients/:id - Update patient
GET /patients/:id/encounters - Get patient encounters
View Full Documentation →
Billing & Finance
Invoicing, payments, and financial management
GET /finance/invoices - List invoices
POST /finance/invoices - Create invoice
POST /finance/payments - Record payment
GET /finance/reports/daily - Daily financial report
View Full Documentation →
Pharmacy
Drug inventory and dispensing
GET /pharmacy/drugs - List drugs
POST /pharmacy/prescriptions - Create prescription
POST /pharmacy/dispense - Dispense medication
GET /pharmacy/stock - Check stock levels
Laboratory
Lab tests and results management
GET /laboratory/tests - List available tests
POST /laboratory/orders - Order lab test
PUT /laboratory/results/:id - Submit test results
Enterprise
Licensing, updates, and phone-home
POST /license/validate - Validate license key Public
GET /updates/check - Check for updates Public
GET /updates/latest - Get latest version Public
POST /phone-home - Send heartbeat Public
GET /features/check/:feature - Check feature availability
Rate Limiting

API requests are rate limited to prevent abuse:

Endpoint TypeLimitWindow
Authentication endpoints10 requests1 minute
Standard API endpoints100 requests1 minute
Report generation10 requests1 minute
File uploads20 requests1 minute

Rate limit headers are included in responses:

X-RateLimit-Limit: 100
X-RateLimit-Remaining: 95
X-RateLimit-Reset: 1617235200
Error Codes
CodeStatusDescription
400Bad RequestInvalid request body or parameters
401UnauthorizedMissing or invalid authentication
403ForbiddenInsufficient permissions
404Not FoundResource not found
409ConflictResource already exists
422UnprocessableValidation failed
429Too Many RequestsRate limit exceeded
500Internal ErrorServer error - contact support