Overview
The Healthstack API gives you access to all the core features available on our dashboard and allows you to integrate them directly into your healthtech applications. It follows REST principles and is organized around key healthcare resources such as patients, medical records, consent, and Medicard — with a few specialized endpoints for advanced use cases.
https://api.healthstack.ng/v1
🔐 Secure Authentication
JWT-based authentication with access and consent tokens for secure data access.
👥 Patient Identity
Centralized patient management using NIN for unique identification across all healthcare providers.
📋 Consent Management
Strict consent-based access control ensuring patient data privacy and compliance.
🏥 Tier-Based Access
KYC-based tier system controlling access levels for different types of healthcare businesses.
Key Concepts
Core Identifiers
NIN (National Identification Number)
Government-issued unique identifier used to identify patients across all healthcare systems.
HealthID
HealthStack-generated unique patient identifier in format HID-XXXXXXXX
.
Authentication Tokens
Token | Purpose | Validity | Header |
---|---|---|---|
Secret Key | API authentication | - - | Authorization: Bearer |
ConsentToken | Patient data access | 24 hours | x-consent-token |
Patient Management
Headers
Request Body
Request Body Parameters
Parameter | Type | Required | Description |
---|---|---|---|
name |
string | Yes | Full name of the patient |
gender |
string | Yes | Patient's gender (male/female/other) |
dob |
string | Yes | Date of birth in ISO format (YYYY-MM-DD) |
nin |
string | Yes | National Identification Number (11 digits) |
email |
string | Yes | Patient's email address |
Response
Response Parameters
Parameter | Type | Description |
---|---|---|
status |
boolean | Indicates whether the request was successful |
message |
string | Descriptive message about the operation result |
data.health_id |
string | Unique patient identifier generated by HealthStack |
data.name |
string | Full name of the patient |
data.nin |
string | National Identification Number |
data.email |
string | Patient's email address |
data.created_at |
string | Timestamp of patient record creation in ISO format |
Headers
Request Body
Request Body Parameters
Parameter | Type | Required | Description |
---|---|---|---|
health_id |
string | Yes | Unique patient identifier in format HID-XXXXXXXX |
Response
Response Parameters
Parameter | Type | Description |
---|---|---|
success |
boolean | Indicates whether the request was successful |
status |
boolean | Indicates whether the consent was successfully granted |
message |
string | Descriptive message about the consent operation |
Headers
Request Body
Request Body Parameters
Parameter | Type | Required | Description |
---|---|---|---|
health_id |
string | Yes | Unique patient identifier in format HID-XXXXXXXX |
otp |
integer | Yes | 6-digit One-Time Password received by patient |
Response
Response Parameters
Parameter | Type | Description |
---|---|---|
success |
boolean | Indicates whether the request was successful |
status |
integer | Indicates the status of the request |
message |
string | Descriptive message about the consent operation |
data.consentToken |
string | Unique token for accessing patient data |
data.health_id |
string | Unique patient identifier in format HID-XXXXXXXX |
Headers
Response
Response Parameters
Parameter | Type | Description |
---|---|---|
success |
boolean | Indicates whether the request was successful |
status |
integer | Indicates the status of the request |
message |
string | Descriptive message about the consent operation |
data.id |
string | Unique patient identifier in format HID-XXXXXXXX |
data.full_name |
string | Full name of the patient |
data.gender |
string | Gender of the patient |
data.dob |
string | Date of birth of the patient |
data.health_id |
string | Unique patient identifier in format HID-XXXXXXXX |
data.created_at |
string | Date and time the patient was created |
data.email |
string | Email of the patient |
data.business_id |
string | Business identifier in format BUS-XXXXXXXX |
data.updated_at |
string | Date and time the patient was updated |
data.metadata |
object | Metadata of the patient |
data.metadata.key |
string | Key of the metadata |
Headers
x-consent-token: ct_1234567890abcdef
Response
Response Parameters
Parameter | Type | Description |
---|---|---|
success |
boolean | Indicates whether the request was successful |
status |
integer | Indicates the status of the request |
message |
string | Descriptive message about the consent operation |
data.id |
string | Unique record identifier in format |
data.full_name |
string | Full name of the patient |
data.gender |
string | Gender of the patient |
data.dob |
string | Date of birth of the patient |
data.health_id |
string | Unique patient identifier in format HID-XXXXXXXX |
data.created_at |
string | Date and time the patient was created |
data.email |
string | Email of the patient |
data.business_id |
string | Business identifier in format BUS-XXXXXXXX |
data.updated_at |
string | Date and time the patient was updated |
data.vital |
object | Vital of the patient |
data.metadata |
object | Metadata of the patient |
data.metadata.key |
string | Key of the metadata |
Headers
x-consent-token: ct_1234567890abcdef
Request Body
Response
Response Parameters
Parameter | Type | Description |
---|---|---|
success |
boolean | Indicates whether the request was successful |
status |
integer | Indicates the status of the request |
message |
string | Descriptive message about the consent operation |
data |
object | Data of the request |
data.metadata |
object | Metadata of the request |
data.metadata.key |
string | Key of the metadata |
Medical Records
Headers
Request Body
Request Body Parameters
Parameter | Type | Required | Description |
---|---|---|---|
recordType |
string | Yes | Type of medical record (diagnosis, prescription, lab, clinical_note) |
data |
object | Yes | Record-specific details based on record type |
provider |
object | Yes | Healthcare provider information |
provider.name |
string | Yes | Name of the healthcare provider/institution |
provider.nprn |
string | Yes | National Provider Registration Number |
Supported Record Types
Diagnosis
"data": { "diagnosis": "Fever", "severity": "Mild", "notes": "Note..." }
Prescription
"data": { "medications": [ { "dosage": "480mlg", "drugName": "Artemeter ", "duration": "3 days", "frequency": "twice daily" } ], "prescribedAt": "2025-07-18T09..", "prescribedBy": "Dr. Michael" }
Lab Results
"data": { "labName": "Lifeline Clinic", "testType": "Blood group", "testedAt": "2025-07-18T09..", "parameters": [ { "name": "SDDH-3", "value": "21", "normalRange": "21" } ] }
Vital Signs
"data": { "heartRate": "76bpm", "measuredAt": "2025-07-18T06..", "temperature": "37", "bloodPressure": "100/80", "respiratoryRate": "18 b/m" }
Consultation
"data": { "date": "2025-07-19T18..", "notes": "Note...", "purpose": "General check-up", "duration": "20 mins", "consultedBy": "Dr. Michael" }
Imaging
"data": { "findings": "Our findings", "scanType": "Chest X-ray", "attachments": [ { "fileUrl": "https://jknvfkr dm", "fileName": "Image" } ], "performedAt": "2025-08-13T20.." }
Surgery
"data": { "surgeon": "Dr. John", "procedure": "Appendix", "surgeryDate": "2025-08-30T00..", "surgicalNotes": "Surgical Note..." }
Allergy
"data": { "notedAt": "2025-08-21T00:00:00.000Z", "reaction": "Rash", "severity": "Moderate", "substance": "Paracetamol" }
Vaccination
"data": { "date": "2025-08-22T00:00:00.000Z", "dose": "1st", "vaccine": "COVID-19", "administeredBy": "Nurse Mary" }
Admission
"data": { "wardUnit": "Room 23", "admissionDate": "2025-08-15T00..", "admissionNotes": "Additional Note", "admissionReason": "Acute Malaria", "admittingPhysician": "Dr. John" }
Discharge
"data": { "dischargeDate": "2025-08-22T00..", "dischargeStatus": "Recovered", "dischargingPhysician": "Dr. John", "followUpInstructions": "Instruction" }
Referral
"data": { "referredTo": "Cardiology Department", "referralDate": "2025-08-28T00..", "referralNotes": "Note", "referralReason": "Reason", "referringPhysician": "Dr. John" }
Mental Health
"data": { "assessment": "Mild depression ", "nextSession": "2025-08-22T00..", "sessionNotes": "Note" }
Progress Note
"data": { "update": "Patient's current status", "reviewDate": "2025-08-22T00.." }
Consent Form
"data": { "signedAt": "2025-08-22T00:00:..", "signedBy": "Patient", "procedure": "Blood transfusion", "attachments": [ { "fileUrl": "https://refnvkredfnlvfe", "fileName": "Attachment" } ] }
Dental Record
"data": { "notes": "Additional notes", "procedure": "Tooth extraction", "performedAt": "2025-08-21T00.." }
Eye Exam
"data": { "result": "20/20 vision", "examinedAt": "2025-08-23T00..", "recommendation": "No lenses required" }
Emergency Visit
"data": { "reason": "Accident", "arrivalTime": "2025-08-15T20..", "treatmentGiven": "Treatment given" }
Headers
Query Parameters
Parameter | Type | Required | Description |
---|---|---|---|
recordType |
string | No | Filter by record type (diagnosis, prescription, lab, note) |
from |
string (ISO) | No | Start date filter |
to |
string (ISO) | No | End date filter |
Medicard Management
Headers
Request Body
Request Body Parameters
Parameter | Type | Required | Description |
---|---|---|---|
health_id |
string | Yes | Unique patient identifier in format HID-XXXXXXXX |
cardName |
string | Yes | Name to be displayed on the Medicard |
cardType |
string | Yes | Type of Medicard to be created |
Response
Response Parameters
Parameter | Type | Description |
---|---|---|
success |
boolean | Indicates whether the Medicard was successfully created |
status |
integer | Indicates the status of the request |
message |
string | Descriptive message about the Medicard creation |
data |
object | Data of the request |
Headers
Request Body
Request Body Parameters
Parameter | Type | Required | Description |
---|---|---|---|
health_id |
string | Yes | Unique patient identifier in format HID-XXXXXXXX |
card_pin |
number | Yes | 4-digit PIN for Medicard activation |
card_number |
string | Yes | Unique card number for the Medicard |
Response
Response Parameters
Parameter | Type | Description |
---|---|---|
success |
boolean | Indicates whether the Medicard was successfully activated |
status |
integer | Indicates the status of the request |
message |
string | Descriptive message about the Medicard activation |
data |
object | Data of the request |
Headers
Request Body
Request Body Parameters
Parameter | Type | Required | Description |
---|---|---|---|
card_number |
string | Yes | Unique card number for the Medicard |
reason |
string | Yes | Reason for deactivating the Medicard |
Response
Response Parameters
Parameter | Type | Description |
---|---|---|
status |
boolean | Indicates whether the Medicard was successfully activated |
message |
string | Descriptive message about the Medicard activation |
data.health_id |
string | Patient's unique health identifier |
data.medicard_status |
string | Updated status of the Medicard (e.g., 'active', 'activated') |
data.activated_at |
string | Timestamp of Medicard activation in ISO format |
Headers
Request Body
Request Body Parameters
Parameter | Type | Required | Description |
---|---|---|---|
quantity |
number | Yes | Quantity of Medicards to reserve |
cardType |
string | Yes | Type of Medicard to reserve |
Response
Response Parameters
Parameter | Type | Description |
---|---|---|
success |
boolean | Indicates whether the Medicard was successfully reserved |
status |
integer | Indicates the status of the request |
message |
string | Descriptive message about the Medicard reservation |
data |
array | Data of the request |
Headers
Request Body
Request Body Parameters
Parameter | Type | Required | Description |
---|---|---|---|
health_id |
string | Yes | Unique patient identifier in format HID-XXXXXXXX |
cardName |
string | Yes | Name displayed on the Medicard |
cardType |
string | Yes | Type of Medicard to assign |
cardNumber |
string | Yes | Unique card number for the Medicard |
expires_at |
string | Yes | Expiration date of the Medicard |
Response
Response Parameters
Parameter | Type | Description |
---|---|---|
success |
boolean | Indicates whether the Medicard was successfully reserved |
status |
integer | Indicates the status of the request |
message |
string | Descriptive message about the Medicard assignment |
data |
object | Data of the request |
data.id |
string | Unique identifier for the assigned Medicard |
data.health_id |
string | Unique patient identifier in format HID-XXXXXXXX |
data.card_number |
string | Unique card number for the Medicard |
data.card_name |
string | Name displayed on the Medicard |
data.balance |
number | Balance of the Medicard |
data.business_id |
string | Unique business identifier in format BUS-XXXXXXXX |
data.created_at |
string | Timestamp of Medicard creation in ISO format |
data.updated_at |
string | Timestamp of Medicard update in ISO format |
data.active |
boolean | Indicates if the Medicard is active |
data.card_type |
string | Type of Medicard |
data.expires_at |
string | Expiration date of the Medicard |
data.card_pin |
string | PIN of the Medicard |
data.failedAttempt |
number | Number of failed attempts to access the Medicard |
data.metadata |
object | Metadata of the Medicard |
data.metadata.goal |
array | Goal of the Medicard |
data.metadata.limit |
number | Limit of the Medicard |
data.status |
string | Status of the Medicard |
Headers
Response
Response Parameters
Parameter | Type | Description |
---|---|---|
success |
boolean | Indicates whether the Medicard was successfully reserved |
status |
integer | Indicates the status of the request |
message |
string | Descriptive message about the Medicard assignment |
data |
object | Data of the request |
data.id |
string | Unique identifier for the assigned Medicard |
data.health_id |
string | Unique patient identifier in format HID-XXXXXXXX |
data.card_number |
string | Unique card number for the Medicard |
data.card_name |
string | Name displayed on the Medicard |
data.balance |
number | Balance of the Medicard |
data.business_id |
string | Unique business identifier in format BUS-XXXXXXXX |
data.created_at |
string | Timestamp of Medicard creation in ISO format |
data.updated_at |
string | Timestamp of Medicard update in ISO format |
data.active |
boolean | Indicates if the Medicard is active |
data.card_type |
string | Type of Medicard |
data.expires_at |
string | Expiration date of the Medicard |
data.card_pin |
string | PIN of the Medicard |
data.failedAttempt |
number | Number of failed attempts to access the Medicard |
data.metadata |
object | Metadata of the Medicard |
data.metadata.goal |
array | Goal of the Medicard |
data.metadata.limit |
number | Limit of the Medicard |
data.status |
string | Status of the Medicard |
Headers
Response
Response Parameters
Parameter | Type | Description |
---|---|---|
success |
boolean | Indicates whether the Medicard was successfully reserved |
status |
integer | Indicates the status of the request |
message |
string | Descriptive message about the Medicard assignment |
data |
array | Data of the Medicards |
data.id |
string | Unique identifier for the assigned Medicard |
data.health_id |
string | Unique patient identifier in format HID-XXXXXXXX |
data.card_number |
string | Unique card number for the Medicard |
data.card_name |
string | Name displayed on the Medicard |
data.balance |
number | Balance of the Medicard |
data.business_id |
string | Unique business identifier in format BUS-XXXXXXXX |
data.created_at |
string | Timestamp of Medicard creation in ISO format |
data.updated_at |
string | Timestamp of Medicard update in ISO format |
data.active |
boolean | Indicates if the Medicard is active |
data.card_type |
string | Type of Medicard |
data.expires_at |
string | Expiration date of the Medicard |
data.card_pin |
string | PIN of the Medicard |
data.failedAttempt |
number | Number of failed attempts to access the Medicard |
data.metadata |
object | Metadata of the Medicard |
data.metadata.goal |
array | Goal of the Medicard |
data.metadata.limit |
number | Limit of the Medicard |
data.status |
string | Status of the Medicard |
Headers
Response
Response Parameters
Parameter | Type | Description |
---|---|---|
success |
boolean | Indicates whether the Medicard was successfully reserved |
status |
integer | Indicates the status of the request |
message |
string | Descriptive message about the Medicard assignment |
data |
array | Data of the Medicards |
data.id |
string | Unique identifier for the Medicard |
data.card_number |
string | Unique card number for the Medicard |
data.business_id |
string | Unique business identifier in format BUS-XXXXXXXX |
data.created_at |
string | Timestamp of Medicard creation in ISO format |
data.active |
boolean | Indicates if the Medicard is active |
data.card_type |
string | Type of Medicard |
data.expires_at |
string | Expiration date of the Medicard |
data.metadata |
object | Metadata of the Medicard |
data.metadata.goal |
array | Goal of the Medicard |
data.metadata.limit |
number | Limit of the Medicard |
Headers
Response
Response Parameters
Parameter | Type | Description |
---|---|---|
success |
boolean | Indicates whether the Medicard was successfully reserved |
status |
integer | Indicates the status of the request |
message |
string | Descriptive message about the Medicard assignment |
data |
array | Data of the Medicards |
Headers
Response
Response Parameters
Parameter | Type | Description |
---|---|---|
success |
boolean | Indicates whether the Medicard was successfully reserved |
status |
integer | Indicates the status of the request |
message |
string | Descriptive message about the Medicard assignment |
data |
array | Data of the Medicards |
Headers
Request Body
Request Body Parameters
Parameter | Type | Required | Description |
---|---|---|---|
card_number |
string | Yes | Unique card number for the Medicard |
reference |
string | Yes | Reference for the transaction |
amount |
number | Yes | Amount to fund the Medicard |
Response
Response Parameters
Parameter | Type | Description |
---|---|---|
success |
boolean | Indicates whether the Medicard was successfully reserved |
status |
integer | Indicates the status of the request |
message |
string | Descriptive message about the Medicard assignment |
data |
object | Data of the transaction |
data.reference |
string | Reference for the transaction |
data.amount |
number | Amount funded to the Medicard |
data.card_number |
string | Unique card number for the Medicard |
KYC Tier Access Control
Tier 1
- Hospitals
- Clinics
- Pharmacies
- Diagnostic Centers
- Homecare Agencies
Tier 2
- Telemedicine Platforms
- Digital Health Apps
- Health Insurance Platforms
- Virtual Clinics
- Medical SaaS Providers
Consent Workflow
1. Create/Fetch Patient
Use the patient's NIN to create a new patient profile or fetch an existing one.
2. Request Consent
Send a 6-digit verification code to the patient's phone or email linked to their NIN.
3. Verify OTP
The patient enters the 6-digit verification code to generate a ConsentToken.
4. Access Data
Use the ConsentToken to read or write the patient's medical records, prescriptions, or other sensitive data.
Security & Compliance
Data Integrity Rules
- Immutable Records: Medical records cannot be deleted or updated once submitted
- Timestamped: All records include creation timestamps
- Source-Tagged: All records are tagged with the creating business
- Audit Trail: Only HealthStack admin can audit submissions
Security Requirements
- All communication must be over HTTPS
- Consent tokens are temporary and patient-specific
- Emergency access is logged and reviewed
- All patient data access requires consent unless emergency access is granted
Error Handling
Error Code | Description | Solution |
---|---|---|
401 |
Unauthorized - Invalid or expired access token | Refresh your access token |
403 |
Forbidden - Insufficient KYC tier or missing consent | Upgrade KYC tier or obtain consent token |
404 |
Patient not found | Create patient first or check HealthID |
422 |
Validation error | Check request body format and required fields |