Guide
Submit IAL2 authorization packages
Register a patient's authorization from a signed, identity-verified acceptance.
When a partner verifies a patient’s identity to NIST IAL2 and the patient accepts a document Hermes has registered, the partner sends the signed package recording that acceptance. Hermes verifies it, creates or updates the patient, approves their authorization and requests Site Sonar, all in one call.
Packages are accepted in sandbox only for now: send them with a sandbox API
key, to a sandbox project whose authorizationMethod is ial2Tokens.
Send the package
Post the package exactly as signed, as one compact JWS string:
{
"package": "eyJhbGciOiJSUzUxMiJ9.eyJqdGkiOiJwa2dfZXhhbXBsZTEyMyJ9.c2lnbmF0dXJl"
}
The response names the patient. Every package about the same person names
the same patientId, so a second package updates that patient rather than
creating another. authorizationStatus is Approved, and Site Sonar has been
requested.
Send a new package for each search
An authorization from a package does not carry over to a later search. Each time you want Site Sonar to run again for a patient, send a new package signed for that run.
Handle refusals
A package that fails verification is answered with 422. Switch on the
error’s code, which is stable, rather than on its text:
unknown_template: the document the patient accepted is not registered.package_expiredorpackage_not_yet_valid: check your clock and send a freshly signed package.subject_token_reused: the identity token already backed another package. Each package needs its own.
A refused package is not consumed. A 503 means a signing key set could not
be read just then; send the package again.
Retry safely
Resending the exact same package to the same project is safe, so repeat a
request whose response you never received: nothing is written twice, and the
response describes the patient that package authorized with replayed: true,
even once the package has expired or its document has been withdrawn.
409package_in_flight: another copy of the package, or another package for the same identity token or patient, is still being received. Send it again shortly.409package_received_elsewhere: the package was already received by another project. A package belongs to the first project it is sent to.404replayed_patient_not_found: the package was received, but its patient has since been deleted. Send a new package to authorize them again.
Next steps
- Find where a patient was treated: read the visits the Site Sonar search finds.