OHN-16 Authorization and Policy Decision Engine
- Version
- 1.3.0
- OpenAPI
- 3.1.0
- Source dans le dépôt
modules/OHN-16/api/openapi.yaml- Serveurs
https://opeshealthnetwork.com- Authentification
bearerAuth: http bearer (JWT)
Les contrats sont rédigés en anglais.
Deny-by-default policy decision point and policy release workflow. Built and tested with synthetic data. Real-patient use requires accepted OHN-01/05/06/15/38 integrations and the legal, privacy and safety authorizations named in governance/IMPLEMENTATION_AUTHORIZATION.md.
Opérations
Decisions
OHN-16-API-001 and the decision explorer
GET/api/ohn/v1/access/decisions
Identifiant d’opération: ohn16_listDecisions
Authentification: bearerAuth
Paramètres
| Nom | Emplacement | Type | Obligatoire | Description |
|---|---|---|---|---|
decision | query | "permit" | "deny" | "indeterminate" | non | |
resource_type | query | string | non | |
simulated | query | "true" | "false" | non | |
cursor | query | string | non | Opaque cursor from next_cursor. |
Réponses
| Code | Description | Type de média |
|---|---|---|
200 | Page of decisions, newest first; patient references are masked | application/json: Page |
401 | Missing, invalid or expired bearer token | application/json: Error |
403 | Denied by role, purpose of use, tenant scope or dual control. The denial is audited. | application/json: Error |
422 | Field validation failure or domain refusal; details names the fields | application/json: Error |
429 | Per-principal rate limit exceeded | application/json: Error |
POST/api/ohn/v1/access/decisions
Evaluates a request against the published policy and records the decision, obligations, workflow trail and audit receipt. A deny or indeterminate result is a successful evaluation (HTTP 200); a permit is HTTP 201. Callers must treat indeterminate as deny and must not cache decisions (cache.ttl_seconds is 0).
Identifiant d’opération: ohn16_decideAccess
Authentification: bearerAuth
Paramètres
| Nom | Emplacement | Type | Obligatoire | Description |
|---|---|---|---|---|
Idempotency-Key | header | string | oui | Same key and payload replays the stored response (Idempotent-Replay true); same key with a different payload is 409. |
Corps de la requête (obligatoire)
application/json:DecisionRequest
Réponses
| Code | Description | Type de média |
|---|---|---|
200 | Denied or indeterminate | application/json: DecisionResult |
201 | Permitted | application/json: DecisionResult |
400 | Malformed request or missing Idempotency-Key | application/json: Error |
401 | Missing, invalid or expired bearer token | application/json: Error |
403 | Denied by role, purpose of use, tenant scope or dual control. The denial is audited. | application/json: Error |
409 | Stale expected_version, invalid state transition, or idempotency key reuse. No partial change is made. | application/json: Error |
422 | Field validation failure or domain refusal; details names the fields | application/json: Error |
429 | Per-principal rate limit exceeded | application/json: Error |
503 | Database or dependency unavailable; nothing was changed | application/json: Error |
GET/api/ohn/v1/access/decisions/{id}
Identifiant d’opération: ohn16_getDecision
Authentification: bearerAuth
Paramètres
| Nom | Emplacement | Type | Obligatoire | Description |
|---|---|---|---|---|
id | path | string (uuid) | oui |
Réponses
| Code | Description | Type de média |
|---|---|---|
200 | Decision with trace, obligations and workflow history | application/json: DecisionResult |
401 | Missing, invalid or expired bearer token | application/json: Error |
403 | Denied by role, purpose of use, tenant scope or dual control. The denial is audited. | application/json: Error |
404 | Not found in the caller's scope (also returned for unknown routes) | application/json: Error |
Policies
OHN-16-API-002, OHN-16-API-003 and the release workflow OHN-16-W001
GET/api/ohn/v1/policies
Identifiant d’opération: ohn16_listPolicies
Authentification: bearerAuth
Paramètres
| Nom | Emplacement | Type | Obligatoire | Description |
|---|---|---|---|---|
state | query | "draft" | "peer_review" | "simulation_passed" | "dual_approved" | "published" | "deprecated" | "revoked" | non | |
cursor | query | string | non | Opaque cursor from next_cursor. |
Réponses
| Code | Description | Type de média |
|---|---|---|
200 | Page of policy bundles in the caller's jurisdiction and organization | application/json: Page |
401 | Missing, invalid or expired bearer token | application/json: Error |
403 | Denied by role, purpose of use, tenant scope or dual control. The denial is audited. | application/json: Error |
422 | Field validation failure or domain refusal; details names the fields | application/json: Error |
429 | Per-principal rate limit exceeded | application/json: Error |
POST/api/ohn/v1/policies
Identifiant d’opération: ohn16_createPolicyDraft
Authentification: bearerAuth
Paramètres
| Nom | Emplacement | Type | Obligatoire | Description |
|---|---|---|---|---|
Idempotency-Key | header | string | oui | Same key and payload replays the stored response (Idempotent-Replay true); same key with a different payload is 409. |
Corps de la requête (obligatoire)
application/json:BundleCreateCommand
Réponses
| Code | Description | Type de média |
|---|---|---|
201 | Draft created | application/json: BundleWithReceipt |
400 | Malformed request or missing Idempotency-Key | application/json: Error |
401 | Missing, invalid or expired bearer token | application/json: Error |
403 | Denied by role, purpose of use, tenant scope or dual control. The denial is audited. | application/json: Error |
404 | Not found in the caller's scope (also returned for unknown routes) | application/json: Error |
409 | Stale expected_version, invalid state transition, or idempotency key reuse. No partial change is made. | application/json: Error |
422 | Field validation failure or domain refusal; details names the fields | application/json: Error |
GET/api/ohn/v1/policies/{id}
Identifiant d’opération: ohn16_getPolicy
Authentification: bearerAuth
Paramètres
| Nom | Emplacement | Type | Obligatoire | Description |
|---|---|---|---|---|
id | path | string (uuid) | oui |
Réponses
| Code | Description | Type de média |
|---|---|---|
200 | Bundle with rules and release history | application/json: Bundle |
401 | Missing, invalid or expired bearer token | application/json: Error |
403 | Denied by role, purpose of use, tenant scope or dual control. The denial is audited. | application/json: Error |
404 | Not found in the caller's scope (also returned for unknown routes) | application/json: Error |
GET/api/ohn/v1/policies/{id}/diff
Identifiant d’opération: ohn16_diffPolicy
Authentification: bearerAuth
Paramètres
| Nom | Emplacement | Type | Obligatoire | Description |
|---|---|---|---|---|
id | path | string (uuid) | oui |
Réponses
| Code | Description | Type de média |
|---|---|---|
200 | Rule and setting differences against the superseded or currently published bundle | application/json: object |
401 | Missing, invalid or expired bearer token | application/json: Error |
403 | Denied by role, purpose of use, tenant scope or dual control. The denial is audited. | application/json: Error |
404 | Not found in the caller's scope (also returned for unknown routes) | application/json: Error |
POST/api/ohn/v1/policies/{id}/rules
Adds a rule to a draft. Only the author may edit; rules are immutable once the bundle leaves draft (also enforced by a database trigger).
Identifiant d’opération: ohn16_addPolicyRule
Authentification: bearerAuth
Paramètres
| Nom | Emplacement | Type | Obligatoire | Description |
|---|---|---|---|---|
id | path | string (uuid) | oui | |
Idempotency-Key | header | string | oui | Same key and payload replays the stored response (Idempotent-Replay true); same key with a different payload is 409. |
Corps de la requête (obligatoire)
application/json:RuleCommand
Réponses
| Code | Description | Type de média |
|---|---|---|
201 | Rule added | application/json: object |
401 | Missing, invalid or expired bearer token | application/json: Error |
403 | Denied by role, purpose of use, tenant scope or dual control. The denial is audited. | application/json: Error |
404 | Not found in the caller's scope (also returned for unknown routes) | application/json: Error |
409 | Stale expected_version, invalid state transition, or idempotency key reuse. No partial change is made. | application/json: Error |
422 | Field validation failure or domain refusal; details names the fields | application/json: Error |
POST/api/ohn/v1/policies/{id}/rules/{ruleId}/remove
Identifiant d’opération: ohn16_removePolicyRule
Authentification: bearerAuth
Paramètres
| Nom | Emplacement | Type | Obligatoire | Description |
|---|---|---|---|---|
id | path | string (uuid) | oui | |
ruleId | path | string (uuid) | oui | |
Idempotency-Key | header | string | oui | Same key and payload replays the stored response (Idempotent-Replay true); same key with a different payload is 409. |
Corps de la requête (obligatoire)
application/json:VersionedCommand
Réponses
| Code | Description | Type de média |
|---|---|---|
200 | Rule removed | application/json: object |
403 | Denied by role, purpose of use, tenant scope or dual control. The denial is audited. | application/json: Error |
404 | Not found in the caller's scope (also returned for unknown routes) | application/json: Error |
409 | Stale expected_version, invalid state transition, or idempotency key reuse. No partial change is made. | application/json: Error |
422 | Field validation failure or domain refusal; details names the fields | application/json: Error |
POST/api/ohn/v1/policies/{id}/submit
draft -> peer_review. Refused (422 domain_refusal) for a bundle without rules.
Identifiant d’opération: ohn16_submitPolicy
Authentification: bearerAuth
Paramètres
| Nom | Emplacement | Type | Obligatoire | Description |
|---|---|---|---|---|
id | path | string (uuid) | oui | |
Idempotency-Key | header | string | oui | Same key and payload replays the stored response (Idempotent-Replay true); same key with a different payload is 409. |
Corps de la requête (obligatoire)
application/json:VersionedCommand
Réponses
| Code | Description | Type de média |
|---|---|---|
200 | Submitted | application/json: BundleWithReceipt |
403 | Denied by role, purpose of use, tenant scope or dual control. The denial is audited. | application/json: Error |
404 | Not found in the caller's scope (also returned for unknown routes) | application/json: Error |
409 | Stale expected_version, invalid state transition, or idempotency key reuse. No partial change is made. | application/json: Error |
422 | Field validation failure or domain refusal; details names the fields | application/json: Error |
POST/api/ohn/v1/policies/{id}/run-fixtures
Runs every active fixture. In peer_review a clean run advances the bundle to simulation_passed and records the run as test evidence. Refused (422 negative_tests_missing) unless at least one fixture expects deny or indeterminate.
Identifiant d’opération: ohn16_runPolicyFixtures
Authentification: bearerAuth
Paramètres
| Nom | Emplacement | Type | Obligatoire | Description |
|---|---|---|---|---|
id | path | string (uuid) | oui | |
Idempotency-Key | header | string | oui | Same key and payload replays the stored response (Idempotent-Replay true); same key with a different payload is 409. |
Corps de la requête (obligatoire)
application/json:VersionedCommand
Réponses
| Code | Description | Type de média |
|---|---|---|
200 | Run recorded | application/json: object |
403 | Denied by role, purpose of use, tenant scope or dual control. The denial is audited. | application/json: Error |
404 | Not found in the caller's scope (also returned for unknown routes) | application/json: Error |
409 | Stale expected_version, invalid state transition, or idempotency key reuse. No partial change is made. | application/json: Error |
422 | Field validation failure or domain refusal; details names the fields | application/json: Error |
POST/api/ohn/v1/policies/{id}/simulate
Evaluates a request against the named bundle in any state. Recorded with simulated=true; never creates a grant, exception or access.denied event.
Identifiant d’opération: ohn16_simulatePolicy
Authentification: bearerAuth
Paramètres
| Nom | Emplacement | Type | Obligatoire | Description |
|---|---|---|---|---|
id | path | string (uuid) | oui | |
Idempotency-Key | header | string | oui | Same key and payload replays the stored response (Idempotent-Replay true); same key with a different payload is 409. |
Corps de la requête (obligatoire)
application/json:DecisionRequest
Réponses
| Code | Description | Type de média |
|---|---|---|
200 | Simulated decision | application/json: DecisionResult |
403 | Denied by role, purpose of use, tenant scope or dual control. The denial is audited. | application/json: Error |
404 | Not found in the caller's scope (also returned for unknown routes) | application/json: Error |
422 | Field validation failure or domain refusal; details names the fields | application/json: Error |
429 | Per-principal rate limit exceeded | application/json: Error |
POST/api/ohn/v1/policies/{id}/approve
Records one of two approvals on a simulation_passed bundle. The author can never approve and one reviewer cannot give both (403 dual_control_violation).
Identifiant d’opération: ohn16_approvePolicy
Authentification: bearerAuth
Paramètres
| Nom | Emplacement | Type | Obligatoire | Description |
|---|---|---|---|---|
id | path | string (uuid) | oui | |
Idempotency-Key | header | string | oui | Same key and payload replays the stored response (Idempotent-Replay true); same key with a different payload is 409. |
Corps de la requête (obligatoire)
application/json:ApprovalCommand
Réponses
| Code | Description | Type de média |
|---|---|---|
200 | Approval recorded | application/json: BundleWithReceipt |
403 | Denied by role, purpose of use, tenant scope or dual control. The denial is audited. | application/json: Error |
404 | Not found in the caller's scope (also returned for unknown routes) | application/json: Error |
409 | Stale expected_version, invalid state transition, or idempotency key reuse. No partial change is made. | application/json: Error |
422 | Field validation failure or domain refusal; details names the fields | application/json: Error |
POST/api/ohn/v1/policies/{id}/reject
Returns a bundle in review to draft and clears its evidence and approvals.
Identifiant d’opération: ohn16_rejectPolicy
Authentification: bearerAuth
Paramètres
| Nom | Emplacement | Type | Obligatoire | Description |
|---|---|---|---|---|
id | path | string (uuid) | oui | |
Idempotency-Key | header | string | oui | Same key and payload replays the stored response (Idempotent-Replay true); same key with a different payload is 409. |
Corps de la requête (obligatoire)
application/json:ReasonedCommand
Réponses
| Code | Description | Type de média |
|---|---|---|
200 | Returned to draft | application/json: BundleWithReceipt |
403 | Denied by role, purpose of use, tenant scope or dual control. The denial is audited. | application/json: Error |
404 | Not found in the caller's scope (also returned for unknown routes) | application/json: Error |
409 | Stale expected_version, invalid state transition, or idempotency key reuse. No partial change is made. | application/json: Error |
422 | Field validation failure or domain refusal; details names the fields | application/json: Error |
POST/api/ohn/v1/policies/{id}/publish
dual_approved -> published. The publisher restates the evidence; anything that differs from the recorded regression run and approvals is refused. The previous published bundle becomes deprecated and is recorded as rollback_ref. Emits policy.published and access.policy-version.changed through the transactional outbox.
Identifiant d’opération: ohn16_publishPolicy
Authentification: bearerAuth
Paramètres
| Nom | Emplacement | Type | Obligatoire | Description |
|---|---|---|---|---|
id | path | string (uuid) | oui | |
Idempotency-Key | header | string | oui | Same key and payload replays the stored response (Idempotent-Replay true); same key with a different payload is 409. |
Corps de la requête (obligatoire)
application/json:PublishCommand
Réponses
| Code | Description | Type de média |
|---|---|---|
200 | Published; downstream delivery is pending confirmation | application/json: BundleWithReceipt |
400 | Malformed request or missing Idempotency-Key | application/json: Error |
401 | Missing, invalid or expired bearer token | application/json: Error |
403 | Denied by role, purpose of use, tenant scope or dual control. The denial is audited. | application/json: Error |
404 | Not found in the caller's scope (also returned for unknown routes) | application/json: Error |
409 | Stale expected_version, invalid state transition, or idempotency key reuse. No partial change is made. | application/json: Error |
422 | Field validation failure or domain refusal; details names the fields | application/json: Error |
429 | Per-principal rate limit exceeded | application/json: Error |
503 | Database or dependency unavailable; nothing was changed | application/json: Error |
POST/api/ohn/v1/policies/{id}/revoke
published -> revoked. Nothing replaces the bundle automatically, so every decision denies (no_published_policy) until another bundle is published.
Identifiant d’opération: ohn16_revokePolicy
Authentification: bearerAuth
Paramètres
| Nom | Emplacement | Type | Obligatoire | Description |
|---|---|---|---|---|
id | path | string (uuid) | oui | |
Idempotency-Key | header | string | oui | Same key and payload replays the stored response (Idempotent-Replay true); same key with a different payload is 409. |
Corps de la requête (obligatoire)
application/json:ReasonedCommand
Réponses
| Code | Description | Type de média |
|---|---|---|
200 | Revoked | application/json: BundleWithReceipt |
403 | Denied by role, purpose of use, tenant scope or dual control. The denial is audited. | application/json: Error |
404 | Not found in the caller's scope (also returned for unknown routes) | application/json: Error |
409 | Stale expected_version, invalid state transition, or idempotency key reuse. No partial change is made. | application/json: Error |
422 | Field validation failure or domain refusal; details names the fields | application/json: Error |
Fixtures
GET/api/ohn/v1/access/fixtures
Identifiant d’opération: ohn16_listFixtures
Authentification: bearerAuth
Paramètres
| Nom | Emplacement | Type | Obligatoire | Description |
|---|---|---|---|---|
cursor | query | string | non | Opaque cursor from next_cursor. |
Réponses
POST/api/ohn/v1/access/fixtures
Identifiant d’opération: ohn16_createFixture
Authentification: bearerAuth
Paramètres
| Nom | Emplacement | Type | Obligatoire | Description |
|---|---|---|---|---|
Idempotency-Key | header | string | oui | Same key and payload replays the stored response (Idempotent-Replay true); same key with a different payload is 409. |
Corps de la requête (obligatoire)
application/json:FixtureCommand
Réponses
POST/api/ohn/v1/access/fixtures/{id}/retire
Identifiant d’opération: ohn16_retireFixture
Authentification: bearerAuth
Paramètres
| Nom | Emplacement | Type | Obligatoire | Description |
|---|---|---|---|---|
id | path | string (uuid) | oui | |
Idempotency-Key | header | string | oui | Same key and payload replays the stored response (Idempotent-Replay true); same key with a different payload is 409. |
Corps de la requête (obligatoire)
application/json:VersionedCommand
Réponses
| Code | Description | Type de média |
|---|---|---|
200 | Fixture retired | application/json: object |
403 | Denied by role, purpose of use, tenant scope or dual control. The denial is audited. | application/json: Error |
404 | Not found in the caller's scope (also returned for unknown routes) | application/json: Error |
409 | Stale expected_version, invalid state transition, or idempotency key reuse. No partial change is made. | application/json: Error |
GET/api/ohn/v1/access/fixture-runs
Identifiant d’opération: ohn16_listFixtureRuns
Authentification: bearerAuth
Paramètres
| Nom | Emplacement | Type | Obligatoire | Description |
|---|---|---|---|---|
release | query | string | non | |
resource_type | query | string | non | |
cursor | query | string | non | Opaque cursor from next_cursor. |
Réponses
Relationships
GET/api/ohn/v1/access/relationships
Identifiant d’opération: ohn16_listRelationships
Authentification: bearerAuth
Paramètres
| Nom | Emplacement | Type | Obligatoire | Description |
|---|---|---|---|---|
cursor | query | string | non | Opaque cursor from next_cursor. |
Réponses
POST/api/ohn/v1/access/relationships
Registers a time-bounded clinical relationship (role relationship_registrar). Until OHN-06 integration this is the only source of relationship facts. The 201 body is the assertion (id, version, status, valid_from, expires_at, evidence_ref, asserted_by, receipt); a caller keeps id and version to revoke it. OHN-32 registers with its service identity as relationship_registrar (see its ADRs). 1.3.0 (owner decision 2026-11-29): role care_team_registrar, purpose relationship_registration, the OHN-61 triage service identity, in the organisation scope of the ticket's facility. It may register only relationship_type care_team (another type answers 403 forbidden, details.reason relationship_type_not_permitted) and only with expires_at at most 72 hours after valid_from (more answers 422 domain_validation_failed, details.fieldErrors.expires_at). It implies no other action (no decisions, no reads). OHN-61 registers one care_team assertion per receiving clinician, when the clinician takes up the ticket (call, start of consultation, handover acknowledgement, summary) or when the handover names them: actor_ref = the clinician's OHN-06 practitioner id (from their own token), patient_ref = the triage patient, facility_ref = the ticket's facility, evidence_ref = the OHN-61 ticket id, valid_from = now - 1 minute, expires_at = valid_from + the facility's OHN-61 care_team_relationship_hours (default 24). Audited here as relationship.register.
Identifiant d’opération: ohn16_registerRelationship
Authentification: bearerAuth
Paramètres
| Nom | Emplacement | Type | Obligatoire | Description |
|---|---|---|---|---|
Idempotency-Key | header | string | oui | Same key and payload replays the stored response (Idempotent-Replay true); same key with a different payload is 409. |
Corps de la requête (obligatoire)
application/json:RelationshipCommand
Réponses
POST/api/ohn/v1/access/relationships/{id}/revoke
Revokes an assertion (role relationship_registrar; 1.3.0: also care_team_registrar, for assertions it registered itself only: asserted_by must be the caller, otherwise 404 not_found, never disclosing the assertion). expected_version is the assertion's current version; a second revoke answers 409 already_revoked, which a service caller such as OHN-61 treats as done. Audited as relationship.revoke.
Identifiant d’opération: ohn16_revokeRelationship
Authentification: bearerAuth
Paramètres
| Nom | Emplacement | Type | Obligatoire | Description |
|---|---|---|---|---|
id | path | string (uuid) | oui | |
Idempotency-Key | header | string | oui | Same key and payload replays the stored response (Idempotent-Replay true); same key with a different payload is 409. |
Corps de la requête (obligatoire)
application/json:ReasonedCommand
Réponses
| Code | Description | Type de média |
|---|---|---|
200 | Assertion revoked; later decisions deny with relationship_revoked | application/json: object |
403 | Denied by role, purpose of use, tenant scope or dual control. The denial is audited. | application/json: Error |
404 | Not found in the caller's scope (also returned for unknown routes) | application/json: Error |
409 | Stale expected_version, invalid state transition, or idempotency key reuse. No partial change is made. | application/json: Error |
Emergency
OHN-16-W003
GET/api/ohn/v1/access/emergency-exceptions
Identifiant d’opération: ohn16_listEmergencyExceptions
Authentification: bearerAuth
Paramètres
| Nom | Emplacement | Type | Obligatoire | Description |
|---|---|---|---|---|
cursor | query | string | non | Opaque cursor from next_cursor. |
Réponses
POST/api/ohn/v1/access/emergency-exceptions/{id}/review
bounded_grant -> post_review. The reviewer must not be the person the grant was for.
Identifiant d’opération: ohn16_reviewEmergencyException
Authentification: bearerAuth
Paramètres
| Nom | Emplacement | Type | Obligatoire | Description |
|---|---|---|---|---|
id | path | string (uuid) | oui | |
Idempotency-Key | header | string | oui | Same key and payload replays the stored response (Idempotent-Replay true); same key with a different payload is 409. |
Corps de la requête (obligatoire)
application/json:ExceptionReviewCommand
Réponses
| Code | Description | Type de média |
|---|---|---|
200 | Review recorded | application/json: object |
403 | Denied by role, purpose of use, tenant scope or dual control. The denial is audited. | application/json: Error |
404 | Not found in the caller's scope (also returned for unknown routes) | application/json: Error |
409 | Stale expected_version, invalid state transition, or idempotency key reuse. No partial change is made. | application/json: Error |
422 | Field validation failure or domain refusal; details names the fields | application/json: Error |
Reports
GET/api/ohn/v1/access/reports/{reportId}
OHN-16-R001 decision distribution (filters country, facility, from, to, action), OHN-16-R002 authorization regression (release, resource_type), OHN-16-R003 privileged policy changes (from, to, author). A country other than the caller's returns no rows. Metric formulas are in modules/OHN-16/adr/0005-report-formulas.md.
Identifiant d’opération: ohn16_getReport
Authentification: bearerAuth
Paramètres
| Nom | Emplacement | Type | Obligatoire | Description |
|---|---|---|---|---|
reportId | path | "OHN-16-R001" | "OHN-16-R002" | "OHN-16-R003" | oui | |
country | query | string (uuid) | non | |
facility | query | string (uuid) | non | |
from | query | string (date-time) | non | |
to | query | string (date-time) | non | |
action | query | string | non | |
author | query | string (uuid) | non | |
release | query | string | non | |
resource_type | query | string | non | |
cursor | query | string | non | Opaque cursor from next_cursor. |
Réponses
POST/api/ohn/v1/access/reports/{reportId}/export
Creates a signed CSV or PDF export, audited, retrievable only by the same principal for five minutes.
Identifiant d’opération: ohn16_createExport
Authentification: bearerAuth
Paramètres
| Nom | Emplacement | Type | Obligatoire | Description |
|---|---|---|---|---|
reportId | path | "OHN-16-R001" | "OHN-16-R002" | "OHN-16-R003" | oui | |
Idempotency-Key | header | string | oui | Same key and payload replays the stored response (Idempotent-Replay true); same key with a different payload is 409. |
Corps de la requête (obligatoire)
application/json:ExportCommand
Réponses
GET/api/ohn/v1/access/exports/{token}
Identifiant d’opération: ohn16_downloadExport
Authentification: bearerAuth
Paramètres
| Nom | Emplacement | Type | Obligatoire | Description |
|---|---|---|---|---|
token | path | string | oui |
Réponses
| Code | Description | Type de média |
|---|---|---|
200 | The export file; every download is audited | application/json: object |
401 | Missing, invalid or expired bearer token | application/json: Error |
403 | Denied by role, purpose of use, tenant scope or dual control. The denial is audited. | application/json: Error |
404 | Not found in the caller's scope (also returned for unknown routes) | application/json: Error |
410 | Export link expired | application/json: Error |
500 | Export failed its integrity check (export_integrity_failed) | application/json: Error |
Support
GET/api/ohn/v1/access/vocabulary
Identifiant d’opération: ohn16_getVocabulary
Authentification: bearerAuth
Réponses
| Code | Description | Type de média |
|---|---|---|
200 | Controlled vocabularies used by the forms (ADR-0001) | application/json: object |
403 | Denied by role, purpose of use, tenant scope or dual control. The denial is audited. | application/json: Error |
GET/api/ohn/v1/access/context
Identifiant d’opération: ohn16_getCallerContext
Authentification: bearerAuth
Réponses
| Code | Description | Type de média |
|---|---|---|
200 | The caller's tenant, role and permitted actions | application/json: object |
403 | Denied by role, purpose of use, tenant scope or dual control. The denial is audited. | application/json: Error |
POST/api/ohn/v1/access/synthetic/actors
Seeds the OHN-05/06 test fake. Returns 404 unless the service runs with synthetic dependencies.
Identifiant d’opération: ohn16_seedSyntheticActor
Authentification: bearerAuth
Paramètres
| Nom | Emplacement | Type | Obligatoire | Description |
|---|---|---|---|---|
Idempotency-Key | header | string | oui | Same key and payload replays the stored response (Idempotent-Replay true); same key with a different payload is 409. |
Corps de la requête (obligatoire)
application/json:SyntheticActorCommand
Réponses
| Code | Description | Type de média |
|---|---|---|
201 | Fake actor stored in memory | application/json: object |
404 | Not found in the caller's scope (also returned for unknown routes) | application/json: Error |
POST/api/ohn/v1/access/synthetic/consents
Seeds the OHN-15 test fake. Returns 404 unless the service runs with synthetic dependencies.
Identifiant d’opération: ohn16_seedSyntheticConsent
Authentification: bearerAuth
Paramètres
| Nom | Emplacement | Type | Obligatoire | Description |
|---|---|---|---|---|
Idempotency-Key | header | string | oui | Same key and payload replays the stored response (Idempotent-Replay true); same key with a different payload is 409. |
Corps de la requête (obligatoire)
application/json:SyntheticConsentCommand
Réponses
| Code | Description | Type de média |
|---|---|---|
201 | Fake consent stored in memory | application/json: object |
404 | Not found in the caller's scope (also returned for unknown routes) | application/json: Error |
Marks
Enforcement of the watermark_export obligation: document marks (security watermark) for printouts and exports, and their public verification
POST/api/ohn/v1/access/marks
Asked before every printout or export. Evaluates an "export" of the named resource against the published policy and answers whether the security watermark is required: when the permit carries the obligation watermark_export, and also when the decision is deny or indeterminate or cannot be evaluated at all (fail closed). Only a permit without the obligation answers required=false. A required mark carries a verification code that /access/marks/verify resolves, an Ed25519 signature over the canonical payload, and the OHN-45 registration when OHN-45 answers. Facilities cannot switch the mark off. Roles: document_printer (purpose document_marking; actor and facility are the token's own) and policy_enforcement_point (purpose access_enforcement; marks a download on behalf of actor_ref at facility_ref, used by the platform export filter). 1.2.0 (2026-11-23): role inspection_printer (purpose inspection_marking), the read-only inspector's print-only grant, marks like a document_printer; its mark is always issued (basis inspection_copy when the policy would not require it) and the text ends with " · INSPECTION COPY". The enforcement point asks for the same with inspection_copy=true (the platform export filter does so for an inspector's download). The public verification answers inspection_copy.
Identifiant d’opération: ohn16_issueMark
Authentification: bearerAuth
Paramètres
| Nom | Emplacement | Type | Obligatoire | Description |
|---|---|---|---|---|
Idempotency-Key | header | string | oui | Same key and payload replays the stored response (Idempotent-Replay true); same key with a different payload is 409. |
Corps de la requête (obligatoire)
application/json:MarkCommand
Réponses
| Code | Description | Type de média |
|---|---|---|
200 | No mark required (permit without watermark_export) | application/json: MarkResult |
201 | Mark required and issued | application/json: MarkResult |
401 | Missing, invalid or expired bearer token | application/json: Error |
403 | Denied by role, purpose of use, tenant scope or dual control. The denial is audited. | application/json: Error |
409 | Stale expected_version, invalid state transition, or idempotency key reuse. No partial change is made. | application/json: Error |
422 | Field validation failure or domain refusal; details names the fields | application/json: Error |
429 | Per-principal rate limit exceeded | application/json: Error |
POST/api/ohn/v1/access/marks/verify
Public check of the verification code printed in a security watermark (no sign-in, rate limited per address). Answers only what the paper shows: who printed it, the facility code, when, the channel and the title. result is valid (local signature and OHN-45 agree), unverified (recorded but unsigned, unregistered or OHN-45 unavailable) or invalid. Every check is recorded.
Identifiant d’opération: ohn16_verifyMark
Corps de la requête (obligatoire)
application/json:MarkVerifyCommand
Réponses
| Code | Description | Type de média |
|---|---|---|
200 | The recorded mark | application/json: MarkVerification |
404 | Not found in the caller's scope (also returned for unknown routes) | application/json: Error |
422 | Field validation failure or domain refusal; details names the fields | application/json: Error |
429 | Per-principal rate limit exceeded | application/json: Error |
Schémas
Error
Machine code in `error` (unauthenticated, forbidden, not_found, domain_validation_failed, invalid_filter, version_conflict, invalid_transition, dual_control_violation, conflict, idempotency_key_required, idempotency_key_reused, request_in_progress, rate_limited, dependency_unavailable, ...). The Java service answers application/problem+json and adds type, title, status, detail and trace_id.
| Nom | Type | Obligatoire | Description |
|---|---|---|---|
error | string | oui | |
message | string | non | |
details | any | non | 422 domain_validation_failed: {formErrors: string[], fieldErrors: {field: string[]}} (zod flatten, unknown keys are a form error); 422 invalid_filter: the same shape; 422 for a rule condition: {conditions: string[]}; 409 version_conflict: {current_version}; 409 invalid_transition: {state, allowed_from}; 503: none. |
Decision
"permit" | "deny" | "indeterminate"
BundleState
"draft" | "peer_review" | "simulation_passed" | "dual_approved" | "published" | "deprecated" | "revoked"
ResourceType
"patient_record" | "clinical_document" | "observation" | "medication" | "encounter" | "consent_record" | "patient_export" | "search_index" | "policy_bundle" | "jurisdiction_config" | "audit_log" | "report_export"
Action
"read" | "create" | "update" | "delete" | "export" | "search" | "share"
Purpose
"treatment" | "payment" | "operations" | "public_health" | "research" | "patient_access" | "emergency_treatment" | "administration"
PolicyEffect
"permit" | "deny" | "emergency_permit"
ObligationType
"audit_access" | "mask_fields" | "notify_patient" | "require_post_review" | "limit_scope" | "watermark_export"
Receipt
| Nom | Type | Obligatoire | Description |
|---|---|---|---|
receipt_id | string (uuid) | oui | |
committed_at | string (date-time) | oui | |
aggregate_id | string (uuid) | oui | |
aggregate_type | string | oui | |
version | integer | oui | |
status | "committed" | "denied" | "pending" | oui |
Page
| Nom | Type | Obligatoire | Description |
|---|---|---|---|
items | array of object | oui | |
next_cursor | string | null | oui |
ApprovalCommand
| Nom | Type | Obligatoire | Description |
|---|---|---|---|
expected_version | integer | oui | |
comment | string | non |
ExceptionReviewCommand
| Nom | Type | Obligatoire | Description |
|---|---|---|---|
expected_version | integer | oui | |
outcome | "justified" | "not_justified" | oui | |
reason | string | oui |
ExportCommand
| Nom | Type | Obligatoire | Description |
|---|---|---|---|
format | "csv" | "pdf" | oui | |
filters | object | non |
SyntheticActorCommand
| Nom | Type | Obligatoire | Description |
|---|---|---|---|
actor_ref | string (uuid) | oui | |
roles | array of string | oui | |
facility_refs | array of string (uuid) | oui | |
status | "active" | "suspended" | non |
SyntheticConsentCommand
| Nom | Type | Obligatoire | Description |
|---|---|---|---|
patient_ref | string (uuid) | oui | |
purpose | Purpose | oui | |
status | "granted" | "withdrawn" | "unknown" | oui |
MarkCommand
| Nom | Type | Obligatoire | Description |
|---|---|---|---|
channel | "print" | "csv" | "pdf" | "json" | oui | |
resource_type | ResourceType | oui | |
resource_ref | string (uuid) | oui | |
patient_ref | string (uuid) | non | |
purpose | Purpose | oui | |
facility_code | string | non | The OHN-05 facility code printed in the mark |
document_title | string | non | |
document_sha256 | string | non | |
actor_ref | string (uuid) | non | policy_enforcement_point only (required there); a document_printer is always the token subject. |
actor_name | string | non | policy_enforcement_point only; a document_printer's name is the attested display_name of the token. |
facility_ref | string (uuid) | non | policy_enforcement_point only (required there); a document_printer is always marked at the token's organization. |
inspection_copy | boolean | non | policy_enforcement_point only (1.2.0): the download is a read-only inspector's copy; the mark is always issued and says INSPECTION COPY |
MarkResult
| Nom | Type | Obligatoire | Description |
|---|---|---|---|
required | boolean | oui | |
basis | "policy_obligation" | "fail_closed" | "no_obligation" | "inspection_copy" | oui | |
basis_reason | string | non | |
decision | string | null | non | |
decision_id | string | null (uuid) | non | |
receipt | Receipt | non | |
event_id | string (uuid) | non | |
mark | MarkResult.mark | non |
MarkVerifyCommand
| Nom | Type | Obligatoire | Description |
|---|---|---|---|
code | string | oui |
MarkVerification
| Nom | Type | Obligatoire | Description |
|---|---|---|---|
code | string | oui | |
result | "valid" | "unverified" | "invalid" | oui | |
signature | "verified_by_ohn45" | "signed_not_registered" | "registry_unavailable" | "unsigned" | "invalid" | oui | |
printed_by | string | non | |
facility_code | string | null | non | |
printed_at | string (date-time) | non | |
channel | "print" | "csv" | "pdf" | "json" | non | |
document_title | string | null | non | |
copy | boolean | non | |
message | string | non |
DecisionRequest
OHN-16-F002. patient_ref is required for patient-data resource types; unknown resource types are treated as patient data.
| Nom | Type | Obligatoire | Description |
|---|---|---|---|
actor_ref | string (uuid) | oui | |
patient_ref | string (uuid) | non | |
resource_ref | string (uuid) | oui | |
resource_type | ResourceType | oui | |
action | Action | oui | |
facility_ref | string (uuid) | oui | A claim until the directory confirms the affiliation. |
purpose | Purpose | oui | |
relationship_evidence | string (uuid) | non | |
resource_facility_ref | string (uuid) | non | |
emergency | DecisionRequest.emergency | non |
DecisionResult
| Nom | Type | Obligatoire | Description |
|---|---|---|---|
id | string (uuid) | oui | |
decision | Decision | oui | |
reason_code | string | oui | |
simulated | boolean | oui | |
patient_ref_masked | string | null | oui | Last four characters only. |
policy_bundle_id | string | null (uuid) | oui | |
policy_version | string | null | oui | |
matched_rule_id | string | null (uuid) | oui | |
failed_clause | string | null | oui | |
obligations | array of DecisionResult.obligations.item | oui | |
trace | array of DecisionResult.trace.item | non | |
workflow_state | "authenticated" | "context_resolved" | "country_policy_applied" | "permit_or_deny" | "obligations_recorded" | oui | |
emergency_exception_id | string | null (uuid) | non | |
grant_expires_at | string | null (date-time) | oui | |
receipt | Receipt | non | |
event_id | string | null (uuid) | non | |
cache | DecisionResult.cache | non |
BundleCreateCommand
| Nom | Type | Obligatoire | Description |
|---|---|---|---|
name | string | oui | |
revision | string | oui | |
change_summary | string | oui | |
emergency_grant_minutes | integer | non | No default. When absent |
consent_required_for_phi | boolean | non | |
clone_from | string (uuid) | non |
RuleCommand
OHN-16-F001
| Nom | Type | Obligatoire | Description |
|---|---|---|---|
jurisdiction_id | string (uuid) | oui | Must equal the authenticated jurisdiction. |
resource_type | ResourceType | oui | |
action | Action | oui | |
purpose | Purpose | oui | |
subject_condition | string | oui | Condition language of ADR-0002. |
resource_condition | string | oui | |
policy_effect | PolicyEffect | oui | |
obligations | array of RuleCommand.obligations.item | non | |
expected_version | integer | oui |
PublishCommand
OHN-16-F003
| Nom | Type | Obligatoire | Description |
|---|---|---|---|
policy_bundle_id | string (uuid) | oui | |
revision | string | oui | |
test_evidence_ref | string (uuid) | oui | |
reviewer_a | string (uuid) | oui | |
reviewer_b | string (uuid) | oui | |
effective_at | string (date-time) | oui | Between the second approval and now; scheduled activation is not supported. |
expected_version | integer | oui |
VersionedCommand
| Nom | Type | Obligatoire | Description |
|---|---|---|---|
expected_version | integer | oui |
ReasonedCommand
| Nom | Type | Obligatoire | Description |
|---|---|---|---|
expected_version | integer | oui | |
reason | string | oui |
RelationshipCommand
| Nom | Type | Obligatoire | Description |
|---|---|---|---|
actor_ref | string (uuid) | oui | |
patient_ref | string (uuid) | oui | |
facility_ref | string (uuid) | oui | |
relationship_type | "treating" | "consulting" | "care_team" | "administrative" | oui | |
valid_from | string (date-time) | oui | |
expires_at | string (date-time) | oui | Must be after valid_from. Relationships are always time-bounded. |
evidence_ref | string (uuid) | oui |
FixtureCommand
| Nom | Type | Obligatoire | Description |
|---|---|---|---|
name | string | oui | |
request | DecisionRequest | oui | OHN-16-F002. patient_ref is required for patient-data resource types; unknown resource types are treated as patient data. |
context | FixtureCommand.context | oui | |
expected_decision | Decision | oui |
Bundle
| Nom | Type | Obligatoire | Description |
|---|---|---|---|
id | string (uuid) | oui | |
state | BundleState | oui | |
version | integer | oui | |
rules | array of object | non | |
history | array of object | non |
BundleWithReceipt
| Nom | Type | Obligatoire | Description |
|---|---|---|---|
id | string (uuid) | oui | |
state | BundleState | oui | |
version | integer | oui | |
rules | array of object | non | |
history | array of object | non | |
receipt | Receipt | oui | |
event_ids | array of string (uuid) | non | |
delivery | "pending_downstream_confirmation" | non |
Report
| Nom | Type | Obligatoire | Description |
|---|---|---|---|
report_id | "OHN-16-R001" | "OHN-16-R002" | "OHN-16-R003" | oui | |
columns | array of string | oui | |
rows | array of object | oui | |
next_cursor | string | null | oui | |
summary | object | oui | |
state | "rendered" | "no_authorized_data" | oui | |
generated_at | string (date-time) | oui |
MarkResult.mark défini sur place
| Nom | Type | Obligatoire | Description |
|---|---|---|---|
id | string (uuid) | oui | |
verify_code | string | oui | |
verify_path | string | oui | |
channel | "print" | "csv" | "pdf" | "json" | oui | |
printed_by | string | oui | |
facility_code | string | null | non | |
printed_at | string (date-time) | oui | |
text | string | oui | "Printed by <name>, <facility code>, <date-time> · COPY · Verify <code>" |
signature | "unsigned" | "signed_not_registered" | "signed_and_registered" | oui |
DecisionRequest.emergency défini sur place
| Nom | Type | Obligatoire | Description |
|---|---|---|---|
reason | string | oui |
DecisionResult.obligations.item défini sur place
| Nom | Type | Obligatoire | Description |
|---|---|---|---|
type | ObligationType | oui | |
parameters | object | oui |
DecisionResult.trace.item défini sur place
| Nom | Type | Obligatoire | Description |
|---|---|---|---|
step | string | oui | |
outcome | "ok" | "deny" | "indeterminate" | "info" | oui | |
detail | string | oui |
DecisionResult.cache défini sur place
| Nom | Type | Obligatoire | Description |
|---|---|---|---|
ttl_seconds | 0 | oui |
RuleCommand.obligations.item défini sur place
| Nom | Type | Obligatoire | Description |
|---|---|---|---|
type | ObligationType | oui | |
parameters | object | non |
FixtureCommand.context défini sur place
| Nom | Type | Obligatoire | Description |
|---|---|---|---|
jurisdiction | "active" | "unavailable" | non | |
actor | object | null | oui | |
relationship | object | null | oui | |
consent | "granted" | "withdrawn" | "unknown" | "unavailable" | oui |