Skip to content
Hermes Health API
GuidesOpenAPI spec

Endpoints

Ial2 packages

POST/v0/companies/{company_id}/projects/{project_id}/ial2-packages

Submit a signed IAL2 authorization package

Verifies a signed IAL2 authorization package and, when it passes, registers the patient’s authorization so Site Sonar can run for them.

The patient is created from the identity the package verified, or matched when an earlier package verified the same person: the patient ID is the same for every package about one person. Their authorization is replaced by the accepted document with an attestation page recording the acceptance, their authorizationStatus becomes Approved, and Site Sonar is requested. An authorization does not carry over to a later search: send a new package each time.

Accepted only with a sandbox API key, on a sandbox project whose authorizationMethod is ial2Tokens. A package that fails verification is refused with 422, its reason in code. Sending the exact same package again to the same project is safe, even after it has expired or its document was withdrawn: nothing is written again, and the response says replayed. The same package sent to another project is refused with 409 (package_received_elsewhere), and one arriving while another copy, or a package for the same identity token or patient, is still being received with 409 (package_in_flight): send it again shortly. A different package reusing a package ID, or an identity token another package already carried, is refused.

Parameters

  • company_idintegerpath, required

    Your company's id: the `companyId` field of `GET /v0/user-profile`.

  • project_idstringpath, required

    The id of the sandbox project the patient belongs to. Its `authorizationMethod` must be `ial2Tokens`.

Request bodyapplication/json

  • packagestring

    The package exactly as signed: a compact JWS of three base64url segments separated by dots.

ReturnsSuccess

  • patientIdstring

    The patient's ID. The same for every package that verifies the same person, so a later package updates this patient rather than creating another.

  • authorizationStatusstring

    The patient's authorization status after the package: `Approved`, unless the patient's authorization was reviewed again after an earlier copy of this same package.

  • packageIdstring

    The package's own ID (its `jti`).

  • acceptedAtstring

    When the patient accepted the document, in UTC.

  • replayedboolean

    True when this exact package was received before: nothing was written again, and the response describes the patient that package authorized as they stand now.

Conditional attributes

  • expiresAtstring

    The last date the authorization covers, as `YYYY-MM-DD`. Null when the document states no date.

Errors

400401403404409422500503