Skip to main content

Quickstart

This walk-through signs a person in, records their terms acceptance and reads their data, all in the sandbox. It uses curl; the Postman collection has the same requests ready to send.

Before you start​

You need a sandbox key from the Health Nexus team. It looks like pk_live_… and is shown once, so keep it in a secret manager. Calls must come from your servers: a request sent from a browser is refused.

export HN_BASE="https://staging-api-portal-nh.prospera.ai"
export HN_KEY="pk_live_…"

1. Check the email​

curl -s "$HN_BASE/api/patient/partner/auth/check-email" \
-H "X-Api-Key: $HN_KEY" -H "Content-Type: application/json" \
-d '{"email":"jane@example.com"}'

The outcome tells you what to show next:

{ "success": true, "outcome": "login", "emailExists": true, "passwordExists": true }

login means the person has an account: ask for their password. register means the person is new: take them through the sign-up steps and they get a Health Nexus account.

2. Sign in​

curl -s "$HN_BASE/api/patient/partner/auth/sign-in" \
-H "X-Api-Key: $HN_KEY" -H "Content-Type: application/json" \
-d '{"email":"jane@example.com","password":"the password she typed"}'
{
"success": true,
"signedIn": true,
"user": { "id": "665f1c…", "email": "jane@example.com", "name": "Jane Doe", "accountId": 96 },
"terms": { "accepted": false, "acceptedAt": null, "url": "https://portal.health-nexus.com/terms" },
"link": { "partnerId": "your-partner-id", "created": true }
}

There is no session token to store. The sign-in linked Jane to your key; from here your key and her email are all you send. If the reply asks for a verification code instead, follow the code steps.

3. Record the terms acceptance​

terms.accepted is false, so show Jane the terms at terms.url, have her type her name to agree, and send it:

curl -s "$HN_BASE/api/patient/partner/terms/accept" \
-H "X-Api-Key: $HN_KEY" -H "X-Subject-Email: jane@example.com" \
-H "Content-Type: application/json" \
-d '{"signedName":"Jane Doe","userIp":"203.0.113.7","userAgent":"YourApp/2.1 (iOS 18.1)"}'
{ "success": true, "accepted": true, "acceptedAt": "2026-12-02T10:15:00.000Z", "recorded": true }

4. Read her data​

Every other endpoint names the person in X-Subject-Email. Send user.accountId as X-Subject-Account-Id as well.

curl -s "$HN_BASE/api/patient/lab/user-summary" \
-H "X-Api-Key: $HN_KEY" \
-H "X-Subject-Email: jane@example.com" -H "X-Subject-Account-Id: 96"

A new account has no results yet. Upload a lab report to see the pipeline work, then read the summary again.

Where to go next​