HealthDock API Documentation

Build powerful healthcare applications with our comprehensive REST API

200+

API Endpoints

99.9%

Uptime SLA

<100ms

Average Response

Quick Start

Get Started in 5 Minutes

1
Create Your Account

Sign up for a HealthDock developer account to get your API credentials.

Sign Up
2
Get Your API Key

Navigate to Settings → API Keys in your dashboard to generate your API key.

3
Make Your First Request

Use your API key to authenticate and make your first API call:

curl -X GET https://api.healthdock.org/v1/patients \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json"
4
Explore the Documentation

Browse through our comprehensive API endpoints and start building!

Authentication

The HealthDock API uses Bearer token authentication. Include your API key in the Authorization header of each request:

Authorization: Bearer YOUR_API_KEY

OAuth 2.0

For third-party applications, we support OAuth 2.0 authentication flow:

POST /oauth/authorize

Initialize OAuth flow for user authorization

Parameter Type Description
client_id string Required Your application's client ID
redirect_uri string Required Callback URL for authorization
scope string Optional Requested permissions

API Endpoints

Patients

GET /v1/patients

Retrieve a list of all patients

Parameter Type Description
page integer Optional Page number (default: 1)
limit integer Optional Results per page (max: 100)
search string Optional Search by name or ID
{ "success": true, "data": { "patients": [...], "pagination": { "current_page": 1, "total_pages": 10, "total_count": 245 } } }
curl -X GET https://api.healthdock.org/v1/patients?page=1&limit=10 \ -H "Authorization: Bearer YOUR_API_KEY"
POST /v1/patients

Create a new patient record

Parameter Type Description
first_name string Required Patient's first name
last_name string Required Patient's last name
date_of_birth date Required Format: YYYY-MM-DD
gender string Required M/F/Other
phone string Required Contact number
abha_number string Optional ABHA ID for ABDM integration

Appointments

GET /v1/appointments

List all appointments with filtering options

Parameter Type Description
date date Optional Filter by date (YYYY-MM-DD)
doctor_id string Optional Filter by doctor
status string Optional scheduled/confirmed/completed/cancelled
POST /v1/appointments

Schedule a new appointment

Parameter Type Description
patient_id string Required Patient ID
doctor_id string Required Doctor ID
date_time datetime Required ISO 8601 format
duration integer Optional Duration in minutes (default: 30)
type string Optional consultation/follow-up/procedure

Webhooks

HealthDock can send real-time notifications to your application when certain events occur. Configure webhook endpoints in your dashboard.

Available Events

  • patient.created - New patient record created
  • patient.updated - Patient information updated
  • appointment.scheduled - New appointment scheduled
  • appointment.cancelled - Appointment cancelled
  • prescription.created - New prescription issued
  • report.ready - Medical report generated
  • payment.completed - Payment processed successfully

Webhook Payload

{ "event": "patient.created", "timestamp": "2024-01-12T10:30:00Z", "data": { "patient_id": "PAT123456", "first_name": "John", "last_name": "Doe", ... }, "signature": "sha256=..." }

Verifying Webhook Signatures

All webhook payloads are signed using HMAC-SHA256. Verify the signature to ensure the request came from HealthDock:

const crypto = require('crypto'); function verifyWebhook(payload, signature, secret) { const expectedSignature = crypto .createHmac('sha256', secret) .update(payload) .digest('hex'); return signature === `sha256=${expectedSignature}`; }

Rate Limits

API Rate Limiting Policy

  • Standard tier: 1,000 requests per hour
  • Professional tier: 10,000 requests per hour
  • Enterprise tier: Unlimited requests
  • Rate limit headers included in all responses
  • 429 status code when limit exceeded
  • Automatic retry with exponential backoff recommended

Rate Limit Headers

X-RateLimit-Limit: 1000 X-RateLimit-Remaining: 750 X-RateLimit-Reset: 1642089600

Error Handling

The HealthDock API uses standard HTTP status codes to indicate success or failure of requests.

Common Error Codes

Code Message Description
200 OK Request successful
201 Created Resource created successfully
400 Bad Request Invalid request parameters
401 Unauthorized Invalid or missing API key
403 Forbidden Insufficient permissions
404 Not Found Resource not found
429 Too Many Requests Rate limit exceeded
500 Internal Server Error Server error, please retry

Error Response Format

{ "success": false, "error": { "code": "INVALID_REQUEST", "message": "The request parameters are invalid", "details": { "field": "date_of_birth", "issue": "Invalid date format" } } }

SDKs & Libraries

Use our official SDKs for faster integration:

Node.js

npm install @healthdock/api-sdk
View on GitHub

Python

pip install healthdock-sdk
View on GitHub

PHP

composer require healthdock/api-sdk
View on GitHub

Java

implementation 'org.healthdock:api-sdk:1.0.0'
View on GitHub