Skip to content
Hermes Health API
API referenceOpenAPI spec

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:

IAL2 package body
json
{
  "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.

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_expired or package_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.

  • 409 package_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.
  • 409 package_received_elsewhere: the package was already received by another project. A package belongs to the first project it is sent to.
  • 404 replayed_patient_not_found: the package was received, but its patient has since been deleted. Send a new package to authorize them again.

Next steps