OHN-16 Authorization and Policy Decision Engine
- Version
- 1.3.0
- OpenAPI
- 3.1.0
- Source in the repository
modules/OHN-16/api/openapi.yaml- Servers
https://opeshealthnetwork.com- Authentication
bearerAuth: http bearer (JWT)
Contracts are written in English.
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.
Operations
Decisions
OHN-16-API-001 and the decision explorer
GET/api/ohn/v1/access/decisions
Operation ID: ohn16_listDecisions
Authentication: bearerAuth
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
decision | query | "permit" | "deny" | "indeterminate" | no | |
resource_type | query | string | no | |
simulated | query | "true" | "false" | no | |
cursor | query | string | no | Opaque cursor from next_cursor. |
Responses
| Code | Description | Media type |
|---|---|---|
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).
Operation ID: ohn16_decideAccess
Authentication: bearerAuth
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
Idempotency-Key | header | string | yes | Same key and payload replays the stored response (Idempotent-Replay true); same key with a different payload is 409. |
Request body (required)
application/json:DecisionRequest
Responses
| Code | Description | Media type |
|---|---|---|
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}
Operation ID: ohn16_getDecision
Authentication: bearerAuth
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
id | path | string (uuid) | yes |
Responses
| Code | Description | Media type |
|---|---|---|
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
Operation ID: ohn16_listPolicies
Authentication: bearerAuth
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
state | query | "draft" | "peer_review" | "simulation_passed" | "dual_approved" | "published" | "deprecated" | "revoked" | no | |
cursor | query | string | no | Opaque cursor from next_cursor. |
Responses
| Code | Description | Media type |
|---|---|---|
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
Operation ID: ohn16_createPolicyDraft
Authentication: bearerAuth
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
Idempotency-Key | header | string | yes | Same key and payload replays the stored response (Idempotent-Replay true); same key with a different payload is 409. |
Request body (required)
application/json:BundleCreateCommand
Responses
| Code | Description | Media type |
|---|---|---|
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}
Operation ID: ohn16_getPolicy
Authentication: bearerAuth
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
id | path | string (uuid) | yes |
Responses
| Code | Description | Media type |
|---|---|---|
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
Operation ID: ohn16_diffPolicy
Authentication: bearerAuth
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
id | path | string (uuid) | yes |
Responses
| Code | Description | Media type |
|---|---|---|
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).
Operation ID: ohn16_addPolicyRule
Authentication: bearerAuth
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
id | path | string (uuid) | yes | |
Idempotency-Key | header | string | yes | Same key and payload replays the stored response (Idempotent-Replay true); same key with a different payload is 409. |
Request body (required)
application/json:RuleCommand
Responses
| Code | Description | Media type |
|---|---|---|
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
Operation ID: ohn16_removePolicyRule
Authentication: bearerAuth
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
id | path | string (uuid) | yes | |
ruleId | path | string (uuid) | yes | |
Idempotency-Key | header | string | yes | Same key and payload replays the stored response (Idempotent-Replay true); same key with a different payload is 409. |
Request body (required)
application/json:VersionedCommand
Responses
| Code | Description | Media type |
|---|---|---|
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.
Operation ID: ohn16_submitPolicy
Authentication: bearerAuth
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
id | path | string (uuid) | yes | |
Idempotency-Key | header | string | yes | Same key and payload replays the stored response (Idempotent-Replay true); same key with a different payload is 409. |
Request body (required)
application/json:VersionedCommand
Responses
| Code | Description | Media type |
|---|---|---|
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.
Operation ID: ohn16_runPolicyFixtures
Authentication: bearerAuth
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
id | path | string (uuid) | yes | |
Idempotency-Key | header | string | yes | Same key and payload replays the stored response (Idempotent-Replay true); same key with a different payload is 409. |
Request body (required)
application/json:VersionedCommand
Responses
| Code | Description | Media type |
|---|---|---|
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.
Operation ID: ohn16_simulatePolicy
Authentication: bearerAuth
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
id | path | string (uuid) | yes | |
Idempotency-Key | header | string | yes | Same key and payload replays the stored response (Idempotent-Replay true); same key with a different payload is 409. |
Request body (required)
application/json:DecisionRequest
Responses
| Code | Description | Media type |
|---|---|---|
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).
Operation ID: ohn16_approvePolicy
Authentication: bearerAuth
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
id | path | string (uuid) | yes | |
Idempotency-Key | header | string | yes | Same key and payload replays the stored response (Idempotent-Replay true); same key with a different payload is 409. |
Request body (required)
application/json:ApprovalCommand
Responses
| Code | Description | Media type |
|---|---|---|
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.
Operation ID: ohn16_rejectPolicy
Authentication: bearerAuth
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
id | path | string (uuid) | yes | |
Idempotency-Key | header | string | yes | Same key and payload replays the stored response (Idempotent-Replay true); same key with a different payload is 409. |
Request body (required)
application/json:ReasonedCommand
Responses
| Code | Description | Media type |
|---|---|---|
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.
Operation ID: ohn16_publishPolicy
Authentication: bearerAuth
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
id | path | string (uuid) | yes | |
Idempotency-Key | header | string | yes | Same key and payload replays the stored response (Idempotent-Replay true); same key with a different payload is 409. |
Request body (required)
application/json:PublishCommand
Responses
| Code | Description | Media type |
|---|---|---|
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.
Operation ID: ohn16_revokePolicy
Authentication: bearerAuth
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
id | path | string (uuid) | yes | |
Idempotency-Key | header | string | yes | Same key and payload replays the stored response (Idempotent-Replay true); same key with a different payload is 409. |
Request body (required)
application/json:ReasonedCommand
Responses
| Code | Description | Media type |
|---|---|---|
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
Operation ID: ohn16_listFixtures
Authentication: bearerAuth
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
cursor | query | string | no | Opaque cursor from next_cursor. |
Responses
POST/api/ohn/v1/access/fixtures
Operation ID: ohn16_createFixture
Authentication: bearerAuth
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
Idempotency-Key | header | string | yes | Same key and payload replays the stored response (Idempotent-Replay true); same key with a different payload is 409. |
Request body (required)
application/json:FixtureCommand
Responses
POST/api/ohn/v1/access/fixtures/{id}/retire
Operation ID: ohn16_retireFixture
Authentication: bearerAuth
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
id | path | string (uuid) | yes | |
Idempotency-Key | header | string | yes | Same key and payload replays the stored response (Idempotent-Replay true); same key with a different payload is 409. |
Request body (required)
application/json:VersionedCommand
Responses
| Code | Description | Media type |
|---|---|---|
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
Operation ID: ohn16_listFixtureRuns
Authentication: bearerAuth
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
release | query | string | no | |
resource_type | query | string | no | |
cursor | query | string | no | Opaque cursor from next_cursor. |
Responses
Relationships
GET/api/ohn/v1/access/relationships
Operation ID: ohn16_listRelationships
Authentication: bearerAuth
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
cursor | query | string | no | Opaque cursor from next_cursor. |
Responses
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.
Operation ID: ohn16_registerRelationship
Authentication: bearerAuth
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
Idempotency-Key | header | string | yes | Same key and payload replays the stored response (Idempotent-Replay true); same key with a different payload is 409. |
Request body (required)
application/json:RelationshipCommand
Responses
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.
Operation ID: ohn16_revokeRelationship
Authentication: bearerAuth
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
id | path | string (uuid) | yes | |
Idempotency-Key | header | string | yes | Same key and payload replays the stored response (Idempotent-Replay true); same key with a different payload is 409. |
Request body (required)
application/json:ReasonedCommand
Responses
| Code | Description | Media type |
|---|---|---|
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
Operation ID: ohn16_listEmergencyExceptions
Authentication: bearerAuth
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
cursor | query | string | no | Opaque cursor from next_cursor. |
Responses
POST/api/ohn/v1/access/emergency-exceptions/{id}/review
bounded_grant -> post_review. The reviewer must not be the person the grant was for.
Operation ID: ohn16_reviewEmergencyException
Authentication: bearerAuth
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
id | path | string (uuid) | yes | |
Idempotency-Key | header | string | yes | Same key and payload replays the stored response (Idempotent-Replay true); same key with a different payload is 409. |
Request body (required)
application/json:ExceptionReviewCommand
Responses
| Code | Description | Media type |
|---|---|---|
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.
Operation ID: ohn16_getReport
Authentication: bearerAuth
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
reportId | path | "OHN-16-R001" | "OHN-16-R002" | "OHN-16-R003" | yes | |
country | query | string (uuid) | no | |
facility | query | string (uuid) | no | |
from | query | string (date-time) | no | |
to | query | string (date-time) | no | |
action | query | string | no | |
author | query | string (uuid) | no | |
release | query | string | no | |
resource_type | query | string | no | |
cursor | query | string | no | Opaque cursor from next_cursor. |
Responses
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.
Operation ID: ohn16_createExport
Authentication: bearerAuth
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
reportId | path | "OHN-16-R001" | "OHN-16-R002" | "OHN-16-R003" | yes | |
Idempotency-Key | header | string | yes | Same key and payload replays the stored response (Idempotent-Replay true); same key with a different payload is 409. |
Request body (required)
application/json:ExportCommand
Responses
GET/api/ohn/v1/access/exports/{token}
Operation ID: ohn16_downloadExport
Authentication: bearerAuth
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
token | path | string | yes |
Responses
| Code | Description | Media type |
|---|---|---|
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
Operation ID: ohn16_getVocabulary
Authentication: bearerAuth
Responses
| Code | Description | Media type |
|---|---|---|
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
Operation ID: ohn16_getCallerContext
Authentication: bearerAuth
Responses
| Code | Description | Media type |
|---|---|---|
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.
Operation ID: ohn16_seedSyntheticActor
Authentication: bearerAuth
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
Idempotency-Key | header | string | yes | Same key and payload replays the stored response (Idempotent-Replay true); same key with a different payload is 409. |
Request body (required)
application/json:SyntheticActorCommand
Responses
| Code | Description | Media type |
|---|---|---|
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.
Operation ID: ohn16_seedSyntheticConsent
Authentication: bearerAuth
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
Idempotency-Key | header | string | yes | Same key and payload replays the stored response (Idempotent-Replay true); same key with a different payload is 409. |
Request body (required)
application/json:SyntheticConsentCommand
Responses
| Code | Description | Media type |
|---|---|---|
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.
Operation ID: ohn16_issueMark
Authentication: bearerAuth
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
Idempotency-Key | header | string | yes | Same key and payload replays the stored response (Idempotent-Replay true); same key with a different payload is 409. |
Request body (required)
application/json:MarkCommand
Responses
| Code | Description | Media type |
|---|---|---|
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.
Operation ID: ohn16_verifyMark
Request body (required)
application/json:MarkVerifyCommand
Responses
| Code | Description | Media type |
|---|---|---|
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 |
Schemas
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.
| Name | Type | Required | Description |
|---|---|---|---|
error | string | yes | |
message | string | no | |
details | any | no | 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
| Name | Type | Required | Description |
|---|---|---|---|
receipt_id | string (uuid) | yes | |
committed_at | string (date-time) | yes | |
aggregate_id | string (uuid) | yes | |
aggregate_type | string | yes | |
version | integer | yes | |
status | "committed" | "denied" | "pending" | yes |
Page
| Name | Type | Required | Description |
|---|---|---|---|
items | array of object | yes | |
next_cursor | string | null | yes |
ApprovalCommand
| Name | Type | Required | Description |
|---|---|---|---|
expected_version | integer | yes | |
comment | string | no |
ExceptionReviewCommand
| Name | Type | Required | Description |
|---|---|---|---|
expected_version | integer | yes | |
outcome | "justified" | "not_justified" | yes | |
reason | string | yes |
ExportCommand
| Name | Type | Required | Description |
|---|---|---|---|
format | "csv" | "pdf" | yes | |
filters | object | no |
SyntheticActorCommand
| Name | Type | Required | Description |
|---|---|---|---|
actor_ref | string (uuid) | yes | |
roles | array of string | yes | |
facility_refs | array of string (uuid) | yes | |
status | "active" | "suspended" | no |
SyntheticConsentCommand
| Name | Type | Required | Description |
|---|---|---|---|
patient_ref | string (uuid) | yes | |
purpose | Purpose | yes | |
status | "granted" | "withdrawn" | "unknown" | yes |
MarkCommand
| Name | Type | Required | Description |
|---|---|---|---|
channel | "print" | "csv" | "pdf" | "json" | yes | |
resource_type | ResourceType | yes | |
resource_ref | string (uuid) | yes | |
patient_ref | string (uuid) | no | |
purpose | Purpose | yes | |
facility_code | string | no | The OHN-05 facility code printed in the mark |
document_title | string | no | |
document_sha256 | string | no | |
actor_ref | string (uuid) | no | policy_enforcement_point only (required there); a document_printer is always the token subject. |
actor_name | string | no | policy_enforcement_point only; a document_printer's name is the attested display_name of the token. |
facility_ref | string (uuid) | no | policy_enforcement_point only (required there); a document_printer is always marked at the token's organization. |
inspection_copy | boolean | no | 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
| Name | Type | Required | Description |
|---|---|---|---|
required | boolean | yes | |
basis | "policy_obligation" | "fail_closed" | "no_obligation" | "inspection_copy" | yes | |
basis_reason | string | no | |
decision | string | null | no | |
decision_id | string | null (uuid) | no | |
receipt | Receipt | no | |
event_id | string (uuid) | no | |
mark | MarkResult.mark | no |
MarkVerifyCommand
| Name | Type | Required | Description |
|---|---|---|---|
code | string | yes |
MarkVerification
| Name | Type | Required | Description |
|---|---|---|---|
code | string | yes | |
result | "valid" | "unverified" | "invalid" | yes | |
signature | "verified_by_ohn45" | "signed_not_registered" | "registry_unavailable" | "unsigned" | "invalid" | yes | |
printed_by | string | no | |
facility_code | string | null | no | |
printed_at | string (date-time) | no | |
channel | "print" | "csv" | "pdf" | "json" | no | |
document_title | string | null | no | |
copy | boolean | no | |
message | string | no |
DecisionRequest
OHN-16-F002. patient_ref is required for patient-data resource types; unknown resource types are treated as patient data.
| Name | Type | Required | Description |
|---|---|---|---|
actor_ref | string (uuid) | yes | |
patient_ref | string (uuid) | no | |
resource_ref | string (uuid) | yes | |
resource_type | ResourceType | yes | |
action | Action | yes | |
facility_ref | string (uuid) | yes | A claim until the directory confirms the affiliation. |
purpose | Purpose | yes | |
relationship_evidence | string (uuid) | no | |
resource_facility_ref | string (uuid) | no | |
emergency | DecisionRequest.emergency | no |
DecisionResult
| Name | Type | Required | Description |
|---|---|---|---|
id | string (uuid) | yes | |
decision | Decision | yes | |
reason_code | string | yes | |
simulated | boolean | yes | |
patient_ref_masked | string | null | yes | Last four characters only. |
policy_bundle_id | string | null (uuid) | yes | |
policy_version | string | null | yes | |
matched_rule_id | string | null (uuid) | yes | |
failed_clause | string | null | yes | |
obligations | array of DecisionResult.obligations.item | yes | |
trace | array of DecisionResult.trace.item | no | |
workflow_state | "authenticated" | "context_resolved" | "country_policy_applied" | "permit_or_deny" | "obligations_recorded" | yes | |
emergency_exception_id | string | null (uuid) | no | |
grant_expires_at | string | null (date-time) | yes | |
receipt | Receipt | no | |
event_id | string | null (uuid) | no | |
cache | DecisionResult.cache | no |
BundleCreateCommand
| Name | Type | Required | Description |
|---|---|---|---|
name | string | yes | |
revision | string | yes | |
change_summary | string | yes | |
emergency_grant_minutes | integer | no | No default. When absent |
consent_required_for_phi | boolean | no | |
clone_from | string (uuid) | no |
RuleCommand
OHN-16-F001
| Name | Type | Required | Description |
|---|---|---|---|
jurisdiction_id | string (uuid) | yes | Must equal the authenticated jurisdiction. |
resource_type | ResourceType | yes | |
action | Action | yes | |
purpose | Purpose | yes | |
subject_condition | string | yes | Condition language of ADR-0002. |
resource_condition | string | yes | |
policy_effect | PolicyEffect | yes | |
obligations | array of RuleCommand.obligations.item | no | |
expected_version | integer | yes |
PublishCommand
OHN-16-F003
| Name | Type | Required | Description |
|---|---|---|---|
policy_bundle_id | string (uuid) | yes | |
revision | string | yes | |
test_evidence_ref | string (uuid) | yes | |
reviewer_a | string (uuid) | yes | |
reviewer_b | string (uuid) | yes | |
effective_at | string (date-time) | yes | Between the second approval and now; scheduled activation is not supported. |
expected_version | integer | yes |
VersionedCommand
| Name | Type | Required | Description |
|---|---|---|---|
expected_version | integer | yes |
ReasonedCommand
| Name | Type | Required | Description |
|---|---|---|---|
expected_version | integer | yes | |
reason | string | yes |
RelationshipCommand
| Name | Type | Required | Description |
|---|---|---|---|
actor_ref | string (uuid) | yes | |
patient_ref | string (uuid) | yes | |
facility_ref | string (uuid) | yes | |
relationship_type | "treating" | "consulting" | "care_team" | "administrative" | yes | |
valid_from | string (date-time) | yes | |
expires_at | string (date-time) | yes | Must be after valid_from. Relationships are always time-bounded. |
evidence_ref | string (uuid) | yes |
FixtureCommand
| Name | Type | Required | Description |
|---|---|---|---|
name | string | yes | |
request | DecisionRequest | yes | OHN-16-F002. patient_ref is required for patient-data resource types; unknown resource types are treated as patient data. |
context | FixtureCommand.context | yes | |
expected_decision | Decision | yes |
Bundle
| Name | Type | Required | Description |
|---|---|---|---|
id | string (uuid) | yes | |
state | BundleState | yes | |
version | integer | yes | |
rules | array of object | no | |
history | array of object | no |
BundleWithReceipt
| Name | Type | Required | Description |
|---|---|---|---|
id | string (uuid) | yes | |
state | BundleState | yes | |
version | integer | yes | |
rules | array of object | no | |
history | array of object | no | |
receipt | Receipt | yes | |
event_ids | array of string (uuid) | no | |
delivery | "pending_downstream_confirmation" | no |
Report
| Name | Type | Required | Description |
|---|---|---|---|
report_id | "OHN-16-R001" | "OHN-16-R002" | "OHN-16-R003" | yes | |
columns | array of string | yes | |
rows | array of object | yes | |
next_cursor | string | null | yes | |
summary | object | yes | |
state | "rendered" | "no_authorized_data" | yes | |
generated_at | string (date-time) | yes |
MarkResult.mark defined inline
| Name | Type | Required | Description |
|---|---|---|---|
id | string (uuid) | yes | |
verify_code | string | yes | |
verify_path | string | yes | |
channel | "print" | "csv" | "pdf" | "json" | yes | |
printed_by | string | yes | |
facility_code | string | null | no | |
printed_at | string (date-time) | yes | |
text | string | yes | "Printed by <name>, <facility code>, <date-time> · COPY · Verify <code>" |
signature | "unsigned" | "signed_not_registered" | "signed_and_registered" | yes |
DecisionRequest.emergency defined inline
| Name | Type | Required | Description |
|---|---|---|---|
reason | string | yes |
DecisionResult.obligations.item defined inline
| Name | Type | Required | Description |
|---|---|---|---|
type | ObligationType | yes | |
parameters | object | yes |
DecisionResult.trace.item defined inline
| Name | Type | Required | Description |
|---|---|---|---|
step | string | yes | |
outcome | "ok" | "deny" | "indeterminate" | "info" | yes | |
detail | string | yes |
DecisionResult.cache defined inline
| Name | Type | Required | Description |
|---|---|---|---|
ttl_seconds | 0 | yes |
RuleCommand.obligations.item defined inline
| Name | Type | Required | Description |
|---|---|---|---|
type | ObligationType | yes | |
parameters | object | no |
FixtureCommand.context defined inline
| Name | Type | Required | Description |
|---|---|---|---|
jurisdiction | "active" | "unavailable" | no | |
actor | object | null | yes | |
relationship | object | null | yes | |
consent | "granted" | "withdrawn" | "unknown" | "unavailable" | yes |