Skip to main content

Redirecting Patients After Consent

Any hosted patient-consent link (https://app.healthex.io/#/patient-consent/<projectId>/enrollment/link?...) — whether generated for a unique link, an Add a Record Location flow, or another flow that uses this URL pattern — supports sending the patient back to your own application after they finish (or decline) the flow. This is a hosted redirect, and is a separate mechanism from the OAuth flow — see Use with OAuth if you're integrating that way instead.

Setting Up a Hosted Redirect

1. Allowlist your redirect URL

In the HealthEx UI, open your project's settings and add the URL(s) you want to redirect to under Redirect URLs. This field is an allowlist only — adding a URL here does not by itself cause any redirect to happen. You can add multiple URLs separated by commas, and use a trailing /* to allow any path under a given origin (e.g. https://partner.com/callback/*).

To trigger the redirect, append a redirectUri query parameter to the link when you send it to the patient:

https://app.healthex.io/#/patient-consent/694d61c2-3f1b/enrollment/link?xid=123-456-000.eyjUKFNMP&redirectUri=https://partner.com/callback

The value of redirectUri must exactly match (or match the wildcard pattern of) one of the URLs allowlisted in step 1. If redirectUri is omitted, the patient lands on the standard HealthEx success screen instead.

3. What you'll receive back

When the patient finishes the flow, HealthEx redirects the browser to your redirectUri with the following query parameters appended:

ParameterDescription
statusThe outcome of the flow: success or declined
patientIdThe HealthEx patient ID
xidThe signed external ID, if one was supplied on the original link