Connect Any HMS or Hospital App to ClaimDesk
Base URL: https://api.claimdesk.ng • All monetary values are integer kobo (₦1 = 100 kobo) to eliminate floating-point rounding drift.
Required Headers & Tenant Isolation
Authorization: Bearer cd_live_...Live organization API key generated from API Keys & Webhooks (or cd_demo_portal in sandbox).
X-ClaimDesk-Org-ID: <uuid>Binds every query to PostgreSQL Row-Level Security for your Hospital, HMO, or HMS Partner tenant.
X-ClaimDesk-Hospital-ID: <uuid>Used by HMS_PARTNER keys when submitting PAs or claims on behalf of a specific child hospital.
Idempotency-Key: <unique-id>Guarantees safe retries on POST and PATCH without ever duplicating claims or PAs.
HMS Partner: Provision Child Hospitals via API
When a new hospital signs up inside your HMS, call POST /v1/organizations with your HMS_PARTNER API key. ClaimDesk automatically links parent_hms_id and can immediately mint a hospital-scoped cd_live_... key.
curl -X POST https://api.claimdesk.ng/v1/organizations \
-H "Authorization: Bearer cd_live_YOUR_PARTNER_KEY" \
-H "X-ClaimDesk-Org-ID: YOUR_HMS_PARTNER_UUID" \
-H "Idempotency-Key: onboard-hospital-1042" \
-H "Content-Type: application/json" \
-d '{
"name": "Victoria Island Specialist Hospital",
"type": "HOSPITAL",
"nhia_code": "NHIA-LA-0991",
"tier": "TERTIARY",
"webhook_url": "https://api.yourhms.ng/webhooks/claimdesk",
"live_webhook_enabled": true,
"issue_api_key": true,
"api_key_label": "Primary HMS Integration Key"
}'
Core Endpoint Reference
Verifying Signed Webhooks (HMAC-SHA256)
Every push event (pa.approved, pa.rejected, claim.vetted, settlement.paid) includes X-ClaimDesk-Timestamp and X-ClaimDesk-Signature: sha256=... computed over "${timestamp}.${rawBody}".
import { verifyClaimDeskWebhook } from './claimdesk-client';
export async function POST(req: Request) {
const rawBody = await req.text(); // Must read raw text BEFORE JSON.parse
const ok = await verifyClaimDeskWebhook({
rawBody,
timestampHeader: req.headers.get('X-ClaimDesk-Timestamp') || '',
signatureHeader: req.headers.get('X-ClaimDesk-Signature') || '',
webhookSecret: process.env.CLAIMDESK_WEBHOOK_SECRET!,
});
if (!ok) return new Response('Invalid signature', { status: 401 });
const evt = JSON.parse(rawBody);
// evt.event -> 'pa.approved' | 'claim.vetted' | 'settlement.paid'
// evt.data.external_ref_id -> your HMS encounter ID
return new Response('OK', { status: 200 });
}
Live API Playground
Test live calls directly against https://api.claimdesk.ng using sandbox credentials or your own cd_live_... key.
Click "Send Live Request" to inspect the response…