Skip to main content

Sign-in & Sign-up

Bring your users onto Health Nexus with the steps our own site and app use: check the email, then sign in, sign up or reset the password. These calls carry only your key (the write scope): the person's email travels in the body, and no X-Subject-* header is needed. A finished sign-in returns no session token: it links the person to your credential, and from then on you call every other folder with X-Subject-Email. Run the requests top to bottom; each saves verificationToken / identityToken for the next one.

📄️Check an email

Step 1 of every sign-in and sign-up. Tells you where this email stands, in `outcome`: `login` (the person has an account and a password: go to `POST sign-in`), `setup` (a clinic created the record and no password is set yet: finish it through the sign-up steps, sending `action` back), or `register` (new to us: go through the sign-up steps). For `setup` and `register` the first verification code has already been emailed and the reply carries the `verificationToken` for `POST sign-up/verify-email`. A new person gets a Health Nexus account.

📄️Sign in

Signs the person in with their email and password. Three possible replies with HTTP 200: a finished sign-in (`signedIn: true`, with `user`, `terms` and `link`); a verification step (`requiresVerification: true` with a `verificationToken`: the person must enter the code sent by email and/or text, see the two verify requests); or `accountSelectionRequired: true` with an `identityToken` (sandbox only: one more step, `POST select-location`). A wrong password answers 401 with `code: wrong_password`. No session token is ever returned: after a finished sign-in you call the data endpoints with your key and `X-Subject-Email`.

📄️Complete the sign-up

Completes the sign-up with the person's details and the password they chose. `action` is the value the check-email or start reply gave you (`register_new_patient` or `register_existing_patient`). Two possible replies with HTTP 200: a finished sign-up (`signedIn: true`), or `accountSelectionRequired: true` with an `identityToken`: sandbox only, one more step: `POST select-location`. Password rule: at least 8 characters with upper case, lower case, a number and a special character. Birth date: a real `YYYY-MM-DD` day, age 16 to 100.