Skip to content

Quickstart

Create a developer account and a test key, make a read, then make a safe write. Everything here runs against the sandbox, so nothing touches a real facility.

1. Create an account

Sign up at /developers/signup with your name and work e-mail. The hub e-mails you a set-up link. Open it, choose a password, and you are signed in to the developer console. The link works once and lasts 24 hours; if it has expired, ask for a new one from the sign-in page.

If this hub cannot send e-mail, the sign-up page tells you so, and a Heka SoftLink administrator sends you the set-up link instead.

2. Create a test key

In the console, open API keys and create a test key with the scopes this quickstart needs: plans:read and usage:write. Test keys (hsl_test_…) are self-serve. They always act on the sandbox facility HSL-SANDBOX, which holds synthetic data only, so you can experiment freely. The secret is shown once; put it in your secret manager or an environment variable:

export HSL_API_KEY="hsl_test_…"
Keep keys server-side
Never ship an API key in a browser bundle or mobile app. Anyone holding the key acts with its scopes until it is revoked.

3. Read the price book

curl https://admin.heka.care/api/platform/v1/plans \
  -H "Authorization: Bearer $HSL_API_KEY"

Amounts are integer pesewas: 350000 is GH₵ 3,500.00. Divide by 100 only when you display a number.

4. Report usage safely

Writes accept an Idempotency-Key header, and usage records also carry their own idempotency_key. If the network drops mid-request, send exactly the same request again — nothing is counted twice.

curl -X POST https://admin.heka.care/api/platform/v1/usage \
  -H "Authorization: Bearer $HSL_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: claims-2026-11-batch-7" \
  -d '{
    "records": [{
      "metric": "nhis_claims_submitted",
      "quantity": 412,
      "value": 8240000,
      "occurred_at": "2026-11-30T23:00:00Z",
      "idempotency_key": "claims-2026-11-batch-7"
    }]
  }'

A test key is confined to the sandbox, so the body needs no facility_id: the facility comes from the key. In the sandbox your keys together store at most 1,000 usage records per UTC day. Beyond that, the API still checks each batch but answers 202 with persisted: false and stores nothing.

Going live

Live keys (hsl_live_…) act on real facilities. To get one:

  • Turn on two-step verification in Settings. Live access is never approved without it.
  • Request live access in Live access: say what you are building and which facilities you work with. A Heka SoftLink administrator reviews the request and approves it per facility, with the scopes allowed on each.
  • Create the live key in API keys for one of the approved facilities. Every live change in the console asks for a current code from your authenticator app: creating or rotating a live key, and creating, changing, enabling or rotating the secret of a live webhook.

See Test and live keys for the exact rules.

Next steps