Skip to main content
Each sample runs with one command against the local mock or the sandbox (set TERARX_BASE_URL). They use synthetic data only.

Patient token

Generate a key pair, print the JWKS you publish, sign a patient assertion with the six required claims, exchange it and call GET /v1/patient. See Authentication.
Node 20+: npm install jose, then node sign-patient-jwt.mjs. Python 3.9+: pip install "PyJWT[crypto]>=2.8,<3", then python sign_patient_jwt.py.

Webhook verification

Check TeraRx-Signature on the raw body, accept either signature during a rotation and dedupe on TeraRx-Event-Id. Run it with no arguments to check the worked example, or with --serve for a receiver on port 4030. See Webhooks.

Enrollment

Client credentials, then POST /v1/enrollments with an Idempotency-Key you reuse on every retry.
enroll-patient.mjs